#228 GDB does not work with GNU debug links

None
open
nobody
GDB (3)
1
2014-12-03
2014-07-16
CCompletion
No

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.

crash.c

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;
}

Makefile

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.

Discussion


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks