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

Side by Side Diff: runtime/vm/native_symbol_linux.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/native_symbol_android.cc ('k') | runtime/vm/native_symbol_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "vm/globals.h"
6 #if defined(TARGET_OS_LINUX)
7
8 #include "vm/native_symbol.h"
9 #include "vm/thread.h"
10
11
12 #include <dlfcn.h> // NOLINT
13
14 namespace dart {
15
16 void NativeSymbolResolver::InitOnce() {
17 }
18
19
20 void NativeSymbolResolver::ShutdownOnce() {
21 }
22
23
24 char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc) {
25 Dl_info info;
26 int r = dladdr(reinterpret_cast<void*>(pc), &info);
27 if (r == 0) {
28 return NULL;
29 }
30 if (info.dli_sname == NULL) {
31 return NULL;
32 }
33 return strdup(info.dli_sname);
34 }
35
36
37 void NativeSymbolResolver::FreeSymbolName(char* name) {
38 free(name);
39 }
40
41
42 } // namespace dart
43
44 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/vm/native_symbol_android.cc ('k') | runtime/vm/native_symbol_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698