g++, I'm not able to produce debug info for some classes
Vyacheslav V. Yurkov
uvv.mail@gmail.com
Fri Feb 18 08:55:00 GMT 2011
On 26.01.2011 19:22, Ian Lance Taylor wrote:
> "Vyacheslav V. Yurkov"<uvv.mail@gmail.com> writes:
>
>
>>> 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.
>>
> Well, OK, but that doesn't work for DWARF, and everybody these days
> should be using DWARF. Actually I would like that option to work for
> DWARF but nobody has implemented it.
>
>
>>> Note that in general you need to have a variable of type X before gdb
>>> can tell you anything about it.
>>>
>>>
>> Actually I have one, but I don't need to.
>> Gdb must be able to display class members without a variable of this class.
>>
> But gcc won't generate debugging information for a class if there are no
> actual instances of the class. Otherwise C++ .o files would be
> gargantuan, since they would have to contain debug info for every class
> defined in every included .h file.
>
> Ian
>
>
If someone is still interested I figured out how to solve my issue.
g++ option -femit-class-debug-always solves my problem.
--
Yours sincerely,
Vyacheslav V. Yurkov
More information about the Gcc-help
mailing list