Module Name:    src
Committed By:   joerg
Date:           Tue Feb 17 21:02:33 UTC 2015

Modified Files:
        src/sys/lib/libunwind: libunwind.cxx unwind.h

Log Message:
Provide _Unwind_Find_FDE for libgcc_s compatibility.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/lib/libunwind/libunwind.cxx
cvs rdiff -u -r1.2 -r1.3 src/sys/lib/libunwind/unwind.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libunwind/libunwind.cxx
diff -u src/sys/lib/libunwind/libunwind.cxx:1.8 src/sys/lib/libunwind/libunwind.cxx:1.9
--- src/sys/lib/libunwind/libunwind.cxx:1.8	Sun Apr 13 19:04:01 2014
+++ src/sys/lib/libunwind/libunwind.cxx	Tue Feb 17 21:02:33 2015
@@ -11,6 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define _UNWIND_GCC_EXTENSIONS
+
 #include <unwind.h>
 
 #include "UnwindCursor.hpp"
@@ -329,6 +331,23 @@ void *_Unwind_FindEnclosingFunction(void
   return info.end_ip ? (void *)info.start_ip : NULL;
 }
 
+void *_Unwind_Find_FDE(void *pc, struct dwarf_eh_bases *bases) {
+  NativeUnwindRegisters registers;
+  ThisUnwindCursor cursor(registers, sThisAddressSpace);
+
+  unw_proc_info_t info;
+  cursor.setIP((uintptr_t)pc);
+  cursor.setInfoBasedOnIPRegister();
+
+  cursor.getInfo(&info);
+  if (info.end_ip == 0)
+    return NULL;
+  bases->tbase = 0; /* Not supported */
+  bases->dbase = (void *)info.data_base;
+  bases->func = (void *)info.start_ip;
+  return (void *)info.unwind_info;
+}
+
 uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) {
   ThisUnwindCursor *cursor = (ThisUnwindCursor *)context;
   unw_proc_info_t frameInfo;

Index: src/sys/lib/libunwind/unwind.h
diff -u src/sys/lib/libunwind/unwind.h:1.2 src/sys/lib/libunwind/unwind.h:1.3
--- src/sys/lib/libunwind/unwind.h:1.2	Thu Mar 13 00:28:20 2014
+++ src/sys/lib/libunwind/unwind.h	Tue Feb 17 21:02:33 2015
@@ -56,6 +56,14 @@ typedef _Unwind_Reason_Code (*__personal
                                                      struct _Unwind_Exception *,
                                                      struct _Unwind_Context *);
 
+#ifdef _UNWIND_GCC_EXTENSIONS
+struct dwarf_eh_bases {
+  void *tbase;
+  void *dbase;
+  void *func;
+};
+#endif
+
 __BEGIN_DECLS
 
 _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *);
@@ -85,6 +93,10 @@ void __register_frame_info(const void *,
 void __deregister_frame(const void *);
 void *__deregister_frame_info(const void *);
 
+#ifdef _UNWIND_GCC_EXTENSIONS
+void *_Unwind_Find_FDE(void *, struct dwarf_eh_bases *);
+#endif
+
 __END_DECLS
 
 #endif // _UNWIND_H

Reply via email to