mstange / pdb-addr2line

A rust crate to symbolicate addresses from PDBs, like addr2line. Uses the `pdb` crate.
https://docs.rs/pdb-addr2line
Apache License 2.0
33 stars 4 forks source link

Include RVA information with find_frames for the entire stack #62

Closed burgerindividual closed 11 months ago

burgerindividual commented 1 year ago

I needed this functionality for my profiler, and I thought it could potentially be useful to others. I'm not sure if my address calculation is exactly right, so that may need to be reviewed.

mstange commented 1 year ago

Can you show how your profiler is using this information, maybe with a screenshot?

The addresses you compute here are the start address of the "inline range" which contains the looked-up address. But is this information useful? A single inlined call may be compiled to multiple non-contiguous ranges of instructions, and you'll just get one arbitrary range here. There may be more instructions from the same call earlier on in the outer function.

burgerindividual commented 1 year ago

I'm using the start address of the range to subtract from the address my profiler returns for a sample. Depending on where the instruction pointer is, it can generate different flamegraph stacks, rather than them being all combined on a callstack. image

mstange commented 1 year ago

Oh, heh, I meant a screenshot of the output, e.g. of a flamegraph. Not a screenshot of the code :)

it can generate different flamegraph stacks, rather than them being all combined on a callstack.

I'm not sure I understand what you mean by that. Can you give an example?

mstange commented 11 months ago

Closing due to lack of response. Please let me know if this is still needed.