aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-07-30 23:16:45 +0000
committerJim Blandy <jimb@codesourcery.com>2001-07-30 23:16:45 +0000
commit9e84cbde42a1987d9623e2b17096452c851eb4ba (patch)
tree054742466eb953b9a9de69db027a62ef856eedf0
parent72473524da621267b753414666ae9fde8d418b7c (diff)
downloadfsf-binutils-gdb-9e84cbde42a1987d9623e2b17096452c851eb4ba.zip
fsf-binutils-gdb-9e84cbde42a1987d9623e2b17096452c851eb4ba.tar.gz
fsf-binutils-gdb-9e84cbde42a1987d9623e2b17096452c851eb4ba.tar.bz2
* dwarf2read.c (dwarf2_build_psymtabs_hard): Doc fix.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dwarf2read.c28
2 files changed, 32 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22b4f02..e33de3b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-30 Jim Blandy <jimb@redhat.com>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Doc fix.
+
2001-07-27 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Only invoke AC_FUNC_SETPGRP if not cross-compiling.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a3ca771..bc559b0 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -977,6 +977,34 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
info_ptr = dwarf_info_buffer;
abbrev_ptr = dwarf_abbrev_buffer;
+ /* We use dwarf2_tmp_obstack for objects that don't need to survive
+ the partial symbol scan, like attribute values.
+
+ We could reduce our peak memory consumption during partial symbol
+ table construction by freeing stuff from this obstack more often
+ --- say, after processing each compilation unit, or each die ---
+ but it turns out that this saves almost nothing. For an
+ executable with 11Mb of Dwarf 2 data, I found about 64k allocated
+ on dwarf2_tmp_obstack. Some investigation showed:
+
+ 1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*,
+ DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*. These are
+ all fixed-length values not requiring dynamic allocation.
+
+ 2) 30% of the attributes used the form DW_FORM_string. For
+ DW_FORM_string, read_attribute simply hands back a pointer to
+ the null-terminated string in dwarf_info_buffer, so no dynamic
+ allocation is needed there either.
+
+ 3) The remaining 1% of the attributes all used DW_FORM_block1.
+ 75% of those were DW_AT_frame_base location lists for
+ functions; the rest were DW_AT_location attributes, probably
+ for the global variables.
+
+ Anyway, what this all means is that the memory the dwarf2
+ reader uses as temporary space reading partial symbols is about
+ 0.5% as much as we use for dwarf_*_buffer. That's noise. */
+
obstack_init (&dwarf2_tmp_obstack);
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);