Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #92

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ edition="2021"
[dependencies]
libc = "0.2"
log = "0.4"
proc-maps = "0.3.2"
proc-maps = "0.4"
read-process-memory = "0.1.6"
goblin = "0.7.1"
goblin = "0.9"
regex = ">=1.8.3"
cfg-if = "1.0.0"

Expand All @@ -26,9 +26,9 @@ libproc = "0.14"

[target.'cfg(target_os="linux")'.dependencies]
nix = {version = "0.26", default-features = false, features = ["ptrace", "sched", "signal"]}
object = "0.32"
addr2line = "0.21"
lazy_static = "1.4.0"
object = "0.36"
addr2line = "0.24"
lazy_static = "1.5.0"
memmap2 = "0.9.4"

[target.'cfg(windows)'.dependencies]
Expand Down
20 changes: 8 additions & 12 deletions src/linux/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use log::{debug, error, info, trace, warn};
use memmap2::Mmap;

use crate::{Error, Pid, Process, StackFrame};
use addr2line::ObjectContext;
use addr2line::Loader;
use goblin;
use goblin::elf::program_header::*;
use object::{self, Object, ObjectSymbol};
Expand Down Expand Up @@ -211,7 +211,7 @@ impl Symbolicator {

pub struct SymbolData {
// Contains symbol info for a single binary
ctx: ObjectContext,
address_loader: Loader,
offset: u64,
symbols: Vec<(u64, u64, String)>,
dynamic_symbols: Vec<(u64, u64, String)>,
Expand All @@ -238,7 +238,7 @@ impl SymbolData {
}
};

let ctx = ObjectContext::new(&file).map_err(|e| {
let address_loader = Loader::new(filename).map_err(|e| {
Error::Other(format!(
"Failed to get symbol context for {}: {:?}",
filename, e
Expand All @@ -261,7 +261,7 @@ impl SymbolData {
}
dynamic_symbols.sort_unstable_by(|a, b| a.cmp(&b));
Ok(SymbolData {
ctx,
address_loader,
offset,
dynamic_symbols,
symbols,
Expand Down Expand Up @@ -291,17 +291,13 @@ impl SymbolData {
if line_info {
let mut has_debug_info = false;

// addr2line0.8 uses an older version of gimli (0.0.19) than we are using here (0.0.21),
// this means we can't use the type of the error returned ourselves here since the
// type alias is private. hack by re-mapping the error
let error_handler = |e| Error::Other(format!("addr2line error: {:?}", e));

// if we have debugging info, get the appropriate stack frames for the address
let mut frames = self
.ctx
.address_loader
.find_frames(offset)
.skip_all_loads()
.map_err(error_handler)?;
.map_err(|e| Error::Other(format!("addr2line error: {:?}", e)))?;

let error_handler = |e| Error::Other(format!("addr2line error: {:?}", e));
while let Some(frame) = frames.next().map_err(error_handler)? {
has_debug_info = true;
if let Some(func) = frame.function {
Expand Down
Loading