* dwarf2.c (find_line): Don't trust debug information after an
unparseable compilation unit.
This commit is contained in:
parent
819da74e19
commit
d74e4b29eb
2 changed files with 40 additions and 34 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-02-16 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
* dwarf2.c (find_line): Don't trust debug information after an
|
||||||
|
unparseable compilation unit.
|
||||||
|
|
||||||
2008-02-15 Alan Modra <amodra@bigpond.net.au>
|
2008-02-15 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
PR 5765
|
PR 5765
|
||||||
|
|
11
bfd/dwarf2.c
11
bfd/dwarf2.c
|
@ -3068,6 +3068,10 @@ find_line (bfd *abfd,
|
||||||
{
|
{
|
||||||
each = parse_comp_unit (stash, length, info_ptr_unit,
|
each = parse_comp_unit (stash, length, info_ptr_unit,
|
||||||
offset_size);
|
offset_size);
|
||||||
|
if (!each)
|
||||||
|
/* The dwarf information is damaged, don't trust it any
|
||||||
|
more. */
|
||||||
|
break;
|
||||||
stash->info_ptr += length;
|
stash->info_ptr += length;
|
||||||
|
|
||||||
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
|
if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
|
||||||
|
@ -3077,8 +3081,6 @@ find_line (bfd *abfd,
|
||||||
stash->sec_info_ptr = stash->info_ptr;
|
stash->sec_info_ptr = stash->info_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (each)
|
|
||||||
{
|
|
||||||
if (stash->all_comp_units)
|
if (stash->all_comp_units)
|
||||||
stash->all_comp_units->prev_unit = each;
|
stash->all_comp_units->prev_unit = each;
|
||||||
else
|
else
|
||||||
|
@ -3089,8 +3091,8 @@ find_line (bfd *abfd,
|
||||||
|
|
||||||
/* DW_AT_low_pc and DW_AT_high_pc are optional for
|
/* DW_AT_low_pc and DW_AT_high_pc are optional for
|
||||||
compilation units. If we don't have them (i.e.,
|
compilation units. If we don't have them (i.e.,
|
||||||
unit->high == 0), we need to consult the line info
|
unit->high == 0), we need to consult the line info table
|
||||||
table to see if a compilation unit contains the given
|
to see if a compilation unit contains the given
|
||||||
address. */
|
address. */
|
||||||
if (do_line)
|
if (do_line)
|
||||||
found = (((symbol->flags & BSF_FUNCTION) == 0
|
found = (((symbol->flags & BSF_FUNCTION) == 0
|
||||||
|
@ -3112,7 +3114,6 @@ find_line (bfd *abfd,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
|
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue