gimli-rs / gimli

A library for reading and writing the DWARF debugging format
https://docs.rs/gimli/
Apache License 2.0
831 stars 105 forks source link

read/cfi: replace Expression with offset/length #703

Closed philipc closed 5 months ago

philipc commented 6 months ago

This avoids the need to store Reader in the UnwindContext, which simplifies lifetime management.

Closes #701

philipc commented 6 months ago

Maybe adding a type for the offset/length pair will make this easier to convert to.

mstange commented 6 months ago

I like this solution a lot more than what I proposed!

philipc commented 5 months ago

I've added the UnwindExpression type. Can you check if this meets your needs? I tried it in unwinding and it was a simple change, but framehop looks more involved.

mstange commented 5 months ago

Can you check if this meets your needs?

It meets my needs perfectly, thanks so much!

I have the framehop changes on a branch here: https://github.com/mstange/framehop/commits/gimli-issue-701/

I tried it in unwinding and it was a simple change, but framehop looks more involved.

I agree, it was quite a bit more involved than I expected (because I had forgotten a lot about what framehop was doing, and because of how framehop is exposing the UnwindContextStorage / EvaluationStorage to the outside world).

mstange commented 5 months ago

I'd be interested in a release with this fix.

philipc commented 5 months ago

I'll do an object release then do a small amount of work on better relocation support here before I do a release.