diff options
author | Dawn Perchik <dawn@cygnus> | 1997-11-01 01:28:26 +0000 |
---|---|---|
committer | Dawn Perchik <dawn@cygnus> | 1997-11-01 01:28:26 +0000 |
commit | 685064606001a865162044835fb96ab597a341af (patch) | |
tree | 87b0a30f9eb64b6470b1acac2519c02adf3631d4 /gdb/dwarf2read.c | |
parent | aa9aa96fac767c2c6517915b101402aad3e3e99e (diff) | |
download | gdb-685064606001a865162044835fb96ab597a341af.zip gdb-685064606001a865162044835fb96ab597a341af.tar.gz gdb-685064606001a865162044835fb96ab597a341af.tar.bz2 |
* dwarf2read.c (dwarf2_build_psymtabs_hard): Handle the case
where a compilation unit die has no children (DW_TAG_compile_unit
has DW_children_no).
(scan_partial_symbols): Add comment for nesting_level.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 38d80fb..a754a84 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -964,8 +964,11 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline) /* Store the function that reads in the rest of the symbol table */ pst->read_symtab = dwarf2_psymtab_to_symtab; - /* Read the rest of the partial symbols from this comp unit */ - info_ptr = scan_partial_symbols (info_ptr, objfile, &lowpc, &highpc); + /* 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. */ + if (comp_unit_die.has_children) + info_ptr = scan_partial_symbols (info_ptr, objfile, &lowpc, &highpc); /* If the compilation unit didn't have an explicit address range, then use the information extracted from its child dies. */ @@ -1004,9 +1007,16 @@ scan_partial_symbols (info_ptr, objfile, lowpc, highpc) { bfd *abfd = objfile->obfd; struct partial_die_info pdi; - int nesting_level = 1; /* we've already read in comp_unit_die */ - int has_pc_info; + /* This function is called after we've read in the comp_unit_die in + order to read its children. We start the nesting level at 1 since + we have pushed 1 level down in order to read the comp unit's children. + The comp unit itself is at level 0, so we stop reading when we pop + back to that level. */ + + int nesting_level = 1; + int has_pc_info; + *lowpc = ((CORE_ADDR) -1); *highpc = ((CORE_ADDR) 0); |