Re: [0/4] RFC: add DWARF index support

Tom Tromey
2010-07-22T15:54:09Z

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> The immediate problem is that a dwarf2_per_cu_data is embedded in struct
Tom> signatured_type, and initialized in create_debug_types_hash_table. This
Tom> embedded struct doesn't get its objfile member initialized.

Here is the fix for the immediate problem. It prevents gdb from dying.

I am checking this in. Bootstrapped & regtested on x86-64 (compile
farm), and also tested locally against an executable with .debug_types.

Tom> The bigger problem is that I completely forgot about .debug_types.
Tom> I am not certain that a simple fix will work if we have both
Tom> .debug_types and .gdb_index. I will try that out.

I think this is going to need an index version bump.
I am still looking into it.

Tom

2010-07-22 Tom Tromey <tromey@redhat.com>

* dwarf2read.c (create_debug_types_hash_table): Set objfile on
type signature's per-CU data.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.421
diff -u -r1.421 dwarf2read.c
--- dwarf2read.c 21 Jul 2010 18:08:26 -0000 1.421
+++ dwarf2read.c 22 Jul 2010 15:42:38 -0000
@@ -2678,6 +2678,7 @@
type_sig->signature = signature;
type_sig->offset = offset;
type_sig->type_offset = type_offset;
+ type_sig->per_cu.objfile = objfile;

slot = htab_find_slot (types_htab, type_sig, INSERT);
gdb_assert (slot != NULL);