Chromium Code Reviews| Index: base/mac/foundation_util.mm |
| diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm |
| index cb5746a3b5db768638c3a46658b0c6be3116925e..4aec60eaba6148213c03584e8d1217c774e9b968 100644 |
| --- a/base/mac/foundation_util.mm |
| +++ b/base/mac/foundation_util.mm |
| @@ -4,6 +4,7 @@ |
| #include "base/mac/foundation_util.h" |
| +#include <dlfcn.h> |
| #include <stdlib.h> |
| #include <string.h> |
| @@ -200,6 +201,14 @@ FilePath GetAppBundlePath(const FilePath& exec_name) { |
| return FilePath(); |
| } |
| +bool GetModulePathForAddress(FilePath* path, const void* address) { |
|
Mark Mentovai
2011/05/23 16:52:16
I don’t believe that this belongs in foundation_ut
|
| + Dl_info info; |
| + if (dladdr(address, &info) == 0) |
| + return false; |
| + *path = FilePath(info.dli_fname); |
| + return true; |
| +} |
| + |
| CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, |
| CFStringRef key, |
| CFTypeID expected_type) { |