Attached is a patch that fixes the compile error.
Created attachment 52684 [details, diff] GCC4 compile fix
do you have an upstream fix ? you cant just remove the left hand cast and have it work
True, it was late when I did this. I will look upstream. Funny how GDB didn't crash when I was using it though.
Actually, the problem isn't even with gdb-6.3 itself. The problem is with: gdb-6.3-scanmem.patch That is where the "broken" code lies right now.
Created attachment 53309 [details, diff] GCC4 compile fix Actually, looking at this again, with 1 slight change, this patch works fine. I tried out scanmem with one of my own programs and it seems to work perfectly fine still. GDB compiles fine without this patch, but this slight change shouldn't break the feature the patch adds.
erm you sure ? with this change: int *pint; - (unsigned char *) pint = (unsigned char *) (data + i); + *pint = (int*)data + i; the original behavior had data as a pointer of type 'unsigned char *' before adding 1 while the new behavior casts data to type 'int *' before adding 1 ... when doing pointer addition, constants are multiplied by the # of bytes the type the pointer points to ... simple test: $ cat test.c void main() { char *b = 50; printf("%i %i\n", b + 1, (int*)b + 1); } $ gcc test.c -w && ./a.out 51 54 the second change looks ok i think ... the original code looked just plain wrong though: unsigned char typc; ... (int) typc = atoi(pattern); wtf is that supposed to mean ? :)
fixed patch in portage