This is the mail archive of the gdb-patches@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: [RFA] Add global/static and symbol kind indicator to .gdb_index


>>>>> "Cary" == Cary Coutant <ccoutant@google.com> writes:

Cary> If the right thing to do is to have only one CU, how do I decide
Cary> what kinds of names get this treatment?

I don't know of a trivial rule.

You can dig around and look at struct partial_symbol and struct
general_symbol_info and deduce most of the rules.  But this is really
hairy.

The index is really tied to gdb's occasionally questionable internals.
This is one of its major disadvantages.

You could probably come up with a conservative approximation to the real
rule, that would work pretty well.  I'd imagine it is most important for
types; and also easier there since types don't have a location.

Cary> (For example, some arbitrary
Cary> type "struct foo" might actually be a different type, and you'd want
Cary> multiple index entries.)

You would think so, but no, because gdb will only ever expand one of
those in response to an index-based lookup.  The index is really only
used in the case where some symbol cannot be found in the current
context (or where there isn't really a current context in the sense of
some fully-read CU).

Tom


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