Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libunwind Move definition of what the native registe...



details:   https://anonhg.NetBSD.org/src/rev/016b645250da
branches:  trunk
changeset: 795449:016b645250da
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Apr 13 19:04:01 2014 +0000

description:
Move definition of what the native register layout is into
Registers.hpp.

diffstat:

 sys/lib/libunwind/Registers.hpp |  15 +++++++++++++++
 sys/lib/libunwind/libunwind.cxx |  32 +++++++-------------------------
 2 files changed, 22 insertions(+), 25 deletions(-)

diffs (106 lines):

diff -r 2de4737366d7 -r 016b645250da sys/lib/libunwind/Registers.hpp
--- a/sys/lib/libunwind/Registers.hpp   Sun Apr 13 17:13:27 2014 +0000
+++ b/sys/lib/libunwind/Registers.hpp   Sun Apr 13 19:04:01 2014 +0000
@@ -518,6 +518,21 @@
   uint32_t reg[REGNO_SH3_PR + 1];
 };
 
+#if __i386__
+typedef Registers_x86 NativeUnwindRegisters;
+#elif __x86_64__
+typedef Registers_x86_64 NativeUnwindRegisters;
+#elif __powerpc__
+typedef Registers_ppc32 NativeUnwindRegisters;
+#elif __arm__ && !defined(__ARM_EABI__)
+typedef Registers_arm32 NativeUnwindRegisters;
+#elif __vax__
+typedef Registers_vax NativeUnwindRegisters;
+#elif __m68k__
+typedef Registers_M68K NativeUnwindRegisters;
+#elif __sh3__
+typedef Registers_SH3 NativeUnwindRegisters;
+#endif
 } // namespace _Unwind
 
 #endif // __REGISTERS_HPP__
diff -r 2de4737366d7 -r 016b645250da sys/lib/libunwind/libunwind.cxx
--- a/sys/lib/libunwind/libunwind.cxx   Sun Apr 13 17:13:27 2014 +0000
+++ b/sys/lib/libunwind/libunwind.cxx   Sun Apr 13 19:04:01 2014 +0000
@@ -17,30 +17,12 @@
 
 using namespace _Unwind;
 
-#if __i386__
-typedef Registers_x86 ThisUnwindRegisters;
-#elif __x86_64__
-typedef Registers_x86_64 ThisUnwindRegisters;
-#elif __powerpc__
-typedef Registers_ppc32 ThisUnwindRegisters;
-#elif __arm__ && !defined(__ARM_EABI__)
-typedef Registers_arm32 ThisUnwindRegisters;
-#elif __vax__
-typedef Registers_vax ThisUnwindRegisters;
-#elif __m68k__
-typedef Registers_M68K ThisUnwindRegisters;
-#elif __sh3__
-typedef Registers_SH3 ThisUnwindRegisters;
-#else
-#error Unsupported architecture
-#endif
-
-typedef CFI_Parser<LocalAddressSpace, ThisUnwindRegisters> MyCFIParser;
+typedef CFI_Parser<LocalAddressSpace, NativeUnwindRegisters> MyCFIParser;
 
 // Internal object representing the address space of this process.
 static LocalAddressSpace sThisAddressSpace(MyCFIParser::findPCRange);
 
-typedef UnwindCursor<LocalAddressSpace, ThisUnwindRegisters> ThisUnwindCursor;
+typedef UnwindCursor<LocalAddressSpace, NativeUnwindRegisters> ThisUnwindCursor;
 
 static _Unwind_Reason_Code unwind_phase1(ThisUnwindCursor &cursor,
                                          struct _Unwind_Exception *exc) {
@@ -205,7 +187,7 @@
 }
 
 _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *exc) {
-  ThisUnwindRegisters registers;
+  NativeUnwindRegisters registers;
   ThisUnwindCursor cursor1(registers, sThisAddressSpace);
   ThisUnwindCursor cursor2(registers, sThisAddressSpace);
 
@@ -224,7 +206,7 @@
 
 _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *exc,
                                          _Unwind_Stop_Fn stop, void *stop_arg) {
-  ThisUnwindRegisters registers;
+  NativeUnwindRegisters registers;
   ThisUnwindCursor cursor(registers, sThisAddressSpace);
 
   // Mark this as forced unwind for _Unwind_Resume().
@@ -235,7 +217,7 @@
 }
 
 void _Unwind_Resume(struct _Unwind_Exception *exc) {
-  ThisUnwindRegisters registers;
+  NativeUnwindRegisters registers;
   ThisUnwindCursor cursor(registers, sThisAddressSpace);
 
   if (exc->private_1 != 0)
@@ -310,7 +292,7 @@
 }
 
 _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
-  ThisUnwindRegisters registers;
+  NativeUnwindRegisters registers;
   ThisUnwindCursor cursor(registers, sThisAddressSpace);
   cursor.setInfoBasedOnIPRegister();
 
@@ -336,7 +318,7 @@
 }
 
 void *_Unwind_FindEnclosingFunction(void *pc) {
-  ThisUnwindRegisters registers;
+  NativeUnwindRegisters registers;
   ThisUnwindCursor cursor(registers, sThisAddressSpace);
 
   unw_proc_info_t info;



Home | Main Index | Thread Index | Old Index