Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1396)

Unified Diff: runtime/vm/signal_handler_macos.cc

Issue 1156053006: - Determine whether the simulator is being used in globals.h (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/signal_handler_linux.cc ('k') | runtime/vm/simulator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/signal_handler_macos.cc
diff --git a/runtime/vm/signal_handler_macos.cc b/runtime/vm/signal_handler_macos.cc
index 79117c285f319d8fc2f8044c93949658275f9689..e0a2a1497548984bb285f3ac63bd9879fc1c2d65 100644
--- a/runtime/vm/signal_handler_macos.cc
+++ b/runtime/vm/signal_handler_macos.cc
@@ -12,19 +12,17 @@ namespace dart {
uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) {
uintptr_t pc = 0;
-#if defined(TARGET_ARCH_IA32)
- pc = static_cast<uintptr_t>(mcontext->__ss.__eip);
-#elif defined(TARGET_ARCH_X64)
- pc = static_cast<uintptr_t>(mcontext->__ss.__rip);
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR)
- pc = static_cast<uintptr_t>(mcontext->__ss.__eip);
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR)
+#if defined(HOST_ARCH_IA32)
pc = static_cast<uintptr_t>(mcontext->__ss.__eip);
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR)
+#elif defined(HOST_ARCH_X64)
pc = static_cast<uintptr_t>(mcontext->__ss.__rip);
+#elif defined(HOST_ARCH_ARM)
+ pc = static_cast<uintptr_t>(mcontext->__ss.__pc);
+#elif defined(HOST_ARCH_ARM64)
+ pc = static_cast<uintptr_t>(mcontext->__ss.__pc);
#else
- UNIMPLEMENTED();
-#endif // TARGET_ARCH_...
+#error Unsuported architecture.
+#endif // HOST_ARCH_...
return pc;
}
@@ -33,19 +31,17 @@ 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)
+#if defined(HOST_ARCH_IA32)
fp = static_cast<uintptr_t>(mcontext->__ss.__ebp);
-#elif defined(TARGET_ARCH_X64)
- fp = static_cast<uintptr_t>(mcontext->__ss.__rbp);
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR)
- fp = static_cast<uintptr_t>(mcontext->__ss.__ebp);
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR)
- fp = static_cast<uintptr_t>(mcontext->__ss.__ebp);
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR)
+#elif defined(HOST_ARCH_X64)
fp = static_cast<uintptr_t>(mcontext->__ss.__rbp);
+#elif defined(HOST_ARCH_ARM)
+ fp = static_cast<uintptr_t>(mcontext->__ss.__r[11]);
+#elif defined(HOST_ARCH_ARM64)
+ fp = static_cast<uintptr_t>(mcontext->__ss.__fp);
#else
- UNIMPLEMENTED();
-#endif // TARGET_ARCH_...
+#error Unsuported architecture.
+#endif // HOST_ARCH_...
return fp;
}
@@ -54,19 +50,17 @@ 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)
- sp = static_cast<uintptr_t>(mcontext->__ss.__esp);
-#elif defined(TARGET_ARCH_X64)
- sp = static_cast<uintptr_t>(mcontext->__ss.__rsp);
-#elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR)
+#if defined(HOST_ARCH_IA32)
sp = static_cast<uintptr_t>(mcontext->__ss.__esp);
-#elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR)
- sp = static_cast<uintptr_t>(mcontext->__ss.__esp);
-#elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR)
+#elif defined(HOST_ARCH_X64)
sp = static_cast<uintptr_t>(mcontext->__ss.__rsp);
+#elif defined(HOST_ARCH_ARM)
+ sp = static_cast<uintptr_t>(mcontext->__ss.__sp);
+#elif defined(HOST_ARCH_ARM64)
+ sp = static_cast<uintptr_t>(mcontext->__ss.__sp);
#else
UNIMPLEMENTED();
-#endif // TARGET_ARCH_...
+#endif // HOST_ARCH_...
return sp;
}
« no previous file with comments | « runtime/vm/signal_handler_linux.cc ('k') | runtime/vm/simulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698