aDiePtrEnd = this_die + aDieInfo->length;
if (aDieInfo->length < 6)
{
/* Just padding bytes. */
aDieInfo->tag = TAG_padding;
aDiePtrEnd = this_die + aDieInfo->length;
if (aDieInfo->length < 6)
{
/* Just padding bytes. */
aDieInfo->tag = TAG_padding;
if (xptr + 2 <= aDiePtrEnd)
{
block_len = bfd_get_16 (abfd, xptr);
if (xptr + 2 <= aDiePtrEnd)
{
block_len = bfd_get_16 (abfd, xptr);
if (xptr + 4 <= aDiePtrEnd)
{
block_len = bfd_get_32 (abfd, xptr);
if (xptr + 4 <= aDiePtrEnd)
{
block_len = bfd_get_32 (abfd, xptr);
}
/* Parse a dwarf1 line number table for 'aUnit->stmt_list_offset'
into 'aUnit->linenumber_table'. Return FALSE if an error
occurs; TRUE otherwise. */
}
/* Parse a dwarf1 line number table for 'aUnit->stmt_list_offset'
into 'aUnit->linenumber_table'. Return FALSE if an error
occurs; TRUE otherwise. */
(stash->abfd, msec, NULL, stash->syms);
if (! stash->line_section)
(stash->abfd, msec, NULL, stash->syms);
if (! stash->line_section)
aUnit->linenumber_table = (struct linenumber *) bfd_alloc (stash->abfd,
amt);
if (!aUnit->linenumber_table)
aUnit->linenumber_table = (struct linenumber *) bfd_alloc (stash->abfd,
amt);
if (!aUnit->linenumber_table)
if (! parse_die (stash->abfd, &eachDieInfo, eachDie,
stash->debug_section_end))
if (! parse_die (stash->abfd, &eachDieInfo, eachDie,
stash->debug_section_end))
}
/* Find the nearest line to 'addr' in 'aUnit'.
Return whether we found the line (or a function) without error. */
}
/* Find the nearest line to 'addr' in 'aUnit'.
Return whether we found the line (or a function) without error. */
dwarf1_unit_find_nearest_line (struct dwarf1_debug* stash,
struct dwarf1_unit* aUnit,
unsigned long addr,
dwarf1_unit_find_nearest_line (struct dwarf1_debug* stash,
struct dwarf1_unit* aUnit,
unsigned long addr,
const char **functionname_ptr,
unsigned int *linenumber_ptr)
{
const char **functionname_ptr,
unsigned int *linenumber_ptr)
{
if (! aUnit->linenumber_table)
{
if (! parse_line_table (stash, aUnit))
if (! aUnit->linenumber_table)
{
if (! parse_line_table (stash, aUnit))
msec = bfd_get_section_by_name (abfd, ".debug");
if (! msec)
/* No dwarf1 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
msec = bfd_get_section_by_name (abfd, ".debug");
if (! msec)
/* No dwarf1 info. Note that at this point the stash
has been allocated, but contains zeros, this lets
future calls to this function fail quicker. */
if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie,
stash->debug_section_end))
if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie,
stash->debug_section_end))
if (aDieInfo.tag == TAG_compile_unit)
{
struct dwarf1_unit* aUnit
= alloc_dwarf1_unit (stash);
if (!aUnit)
if (aDieInfo.tag == TAG_compile_unit)
{
struct dwarf1_unit* aUnit
= alloc_dwarf1_unit (stash);
if (!aUnit)