diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2003-04-09 09:56:17 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2003-04-09 09:56:17 +0000 |
commit | a3805e4e10604d5d9b469949d6141c5935d9275c (patch) | |
tree | a8db3ebc89f3296b5eb90c6ce8c77e861824965b /bfd/dwarf2.c | |
parent | c1124b23a9b0883c4400d05b90d01fee2612a41d (diff) | |
download | gdb-a3805e4e10604d5d9b469949d6141c5935d9275c.zip gdb-a3805e4e10604d5d9b469949d6141c5935d9275c.tar.gz gdb-a3805e4e10604d5d9b469949d6141c5935d9275c.tar.bz2 |
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
and IRIX-specific shift-to-64-bit 4-byte lengths before following
addr_size.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r-- | bfd/dwarf2.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 8a4cc64..c4a4423 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1927,26 +1927,34 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, bfd_boolean found; unsigned int offset_size = addr_size; - if (addr_size == 4) + length = read_4_bytes (abfd, stash->info_ptr); + /* A 0xffffff length is the DWARF3 way of indicating we use + 64-bit offsets, instead of 32-bit offsets. */ + if (length == 0xffffffff) { - length = read_4_bytes (abfd, stash->info_ptr); - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - else if (length == 0) - { - /* Handle (non-standard) 64-bit DWARF2 formats. */ - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 4; - } + offset_size = 8; + length = read_8_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 12; + } + /* A zero length is the IRIX way of indicating 64-bit offsets, + mostly because the 64-bit length will generally fit in 32 + bits, and the endianness helps. */ + else if (length == 0) + { + offset_size = 8; + length = read_4_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + /* In the absence of the hints above, we assume addr_size-sized + offsets, for backward-compatibility with pre-DWARF3 64-bit + platforms. */ + else if (addr_size == 8) + { + length = read_8_bytes (abfd, stash->info_ptr); + stash->info_ptr = 8; } else - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += addr_size; + stash->info_ptr += 4; if (length > 0) { |