Module Name: src Committed By: joerg Date: Sun Apr 13 19:04:02 UTC 2014
Modified Files: src/sys/lib/libunwind: Registers.hpp libunwind.cxx Log Message: Move definition of what the native register layout is into Registers.hpp. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/lib/libunwind/Registers.hpp cvs rdiff -u -r1.7 -r1.8 src/sys/lib/libunwind/libunwind.cxx 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/Registers.hpp diff -u src/sys/lib/libunwind/Registers.hpp:1.8 src/sys/lib/libunwind/Registers.hpp:1.9 --- src/sys/lib/libunwind/Registers.hpp:1.8 Wed Apr 2 22:34:29 2014 +++ src/sys/lib/libunwind/Registers.hpp Sun Apr 13 19:04:01 2014 @@ -518,6 +518,21 @@ private: 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__ Index: src/sys/lib/libunwind/libunwind.cxx diff -u src/sys/lib/libunwind/libunwind.cxx:1.7 src/sys/lib/libunwind/libunwind.cxx:1.8 --- src/sys/lib/libunwind/libunwind.cxx:1.7 Wed Apr 2 22:34:29 2014 +++ src/sys/lib/libunwind/libunwind.cxx Sun Apr 13 19:04:01 2014 @@ -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 @@ static _Unwind_Reason_Code unwind_phase2 } _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_RaiseExcepti _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 @@ _Unwind_Reason_Code _Unwind_ForcedUnwind } void _Unwind_Resume(struct _Unwind_Exception *exc) { - ThisUnwindRegisters registers; + NativeUnwindRegisters registers; ThisUnwindCursor cursor(registers, sThisAddressSpace); if (exc->private_1 != 0) @@ -310,7 +292,7 @@ uintptr_t _Unwind_GetLanguageSpecificDat } _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 @@ uintptr_t _Unwind_GetCFA(struct _Unwind_ } void *_Unwind_FindEnclosingFunction(void *pc) { - ThisUnwindRegisters registers; + NativeUnwindRegisters registers; ThisUnwindCursor cursor(registers, sThisAddressSpace); unw_proc_info_t info;