This is the mail archive of the gdb@sources.redhat.com 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: C++/Java regressions


ian> Good question.  My guess is that it's because lookup_symbol_aux()
ian> calls current_language->la_lookup_symbol_nonlocal() before it calls
ian> lookup_symbol_aux_psymtabs().  If I force la_lookup_symbol_nonlocal()
ian> to return NULL, then lookup_symbol_aux_psymtabs() finds the typedef,
ian> and `ptype T5<int>' works more or less correctly.

Have a look at

  http://sources.redhat.com/gdb/bugs/1465

I just mailed in an analysis of a similar bug.  It will take some
time for gnats to post it.

Briefly, the call tree is:

  lookup_symbol_aux
    current_language->la_lookup_symbol_nonlocal
      lookup_symbol_file
	lookup_symbol_static                    [1]
	lookup_symbol_aux_block
	lookup_symbol_global                    [2]
	lookup_possible_namespace_symbol        [3]
    lookup_symbol_aux_symtabs                   [4]
    lookup_symbol_aux_psymtabs

You are probably getting a hit at [3].

Check the value of "block" in lookup_symbol_file.  I bet that
you have block=0.  That prevents [1] from finding a match in the current
static block.

[4] is a kludge that looks in ALL static blocks.  That's not good.
Before [3] came along as part of DavidC's namespace work,
[4] was happening all the time.

I think the right fix is to pass a correct "block" to local_symbol_aux
so that [1] can do its job properly.

Michael C


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