This is the mail archive of the gdb-patches@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]

[RFC/RFA] find_pc_sect_psymtab(): symbol table not always complete


Hello,

Re: http://sources.redhat.com/ml/gdb-patches/2003-11/msg00368.html

The following change tweaks find_pc_sect_psymtab() to stop assuming
that the symbol table will contain all symbols. So when we don't find
a partial symtab containing a symbol at the same address as the minimal
symbol we found, we return the symtab containing  symbol which address
is the closest to the given PC address.

This fixes the problem reported in the message referenced above.

As noted by Daniel J, the cleanest fix, in the long run, is probably to
record accurate code ranges rather insted of the textlow/texthigh
addresses. This is a more long term project which I wanted to tackle
without the pressure of the users not being able to debug comfortably.
This will be the subject of another post coming shortly.

2003-11-19  J. Brobecker  <brobecker@gnat.com>

        * symtab.c (find_pc_sect_psymtab): Refine the search for the
        partial symtab corresponding to the given PC address, taking
        into account the fact that the symbol table might be incomplete.

It has been tested on x86-linux with stabs & dwarf-2 with no regression.
It has also been tested on mips-irix but on a 5.3-based version of GDB
(we haven't moved to a more recent version of GDB on this platform yet,
and the HEAD version is giving me some trouble that I need to sort out).

Comments? OK to apply?

Thanks,
-- 
Joel

Attachment: symtab.c.diff
Description: Text document


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