diff options
author | Daniel Jacobowitz <drow@false.org> | 2009-11-12 18:59:40 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2009-11-12 18:59:40 +0000 |
commit | 328c9494f5b05541265b4cb8db8702479299c24e (patch) | |
tree | 6f2f9fcf5898adaa8f33c4d899562d8b7f79f06a /gdb/dwarf2read.c | |
parent | c32fa91d70ea20b38f90e5a88911f796b9a6418c (diff) | |
download | gdb-328c9494f5b05541265b4cb8db8702479299c24e.zip gdb-328c9494f5b05541265b4cb8db8702479299c24e.tar.gz gdb-328c9494f5b05541265b4cb8db8702479299c24e.tar.bz2 |
* dwarf2read.c (process_psymtab_comp_unit): Initialize per_cu backlink
at the same time as the forward link.
(load_partial_comp_unit): Initialize per_cu links before calling
init_cu_die_reader.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 5c9f3b8..e856a4b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1887,6 +1887,20 @@ process_psymtab_comp_unit (struct objfile *objfile, cu.list_in_scope = &file_symbols; + /* If this compilation unit was already read in, free the + cached copy in order to read it in again. This is + necessary because we skipped some symbols when we first + read in the compilation unit (see load_partial_dies). + This problem could be avoided, but the benefit is + unclear. */ + if (this_cu->cu != NULL) + free_one_cached_comp_unit (this_cu->cu); + + /* Note that this is a pointer to our stack frame, being + added to a global data structure. It will be cleaned up + in free_stack_comp_unit when we finish with this + compilation unit. */ + this_cu->cu = &cu; cu.per_cu = this_cu; /* Read the abbrevs for this compilation unit into a table. */ @@ -1941,21 +1955,6 @@ process_psymtab_comp_unit (struct objfile *objfile, /* Store the function that reads in the rest of the symbol table */ pst->read_symtab = dwarf2_psymtab_to_symtab; - /* If this compilation unit was already read in, free the - cached copy in order to read it in again. This is - necessary because we skipped some symbols when we first - read in the compilation unit (see load_partial_dies). - This problem could be avoided, but the benefit is - unclear. */ - if (this_cu->cu != NULL) - free_one_cached_comp_unit (this_cu->cu); - - /* Note that this is a pointer to our stack frame, being - added to a global data structure. It will be cleaned up - in free_stack_comp_unit when we finish with this - compilation unit. */ - this_cu->cu = &cu; - this_cu->psymtab = pst; dwarf2_find_base_address (comp_unit_die, &cu); @@ -2153,6 +2152,11 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu, /* ??? Missing cleanup for CU? */ + /* Link this compilation unit into the compilation unit tree. */ + this_cu->cu = cu; + cu->per_cu = this_cu; + cu->type_hash = this_cu->type_hash; + info_ptr = partial_read_comp_unit_head (&cu->header, info_ptr, dwarf2_per_objfile->info.buffer, dwarf2_per_objfile->info.size, @@ -2178,11 +2182,6 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu, else set_cu_language (language_minimal, cu); - /* Link this compilation unit into the compilation unit tree. */ - this_cu->cu = cu; - cu->per_cu = this_cu; - cu->type_hash = this_cu->type_hash; - /* Check if comp unit has_children. If so, read the rest of the partial symbols from this comp unit. If not, there's no more debug_info for this comp unit. */ |