|
@@ -148,6 +148,7 @@ Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid)
|
|
|
}
|
|
|
|
|
|
Vector<Symbol> symbols;
|
|
|
+ bool first_frame = true;
|
|
|
|
|
|
for (auto address : stack) {
|
|
|
const RegionWithSymbols* found_region = nullptr;
|
|
@@ -171,7 +172,11 @@ Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid)
|
|
|
|
|
|
// We're subtracting 1 from the address because this is the return address,
|
|
|
// i.e. it is one instruction past the call instruction.
|
|
|
- auto result = symbolicate(found_region->path, adjusted_address - 1);
|
|
|
+ // However, because the first frame represents the current
|
|
|
+ // instruction pointer rather than the return address we don't
|
|
|
+ // subtract 1 for that.
|
|
|
+ auto result = symbolicate(found_region->path, adjusted_address - (first_frame ? 0 : 1));
|
|
|
+ first_frame = false;
|
|
|
if (!result.has_value()) {
|
|
|
symbols.append(Symbol {
|
|
|
.address = address,
|