[wpiutil] StackTrace: Include offset on Linux (#3305)

This commit is contained in:
Peter Johnson
2021-04-18 20:34:39 -07:00
committed by GitHub
parent 4630191fa4
commit 659b37ef9d

View File

@@ -26,8 +26,11 @@ std::string GetStackTrace(int offset) {
// extract just function name from "pathToExe(functionName+offset)"
StringRef sym{mangledSymbols[i]};
sym = sym.split('(').second;
sym = sym.split('+').first;
trace << "\tat " << Demangle(sym) << "\n";
StringRef offset;
std::tie(sym, offset) = sym.split('+');
StringRef addr;
std::tie(offset, addr) = offset.split(')');
trace << "\tat " << Demangle(sym) << " + " << offset << addr << "\n";
}
}