From 6396de75efb303c771d93fe9c0d545feb6a9619b Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 11 Jun 2024 20:08:37 -0700 Subject: [PATCH 1/4] Update gimli to 0.30.0 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ad1349..28a6611 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,9 +18,9 @@ checksum = "01a6d58e9c3408138099a396a98fd0d0e6cfb25d723594d2ae48b5004513fd5b" [[package]] name = "gimli" -version = "0.28.0" +version = "0.30.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9" dependencies = [ "compiler_builtins", "rustc-std-workspace-alloc", diff --git a/Cargo.toml b/Cargo.toml index 5ab1a8f..1b59aab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ members = [ ] [dependencies] -gimli = { version = "0.28", default-features = false, features = ["read-core"] } +gimli = { version = "0.30", default-features = false, features = ["read-core"] } libc = { version = "0.2", optional = true } spin = { version = "0.9.8", optional = true, default-features = false, features = ["mutex", "spin_mutex"] } core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' } From b6a96a4a435d0ada8e7115a7a41b4aa383a5fcf6 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 11 Jun 2024 20:08:47 -0700 Subject: [PATCH 2/4] Use ReaderOffset bounds --- src/unwinder/frame.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unwinder/frame.rs b/src/unwinder/frame.rs index 9ede0a1..5751191 100644 --- a/src/unwinder/frame.rs +++ b/src/unwinder/frame.rs @@ -25,9 +25,9 @@ const fn next_value(x: usize) -> usize { 192 } -impl gimli::UnwindContextStorage for StoreOnStack { - type Rules = [(Register, RegisterRule); next_value(MAX_REG_RULES)]; - type Stack = [UnwindTableRow; 2]; +impl gimli::UnwindContextStorage for StoreOnStack { + type Rules = [(Register, RegisterRule); next_value(MAX_REG_RULES)]; + type Stack = [UnwindTableRow; 2]; } #[cfg(feature = "dwarf-expr")] @@ -40,7 +40,7 @@ impl gimli::EvaluationStorage for StoreOnStack { #[derive(Debug)] pub struct Frame { fde_result: FDESearchResult, - row: UnwindTableRow, + row: UnwindTableRow, } impl Frame { From d5defbb83089fa75d6d048b2b1057e3907a54085 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 11 Jun 2024 20:29:57 -0700 Subject: [PATCH 3/4] Obtain expression from eh_frame --- src/unwinder/frame.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/unwinder/frame.rs b/src/unwinder/frame.rs index 5751191..75f74d4 100644 --- a/src/unwinder/frame.rs +++ b/src/unwinder/frame.rs @@ -1,5 +1,5 @@ use gimli::{ - BaseAddresses, CfaRule, Expression, Register, RegisterRule, UnwindContext, UnwindTableRow, + BaseAddresses, CfaRule, Register, RegisterRule, UnwindContext, UnwindExpression, UnwindTableRow, }; #[cfg(feature = "dwarf-expr")] use gimli::{Evaluation, EvaluationResult, Location, Value}; @@ -79,8 +79,9 @@ impl Frame { fn evaluate_expression( &self, ctx: &Context, - expr: Expression, + expr: UnwindExpression, ) -> Result { + let expr = expr.get(&self.fde_result.eh_frame).unwrap(); let mut eval = Evaluation::<_, StoreOnStack>::new_in(expr.0, self.fde_result.fde.cie().encoding()); let mut result = eval.evaluate()?; @@ -120,7 +121,7 @@ impl Frame { fn evaluate_expression( &self, _ctx: &Context, - _expr: Expression, + _expr: UnwindExpression, ) -> Result { Err(gimli::Error::UnsupportedEvaluation) } From c3bc46a4b883f331eb992a581e52fdabde588aa1 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 11 Jun 2024 20:40:27 -0700 Subject: [PATCH 4/4] Prop error constant --- src/personality.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/personality.rs b/src/personality.rs index 3bbdb16..ee11298 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -25,7 +25,7 @@ fn parse_pointer_encoding(input: &mut StaticSlice) -> gimli::Result