/// Whether the format of a compilation unit is 32- or 64-bit. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubenum Format { /// 64-bit DWARF
Dwarf64 = 8, /// 32-bit DWARF
Dwarf32 = 4,
}
impl Format { /// Return the serialized size of an initial length field for the format. #[inline] pubfn initial_length_size(self) -> u8 { matchself {
Format::Dwarf32 => 4,
Format::Dwarf64 => 12,
}
}
/// Return the natural word size for the format #[inline] pubfn word_size(self) -> u8 { matchself {
Format::Dwarf32 => 4,
Format::Dwarf64 => 8,
}
}
}
/// Which vendor extensions to support. #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[non_exhaustive] pubenum Vendor { /// A default set of extensions, including some common GNU extensions.
Default, /// AAarch64 extensions.
AArch64,
}
/// Encoding parameters that are commonly used for multiple DWARF sections. /// /// This is intended to be small enough to pass by value. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] // `address_size` and `format` are used more often than `version`, so keep // them first. #[repr(C)] pubstruct Encoding { /// The size of an address. pub address_size: u8,
// The size of a segment selector. // TODO: pub segment_size: u8, /// Whether the DWARF format is 32- or 64-bit. pub format: Format,
/// The DWARF version of the header. pub version: u16,
}
/// Encoding parameters for a line number program. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct LineEncoding { /// The size in bytes of the smallest target machine instruction. pub minimum_instruction_length: u8,
/// The maximum number of individual operations that may be encoded in an /// instruction. pub maximum_operations_per_instruction: u8,
/// The initial value of the `is_stmt` register. pub default_is_stmt: bool,
/// The minimum value which a special opcode can add to the line register. pub line_base: i8,
/// The range of values which a special opcode can add to the line register. pub line_range: u8,
}
/// A DWARF register number. /// /// The meaning of this value is ABI dependent. This is generally encoded as /// a ULEB128, but supported architectures need 16 bits at most. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pubstruct Register(pub u16);
/// An offset into the `.debug_abbrev` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DebugAbbrevOffset<T = usize>(pub T);
/// An offset to a set of entries in the `.debug_addr` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugAddrBase<T = usize>(pub T);
/// An index into a set of addresses in the `.debug_addr` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugAddrIndex<T = usize>(pub T);
/// An offset into the `.debug_aranges` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugArangesOffset<T = usize>(pub T);
/// An offset into the `.debug_info` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] pubstruct DebugInfoOffset<T = usize>(pub T);
/// An offset into the `.debug_line` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugLineOffset<T = usize>(pub T);
/// An offset into the `.debug_line_str` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugLineStrOffset<T = usize>(pub T);
/// An offset into either the `.debug_loc` section or the `.debug_loclists` section, /// depending on the version of the unit the offset was contained in. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct LocationListsOffset<T = usize>(pub T);
/// An offset to a set of location list offsets in the `.debug_loclists` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugLocListsBase<T = usize>(pub T);
/// An index into a set of location list offsets in the `.debug_loclists` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugLocListsIndex<T = usize>(pub T);
/// An offset into the `.debug_macinfo` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DebugMacinfoOffset<T = usize>(pub T);
/// An offset into the `.debug_macro` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DebugMacroOffset<T = usize>(pub T);
/// An offset into either the `.debug_ranges` section or the `.debug_rnglists` section, /// depending on the version of the unit the offset was contained in. /// /// If this is from a DWARF 4 DWO file, then it must additionally be offset by the /// value of `DW_AT_GNU_ranges_base`. You can use `Dwarf::ranges_offset_from_raw` to do this. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct RawRangeListsOffset<T = usize>(pub T);
/// An offset into either the `.debug_ranges` section or the `.debug_rnglists` section, /// depending on the version of the unit the offset was contained in. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct RangeListsOffset<T = usize>(pub T);
/// An offset to a set of range list offsets in the `.debug_rnglists` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugRngListsBase<T = usize>(pub T);
/// An index into a set of range list offsets in the `.debug_rnglists` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugRngListsIndex<T = usize>(pub T);
/// An offset into the `.debug_str` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugStrOffset<T = usize>(pub T);
/// An offset to a set of entries in the `.debug_str_offsets` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugStrOffsetsBase<T = usize>(pub T);
/// An index into a set of entries in the `.debug_str_offsets` section. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubstruct DebugStrOffsetsIndex<T = usize>(pub T);
/// An offset into the `.debug_types` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] pubstruct DebugTypesOffset<T = usize>(pub T);
/// A type signature as used in the `.debug_types` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DebugTypeSignature(pub u64);
/// An offset into the `.debug_frame` section. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DebugFrameOffset<T = usize>(pub T);
/// An offset into the `.debug_info` or `.debug_types` sections. #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] pubenum UnitSectionOffset<T = usize> { /// An offset into the `.debug_info` section.
DebugInfoOffset(DebugInfoOffset<T>), /// An offset into the `.debug_types` section.
DebugTypesOffset(DebugTypesOffset<T>),
}
/// Returns the ELF section name for this kind, when found in a .dwo or .dwp file. pubfn dwo_name(self) -> Option<&'static str> {
Some(matchself {
SectionId::DebugAbbrev => ".debug_abbrev.dwo",
SectionId::DebugCuIndex => ".debug_cu_index",
SectionId::DebugInfo => ".debug_info.dwo",
SectionId::DebugLine => ".debug_line.dwo", // The debug_loc section can be present in the dwo when using the // GNU split-dwarf extension to DWARF4.
SectionId::DebugLoc => ".debug_loc.dwo",
SectionId::DebugLocLists => ".debug_loclists.dwo",
SectionId::DebugMacinfo => ".debug_macinfo.dwo",
SectionId::DebugMacro => ".debug_macro.dwo",
SectionId::DebugRngLists => ".debug_rnglists.dwo",
SectionId::DebugStr => ".debug_str.dwo",
SectionId::DebugStrOffsets => ".debug_str_offsets.dwo",
SectionId::DebugTuIndex => ".debug_tu_index",
SectionId::DebugTypes => ".debug_types.dwo",
_ => return None,
})
}
/// An optionally-provided implementation-defined compilation unit ID to enable /// split DWARF and linking a split compilation unit back together. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pubstruct DwoId(pub u64);
/// The "type" of file with DWARF debugging information. This determines, among other things, /// which files DWARF sections should be loaded from. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pubenum DwarfFileType { /// A normal executable or object file.
Main, /// A .dwo split DWARF file.
Dwo, // TODO: Supplementary files, .dwps?
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.