This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] dwarf2read.c: create_debug_types_hash_table cleanup
- From: Doug Evans <dje at google dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 28 Mar 2013 17:36:23 -0700
- Subject: [commit] dwarf2read.c: create_debug_types_hash_table cleanup
Hi.
Another minor cleanup.
Committed.
2013-03-28 Doug Evans <dje@google.com>
* dwarf2read.c (create_debug_types_hash_table): Don't allocate the
types hash table until we know we need it.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.762
diff -u -p -r1.762 dwarf2read.c
--- dwarf2read.c 29 Mar 2013 00:11:10 -0000 1.762
+++ dwarf2read.c 29 Mar 2013 00:13:34 -0000
@@ -4242,14 +4257,6 @@ create_debug_types_hash_table (struct dw
else
abbrev_section = &dwarf2_per_objfile->abbrev;
- if (types_htab == NULL)
- {
- if (dwo_file)
- types_htab = allocate_dwo_unit_table (objfile);
- else
- types_htab = allocate_signatured_type_table (objfile);
- }
-
/* We don't use init_cutu_and_read_dies_simple, or some such, here
because we don't need to read any dies: the signature is in the
header. */
@@ -4286,6 +4293,14 @@ create_debug_types_hash_table (struct dw
continue;
}
+ if (types_htab == NULL)
+ {
+ if (dwo_file)
+ types_htab = allocate_dwo_unit_table (objfile);
+ else
+ types_htab = allocate_signatured_type_table (objfile);
+ }
+
if (dwo_file)
{
sig_type = NULL;