This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Error referencing symbols in gdb when compiled with gcc 3.4.6


Hello,

I am having a problem when using gcc 3.4.6. My code was compiled earlier using gcc 3.2.2 with the -g option.
I was able to print the addess of any symbol or do a "ptype" on any symbol using gdb 6.4 with the generated
binary.


Now I compile the very same code using gcc 3.4.6 using the -g option again. Here, I get an error saying
"There is no field/member named <symbol name>".
This very symbol was found when the code was compiled using gcc 3.2.2.


To solve this problem, I followed two workarounds - but I do not understand why they worked with those
workarounds.


Workaround 1: I tried to compile the code with gcc 3.4.6 using -gstabs+ option instead of with -g. This
resulted in the symbols being found and I could proceed with debugging using gdb 6.4 as before. No problems
at all.


Workaround 2 : I changed the order of linking the .o files to my resulting binary. The .o files where the symbol
referencing was problematic were placed on top of the list of the object files to be linked. Now when I debug
the resulting binary, things work perfectly again as it did earlier with the older compiler.


I don't know why this is a problem. Is this a problem with giving the compiler options or is it a linker problem ?
Or does it have to do with a problem of using the right debug formats (stabs, dwarf).


Any help here will be highly appreciated. I've reached the dead end and do not know how to proceed further.

Regards,
Kalpana Balaji

_________________________________________________________________
Wedding bells are ringing. When's your time to walk the aisle? http://ad.in.doubleclick.net/clk;112111293;17571293;v?http://www.simplymarry.com/timesmatri/faces/jsp/UserTrackLandingPage.jsp?origin=hotmail_taglines_ros_june07



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]