diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /vendor/addr2line/tests | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/addr2line/tests')
-rw-r--r-- | vendor/addr2line/tests/correctness.rs | 11 | ||||
-rw-r--r-- | vendor/addr2line/tests/output_equivalence.rs | 1 | ||||
-rw-r--r-- | vendor/addr2line/tests/parse.rs | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/vendor/addr2line/tests/correctness.rs b/vendor/addr2line/tests/correctness.rs index 3f7b43373..955e2b831 100644 --- a/vendor/addr2line/tests/correctness.rs +++ b/vendor/addr2line/tests/correctness.rs @@ -2,7 +2,7 @@ extern crate addr2line; extern crate fallible_iterator; extern crate findshlibs; extern crate gimli; -extern crate memmap; +extern crate memmap2; extern crate object; use addr2line::Context; @@ -11,10 +11,10 @@ use findshlibs::{IterationControl, SharedLibrary, TargetSharedLibrary}; use object::Object; use std::fs::File; -fn find_debuginfo() -> memmap::Mmap { +fn find_debuginfo() -> memmap2::Mmap { let path = std::env::current_exe().unwrap(); let file = File::open(&path).unwrap(); - let map = unsafe { memmap::Mmap::map(&file).unwrap() }; + let map = unsafe { memmap2::Mmap::map(&file).unwrap() }; let file = &object::File::parse(&*map).unwrap(); if let Ok(uuid) = file.mach_uuid() { for candidate in path.parent().unwrap().read_dir().unwrap() { @@ -25,7 +25,7 @@ fn find_debuginfo() -> memmap::Mmap { for candidate in path.join("Contents/Resources/DWARF").read_dir().unwrap() { let path = candidate.unwrap().path(); let file = File::open(&path).unwrap(); - let map = unsafe { memmap::Mmap::map(&file).unwrap() }; + let map = unsafe { memmap2::Mmap::map(&file).unwrap() }; let file = &object::File::parse(&*map).unwrap(); if file.mach_uuid().unwrap() == uuid { return map; @@ -41,11 +41,12 @@ fn find_debuginfo() -> memmap::Mmap { fn correctness() { let map = find_debuginfo(); let file = &object::File::parse(&*map).unwrap(); + let module_base = file.relative_address_base(); let ctx = Context::new(file).unwrap(); let mut bias = None; TargetSharedLibrary::each(|lib| { - bias = Some(lib.virtual_memory_bias().0 as u64); + bias = Some((lib.virtual_memory_bias().0 as u64).wrapping_sub(module_base)); IterationControl::Break }); diff --git a/vendor/addr2line/tests/output_equivalence.rs b/vendor/addr2line/tests/output_equivalence.rs index 9dc366672..c0e1f8335 100644 --- a/vendor/addr2line/tests/output_equivalence.rs +++ b/vendor/addr2line/tests/output_equivalence.rs @@ -11,6 +11,7 @@ use backtrace::Backtrace; use findshlibs::{IterationControl, SharedLibrary, TargetSharedLibrary}; use test::{ShouldPanic, TestDesc, TestDescAndFn, TestFn, TestName}; +#[inline(never)] fn make_trace() -> Vec<String> { fn foo() -> Backtrace { bar() diff --git a/vendor/addr2line/tests/parse.rs b/vendor/addr2line/tests/parse.rs index 91d66e382..60b2300b5 100644 --- a/vendor/addr2line/tests/parse.rs +++ b/vendor/addr2line/tests/parse.rs @@ -1,5 +1,5 @@ extern crate addr2line; -extern crate memmap; +extern crate memmap2; extern crate object; use std::borrow::Cow; @@ -25,7 +25,7 @@ fn release_fixture_path() -> PathBuf { fn with_file<F: FnOnce(&object::File)>(target: &path::Path, f: F) { let file = File::open(target).unwrap(); - let map = unsafe { memmap::Mmap::map(&file).unwrap() }; + let map = unsafe { memmap2::Mmap::map(&file).unwrap() }; let file = object::File::parse(&*map).unwrap(); f(&file) } |