Skip to content

Commit

Permalink
Swap linux symbolication's unmaintained memmap dependency for memmap2
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed Jun 29, 2024
1 parent 3e94f99 commit 613222e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ log = "0.4"
proc-maps = "0.3.2"
read-process-memory = "0.1.6"
goblin = "0.7.1"
memmap = "0.7.0"
regex = ">=1.8.3"

[target.'cfg(target_os="macos")'.dependencies]
Expand All @@ -29,6 +28,7 @@ nix = {version = "0.26", default-features = false, features = ["ptrace", "sched"
object = "0.32"
addr2line = "0.21"
lazy_static = "1.4.0"
memmap2 = "0.9.4"

[target.'cfg(windows)'.dependencies]
winapi = {version = "0.3", features = ["winbase", "consoleapi", "wincon", "handleapi", "timeapi", "processenv" ]}
Expand Down
5 changes: 2 additions & 3 deletions src/linux/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::fs::File;
use std::path::Path;

use log::{debug, error, info, trace, warn};
use memmap;
use memmap::Mmap;
use memmap2::Mmap;

use crate::{Error, Pid, Process, StackFrame};
use addr2line::ObjectContext;
Expand Down Expand Up @@ -224,7 +223,7 @@ impl SymbolData {
info!("opening {} for symbols", filename);

let file = File::open(filename)?;
let map = unsafe { memmap::Mmap::map(&file)? };
let map = unsafe { memmap2::Mmap::map(&file)? };
let file = match object::File::parse(&*map) {
Ok(f) => f,
Err(e) => {
Expand Down

0 comments on commit 613222e

Please sign in to comment.