Index: runtime/vm/signal_handler_linux.cc |
diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc |
index 2d7b74d16084143bf819a8923858b6fb1e27cf93..45fa50de5b6ae4c90eb7b0c144f5ef39496d074a 100644 |
--- a/runtime/vm/signal_handler_linux.cc |
+++ b/runtime/vm/signal_handler_linux.cc |
@@ -12,25 +12,19 @@ namespace dart { |
uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) { |
uintptr_t pc = 0; |
-#if defined(TARGET_ARCH_IA32) |
+#if defined(HOST_ARCH_IA32) |
pc = static_cast<uintptr_t>(mcontext.gregs[REG_EIP]); |
-#elif defined(TARGET_ARCH_X64) |
+#elif defined(HOST_ARCH_X64) |
pc = static_cast<uintptr_t>(mcontext.gregs[REG_RIP]); |
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) |
- pc = static_cast<uintptr_t>(mcontext.gregs[REG_EIP]); |
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) |
- pc = static_cast<uintptr_t>(mcontext.gregs[REG_EIP]); |
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) |
- pc = static_cast<uintptr_t>(mcontext.gregs[REG_RIP]); |
-#elif defined(TARGET_ARCH_ARM) |
+#elif defined(HOST_ARCH_ARM) |
pc = static_cast<uintptr_t>(mcontext.arm_pc); |
-#elif defined(TARGET_ARCH_ARM64) |
+#elif defined(HOST_ARCH_ARM64) |
pc = static_cast<uintptr_t>(mcontext.pc); |
-#elif defined(TARGET_ARCH_MIPS) |
+#elif defined(HOST_ARCH_MIPS) |
pc = static_cast<uintptr_t>(mcontext.pc); |
#else |
- UNIMPLEMENTED(); |
-#endif // TARGET_ARCH_... |
+#error Unsupported architecture. |
+#endif // HOST_ARCH_... |
return pc; |
} |
@@ -38,25 +32,19 @@ uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) { |
uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) { |
uintptr_t fp = 0; |
-#if defined(TARGET_ARCH_IA32) |
- fp = static_cast<uintptr_t>(mcontext.gregs[REG_EBP]); |
-#elif defined(TARGET_ARCH_X64) |
- fp = static_cast<uintptr_t>(mcontext.gregs[REG_RBP]); |
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) |
- fp = static_cast<uintptr_t>(mcontext.gregs[REG_EBP]); |
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) |
+#if defined(HOST_ARCH_IA32) |
fp = static_cast<uintptr_t>(mcontext.gregs[REG_EBP]); |
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) |
+#elif defined(HOST_ARCH_X64) |
fp = static_cast<uintptr_t>(mcontext.gregs[REG_RBP]); |
-#elif defined(TARGET_ARCH_ARM) |
+#elif defined(HOST_ARCH_ARM) |
fp = static_cast<uintptr_t>(mcontext.arm_fp); |
-#elif defined(TARGET_ARCH_ARM64) |
+#elif defined(HOST_ARCH_ARM64) |
fp = static_cast<uintptr_t>(mcontext.regs[29]); |
-#elif defined(TARGET_ARCH_MIPS) |
+#elif defined(HOST_ARCH_MIPS) |
fp = static_cast<uintptr_t>(mcontext.gregs[30]); |
#else |
- UNIMPLEMENTED(); |
-#endif // TARGET_ARCH_... |
+#error Unsupported architecture. |
+#endif // HOST_ARCH_... |
return fp; |
} |
@@ -65,25 +53,19 @@ uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) { |
uintptr_t SignalHandler::GetCStackPointer(const mcontext_t& mcontext) { |
uintptr_t sp = 0; |
-#if defined(TARGET_ARCH_IA32) |
+#if defined(HOST_ARCH_IA32) |
sp = static_cast<uintptr_t>(mcontext.gregs[REG_ESP]); |
-#elif defined(TARGET_ARCH_X64) |
+#elif defined(HOST_ARCH_X64) |
sp = static_cast<uintptr_t>(mcontext.gregs[REG_RSP]); |
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) |
- sp = static_cast<uintptr_t>(mcontext.gregs[REG_ESP]); |
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) |
- sp = static_cast<uintptr_t>(mcontext.gregs[REG_ESP]); |
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) |
- sp = static_cast<uintptr_t>(mcontext.gregs[REG_RSP]); |
-#elif defined(TARGET_ARCH_ARM) |
+#elif defined(HOST_ARCH_ARM) |
sp = static_cast<uintptr_t>(mcontext.arm_sp); |
-#elif defined(TARGET_ARCH_ARM64) |
+#elif defined(HOST_ARCH_ARM64) |
sp = static_cast<uintptr_t>(mcontext.sp); |
-#elif defined(TARGET_ARCH_MIPS) |
+#elif defined(HOST_ARCH_MIPS) |
sp = static_cast<uintptr_t>(mcontext.gregs[29]); |
#else |
- UNIMPLEMENTED(); |
-#endif // TARGET_ARCH_... |
+#error Unsupported architecture. |
+#endif // HOST_ARCH_... |
return sp; |
} |
@@ -100,25 +82,19 @@ uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { |
uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
uintptr_t lr = 0; |
-#if defined(TARGET_ARCH_IA32) |
- lr = 0; |
-#elif defined(TARGET_ARCH_X64) |
- lr = 0; |
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) |
- lr = 0; |
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) |
+#if defined(HOST_ARCH_IA32) |
lr = 0; |
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR) |
+#elif defined(HOST_ARCH_X64) |
lr = 0; |
-#elif defined(TARGET_ARCH_ARM) |
+#elif defined(HOST_ARCH_ARM) |
lr = static_cast<uintptr_t>(mcontext.arm_lr); |
-#elif defined(TARGET_ARCH_ARM64) |
+#elif defined(HOST_ARCH_ARM64) |
lr = static_cast<uintptr_t>(mcontext.regs[30]); |
-#elif defined(TARGET_ARCH_MIPS) |
+#elif defined(HOST_ARCH_MIPS) |
lr = static_cast<uintptr_t>(mcontext.gregs[31]); |
#else |
- UNIMPLEMENTED(); |
-#endif // TARGET_ARCH_... |
+#error Unsupported architecture. |
+#endif // HOST_ARCH_... |
return lr; |
} |