[PATCH] D99585: [X86] add dwarf information for loop stack probe

YangKeao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 07:04:25 PDT 2021


YangKeao added a comment.

Please correct me if I'm wrong. I realize that generating a DWARF message based on `r11d` doesn't help the unwinder to get a correct backtrace.

In most case, the unwinder got an RIP register, parse the .eh_frames table and use it to find the address of "return address". The pointer to the "return address" (called `ax1`) is usually "CFA - 8" and by dereferencing it, we can get a parent IP address (usually is 5 bytes more than the call instruction location). Then it uses the parent IP as the new RIP address and find the representation of the new pointer to the return address, which could also be "CFA - 8". The problem is that if "CFA" is calculated through `r11`, the unwinder will have no chance to know what `r11` is at that RIP. But the unwinder could know the `rsp` at that RIP, because the `RSP` is `ax1 - 8`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99585/new/

https://reviews.llvm.org/D99585



More information about the llvm-commits mailing list