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: "set foo"


>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

>> FWIW, this sounds like a gdb bug to me.

Eli> Could be a GCC bug as well, no?

I suppose so.  It is hard to say without more info.

>> I looked at emacs/src/.gdbinit and it seems to me that the types and
>> variables in question are global (in the sense of, not local to a
>> function).  So, they should be found without this trick.

Eli> So you are saying that global types and variables are always loaded by
Eli> GDB automatically, not lazily?

I can only say what happens for DWARF debuginfo, I don't know anything
about the other formats.  (I gather stabs is similar, but I don't know
details.)

For DWARF, GDB does two passes over the debuginfo.  The first time it
reads "partial symbols".  There are some maint commands ("apropos partial")
to dump this info, that might be helpful to you.

In this first pass, GDB just looks for global symbols -- variables,
functions, and types.  It skips a lot of the debuginfo.

Then when a partial symbol is looked up, its partial symbol table is
expanded to a full symbol table.  In DWARF terms this means reading all
the debuginfo in the CU.

Because there are two scanners, this approach is open to a couple types
of bugs if they disagree.  One is if a symbol appears in a psymtab but
not in a full symtab.  GDB prints an error in that case (maybe
internal_error, I forget).  The other is the reverse, which sounds like
what you've hit.

Tom


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