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

Rename AddrLineInfo -> AddrSrcInfo #314

Merged
merged 1 commit into from
Sep 14, 2023
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
6 changes: 3 additions & 3 deletions src/dwarf/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::elf::ElfParser;
use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::inspect::SymType;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::Error;
use crate::IntSym;
Expand Down Expand Up @@ -94,7 +94,7 @@ impl DwarfResolver {
/// Find line information of an address.
///
/// `addr` is a normalized address.
pub fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo<'_>>> {
pub fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo<'_>>> {
// TODO: This conditional logic is weird and potentially
// unnecessary. Consider removing it or moving it higher
// in the call chain.
Expand All @@ -107,7 +107,7 @@ impl DwarfResolver {
column,
} = location;

AddrLineInfo {
AddrSrcInfo {
dir,
file,
line,
Expand Down
6 changes: 3 additions & 3 deletions src/elf/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::path::PathBuf;

use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::IntSym;
use crate::Result;
Expand Down Expand Up @@ -92,7 +92,7 @@ impl SymResolver for ElfResolver {
}

#[cfg(feature = "dwarf")]
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo<'_>>> {
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo<'_>>> {
if let ElfBackend::Dwarf(dwarf) = &self.backend {
dwarf.find_line_info(addr)
} else {
Expand All @@ -101,7 +101,7 @@ impl SymResolver for ElfResolver {
}

#[cfg(not(feature = "dwarf"))]
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo>> {
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo>> {
Ok(None)
}

Expand Down
8 changes: 4 additions & 4 deletions src/gsym/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::PathBuf;
use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::mmap::Mmap;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::IntSym;
use crate::IntoError as _;
Expand Down Expand Up @@ -128,9 +128,9 @@ impl SymResolver for GsymResolver<'_> {
///
/// # Returns
///
/// The `AddrLineInfo` corresponding to the address or `None`.
/// The `AddrSrcInfo` corresponding to the address or `None`.
#[cfg_attr(feature = "tracing", crate::log::instrument(skip(self), fields(file = debug(&self.file_name))))]
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo<'_>>> {
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo<'_>>> {
let idx = match self.ctx.find_addr(addr) {
Some(idx) => idx,
None => return Ok(None),
Expand Down Expand Up @@ -205,7 +205,7 @@ impl SymResolver for GsymResolver<'_> {
.ok_or_invalid_data(|| {
format!("failed to retrieve file name string @ {}", finfo.filename)
})?;
return Ok(Some(AddrLineInfo {
return Ok(Some(AddrSrcInfo {
dir: Path::new(dir),
file,
line: Some(lntab_row.file_line),
Expand Down
4 changes: 2 additions & 2 deletions src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::elf::ElfResolver;
use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::ksym::KSymResolver;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::Error;
use crate::IntSym;
Expand Down Expand Up @@ -52,7 +52,7 @@ impl SymResolver for KernelResolver {
Ok(Vec::new())
}

fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo>> {
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo>> {
if let Some(resolver) = self.elf_resolver.as_ref() {
resolver.find_line_info(addr)
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/ksym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::rc::Rc;
use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::inspect::SymType;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::IntSym;
use crate::Result;
Expand Down Expand Up @@ -172,7 +172,7 @@ impl SymResolver for KSymResolver {
}
}

fn find_line_info(&self, _addr: Addr) -> Result<Option<AddrLineInfo>> {
fn find_line_info(&self, _addr: Addr) -> Result<Option<AddrSrcInfo>> {
Ok(None)
}

Expand Down
4 changes: 2 additions & 2 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt::Debug;

use crate::inspect::FindAddrOpts;
use crate::inspect::SymInfo;
use crate::symbolize::AddrLineInfo;
use crate::symbolize::AddrSrcInfo;
use crate::Addr;
use crate::Result;

Expand Down Expand Up @@ -45,7 +45,7 @@ where
/// Find the address and size of a symbol name.
fn find_addr(&self, name: &str, opts: &FindAddrOpts) -> Result<Vec<SymInfo>>;
/// Find the file name and the line number of an address.
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrLineInfo>>;
fn find_line_info(&self, addr: Addr) -> Result<Option<AddrSrcInfo>>;
/// Translate an address (virtual) in a process to the file offset
/// in the object file.
fn addr_file_off(&self, addr: Addr) -> Option<u64>;
Expand Down
2 changes: 1 addition & 1 deletion src/symbolize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub use symbolizer::Sym;
pub use symbolizer::Symbolizer;


pub(crate) struct AddrLineInfo<'src> {
pub(crate) struct AddrSrcInfo<'src> {
pub dir: &'src Path,
pub file: &'src OsStr,
pub line: Option<u32>,
Expand Down
Loading