aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-06-08 13:34:56 +0000
committerPaul Brook <paul@codesourcery.com>2004-06-08 13:34:56 +0000
commit28ba0b33be60df63fca1d457b70bf791dc7c97ef (patch)
treee45382c2734bf4112ffafd3ed39449a7333b78a5
parentf26caa111510d587da5a777082803dedef2f42eb (diff)
downloadgdb-28ba0b33be60df63fca1d457b70bf791dc7c97ef.zip
gdb-28ba0b33be60df63fca1d457b70bf791dc7c97ef.tar.gz
gdb-28ba0b33be60df63fca1d457b70bf791dc7c97ef.tar.bz2
* gdb/dwarf2-frame.c (decode_frame_entry_1): Decode version 3 CIE
records.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2-frame.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 370a5d9..973ad81 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-06 Paul Brook <paul@codesourcery.com>
+
+ * gdb/dwarf2-frame.c (decode_frame_entry_1): Decode version 3 CIE
+ records.
+
2004-06-08 Paul N. Hilfinger <Hilfinger@gnat.com>
* ada-lang.c (lookup_symbol_in_language): New function to allow
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index fccb94d..52ca337 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1268,6 +1268,7 @@ decode_frame_entry_1 (struct comp_unit *unit, char *start, int eh_frame_p)
/* This is a CIE. */
struct dwarf2_cie *cie;
char *augmentation;
+ unsigned int cie_version;
/* Record the offset into the .debug_frame section of this CIE. */
cie_pointer = start - unit->dwarf_frame_buffer;
@@ -1288,7 +1289,8 @@ decode_frame_entry_1 (struct comp_unit *unit, char *start, int eh_frame_p)
cie->encoding = encoding_for_size (unit->addr_size);
/* Check version number. */
- if (read_1_byte (unit->abfd, buf) != DW_CIE_VERSION)
+ cie_version = read_1_byte (unit->abfd, buf);
+ if (cie_version != 1 && cie_version != 3)
return NULL;
buf += 1;
@@ -1314,8 +1316,15 @@ decode_frame_entry_1 (struct comp_unit *unit, char *start, int eh_frame_p)
read_signed_leb128 (unit->abfd, buf, &bytes_read);
buf += bytes_read;
- cie->return_address_register = read_1_byte (unit->abfd, buf);
- buf += 1;
+ if (cie_version == 1)
+ {
+ cie->return_address_register = read_1_byte (unit->abfd, buf);
+ bytes_read = 1;
+ }
+ else
+ cie->return_address_register = read_unsigned_leb128 (unit->abfd, buf,
+ &bytes_read);
+ buf += bytes_read;
cie->saw_z_augmentation = (*augmentation == 'z');
if (cie->saw_z_augmentation)