Jelajahi Sumber

Update gimli version

Gary Guo 1 tahun lalu
induk
melakukan
00a7465328
3 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 1 1
      Cargo.toml
  2. 1 0
      src/lib.rs
  3. 3 0
      src/unwinder/frame.rs

+ 1 - 1
Cargo.toml

@@ -11,7 +11,7 @@ repository = "https://github.com/nbdd0121/unwinding/"
 members = ["cdylib", "example"]
 
 [dependencies]
-gimli = { version = "0.26.1", default-features = false, features = ["read-core"] }
+gimli = { version = "0.28", 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' }

+ 1 - 0
src/lib.rs

@@ -1,6 +1,7 @@
 #![doc = include_str!("../README.md")]
 #![feature(c_unwind)]
 #![feature(naked_functions)]
+#![feature(non_exhaustive_omitted_patterns_lint)]
 // lang_items is an internal feature. `internal_features` lint is added recently
 // so also allow unknown lints to prevent warning in older nightly versions.
 #![cfg_attr(

+ 3 - 0
src/unwinder/frame.rs

@@ -144,6 +144,7 @@ impl Frame {
         new_ctx[Arch::SP] = cfa as _;
         new_ctx[Arch::RA] = 0;
 
+        #[warn(non_exhaustive_omitted_patterns)]
         for (reg, rule) in row.registers() {
             let value = match *rule {
                 RegisterRule::Undefined | RegisterRule::SameValue => ctx[*reg],
@@ -158,6 +159,8 @@ impl Frame {
                 }
                 RegisterRule::ValExpression(expr) => self.evaluate_expression(ctx, expr)?,
                 RegisterRule::Architectural => unreachable!(),
+                RegisterRule::Constant(value) => value as usize,
+                _ => unreachable!(),
             };
             new_ctx[*reg] = value;
         }