Source code
Revision control
Copy as Markdown
Other Tools
# `gimli` Change Log
--------------------------------------------------------------------------------
## 0.30.0
Released 2024/05/26.
### Breaking changes
* Added context to some `read::Error` variants.
* Changed type of `read::UnitIndexSection::section` to `IndexSectionId`.
### Changed
* Fixed `write::Operation::ImplicitPointer::size`.
* Changed `read::RngListIter` and `read::LocListIter` to skip ranges where
the end is before the beginning, instead of returning an error.
* Fixed clippy warnings.
### Added
* Added `read::UnitRef`.
--------------------------------------------------------------------------------
## 0.29.0
Released 2024/04/11.
### Breaking changes
* Changed `Reader` type parameter to `ReaderOffset` for `read::UnwindContext` and related types.
Replaced `Expression` with `UnwindExpression` in unwind information types.
### Changed
* Changed `write::Sections::for_each` and `for_each_mut` to specify section lifetime.
* Fixed writing unwind information with an LSDA encoding that is not `DW_EH_PE_absptr`.
* Fixed parsing for an empty DWP index.
* Improved error handling in `read::Unit::dwo_name`.
* Fixed warnings.
### Added
* Added MIPS register definitions.
* Added PowerPC register definitions.
* Added `read::DwarfSections` and `read::DwarfPackageSections`.
* Implemented `BitOr` for `DwEhPe`.
* Added `read::Relocate`, `read::RelocateReader`, and `write::RelocateWriter`.
--------------------------------------------------------------------------------
## 0.28.1
Released 2023/11/24.
### Changed
* Changed `read::AbbreviationsCache` to require manual population using
`Dwarf::populate_abbreviations_cache`.
* Changed the default `read::UnwindContextStorage` to use `Box` instead of `Vec`
so that its memory usage is limited.
* Changed `read::UnwindTable::new` to always reset the context, because
previous errors may have left the context in an invalid state.
* Changed the `Debug` implementation for `read::EndianSlice` to limit the number
of bytes it displays.
### Added
* Added more AArch64 register definitions.
* Added `read::Unit::new_with_abbreviations`.
* Added `read::Evaluation::value_result`.
--------------------------------------------------------------------------------
## 0.28.0
Released 2023/08/12.
### Breaking changes
* Deleted `impl From<EndianSlice> for &[u8]`. Use `EndianSlice::slice` instead.
* Deleted `impl Index<usize> for EndianSlice` and
`impl Index<RangeFrom<usize>> for EndianSlice`.
* Replaced `impl From<Pointer> for u64` with `Pointer::pointer`.
* Updated `fallible-iterator` to 0.3.0.
* Changed some optional dependencies to use the `dep:` feature syntax.
* Added `non_exhaustive` attribute to `read::RegisterRule`,
`read::CallFrameInstruction`, and `write::CallFrameInstruction`.
### Changed
* The minimum supported rust version for the `read` feature and its dependencies
increased to 1.60.0.
* The minimum supported rust version for other features increased to 1.65.0.
### Added
* Added `Vendor`, `read::DebugFrame::set_vendor`, and `read::EhFrame::set_vendor`.
* Added more ARM and AArch64 register definitions, and
`DW_CFA_AARCH64_negate_ra_state` support.
--------------------------------------------------------------------------------
## 0.27.3
Released 2023/06/14.
### Changed
* Excluded test fixtures from published package.
### Added
* Added `FallibleIterator` implementation for `read::OperationIter`.
* Added `DW_AT_GNU_deleted` constant.
--------------------------------------------------------------------------------
## 0.27.2
Released 2023/02/15.
### Added
* Added support for tombstones in `read::LineRows`.
--------------------------------------------------------------------------------
## 0.27.1
Released 2023/01/23.
### Added
* Added `SectionId::xcoff_name` and `read::Section::xcoff_section_name`.
* Added `read::Dwarf::make_dwo` and `read::Unit::dwo_name`.
### Changed
* Changed `read::DwarfPackage::sections` to handle supplementary files.
--------------------------------------------------------------------------------
## 0.27.0
Released 2022/11/23.
### Breaking changes
* Added `read::Dwarf::abbreviations_cache` to cache abbreviations at offset 0.
Changed `read::Dwarf::abbreviations` to return `Result<Arc<Abbreviations>>`,
and changed `read::Unit::abbreviations` to `Arc<Abbreviations>`.
### Added
* Added LoongArch register definitions.
* Added support for tombstones in `read::LocListIter` and `read::RngListIter`.
--------------------------------------------------------------------------------
## 0.26.2
Released 2022/07/16.
### Changed
* Fixed CFI personality encoding when writing.
* Fixed use of raw pointer for mutation, detected by Miri.
* Fixed `DW_OP_GNU_implicit_pointer` handling for DWARF version 2.
### Added
* Added `read::EhHdrTable::iter`.
--------------------------------------------------------------------------------
## 0.26.1
Released 2021/11/02.
### Changed
* Fixed segmentation fault in `ArrayVec<Vec<T>>::into_vec`, which may be used by
`read::Evaluation::result`. This regression was introduced in 0.26.0.
--------------------------------------------------------------------------------
## 0.26.0
Released 2021/10/24.
### Breaking changes
* Removed `read::UninitializedUnwindContext`. Use `Box<UnwindContext>` instead.
* Renamed `read::Error::CfiStackFull` to `StackFull`.
* Added `UnwindContextStorage` type parameter to `read::UnwindContext`, `read::UnwindTable`,
`read::UnwindTableRow`, and `read::RegisterRuleMap`.
* Added `EvaluationStorage` type parameter to `read::Evaluation`.
* Added `read::SectionId::DebugCuIndex` and `read::SectionId::DebugTuIndex`.
### Changed
* Fixed `DW_EH_PE_pcrel` handling in default `write::Writer::write_eh_pointer` implementation.
* Fixed `read::AttributeSpecification::size` for some forms.
* Display more unit details in dwarfdump.
### Added
* Added `write::DebuggingInformationEntry::delete_child`.
* Added ARM and AArch64 register definitions.
* Added RISC-V register definitions.
* Added `read::DwarfPackage`, `read::DebugCuIndex`, and `read::DebugTuIndex`.
* Added `read-core` feature to allow building without `liballoc`.
* Added `read::EntriesRaw::skip_attributes`.
--------------------------------------------------------------------------------
## 0.25.0
Released 2021/07/26.
### Breaking changes
* `read::FrameDescriptionEntry::unwind_info_for_address` now returns a reference
instead of cloning.
* `read::AttributeValue::RangeListsRef` now contains a `RawRangeListsOffset`
to allow handling of GNU split DWARF extensions.
Use `read::Dwarf::ranges_offset_from_raw` to handle it.
* Added `read::Unit::dwo_id`.
### Changed
* `.debug_aranges` parsing now accepts version 3.
* `read::Dwarf::attr_ranges_offset` and its callers now handle GNU split DWARF extensions.
### Added
* Added `read::DebugLineStr::new`.
* Added `read::UnwindTable::into_current_row`.
* Added more `DW_LANG` constants.
* dwarfdump: added DWO parent support.
* Added `read::Dwarf` methods: `ranges_offset_from_raw`, `raw_ranges`, and `raw_locations`.
--------------------------------------------------------------------------------
## 0.24.0
Released 2021/05/01.
### Breaking changes
* Minimum Rust version increased to 1.42.0.
* Added `read::Dwarf::debug_aranges`.
* Replaced `read::DebugAranges::items` with `read::DebugAranges::headers`.
* Added `read::Operation::Wasm*`.
* `read::LineRow::line` now returns `Option<NonZeroU64>`.
The `read::ColumnType::Column` variant now contains a `NonZeroU64`.
* Replaced `read::Dwarf::debug_str_sup` with `read::Dwarf::sup`.
Deleted `sup` parameter of `read::Dwarf::load`.
Added `read::Dwarf::load_sup`.
### Added
* dwarfdump: Supplementary object file support.
### Changed
* Support `DW_FORM_addrx*` for `DW_AT_low_pc`/`DW_AT_high_pc` in `read::Dwarf`.
* Performance improvement in `EndianReader`.
--------------------------------------------------------------------------------
## 0.23.0
Released 2020/10/27.
### Breaking changes
* Added more variants to `read::UnitType`.
Added `read::AttributeValue::DwoId`
* Replaced `CompilationUnitHeader` and `TypeUnitHeader` with `UnitHeader`.
Replaced `CompilationUnitHeadersIter` with `DebugInfoUnitHeadersIter`.
Replaced `TypeUnitHeadersIter` with `DebugTypesUnitHeadersIter`.
### Added
* Added read support for split DWARF.
* Added `read::Dwarf::attr_address`.
* Added read support for `DW_AT_GNU_addr_base` and `DW_AT_GNU_ranges_base`.
* dwarfdump: Display index values for attributes.
* Added `name_to_register`.
--------------------------------------------------------------------------------
## 0.22.0
Released 2020/07/03.
### Breaking changes
* Fixed `UnitHeader::size_of_header` for DWARF 5 units.
### Added
* Added fuzz targets in CI.
* Added read support for `DW_OP_GNU_addr_index` and `DW_OP_GNU_const_index`.
* Added `.dwo` support to dwarfdump.
* Added `SectionId::dwo_name` and `Section::dwo_section_name`.
### Fixed
* Fixed panic when reading `DW_FORM_indirect` combined with `DW_FORM_implicit_const`.
* Fixed panic for `read::Abbreviations::get(0)`.
* Fixed arithmetic overflow when reading `.debug_line`.
* Fixed arithmetic overflow when reading CFI.
* Fixed arithmetic overflow and division by zero when reading `.debug_aranges`.
* Don't return error from `read::Unit::new` when `DW_AT_name` or `DW_AT_comp_dir` is missing.
--------------------------------------------------------------------------------
## 0.21.0
Released 2020/05/12.
### Breaking changes
* Minimum Rust version increased to 1.38.0.
* Replaced `read::Operation::Literal` with `Operation::UnsignedConstant` and `Operation::SignedConstant`.
Changed `read::Operation::Bra` and `read::Operation::Skip` to contain the target offset instead of the bytecode.
* Changed `write::Expression` to support references. Existing users can convert to use `Expression::raw`.
* Replaced `write::AttributeValue::AnyUnitEntryRef` with `DebugInfoRef`.
Renamed `write::AttributeValue::ThisUnitEntryRef` to `UnitRef`.
* Added more optional features: `endian-reader` and `fallible-iterator`.
### Added
* Added `read::Expression::operations`
### Fixed
* Fixed newlines in `dwarfdump` example.
* Ignore zero terminators when reading `.debug_frame` sections.
* Increase the number of CFI register rules supported by `read::UnwindContext`.
* Fixed version handling and return register encoding when reading `.eh_frame` sections.
### Changed
* Added `EhFrame` and `DebugFrame` to `write::Sections`.
* Improved performance of `write::LineProgram::generate_row`.
* Removed use of the `byteorder`, `arrayvec` and `smallvec` crates.
--------------------------------------------------------------------------------
## 0.20.0
Released 2020/01/11.
### Breaking changes
* Changed type of `DwTag`, `DwAt`, and `DwForm` constants.
* Added `read/write::AttributeValue::DebugMacroRef`, and returned where
required in `read::Attribute::value`. Added `SectionId::DebugMacro`.
* Deleted `alloc` feature, and fixed `no-std` builds with stable rust.
* Deleted `read::Error::description`, and changed `<read::Error as Display>`
to display what was previously the description.
### Added
* Added GNU view constants.
* Added `read::EntriesRaw` for low level DIE parsing.
* Added `examples/simple-line.rs`.
### Fixed
* Fixed handling of CFI augmentations without data.
* dwarfdump: fix panic for malformed expressions.
* dwarfdump: fix handling of Mach-O relocations.
### Changed
* Improved abbreviation parsing performance.
--------------------------------------------------------------------------------
## 0.19.0
Released 2019/07/08.
### Breaking changes
* Small API changes related to `.debug_loc` and `.debug_loclists`:
added `read::RawLocListEntry::AddressOrOffsetPair` enum variant,
added `write::Sections::debug_loc/debug_loclists` public members,
and replaced `write::AttributeValue::LocationListsRef` with `LocationListRef`.
### Added
* Added `read::Attribute::exprloc_value` and `read::AttributeValue::exprloc_value`.
* Added support for writing `.debug_loc` and `.debug_loclists` sections.
* Added `-G` flag to `dwarfdump` example to display global offsets.
* Added `examples/simple.rs`.
### Fixed
* `write::LineProgram::from` no longer requires `DW_AT_name` or `DW_AT_comp_dir`
attributes to be present in the unit DIE.
--------------------------------------------------------------------------------
## 0.18.0
Released 2019/04/25.
The focus of this release has been on improving support for reading CFI,
and adding support for writing CFI.
### Breaking changes
* For types which have an `Offset` type parameter, the default `Offset`
has changed from `usize` to `R::Offset`.
* Added an `Offset` type parameter to the `read::Unit` type to allow variance.
* Changed the `UninitializedUnwindContext::initialize` method to borrow `self`,
and return `&mut UnwindContext`. Deleted the `InitializedUnwindContext` type.
* Deleted the `UnwindSection` type parameters from the `CommonInformationEntry`,
`FrameDescriptionEntry`, `UninitializedUnwindContext`,
`UnwindContext`, and `UnwindTable` types.
* Changed the signature of the `get_cie` callback parameter for various functions.
The signature now matches the `UnwindSection::cie_from_offset` method, so
that method can be used as the parameter.
* Reduced the number of lifetime parameters for the `UnwindTable` type.
* Updated `fallible-iterator` to version 0.2.0.
* Added a parameter to the `Error::UnexpectedEof` enum variant.
### Added
* Update to 2018 edition.
* Added the `FrameDescriptionEntry::unwind_info_for_address` method.
* Added the `FrameDescriptionEntry::rows` method.
* Added the `EhHdrTable::unwind_info_for_address` method.
* Added the `EhHdrTable::fde_for_address` method and deprecated the
`EhHdrTable::lookup_and_parse` method.
* Added the `EhHdrTable::pointer_to_offset` method.
* Added the `UnwindSection::fde_for_address` method.
* Added the `UnwindSection::fde_from_offset` method.
* Added the `UnwindSection::partial_fde_from_offset` method.
* Added the `Section::id` method.
* Added the `Dwarf::load` method, and corresponding methods for individual sections.
* Added the `Dwarf::borrow` method, and corresponding methods for individual sections.
* Added the `Dwarf::format_error` method.
* Added the `Dwarf::die_ranges` method.
* Added the `Dwarf::unit_ranges` method.
* Added support for writing `.debug_frame` and `.eh_frame` sections.
### Fixed
* The `code_alignment_factor` is now used when evaluating CFI instructions
that advance the location.
* Fixed parsing of pointers encoded with `DW_EH_PE_funcrel`.
* Use the FDE address encoding from the augmentation when parsing `DW_CFA_set_loc`.
* Fixed setting of `.eh_frame` base addresses in dwarfdump.
## 0.17.0
Released 2019/02/21.
The focus of this release has been on improving DWARF 5 support, and
adding support for writing DWARF.
### Breaking changes
* Changed register values to a `Register` type instead of `u8`/`u64`.
* Replaced `BaseAddresses::set_cfi` with `set_eh_frame_hdr` and `set_eh_frame`.
Replaced `BaseAddresses::set_data` with `set_got`.
You should now use the same `BaseAddresses` value for parsing both
`.eh_frame` and `.eh_frame_hdr`.
* Renamed many types and functions related to `.debug_line`.
Renamed `LineNumberProgram` to `LineProgram`.
Renamed `IncompleteLineNumberProgram` to `IncompleteLineProgram`.
Renamed `CompleteLineNumberProgram` to `CompleteLineProgram`.
Renamed `LineNumberProgramHeader` to `LineProgramHeader`.
Renamed `LineNumberRow` to `LineRow`.
Renamed `StateMachine` to `LineRows`.
Renamed `Opcode` to `LineInstruction`.
Renamed `OpcodesIter` to `LineInstructions`.
Renamed `LineNumberSequence` to `LineSequence`.
* Added `Offset` type parameter to `AttributeValue`, `LineProgram`,
`IncompleteLineProgram`, `CompleteLineProgram`, `LineRows`, `LineInstruction`,
and `FileEntry`.
* Changed `FileEntry::path_name`, `FileEntry::directory`, and
`LineProgramHeader::directory` to return an `AttributeValue` instead
of a `Reader`.
* Renamed `FileEntry::last_modification` to `FileEntry::timestamp`
and renamed `FileEntry::length` to `FileEntry::size`.
* Added an `Encoding` type. Changed many functions that previously accepted
`Format`, version or address size parameters to accept an `Encoding`
parameter instead.
Notable changes are `LocationLists::locations`, `RangeLists::ranges`,
and `Expression::evaluation`.
* Changed return type of `LocationLists::new` and `RangeLists::new`.
* Added parameters to `LocationsLists::locations` and `RangeLists::ranges`
to support `.debug_addr`.
* Added more `AttributeValue` variants: `DebugAddrBase`, `DebugAddrIndex`,
`DebugLocListsBase`, `DebugLocListsIndex`, `DebugRngListsBase`, `DebugRngListsIndex`,
`DebugStrOffsetsBase`, `DebugStrOffsetsIndex`, `DebugLineStrRef`.
* Changed `AttributeValue::Data*` attributes to native endian integers instead
of byte arrays.
* Replaced `EvaluationResult::TextBase` with
`EvaluationResult::RequiresRelocatedAddress`. The handling of `TextBase`
was incorrect.
* Added `EvaluationResult::IndexedAddress` for operations that require an
address from `.debug_addr`.
* Added `Reader::read_slice`. Added a default implementation of
`Reader::read_u8_array` which uses this.
### Added
* Added initial support for writing DWARF. This is targeted at supporting
line number information only.
* Added `read` and `write` Cargo features. Both are enabled by default.
* Added support for reading DWARF 5 `.debug_line` and `.debug_line_str` sections.
* Added support for reading DWARF 5 `.debug_str_offsets` sections, including
parsing `DW_FORM_strx*` attributes.
* Added support for reading DWARF 5 `.debug_addr` sections, including parsing
`DW_FORM_addrx*` attributes and evaluating `DW_OP_addrx` and `DW_OP_constx`
operations.
* Added support for reading DWARF 5 indexed addresses and offsets in
`.debug_loclists` and `.debug_rnglists`, including parsing `DW_FORM_rnglistx`
and `DW_FORM_loclistx` attributes.
* Added high level `Dwarf` and `Unit` types. Existing code does not need to
switch to using these types, but doing so will make DWARF 5 support simpler.
* Added `EhFrame::set_address_size` and `DebugFrame::set_address_size` methods
to allow parsing non-native CFI sections. The default address size is still
the native size.
* Added architecture specific definitions for `Register` values and names.
Changed dwarfdump to print them.
* Added support for reading relocatable DWARF sections.
* Added parsing of `DW_FORM_data16`.
### Fixed
* Fixed parsing DWARF 5 ranges with `start == end == 0`.
* Changed `LineRows` to be covariant in its `Reader` type parameter.
* Fixed handling of empty units in dwarfdump.
* Fixed `UnitHeader::length_including_self` for `Dwarf64`.
* Fixed parsing of `DW_CFA_set_loc`.
* Fixed handling of multiple headers in `.debug_loclists` and `.debug_rnglists`.
--------------------------------------------------------------------------------
## 0.16.1
Released 2018/08/28.
### Added
* Added `EhFrameHdr::lookup_and_parse`. [#316][]
* Added support for `DW_CFA_GNU_args_size`. [#319][]
### Fixed
* Implement `Send`/`Sync` for `SubRange`. [#305][]
* Fixed `alloc` support on nightly. [#306][] [#310][]
--------------------------------------------------------------------------------
## 0.16.0
Released 2018/06/01.
### Added
* Added support for building in `#![no_std]` environments, when the `alloc`
crate is available. Disable the "std" feature and enable the "alloc"
feature. [#138][] [#271][]
* Added support for DWARF 5 `.debug_rnglists` and `.debug_loclists`
sections. [#272][]
* Added support for DWARF 5 `DW_FORM_ref_sup` and `DW_FORM_strp_sup` attribute
forms. [#288][]
* Added support for DWARF 5 operations on typed values. [#293][]
* A `dwarf-validate` example program that checks the integrity of the given
DWARF and its references between sections. [#290][]
* Added the `EndianReader<T>` type, an easy way to define a custom `Reader`
implementation with a reference to a generic buffer of bytes and an associated
endianity. [#298][] [#302][]
### Changed
* Various speed improvements for evaluating `.debug_line` line number
programs. [#276][]
* The example `dwarfdump` clone is a [whole lot faster
now][dwarfdump-faster]. [#282][] [#284][] [#285][]
### Deprecated
* `EndianBuf` has been renamed to `EndianSlice`, use that name instead. [#295][]
### Fixed
* Evaluating the `DW_CFA_restore_state` opcode properly maintains the current
location. Previously it would incorrectly restore the old location when
popping from evaluation stack. [#274][]
--------------------------------------------------------------------------------
## 0.15.0
Released 2017/12/01.
### Added
* Added the `EndianBuf::to_string()` method. [#233][]
* Added more robust error handling in our example `dwarfdump` clone. [#234][]
* Added `FrameDescriptionEntry::initial_address` method. [#237][]
* Added `FrameDescriptionEntry::len` method. [#237][]
* Added the `FrameDescriptionEntry::entry_len` method. [#241][]
* Added the `CommonInformationEntry::offset` method. [#241][]
* Added the `CommonInformationEntry::entry_len` method. [#241][]
* Added the `CommonInformationEntry::version` method. [#241][]
* Added the `CommonInformationEntry::augmentation` method. [#241][]
* Added the `CommonInformationEntry::code_alignment_factor` method. [#241][]
* Added the `CommonInformationEntry::data_alignment_factor` method. [#241][]
* Added the `CommonInformationEntry::return_address_register` method. [#241][]
* Added support for printing `.eh_frame` sections to our example `dwarfdump`
clone. [#241][]
* Added support for parsing the `.eh_frame_hdr` section. On Linux, the
`.eh_frame_hdr` section provides a pointer to the already-mapped-in-memory
`.eh_frame` data, so that it doesn't need to be duplicated, and a binary
search table of its entries for faster unwinding information lookups. [#250][]
* Added support for parsing DWARF 5 compilation unit headers. [#257][]
* Added support for DWARF 5's `DW_FORM_implicit_const`. [#257][]
### Changed
* Unwinding methods now give ownership of the unwinding context back to the
caller if errors are encountered, not just on the success path. This allows
recovering from errors in signal-safe code, where constructing a new unwinding
context is not an option because it requires allocation. This is a **breaking
change** affecting `UnwindSection::unwind_info_for_address` and
`UninitializedUnwindContext::initialize`. [#241][]
* `CfaRule` and `RegisterRule` now expose their `DW_OP` expressions as
`Expression`. This is a minor **breaking change**. [#241][]
* The `Error::UnknownVersion` variant now contains the unknown version
number. This is a minor **breaking change**. [#245][]
* `EvaluationResult::RequiresEntryValue` requires an `Expression` instead of a
`Reader` now. This is a minor **breaking change**. [#256][]
--------------------------------------------------------------------------------
## 0.14.0
Released 2017/08/08.
### Added
* All `pub` types now `derive(Hash)`. [#192][]
* All the constants from DWARF 5 are now defined. [#193][]
* Added support for the `DW_OP_GNU_parameter_ref` GNU extension to parsing and
evaluation DWARF opcodes. [#208][]
* Improved LEB128 parsing performance. [#216][]
* Improved `.debug_{aranges,pubnames,pubtypes}` parsing performance. [#218][]
* Added the ability to choose endianity dynamically at run time, rather than
only statically at compile time. [#219][]
### Changed
* The biggest change of this release is that `gimli` no longer requires the
object file's section be fully loaded into memory. This enables using `gimli`
on 32 bit platforms where there often isn't enough contiguous virtual memory
address space to load debugging information into. The default behavior is
still geared for 64 bit platforms, where address space overfloweth, and you
can still load the whole sections of the object file (or the entire object
file) into memory. This is abstracted over with the `gimli::Reader`
trait. This manifests as small (but many) breaking changes to much of the
public API. [#182][]
### Fixed
* The `DW_END_*` constants for defining endianity of a compilation unit were
previously incorrect. [#193][]
* The `DW_OP_addr` opcode is relative to the base address of the `.text` section
of the binary, but we were incorrectly treating it as an absolute value. [#210][]