On Fri, 23 Oct 2026 07:25:16 GMT, Yasumasa Suenaga <[email protected]> wrote:

> I cannot agree to use "PC - 1" always. It could report incorrect PC if the 
> crash happened on normal operation like `mov %rax, (<incorrect address>)`.

Thanks. I agree that always use `PC-1` would be incorrect. However, the 
proposal does not adjust that PC. Top frames use the exact register PC, and 
when unwinding a signal trampoline, sender() returns directly through 
getFrameFromReg(), using the exact PC saved in the signal context and bypassing 
the `PC−1` lookup block. Thus, for a faulting mov, both DWARF processing and 
symbol lookup use the exact fault PC.  
`PC−1` is used only for ordinary native caller return-address lookups; and the 
original PC is passed to the frame constructor.  

https://github.com/openjdk/jdk/blob/368285c6a43ace7237c2246a0f8ce063bbd07425/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/riscv64/LinuxRISCV64CFrame.java#L262-L273

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33374#issuecomment-6360150470

Reply via email to