Skip to content

Commit 8f0f71c

Browse files
authored
Merge pull request #20 from philipc/update-gimli
Update gimli
2 parents 6eb846f + 2f602a5 commit 8f0f71c

File tree

7 files changed

+8
-13
lines changed

7 files changed

+8
-13
lines changed

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ debug = true
66

77
[workspace]
88
members = ["unwind"]
9-
10-
#[patch.crates-io]
11-
#gimli = { git = 'https://github.com/roblabla/gimli.git?branch=lookup_and_parse' }
12-
[replace]
13-
"gimli:0.16.0" = { git = 'https://github.com/roblabla/gimli.git', branch = 'lookup_and_parse' }

unwind/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["main() <[email protected]>"]
55

66
[dependencies]
7-
gimli = "0.16"
7+
gimli = "0.16.1"
88
libc = "0.2"
99
fallible-iterator = "0.1"
1010
log = "0.4"

unwind/examples/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use fallible_iterator::FallibleIterator;
77
use unwind::{Unwinder, DwarfUnwinder};
88

99
fn bar() {
10-
DwarfUnwinder::default().trace(|mut x| {
10+
DwarfUnwinder::default().trace(|x| {
1111
while let Some(frame) = x.next().unwrap() {
1212
backtrace::resolve(x.registers()[16].unwrap() as *mut std::os::raw::c_void, |sym| println!("{:?} ({:?}:{:?})", sym.name(), sym.filename(), sym.lineno()));
1313
println!("{:?}", frame);

unwind/src/find_cfi/baremetal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn find_cfi_sections() -> Vec<EhRef> {
1818
let text_end = &__text_end as *const _ as u64;
1919
let cfi_start = &__ehframehdr_start as *const _ as u64;
2020
let cfi_end = &__ehframehdr_end as *const _ as u64;
21-
let eh_frame_end = &__ehframe_end as *const _ as u64;
21+
let ehframe_end = &__ehframe_end as *const _ as u64;
2222

2323
cfi.push(EhRef {
2424
obj_base: 0,

unwind/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate libc;
55
extern crate fallible_iterator;
66
#[macro_use] extern crate log;
77

8-
use gimli::{UnwindSection, UnwindTable, UnwindTableRow, EhFrame, BaseAddresses, UninitializedUnwindContext, Pointer, Reader, CieOrFde, EndianBuf, NativeEndian, CfaRule, RegisterRule, EhFrameHdr, ParsedEhFrameHdr};
8+
use gimli::{UnwindSection, UnwindTable, UnwindTableRow, EhFrame, BaseAddresses, UninitializedUnwindContext, Pointer, Reader, EndianSlice, NativeEndian, CfaRule, RegisterRule, EhFrameHdr, ParsedEhFrameHdr};
99
use fallible_iterator::FallibleIterator;
1010

1111
mod registers;
@@ -35,7 +35,7 @@ pub trait Unwinder: Default {
3535
fn trace<F>(&mut self, f: F) where F: FnMut(&mut StackFrames);
3636
}
3737

38-
type StaticReader = EndianBuf<'static, NativeEndian>;
38+
type StaticReader = EndianSlice<'static, NativeEndian>;
3939

4040
struct ObjectRecord {
4141
er: EhRef,

unwind/src/libunwind_shim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub unsafe extern "C" fn _Unwind_RaiseException(exception: *mut _Unwind_Exceptio
114114
unreachable!();
115115
}
116116

117-
unsafe fn unwind_tracer(mut frames: &mut ::StackFrames, exception: *mut _Unwind_Exception) {
117+
unsafe fn unwind_tracer(frames: &mut ::StackFrames, exception: *mut _Unwind_Exception) {
118118
if let Some(contptr) = (*exception).private_contptr {
119119
loop {
120120
if let Some(frame) = frames.next().unwrap() {
@@ -156,7 +156,7 @@ unsafe fn unwind_tracer(mut frames: &mut ::StackFrames, exception: *mut _Unwind_
156156
pub unsafe extern "C" fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
157157
trace_argument: *mut c_void)
158158
-> _Unwind_Reason_Code {
159-
DwarfUnwinder::default().trace(|mut frames| {
159+
DwarfUnwinder::default().trace(|frames| {
160160
while let Some(frame) = frames.next().unwrap() {
161161
let mut ctx = _Unwind_Context {
162162
lsda: frame.lsda.unwrap_or(0),

unwind/tests/correctness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn test_frame_3() {
2828
}
2929
println!();
3030

31-
DwarfUnwinder::default().trace(move |mut frames| {
31+
DwarfUnwinder::default().trace(move |frames| {
3232
// skip 2 (unwind-rs + test_frame_3)
3333
frames.next().unwrap();
3434
frames.next().unwrap();

0 commit comments

Comments
 (0)