From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jacques-Olivier Goussard" To: Subject: RE: Helping GDB to find symbols Date: Tue, 01 May 2001 06:05:00 -0000 Message-id: References: X-SW-Source: 2001-05/msg00002.html > From: Eli Zaretskii [ mailto:eliz@is.elta.co.il ] > On Mon, 30 Apr 2001, Jacques-Olivier Goussard wrote: > > > > Doesn't it work to say "gdb yourprog core", where `yourprog' is the > > > unstripped binary and `core' is the core file you get from your > > > customers? > > No. I guess it gets mixed up in the addresses and offsets. The > stacktrace > > for example is quite different when I switched to the non-debug to > > debug binaries (exec and dynamic libraries). > > Hmm? I don't understand how is this possible: all the addresses in a > stripped program should be exactly like in an unstripped one. > Otherwise, you won't be able to debug the core dump which originated > from an unstripped program. > > Am I missing something? > > What is your object file format and debug info format, btw? I do not think the addresses are the same in stripped and unstripped: just run nm on the same library for debug and non-debug build and you'll see the symbols are not at the same address. The symbol-file cmd may be what I need, but it's not complete: it uses the symbols of the provided file insteed of the ones of the exec, so that you should be able debug one lib for ex, but you lose the symbols of the rest... I can live with that, but it would be nice to have a cmd that would just load as much symbol defs as possible from a set of files. For ex, assume liba.so and libb.so contains the definitions of structures A and B. In debug mode, gdb is able to understand (gdb) p *(A*) (gdb) p *(B*) and display the content of address 'meaningfully'. In non debug mode, you loose this possibility. I just want to be able to point gdb to where it could find the definitions of symbol A and B, so that the 2 previous cmds will be understood even in non debug mode (at the best, GDB would also use them to display the stack trace with the args to the functions disposed as in debug mode). Does it make sense ? Jacques-Olivier