aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2009-01-30 01:04:47 +0000
committerAdam Nemet <anemet@caviumnetworks.com>2009-01-30 01:04:47 +0000
commit13d72a148e239265338a80acec26874a95a91ab6 (patch)
treefbd47aaa972feda080b1358e2a2601df26a8e915 /bfd/dwarf2.c
parent5efc7cd2d630cf8acc716a45d0cb1025096fd308 (diff)
downloadgdb-13d72a148e239265338a80acec26874a95a91ab6.zip
gdb-13d72a148e239265338a80acec26874a95a91ab6.tar.gz
gdb-13d72a148e239265338a80acec26874a95a91ab6.tar.bz2
* dwarf2.c (read_rangelist): Use read_address to read low_pc and
high_pc in order to properly sign-extend VMAs.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 4f2e38c..0c18253 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1803,20 +1803,11 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
bfd_vma low_pc;
bfd_vma high_pc;
- if (unit->addr_size == 4)
- {
- low_pc = read_4_bytes (unit->abfd, ranges_ptr);
- ranges_ptr += 4;
- high_pc = read_4_bytes (unit->abfd, ranges_ptr);
- ranges_ptr += 4;
- }
- else
- {
- low_pc = read_8_bytes (unit->abfd, ranges_ptr);
- ranges_ptr += 8;
- high_pc = read_8_bytes (unit->abfd, ranges_ptr);
- ranges_ptr += 8;
- }
+ low_pc = read_address (unit, ranges_ptr);
+ ranges_ptr += unit->addr_size;
+ high_pc = read_address (unit, ranges_ptr);
+ ranges_ptr += unit->addr_size;
+
if (low_pc == 0 && high_pc == 0)
break;
if (low_pc == -1UL && high_pc != -1UL)