This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

Re: gdb bug or corrupt dwarf info?


>>>>> "Jens" == Elmenthaler, Jens <JENS.ELMENTHALER@advantest.com> writes:

Jens> I'm currently investigation why gdb is only showing 'i' as local
Jens> variable in the following loop body, and not also 'text':

Jens> So my question now is, whether this is a gdb bug which I possibly
Jens> could fix, or whether the debug info is broken.

Jens> In my opinion it looks suspicious that the lexical block
Jens> containing 'text' is not a child of the lexical block containing
Jens> 'i', but a sibling.

I am not sure if it is invalid DWARF.  There isn't much in DWARF that
prohibits odd output like this.  Maybe such a prohibition is in there --
I couldn't quickly find it, but that isn't definitive.

This DWARF is definitely not what gdb expects.  gdb expects lexical
blocks to be nested and not to overlap.  However, see the "???" comment
in read_lexical_block_scope -- there appears to be some room for
improvement, though it is unclear to me if trying to handle the DWARF
you have is worth the effort.  In particular the comment refers to how
to handle disjoint ranges, but your problem is both disjoint ranges in
one scope combined with an overlap of another scope.

I would say that it is both a compiler bug and a gdb bug.
The blocks ought to nest, and there doesn't seem to me to be a good
reason to use the representation you are seeing.

Tom


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