New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Deploy preview] Inline callstacks demo #2556
Conversation
Turns out it's not that hard to work around this: When looking up symbols for callers, we can just subtract one byte from the return address, and we'll fall into the call instruction. |
For return addresses, look up addresses minus one byte, to fall into the previous instruction. This is necessary to get accurate line information and accurate inline stacks. The stack leaf (instruction pointer) must not be adjusted. As a result, this is a rather invasive process because the stack table needs major surgery to account for new stacks.
Deploy preview
Deploy preview
Same profile: before after
Another comparison: before after
It's not working as great as I hoped it would. There are lots of bad frames in the call stacks. I think the problem is that the return addresses, which are collected during stackwalking, point to the instruction after the call instruction.I'll try to find out how many goats I'd have to sacrifice to have the stackwalkers give me the addresses of the actual call instructions, for all caller frames upstack.
Edit: This is working great now. I just needed to adjust caller addresses by 1 byte upwards. Now all line information and inline stacks in caller functions look correct.