GDB does not work with GNU debug links
GCC for 32-bit and 64-bit Windows with a real installer & updater
Brought to you by:
tdragon
GNU debug links enable to have debug info in separate files in order to not distribute it.
One can debug based on crash address and have all symbols etc.
However, with the current package (tdm64-gcc-4.8.1-3.exe), GDB seems to not understand debug links.
Of course, the problem might also be with objcopy, which I already reported for not working correctly in the case of -S switch.
static void fun123(int i) {
int* p = (int*)i;
char* c = "6789";
int var1234 = *p; //crash
}
int main(int argc, char** argv)
{
fun123(123);
return 0;
}
crash.exe: crash.o
gcc -Wall -g -o crash crash.o
objcopy --only-keep-debug crash.exe crash.exe.debug
objcopy --strip-debug crash.exe
objcopy --add-gnu-debuglink=crash.exe.debug crash.exe
crash.o: crash.c Makefile
gcc -Wall -g -c crash.c
test:
gdb crash.exe
...
Reading symbols from C:\1\crash.exe...(no debugging symbols found)...done.
Anonymous