| Index: runtime/vm/os_macos.cc
|
| ===================================================================
|
| --- runtime/vm/os_macos.cc (revision 19653)
|
| +++ runtime/vm/os_macos.cc (working copy)
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "vm/os.h"
|
|
|
| +#include <dlfcn.h> // NOLINT
|
| #include <errno.h> // NOLINT
|
| #include <limits.h> // NOLINT
|
| #include <mach/mach.h> // NOLINT
|
| @@ -190,6 +191,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)) {
|
| + return info.dli_sname;
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +
|
| +
|
| void OS::PrintErr(const char* format, ...) {
|
| va_list args;
|
| va_start(args, format);
|
|
|