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

Unified Diff: runtime/vm/signal_handler_android.cc

Issue 254383003: Small fixes for Android. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
Index: runtime/vm/signal_handler_android.cc
===================================================================
--- runtime/vm/signal_handler_android.cc (revision 35316)
+++ runtime/vm/signal_handler_android.cc (working copy)
@@ -2,30 +2,60 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include "platform/thread.h"
#include "vm/globals.h"
+#include "vm/simulator.h"
#include "vm/signal_handler.h"
#if defined(TARGET_OS_ANDROID)
namespace dart {
uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) {
+ uintptr_t pc = 0;
+
+#if defined(TARGET_ARCH_ARM)
+ pc = static_cast<uintptr_t>(mcontext.arm_pc);
+#else
UNIMPLEMENTED();
+#endif // TARGET_ARCH_...
+ return pc;
}
uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) {
+ uintptr_t fp = 0;
+
+#if defined(TARGET_ARCH_ARM)
+ fp = static_cast<uintptr_t>(mcontext.arm_fp);
+#else
UNIMPLEMENTED();
+#endif // TARGET_ARCH_...
+
+ return fp;
}
uintptr_t SignalHandler::GetStackPointer(const mcontext_t& mcontext) {
+ uintptr_t sp = 0;
+
+#if defined(TARGET_ARCH_ARM)
+ sp = static_cast<uintptr_t>(mcontext.arm_sp);
+#else
UNIMPLEMENTED();
+#endif // TARGET_ARCH_...
+ return sp;
}
void SignalHandler::Install(SignalAction action) {
- UNIMPLEMENTED();
+ struct sigaction act;
+ memset(&act, 0, sizeof(act));
+ act.sa_sigaction = action;
+ act.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&act.sa_mask);
+ // TODO(johnmccutchan): Do we care about restoring the signal handler?
+ struct sigaction old_act;
+ int r = sigaction(SIGPROF, &act, &old_act);
+ ASSERT(r == 0);
}

Powered by Google App Engine
This is Rietveld 408576698