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]

implement _Unwind_GetCFA for ia64


It was brought to my attention that I hadn't implemented
this function for ia64.  Done.

Also fixed the empty definition of _Unwind_FindEnclosingFunction
for the benefit of libjava.


r~



        * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
        (_Unwind_FindEnclosingFunction): Implement.

Index: unwind-ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/unwind-ia64.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 unwind-ia64.c
--- unwind-ia64.c	27 Nov 2002 10:33:56 -0000	1.13
+++ unwind-ia64.c	18 Jun 2003 21:55:38 -0000
@@ -1645,7 +1645,24 @@ _Unwind_GetRegionStart (struct _Unwind_C
 void *
 _Unwind_FindEnclosingFunction (void *pc)
 {
-  return NULL;
+  struct unw_table_entry *ent;
+  unsigned long segment_base, gp;
+
+  ent = _Unwind_FindTableEntry (pc, &segment_base, &gp);
+  if (ent == NULL)
+    return NULL;
+  else
+    return (void *)(segment_base + ent->start_offset);
+}
+
+/* Get the value of the CFA as saved in CONTEXT.  In GCC/Dwarf2 parlance,
+   the CFA is the value of the stack pointer on entry; In IA-64 unwind
+   parlance, this is the PSP.  */
+
+_Unwind_Word
+_Unwind_GetCFA (struct _Unwind_Context *context)
+{
+  return (_Unwind_Ptr) context->psp;
 }
 
 


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