Re: [PATCH] decode_stacktrace: Support heuristic caller address search
From: Sasha Levin
Date: Thu Mar 05 2026 - 15:41:06 EST
On Fri, Mar 06, 2026 at 01:32:41AM +0900, Masami Hiramatsu wrote:
On Thu, 5 Mar 2026 10:51:47 -0500
Sasha Levin <sashal@xxxxxxxxxx> wrote:
DWARF line tables map address *ranges* to source lines, so any address
within the CALL instruction resolves to the correct source line.
return_addr-1 is guaranteed to land inside the CALL instruction (it's
the last byte of it), so a single addr2line call is sufficient.
Ah, got it, OK. I also confirmed "addr-1" works. But if there is no lineinfo
entry for the call instruction, shouldn't we check more instructions before
the call?
There's no such thing as "no lineinfo entry for the call instruction" - DWARF
line tables are range-based, not discrete points. Each row covers all addresses
up to the next row, so every address within a function resolves to some source
line. addr-1 lands inside the CALL instruction and will always resolve to same
line as the CALL itself.
We show "??:0" because the address we passed falls outside of any DWARF
compilation unit altogether.
--
Thanks,
Sasha