This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Dwarf3 unwind support


The following patch teaches the dwarf unwinding code about dwarf3 format CIE 
entries.

Tested on i686-linux.
Ok?

Paul

2004-05-17  Paul Brook  <paul@codesourcery.com>

	* unwind-dw2-fde.c (get_cie_encoding): Handle dwarf3 CIE format.
	* unwind-dw2.c (extract_cie_info): Ditto.
	(_Unwind_FrameState): Change retaddr_column to word type.

Index: unwind-dw2-fde.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/unwind-dw2-fde.c,v
retrieving revision 1.26
diff -u -p -r1.26 unwind-dw2-fde.c
--- a/unwind-dw2-fde.c	31 Oct 2003 20:46:26 -0000	1.26
+++ b/unwind-dw2-fde.c	17 May 2004 14:41:57 -0000
@@ -276,7 +276,10 @@ get_cie_encoding (const struct dwarf_cie
   p = aug + strlen (aug) + 1;		/* Skip the augmentation string.  */
   p = read_uleb128 (p, &utmp);		/* Skip code alignment.  */
   p = read_sleb128 (p, &stmp);		/* Skip data alignment.  */
-  p++;					/* Skip return address column.  */
+  if (cie->version == 1)		/* Skip return address column.  */
+    p++;
+  else
+    p = read_uleb128 (p, &utmp);
 
   aug++;				/* Skip 'z' */
   p = read_uleb128 (p, &utmp);		/* Skip augmentation length.  */
Index: unwind-dw2.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.40
diff -u -p -r1.40 unwind-dw2.c
--- a/unwind-dw2.c	1 Nov 2003 18:31:56 -0000	1.40
+++ b/unwind-dw2.c	17 May 2004 15:01:42 -0000
@@ -133,7 +133,7 @@ typedef struct
   _Unwind_Personality_Fn personality;
   _Unwind_Sword data_align;
   _Unwind_Word code_align;
-  unsigned char retaddr_column;
+  _Unwind_Word retaddr_column;
   unsigned char fde_encoding;
   unsigned char lsda_encoding;
   unsigned char saw_z;
@@ -337,7 +337,10 @@ extract_cie_info (const struct dwarf_cie
      data alignment and return address column.  */
   p = read_uleb128 (p, &fs->code_align);
   p = read_sleb128 (p, &fs->data_align);
-  fs->retaddr_column = *p++;
+  if (cie->version == 1)
+    fs->retaddr_column = *p++;
+  else
+    p = read_uleb128 (p, &fs->retaddr_column);
   fs->lsda_encoding = DW_EH_PE_omit;
 
   /* If the augmentation starts with 'z', then a uleb128 immediately


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]