[DynInst_API:] [dyninst/dyninst] 9d15c0: Update DwarfWalker subrange handling (#1369)


Date: Mon, 27 Feb 2023 10:39:30 -0800
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 9d15c0: Update DwarfWalker subrange handling (#1369)
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 9d15c0f714397a1316c74fc8d2c24a62a772ecc3
      https://github.com/dyninst/dyninst/commit/9d15c0f714397a1316c74fc8d2c24a62a772ecc3
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M dwarf/CMakeLists.txt
    A dwarf/src/dwarf_subrange.cpp
    A dwarf/src/dwarf_subrange.h
    M symtabAPI/src/dwarfWalker.C
    M symtabAPI/src/dwarfWalker.h

  Log Message:
  -----------
  Update DwarfWalker subrange handling (#1369)

* Remove redundant include of libdw.h

* Add subrange parsing to dynDwarf

* Remove decipherBound

This implementation was neither correct nor complete. Moreover, we
shouldn't be parsing FORM types. Looking for DW_TAG* is sufficient.

* Remove legacy comments and commented-out code from parseArray

* Improve error message in parseArray

* Rename parseSubrangeAUX to parseSubrange and change interface

* Replace bound calculations in parseSubrange

* Update some comments and whitespace

* Update construction of the result type

The LONG_MIN/MAX aren't great, but they are propagated to preserve
behavior.

* Update debugging messages in parseSubrange

* Have parseSubrange() call parseSubrange(Dwarf_Die*)

* Use updated parseSubrange in parseMultidimensionalArray

* Use std::tostring instead of snprintf

* Update comments and remove dead code

* Whitespace

* parseMDA returns a typeArray instead of just a Type

* Fix bug in dwarf_result::operator bool

* Fix hi/low bound mixup in parseMDA

* Try using Dyninst's parsed CU language, if needed

* Display subrange DIE ID in pareSubrange

* Don't create subrange type in parseSubrange

This will happen in the callee

* Update parseSubrange() to use new parseSubrange(Dwarf_DIE*)

* More carefully parse the child DIE

* Iteratively parse the subranges in parseArray

* Whitespace

* Remove parseMultiDimensionalArray

* Improve debug messages

* Register each subrange type in parseArray

* Remove common/h/dyninstversion.h

This was accidentally included.

* Add copyright notices to new files

* Make dwarf_result also hold a Dwarf_Word

C++ doesn't guarantee it is convertible to `long`.

* Only offer an interface to parse both bounds simultaneously

The calculation for a range's upper bound when DW_AT_count is used
requires knowing the lower bound (if given), so these needed to be
merged.

* Use new dwarf_subrange interface in DwarfWalker::parseSubrange


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] 9d15c0: Update DwarfWalker subrange handling (#1369), Tim Haines <=