MCPcopy Create free account
hub / github.com/apple/foundationdb / format_backtrace

Function format_backtrace

flow/Platform.actor.cpp:3406–3420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3404}
3405
3406std::string format_backtrace(void** addresses, int numAddresses) {
3407 ImageInfo const& imageInfo = getCachedImageInfo();
3408#ifdef __APPLE__
3409 std::string s = format("atos -o %s -arch x86_64 -l %p", imageInfo.symbolFileName.c_str(), imageInfo.offset);
3410 for (int i = 1; i < numAddresses; i++) {
3411 s += format(" %p", addresses[i]);
3412 }
3413#else
3414 std::string s = format("addr2line -e %s -p -C -f -i", imageInfo.symbolFileName.c_str());
3415 for (int i = 1; i < numAddresses; i++) {
3416 s += format(" %p", (char*)addresses[i] - (char*)imageInfo.offset);
3417 }
3418#endif
3419 return s;
3420}
3421
3422std::string get_backtrace() {
3423 void* addresses[50];

Callers 4

outOfMemoryFunction · 0.85
get_backtraceFunction · 0.85
runMethod · 0.85
customSystemMonitorFunction · 0.85

Calls 3

getCachedImageInfoFunction · 0.85
formatFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected