Index: runtime/vm/native_symbol_linux.cc |
diff --git a/runtime/vm/native_symbol_linux.cc b/runtime/vm/native_symbol_linux.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..225a4b0f01ade69ed472b50a879e6265c991c51b |
--- /dev/null |
+++ b/runtime/vm/native_symbol_linux.cc |
@@ -0,0 +1,44 @@ |
+// 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_LINUX) |
+ |
+#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_LINUX) |