aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-10-15 11:50:58 -0600
committerTom Tromey <tromey@redhat.com>2014-02-26 12:11:18 -0700
commit5f6cac4085c95c5339b9549dc06d4f9184184fa6 (patch)
treee37ad03a89a177fcc90dca01ec5a38e73840a926 /gdb/objfiles.h
parent2750ef27997b6114da090a25a314396eaf85a87a (diff)
downloadgdb-5f6cac4085c95c5339b9549dc06d4f9184184fa6.zip
gdb-5f6cac4085c95c5339b9549dc06d4f9184184fa6.tar.gz
gdb-5f6cac4085c95c5339b9549dc06d4f9184184fa6.tar.bz2
add short-circuit logic to elfread.c
If minimal symbols have already been read into a per-BFD object, then a symbol reader can skip re-reading them. This changes the ELF reader to do so. We only skip the work if the file is ELF+DWARF. If it has stabs or mdebug sections, then I think extra information is computed during the minsym creation pass; and so we must still repeat it. Eventually even this will go away, once all symbol types have switched to being progspace-independent. In the meantime this has no negative effect -- it is just a missing optimization for a small set of users. This change also required a somewhat non-obvious change to the OBJSTAT accounting code. If a symbol reader skips re-reading minimal symbols, then the corresponding OBJSTAT will not be updated. This leads to a test failure in gdb.base/maint.exp. To fix this, I've moved the needed stat field out of objfile and into the per-BFD object. 2014-02-26 Tom Tromey <tromey@redhat.com> * elfread.c (elf_read_minimal_symbols): Return early if minimal symbols have already been read. Add "ei" parameter. (elf_symfile_read): Call elf_read_minimal_symbols earlier. * minsyms.c (prim_record_minimal_symbol_full): Update. * objfiles.h (struct objstats) <n_minsyms>: Move... (struct objfile_per_bfd_storage) <n_minsyms>: ... here. * symmisc.c (print_objfile_statistics): Update.
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r--gdb/objfiles.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index d585bc4..dc06c7b 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -151,7 +151,6 @@ struct obj_section
struct objstats
{
- int n_minsyms; /* Number of minimal symbols read */
int n_psyms; /* Number of partial symbols read */
int n_syms; /* Number of full symbols read */
int n_stabs; /* Number of ".stabs" read (if applicable) */
@@ -224,6 +223,12 @@ struct objfile_per_bfd_storage
struct minimal_symbol *msymbols;
int minimal_symbol_count;
+ /* The number of minimal symbols read, before any minimal symbol
+ de-duplication is applied. Note in particular that this has only
+ a passing relationship with the actual size of the table above;
+ use minimal_symbol_count if you need the true size. */
+ int n_minsyms;
+
/* This is true if minimal symbols have already been read. Symbol
readers can use this to bypass minimal symbol reading. Also, the
minimal symbol table management code in minsyms.c uses this to