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]

[RFC 0/7] make psymbols independent of progspace


This patch series changes partial symbols to be independent of the
program space.

This is done following the same general approach as was taken for
minimal symbols and for SystemTap probes.  It is based on top of the
minimal symbol series.

One thing to note is that this series does not actually move partial
symbols or partial symbol tables to the per-BFD object.  This is
harder than it may seem.

One problem is that psymtabs have a back-link to the symtab.  This
could be broken in various ways, for example moving the mapping to a
hash table on the objfile.  (Temporarily, since once symtabs are moved
to the per-BFD, we could revert to the current scheme.)

However, there are other lurking issues.  E.g., in the DWARF reader
there are further back-links in the .gdb_index code.  And, I think
some fields of the dwarf2_per_objfile object are initialized during
psymtab reading.


One idea for the next step of improvements here would be to move the
psymbol bcache to the per-BFD object.  This would allow sharing the
psymbols at least, if not the psymtabs.  This is not extremely hard,
except:

* Some code paths in dwarf2read.c allocate psymbol names on the
  objfile_obstack; and as this code is shared with the full symbol
  reader it isn't trivial to move this.  Specifically,
  read_partial_die calls dwarf2_canonicalize_name.  This could be
  solved either by noting the fact in the partial DIE and then later
  copying the name; or by introducing a new bcache to hold canonical
  names.

* add_psymbol_to_list checks to see whether the psymbol was added to
  the cache.  This would have to change to a post-pass to remove
  duplicates.

I think a more likely route forward instead is to convert symbols,
symbol tables, types, and whatever issues there are in dwarf2read; and
then move all these data structures to the per-BFD object at one time.

Built and regtested on x86-64 Fedora 18, both in the default mode and
with -gstabs+; and on AIX (gcc111).

Tom


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