Chromium Code Reviews| Index: runtime/vm/os_linux.cc |
| =================================================================== |
| --- runtime/vm/os_linux.cc (revision 19653) |
| +++ runtime/vm/os_linux.cc (working copy) |
| @@ -7,6 +7,7 @@ |
| #include "vm/os.h" |
| +#include <dlfcn.h> // NOLINT |
| #include <errno.h> // NOLINT |
| #include <limits.h> // NOLINT |
| #include <malloc.h> // NOLINT |
| @@ -482,6 +483,18 @@ |
| } |
| +const char* OS::ReverseLookupSymbol(uword address) { |
| + // TODO(regis): This does not work for symbols of the main program. |
| + // Passing -export-dynamic to the linker does not help. |
| + Dl_info info; |
| + if (dladdr(reinterpret_cast<void*>(address), &info)) { |
|
Ivan Posva
2013/03/08 17:00:42
I am not sure this is allowed within the security
|
| + return info.dli_sname; |
| + } else { |
| + return NULL; |
| + } |
| +} |
| + |
| + |
| void OS::PrintErr(const char* format, ...) { |
| va_list args; |
| va_start(args, format); |