diff options
author | Tom Tromey <tromey@redhat.com> | 2010-03-04 22:01:10 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-03-04 22:01:10 +0000 |
commit | ae4114972997ac939791195c8cc33ca7e4eaeadc (patch) | |
tree | c7fb4981c82519261d52cbf38026dbb9b2f4719e /gdb/dwarf2read.c | |
parent | 111f853cd1df95703d0aec63aa57cbb012aee12e (diff) | |
download | gdb-ae4114972997ac939791195c8cc33ca7e4eaeadc.zip gdb-ae4114972997ac939791195c8cc33ca7e4eaeadc.tar.gz gdb-ae4114972997ac939791195c8cc33ca7e4eaeadc.tar.bz2 |
* dwarf2read.c (skip_one_die) <DW_FORM_ref_addr>: Use offset size
in DWARF 3 and later.
(read_attribute_value) <DW_FORM_ref_addr>: Likewise.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 549d2c0..b144dc1 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2882,8 +2882,15 @@ skip_one_die (gdb_byte *buffer, gdb_byte *info_ptr, skip_attribute: switch (form) { - case DW_FORM_addr: case DW_FORM_ref_addr: + /* In DWARF 2, DW_FORM_ref_addr is address sized; in DWARF 3 + and later it is offset sized. */ + if (cu->header.version == 2) + info_ptr += cu->header.addr_size; + else + info_ptr += cu->header.offset_size; + break; + case DW_FORM_addr: info_ptr += cu->header.addr_size; break; case DW_FORM_data1: @@ -7017,8 +7024,14 @@ read_attribute_value (struct attribute *attr, unsigned form, attr->form = form; switch (form) { - case DW_FORM_addr: case DW_FORM_ref_addr: + if (cu->header.version == 2) + DW_ADDR (attr) = read_address (abfd, info_ptr, cu, &bytes_read); + else + DW_ADDR (attr) = read_offset (abfd, info_ptr, &cu->header, &bytes_read); + info_ptr += bytes_read; + break; + case DW_FORM_addr: DW_ADDR (attr) = read_address (abfd, info_ptr, cu, &bytes_read); info_ptr += bytes_read; break; |