Skip to main content

Module convert

Module convert 

Source
Expand description

Linux ELF and DWARF conversion support.

ElfConverter reads an ELF image, imports its STT_FUNC symbols and DWARF subprogram information, and returns a populated GsymBuilder rather than finished bytes, so the model can be inspected or edited before an encoding is chosen.

use gsym::convert::ElfConverter;

let report = ElfConverter::default().convert_path("./app")?;
std::fs::write("./app.gsym", report.builder.to_bytes()?)?;

convert_path also searches for separate debug files: .gnu_debuglink targets validated by CRC, build-ID trees, debuginfod when it is configured, embedded .gnu_debugdata, supplementary .gnu_debugaltlink objects, and split DWARF. convert takes caller-supplied ElfInputs instead and searches for nothing.

Conversion is lenient. Anything unusable is skipped, counted in ConversionStats, and explained in a ConversionWarning, so one bad compilation unit does not fail the whole file. Errors are reserved for input that cannot be used at all, such as a malformed image or a companion file belonging to a different build.

See docs::conversion for the full guide.

Structs§

ConversionOptions
Controls ELF/DWARF import and optional companion discovery.
ConversionReport
Successful conversion output plus diagnostics and provenance.
ConversionStats
Counts describing one completed conversion.
DwarfImportOptions
Selects optional DWARF records to import.
ElfConverter
Reusable ELF-to-GSYM converter with immutable options.
ElfInputs
ELF inputs used to construct a GSYM file.

Enums§

ConversionWarning
Non-fatal issue observed while importing ELF or DWARF data.
DiscoveryEvent
A potentially slow operation reported during path-based debug discovery.
DiscoveryPolicy
Companion-file discovery policy for path-based conversion.