Index: src/Registers.hpp =================================================================== --- src/Registers.hpp +++ src/Registers.hpp @@ -42,7 +42,7 @@ bool validVectorRegister(int) const { return false; } v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86; } @@ -248,7 +248,7 @@ bool validVectorRegister(int) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64; } @@ -561,7 +561,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC; } @@ -1126,7 +1126,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64; } @@ -1768,7 +1768,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64; } @@ -2038,7 +2038,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto() { restoreSavedFloatRegisters(); restoreCoreAndJumpTo(); @@ -2518,7 +2518,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K; } @@ -2714,7 +2714,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS; } @@ -3035,7 +3035,7 @@ bool validVectorRegister(int num) const; v128 getVectorRegister(int num) const; void setVectorRegister(int num, v128 value); - const char *getRegisterName(int num); + static const char *getRegisterName(int num); void jumpto(); static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS; } Index: src/UnwindCursor.hpp =================================================================== --- src/UnwindCursor.hpp +++ src/UnwindCursor.hpp @@ -804,113 +804,7 @@ template const char *UnwindCursor::getRegisterName(int regNum) { - switch (regNum) { -#if defined(_LIBUNWIND_TARGET_X86_64) - case UNW_REG_IP: return "rip"; - case UNW_X86_64_RAX: return "rax"; - case UNW_X86_64_RDX: return "rdx"; - case UNW_X86_64_RCX: return "rcx"; - case UNW_X86_64_RBX: return "rbx"; - case UNW_REG_SP: - case UNW_X86_64_RSP: return "rsp"; - case UNW_X86_64_RBP: return "rbp"; - case UNW_X86_64_RSI: return "rsi"; - case UNW_X86_64_RDI: return "rdi"; - case UNW_X86_64_R8: return "r8"; - case UNW_X86_64_R9: return "r9"; - case UNW_X86_64_R10: return "r10"; - case UNW_X86_64_R11: return "r11"; - case UNW_X86_64_R12: return "r12"; - case UNW_X86_64_R13: return "r13"; - case UNW_X86_64_R14: return "r14"; - case UNW_X86_64_R15: return "r15"; -#elif defined(_LIBUNWIND_TARGET_ARM) - case UNW_ARM_R0: return "r0"; - case UNW_ARM_R1: return "r1"; - case UNW_ARM_R2: return "r2"; - case UNW_ARM_R3: return "r3"; - case UNW_ARM_R4: return "r4"; - case UNW_ARM_R5: return "r5"; - case UNW_ARM_R6: return "r6"; - case UNW_ARM_R7: return "r7"; - case UNW_ARM_R8: return "r8"; - case UNW_ARM_R9: return "r9"; - case UNW_ARM_R10: return "r10"; - case UNW_ARM_R11: return "r11"; - case UNW_ARM_R12: return "r12"; - case UNW_REG_SP: - case UNW_ARM_SP: return "sp"; - case UNW_ARM_LR: return "lr"; - case UNW_REG_IP: - case UNW_ARM_IP: return "pc"; - case UNW_ARM_S0: return "s0"; - case UNW_ARM_S1: return "s1"; - case UNW_ARM_S2: return "s2"; - case UNW_ARM_S3: return "s3"; - case UNW_ARM_S4: return "s4"; - case UNW_ARM_S5: return "s5"; - case UNW_ARM_S6: return "s6"; - case UNW_ARM_S7: return "s7"; - case UNW_ARM_S8: return "s8"; - case UNW_ARM_S9: return "s9"; - case UNW_ARM_S10: return "s10"; - case UNW_ARM_S11: return "s11"; - case UNW_ARM_S12: return "s12"; - case UNW_ARM_S13: return "s13"; - case UNW_ARM_S14: return "s14"; - case UNW_ARM_S15: return "s15"; - case UNW_ARM_S16: return "s16"; - case UNW_ARM_S17: return "s17"; - case UNW_ARM_S18: return "s18"; - case UNW_ARM_S19: return "s19"; - case UNW_ARM_S20: return "s20"; - case UNW_ARM_S21: return "s21"; - case UNW_ARM_S22: return "s22"; - case UNW_ARM_S23: return "s23"; - case UNW_ARM_S24: return "s24"; - case UNW_ARM_S25: return "s25"; - case UNW_ARM_S26: return "s26"; - case UNW_ARM_S27: return "s27"; - case UNW_ARM_S28: return "s28"; - case UNW_ARM_S29: return "s29"; - case UNW_ARM_S30: return "s30"; - case UNW_ARM_S31: return "s31"; - case UNW_ARM_D0: return "d0"; - case UNW_ARM_D1: return "d1"; - case UNW_ARM_D2: return "d2"; - case UNW_ARM_D3: return "d3"; - case UNW_ARM_D4: return "d4"; - case UNW_ARM_D5: return "d5"; - case UNW_ARM_D6: return "d6"; - case UNW_ARM_D7: return "d7"; - case UNW_ARM_D8: return "d8"; - case UNW_ARM_D9: return "d9"; - case UNW_ARM_D10: return "d10"; - case UNW_ARM_D11: return "d11"; - case UNW_ARM_D12: return "d12"; - case UNW_ARM_D13: return "d13"; - case UNW_ARM_D14: return "d14"; - case UNW_ARM_D15: return "d15"; - case UNW_ARM_D16: return "d16"; - case UNW_ARM_D17: return "d17"; - case UNW_ARM_D18: return "d18"; - case UNW_ARM_D19: return "d19"; - case UNW_ARM_D20: return "d20"; - case UNW_ARM_D21: return "d21"; - case UNW_ARM_D22: return "d22"; - case UNW_ARM_D23: return "d23"; - case UNW_ARM_D24: return "d24"; - case UNW_ARM_D25: return "d25"; - case UNW_ARM_D26: return "d26"; - case UNW_ARM_D27: return "d27"; - case UNW_ARM_D28: return "d28"; - case UNW_ARM_D29: return "d29"; - case UNW_ARM_D30: return "d30"; - case UNW_ARM_D31: return "d31"; -#endif - default: - _LIBUNWIND_ABORT("unsupported register"); - } + return R::getRegisterName(regNum); } template bool UnwindCursor::isSignalFrame() {