ddbug icon indicating copy to clipboard operation
ddbug copied to clipboard

Display stack layout

Open philipc opened this issue 8 years ago • 3 comments

Use DWARF locations to determine the stack layout.

philipc avatar Oct 28 '17 07:10 philipc

This seems like it would be quite valuable. I don't know of any other tool that exposes this kind of information.

jrmuizel avatar Nov 03 '17 21:11 jrmuizel

This is partially done using DW_OP_fbreg and DW_OP_call_frame_cfa in location expressions. To do better, I think I need to also handle DW_OP_breg*, but for that I also need to determine how the base register relates to the stack frame... maybe this can be determined by getting the CFA from the CFI. Also, need to investigate how complete this information is going to be... there's big holes in the current output, and I don't think that DW_OP_breg* will be enough to fix that.

philipc avatar Oct 03 '18 09:10 philipc

If you just want the stack size, there's also https://github.com/japaric/stack-sizes/

philipc avatar Oct 04 '18 08:10 philipc