| 1330 | } |
| 1331 | |
| 1332 | void SymbolProperties::Initialize(void* address) |
| 1333 | { |
| 1334 | this->Address = address; |
| 1335 | # if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) |
| 1336 | // first fallback option can demangle c++ functions |
| 1337 | Dl_info info; |
| 1338 | int ierr = dladdr(this->Address, &info); |
| 1339 | if (ierr && info.dli_sname && info.dli_saddr) { |
| 1340 | this->SetBinary(info.dli_fname); |
| 1341 | this->SetFunction(info.dli_sname); |
| 1342 | } |
| 1343 | # else |
| 1344 | // second fallback use builtin backtrace_symbols |
| 1345 | // to decode the backtrace. |
| 1346 | # endif |
| 1347 | } |
| 1348 | #endif // don't define this class if we're not using it |
| 1349 | |
| 1350 | #if defined(_WIN32) || defined(__CYGWIN__) |