pub struct ElfInputs<'data> {
pub image: &'data [u8],
pub debug: Option<&'data [u8]>,
pub symbols: Option<&'data [u8]>,
pub supplementary: Option<&'data [u8]>,
pub dwp: Option<&'data [u8]>,
}convert only.Expand description
ELF inputs used to construct a GSYM file.
Only image is required. Leaving a companion as None makes
the converter fall back to the image itself for symbols and DWARF, so a
single unstripped binary needs nothing else.
Passing inputs this way skips discovery entirely: nothing is read from the
filesystem or the network. Use
ElfConverter::convert_path when companion files should be searched for.
use gsym::convert::ElfInputs;
let image = std::fs::read("app")?;
let debug = std::fs::read("app.debug")?;
let inputs = ElfInputs::new(&image).with_debug(&debug);Fields§
§image: &'data [u8]Linked ET_EXEC, ET_DYN, or relocatable ET_REL ELF image.
debug: Option<&'data [u8]>Explicit separate DWARF ELF, if different from the image.
symbols: Option<&'data [u8]>Extra symbol-table ELF read alongside the image’s and debug input’s own tables.
supplementary: Option<&'data [u8]>Supplementary DWARF ELF referenced by the main debug input.
dwp: Option<&'data [u8]>Packaged split-DWARF input.
Implementations§
Source§impl<'data> ElfInputs<'data>
impl<'data> ElfInputs<'data>
Sourcepub const fn new(image: &'data [u8]) -> Self
pub const fn new(image: &'data [u8]) -> Self
Creates inputs using one ELF for the image, symbols, and DWARF.
Sourcepub const fn with_debug(self, debug: &'data [u8]) -> Self
pub const fn with_debug(self, debug: &'data [u8]) -> Self
Uses an explicit ELF containing the image’s DWARF sections.
Sourcepub const fn with_symbols(self, symbols: &'data [u8]) -> Self
pub const fn with_symbols(self, symbols: &'data [u8]) -> Self
Adds an explicit ELF symbol table to the ones already imported.
Sourcepub const fn with_supplementary(self, supplementary: &'data [u8]) -> Self
pub const fn with_supplementary(self, supplementary: &'data [u8]) -> Self
Supplies the supplementary DWARF ELF referenced by the main debug input.