This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch] Add dwarf3 frame CIE support
From: Paul Brook <paul@codesourcery.com>
Date: Wed, 12 May 2004 00:26:24 +0100
On Tuesday 11 May 2004 19:34, Paul Brook wrote:
> The patch below adds support for dwarf3 format CIE frame records.
> Changes should be self-explanatory, and backwards compatible.
>
> Ok?
>
> Paul
>
> 2004-05-11 Paul Brook <paul@codesourcery.com>
>
> * gdb/dwarf2-frame.c (decode_frame_entry_1): Decode ver3 CIE records.
Whoops, wrong version of the patch. This one actually works.
Paul
Paul, two minor nits. See below. Oh and I think the "ver3" in the
ChangeLog is a bit terse. Otherwise, OK.
Mark
Index: gdb/dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.34
diff -u -p -r1.34 dwarf2-frame.c
--- gdb/dwarf2-frame.c 1 May 2004 10:55:19 -0000 1.34
+++ gdb/dwarf2-frame.c 11 May 2004 23:17:48 -0000
@@ -1268,6 +1268,8 @@ decode_frame_entry_1 (struct comp_unit *
/* This is a CIE. */
struct dwarf2_cie *cie;
char *augmentation;
+ unsigned int cie_version;
+
This introduces some extra whitespace that shouldn't be there.
/* Record the offset into the .debug_frame section of this CIE. */
cie_pointer = start - unit->dwarf_frame_buffer;
@@ -1288,7 +1290,9 @@ decode_frame_entry_1 (struct comp_unit *
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;
That if-statement fits on a single line, which I'd prefer.