Re: g++, I'm not able to produce debug info for some classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.01.2011 18:17, Ian Lance Taylor wrote:
"Vyacheslav V. Yurkov"<uvv.mail@xxxxxxxxx>  writes:

We use several static libraries in our project as our run-time.
To add debug info for a class X I just do:
g++ X.cpp -I../include -c -g -Wall -o X.o
ar rsu ../lib1.a X.o
That worked OK with any class from our library but at the moment
I have some issues with class X. I can't see its members in a debugger gdb.
gdb says that class X is<incomplete type>.
I tried to do 'ptype X' in gdb and got the following:
No symbol "X" in current context.
I looked into it more, did objdump for X.o file and saw that
there is no address near the symbol which looks like my class X.

I tried 3 different versions of g++ (4.3.x, 4.4.x, 4.5.x), tried following
parameters for gcc: -g3, -g2 -O0, -ggdb, -gstubs+. But nothing helped.
My class X also doesn't use anonymous unions.

Does anyone have an idea what is wrong with g++ or with my class X?
I think you are asking a gdb question, not a gcc question.  You may want
to ask on a gdb mailing list.  See http://sourceware.org/gdb/ .
Just did. I just thought that it is more g++ related issue.
I don't fully grasp your comment about objdump.  A type like class X
would not have an address.  The objdump program does not dump debugging
information.
It does, objdump with -g option displays debug information from object file.
Note that in general you need to have a variable of type X before gdb
can tell you anything about it.

Ian
Actually I have one, but I don't need to.
Gdb must be able to display class members without a variable of this class.

--
Yours sincerely,
Vyacheslav V. Yurkov



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux