summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-08-07 19:57:51 +0000
committerTom Tromey <tromey@redhat.com>2013-08-07 19:57:51 +0000
commit004afad6580339ea2058e2e57844f9c4cec045d4 (patch)
treed3306c4acd805d5dc2d8d15c3e8a46febac5b2c7 /gdb/dwarf2read.c
parent17db83e3ba28f9ad4b6fc99d12fb0537644f8a8e (diff)
downloadgdb-004afad6580339ea2058e2e57844f9c4cec045d4.tar.gz
fix recursively_compute_inclusions and add dwz test case
Doug pointed out a while ago that in the final dwz -m patch, nothing ever set symtab::user. This patch fixes this oversight and adds a test case showing why it is important. Built and regtested (both ways) on x86-64 Fedora 18. The new test unconditionally tests the partial unit machinery, which I think is an added plus. * dwarf2read.c (recursively_compute_inclusions): Add "immediate_parent" argument. Set symtab's "user" field if not set. (compute_symtab_includes): Update. * gdb.dwarf2/dwz.exp: New file.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index cb77386f6f2..ff901e9a88d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7374,7 +7374,8 @@ get_symtab (struct dwarf2_per_cu_data *per_cu)
static void
recursively_compute_inclusions (VEC (symtab_ptr) **result,
htab_t all_children, htab_t all_type_symtabs,
- struct dwarf2_per_cu_data *per_cu)
+ struct dwarf2_per_cu_data *per_cu,
+ struct symtab *immediate_parent)
{
void **slot;
int ix;
@@ -7402,10 +7403,16 @@ recursively_compute_inclusions (VEC (symtab_ptr) **result,
{
*slot = symtab;
VEC_safe_push (symtab_ptr, *result, symtab);
+ if (symtab->user == NULL)
+ symtab->user = immediate_parent;
}
}
else
- VEC_safe_push (symtab_ptr, *result, symtab);
+ {
+ VEC_safe_push (symtab_ptr, *result, symtab);
+ if (symtab->user == NULL)
+ symtab->user = immediate_parent;
+ }
}
for (ix = 0;
@@ -7413,7 +7420,7 @@ recursively_compute_inclusions (VEC (symtab_ptr) **result,
++ix)
{
recursively_compute_inclusions (result, all_children,
- all_type_symtabs, iter);
+ all_type_symtabs, iter, symtab);
}
}
@@ -7449,7 +7456,8 @@ compute_symtab_includes (struct dwarf2_per_cu_data *per_cu)
++ix)
{
recursively_compute_inclusions (&result_symtabs, all_children,
- all_type_symtabs, per_cu_iter);
+ all_type_symtabs, per_cu_iter,
+ symtab);
}
/* Now we have a transitive closure of all the included symtabs. */