Skip to content

Commit

Permalink
feat(debuginfo): Expose binary names for ELF and MachO (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Jul 15, 2020
1 parent 281fd3b commit 3cccb75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions debuginfo/src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ impl<'d> ElfObject<'d> {
.map(|slice| CodeId::from_binary(slice))
}

/// The binary's soname, if any.
pub fn name(&self) -> Option<&'d str> {
self.elf.soname
}

/// The debug information identifier of an ELF object.
///
/// The debug identifier is a rehash of the first 16 bytes of the `code_id`, if
Expand Down
5 changes: 5 additions & 0 deletions debuginfo/src/macho.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ impl<'d> MachObject<'d> {
None
}

/// The name of the dylib if any.
pub fn name(&self) -> Option<&'d str> {
self.macho.name
}

/// The code identifier of this object.
///
/// Mach objects use a UUID which is specified in the load commands that are part of the Mach
Expand Down

0 comments on commit 3cccb75

Please sign in to comment.