From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: Jacques-Olivier Goussard Cc: Subject: RE: Helping GDB to find symbols Date: Tue, 01 May 2001 12:19:00 -0000 Message-id: References: X-SW-Source: 2001-05/msg00018.html On Tue, 1 May 2001, Jacques-Olivier Goussard wrote: > > > > 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. This is incorrect. In fact, it's a law in gcc that using -g shouldn't change the code generation. They won't accept patches that violate this. So the symbol addresses are the same. If they aren't for you, you must be compiling the non-debug build with optimization, and the debug build without optimization, or something of the sort. gdb ./debug-file core should work fine, even if the core is generated from the non-debug versio. I do it all the tie. --Dan