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

Unified Diff: runtime/vm/native_symbol_macos.cc

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/native_symbol_linux.cc ('k') | runtime/vm/native_symbol_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_symbol_macos.cc
diff --git a/runtime/vm/native_symbol_macos.cc b/runtime/vm/native_symbol_macos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3b240bdacc5042d3cad7dbb6e7f36f5b44fa1091
--- /dev/null
+++ b/runtime/vm/native_symbol_macos.cc
@@ -0,0 +1,43 @@
+// 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.
+
+#include "vm/globals.h"
+#if defined(TARGET_OS_MACOS)
+
+#include "vm/native_symbol.h"
+#include "vm/thread.h"
+
+#include <dlfcn.h> // NOLINT
+
+namespace dart {
+
+void NativeSymbolResolver::InitOnce() {
+}
+
+
+void NativeSymbolResolver::ShutdownOnce() {
+}
+
+
+char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc) {
+ Dl_info info;
+ int r = dladdr(reinterpret_cast<void*>(pc), &info);
+ if (r == 0) {
+ return NULL;
+ }
+ if (info.dli_sname == NULL) {
+ return NULL;
+ }
+ return strdup(info.dli_sname);
+}
+
+
+void NativeSymbolResolver::FreeSymbolName(char* name) {
+ free(name);
+}
+
+
+} // namespace dart
+
+#endif // defined(TARGET_OS_MACOS)
« no previous file with comments | « runtime/vm/native_symbol_linux.cc ('k') | runtime/vm/native_symbol_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698