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: how to search for a global type?


On Wed, Jan 02, 2008 at 09:41:58AM -0800, Gary Funck wrote:
> I did try lookup_symbol() as well, no go.

You may need to trace how ptype finds it, then.  I would expect
lookup_symbol to work.  If there is no symbol in the global blocks, it
falls back to static blocks (not just the current file's).
search_symbols is going to be much less efficient.

> I think one difficulty is that the current file doesn't
> define the type.  It is defined in the runtime files.
> 
> I haven't tried following the logic, but could you briefly
> explain the raltionship between block vectors and symbol
> tables?

Each file has a blockvector.  Block 0 is its contribution to the
global symbol table.  Block 1 is its static symbol table, including
things like types.  Later blocks are children of one or the other,
representing functions (and further inner blocks of functions).

The symbol table is made up of the contents of those blocks, though
indexed differently (I think, I have not checked in a while).

-- 
Daniel Jacobowitz
CodeSourcery


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