mozilla / fix-stacks

This program post-processes the stack frames produced by `MozFormatCodeAddress()`.
Apache License 2.0
20 stars 8 forks source link

Dump inline frames #15

Open jrmuizel opened 4 years ago

jrmuizel commented 4 years ago

I'm not sure how easy this is or whether symbolic supports it but it would be nice to have.

As an aside: I was able to get inline frames working for my hacked together https://github.com/jrmuizel/pdb-addr2line but needed to work around https://github.com/willglynn/pdb/issues/78

jan-auer commented 4 years ago

Right, symbolic does have support for inline frames in PDBs. However, the interface to DebugSession might not be super ergonomic, I'm up for suggestions.

Under the hood, symbolic shells out to pdb for all these operations, so we'll have to fix willglynn/pdb#78 first.

jrmuizel commented 1 year ago

@mstange what's needed to fix this?

mstange commented 1 year ago

I'm not sure why, but fix-stacks currently does a full pre-pass over the debuginfo and converts it into its own representation, maybe so that it can query it more efficiently or maybe to save memory. During the conversion, any inline info is lost.

We could potentially switch it to use a symbolic symcache; those can be queried very efficiently and preserve inline info. However, this would probably break the macOS OSO path, and it has a big startup cost.

Another alternative would be to switch to the Firefox profiler's symbolication infrastructure. I'm currently improving its API so this might become an option soon. The profiler symbolication code can deal with macOS OSOs and it's optimized for fast time-to-first-symbol, i.e. it tries to do only minimal preprocessing.

jrmuizel commented 1 year ago

The Firefox profiler's symbolication infrastructure is https://github.com/mstange/samply/tree/main/samply-symbols

mstange commented 6 months ago

In the meantime I've polished up "The Firefox profiler's symbolication infrastructure" into a crate called wholesym.

So the next step here would be to switch fix-stacks to wholesym, which I've attempted in this branch: https://github.com/mstange/fix-stacks/commits/use-wholesym/