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

Unified Diff: runtime/vm/signal_handler.h

Issue 25909002: Sampling profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/profiler_win.cc ('k') | runtime/vm/signal_handler_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/signal_handler.h
diff --git a/runtime/vm/signal_handler.h b/runtime/vm/signal_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..a16553c35dcd92b6697122968ebed327f5a82630
--- /dev/null
+++ b/runtime/vm/signal_handler.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+#ifndef VM_SIGNAL_HANDLER_H_
+#define VM_SIGNAL_HANDLER_H_
+
+#include "vm/allocation.h"
+#include "vm/globals.h"
+
+#if defined(TARGET_OS_LINUX)
+#include <signal.h> // NOLINT
+#include <ucontext.h> // NOLINT
+#elif defined(TARGET_OS_ANDROID)
+#include <signal.h> // NOLINT
+#include <ucontext.h> // NOLINT
+#elif defined(TARGET_OS_MACOS)
+#include <signal.h> // NOLINT
+#include <sys/ucontext.h> // NOLINT
+#elif defined(TARGET_OS_WINDOWS)
+// Stub out for windows.
+struct siginfo_t;
+struct mcontext_t;
+struct sigset_t {
+};
+#endif
+
+namespace dart {
+
+typedef void (*SignalAction)(int signal, siginfo_t* info,
+ void* context);
+
+class SignalHandler : public AllStatic {
+ public:
+ static void Install(SignalAction action);
+ static uintptr_t GetProgramCounter(const mcontext_t& mcontext);
+ static uintptr_t GetFramePointer(const mcontext_t& mcontext);
+ static uintptr_t GetStackPointer(const mcontext_t& mcontext);
+ private:
+};
+
+
+class ScopedSignalBlocker {
+ public:
+ ScopedSignalBlocker();
+ ~ScopedSignalBlocker();
+
+ private:
+ sigset_t old_;
+};
+
+
+} // namespace dart
+
+#endif // VM_SIGNAL_HANDLER_H_
« no previous file with comments | « runtime/vm/profiler_win.cc ('k') | runtime/vm/signal_handler_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698