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]

updated for unwind-libunwind.c


It appears that unwind-libunwind.c wasn't kept entirely up-to-date
with recent changes.  The patch below fixes a few obvious problems.  I
think the patch is safe and it should be applied.

After applying this patch, there is still one problem, though: when
building libgcc_s.so, -lunwind needs to be mentioned on the linker
command-line, to ensure that libgcc_s.so lists libunwind as a
dependency (DT_NEEDED).  Otherwise, libgcc_s.so can't be loaded with
dlopen(), which something newer versions of glibc like to do.  I don't
understand the intricacies of building libgcc_s.so, so if somebody
could give me a tip on where to add this dependency, I'd very much
appreciate it.

Thanks,

	--david

ChangeLog

2003-11-17    <davidm@hpl.hp.com>

	* config/t-libunwind: Mention unwind-c.c.

	* unwind-libunwind.c (_Unwind_GetCFA): Implement.
	(_Unwind_GetBSP) [UNW_TARGET_IA64]: New function.

Index: unwind-libunwind.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/unwind-libunwind.c,v
retrieving revision 1.6
diff -u -r1.6 unwind-libunwind.c
--- unwind-libunwind.c	8 May 2003 01:15:40 -0000	1.6
+++ unwind-libunwind.c	17 Nov 2003 18:13:44 -0000
@@ -110,9 +110,11 @@
 _Unwind_Word
 _Unwind_GetCFA (struct _Unwind_Context *context)
 {
-  /* ??? Is there any way to get this information?  */
-  return NULL;
-} 
+  unw_word_t ret;
+
+  unw_get_reg (&context->cursor, UNW_IA64_SP, &ret);
+  return ret;
+}
 
 /* Overwrite the saved value for register REG in CONTEXT with VAL.  */
 
@@ -166,6 +168,19 @@
 {
   return NULL;
 }
+
+#ifdef UNW_TARGET_IA64
+
+_Unwind_Word
+_Unwind_GetBSP (struct _Unwind_Context *context)
+{
+  unw_word_t ret;
+
+  unw_get_reg (&context->cursor, UNW_IA64_BSP, &ret);
+  return ret;
+}
+
+#endif
 
 #include "unwind.inc"
 
Index: config/t-libunwind
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/t-libunwind,v
retrieving revision 1.2
diff -u -r1.2 t-libunwind
--- config/t-libunwind	16 Dec 2002 18:20:44 -0000	1.2
+++ config/t-libunwind	17 Nov 2003 18:13:44 -0000
@@ -1 +1,2 @@
-LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c
+LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c \
+	    $(srcdir)/unwind-c.c


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