public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] elfutils: DWARF package (.dwp) file support
@ 2023-12-06  9:22 Omar Sandoval
  2023-12-06  9:22 ` [PATCH v2 1/4] libdw: Parse DWARF package file index sections Omar Sandoval
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Omar Sandoval @ 2023-12-06  9:22 UTC (permalink / raw)
  To: elfutils-devel

From: Omar Sandoval <osandov@fb.com>

Hi,

This is version 2 of my patch series adding support for DWARF package
files to libdw and the elfutils tools. Version 1 is here [1].

Patches 1-3 add the main implementation and tests for dwp files.

Most of this support is internal to libdw, but patch 1 adds a new public
function, dwarf_cu_dwp_section_info. drgn's dwp branch [2] demonstrates
how that function will be used. Also see [3] for more context on why
drgn needs this.

Patch 4 adds support and tests for an LLVM extension to the dwp format.
The "extension" is ugly because of an oversight in the design of the
format that LLVM had to make the best of, but unfortunately it's
necessary for a lot of our use cases.

With this patch series, drgn's test suite passes against a Linux kernel
build using .dwp.

Changes from v1:

* Rebased on main and dropped patches that were already merged.
* Moved ChangeLog entries to commit messages.
* Updated version in libdw.map to 0.191.
* Moved DW_SECT_TYPES definition to dwarf.h.
* Added copyright years.
* Added error handling for dwarf_cu_dwp_section_info calls in
  str_offsets_base_off, __libdw_cu_ranges_base, and __libdw_cu_locs_base
* Changed memset initialization of index->sections to an explicit
  loop.
* Added comment explaining __libdw_link_skel_split change.

There were a couple of things that were mentioned in review that I
didn't change:

* I kept dwarf_cu_dwp_section_info in patch 1 instead of separating it
  into its own patch so that I could test the dwp index implementation
  in the same commit that I introduced it in.
* I didn't make try_dwp_file return an error since try_split_file that
  it's based on doesn't either.

Thanks!
Omar

1: https://sourceware.org/pipermail/elfutils-devel/2023q3/006410.html
2: https://github.com/osandov/drgn/tree/dwp
3: https://sourceware.org/pipermail/elfutils-devel/2023q4/006630.html

Omar Sandoval (4):
  libdw: Parse DWARF package file index sections
  libdw: Try .dwp file in __libdw_find_split_unit()
  libdw: Apply DWARF package file section offsets where appropriate
  libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file
    indexes

 libdw/Makefile.am                             |    2 +-
 libdw/dwarf.h                                 |    2 +-
 libdw/dwarf_begin_elf.c                       |    1 +
 libdw/dwarf_cu_dwp_section_info.c             |  531 +++++++
 libdw/dwarf_end.c                             |   24 +-
 libdw/dwarf_error.c                           |    1 +
 libdw/dwarf_getlocation.c                     |    6 +
 libdw/dwarf_getmacros.c                       |   26 +-
 libdw/libdw.h                                 |   23 +
 libdw/libdw.map                               |    5 +
 libdw/libdwP.h                                |  101 +-
 libdw/libdw_find_split_unit.c                 |   75 +-
 libdw/libdw_findcu.c                          |    8 +
 tests/.gitignore                              |    1 +
 tests/Makefile.am                             |   15 +-
 tests/cu-dwp-section-info.c                   |   73 +
 tests/run-all-dwarf-ranges.sh                 |  114 ++
 tests/run-cu-dwp-section-info.sh              |  168 ++
 tests/run-dwarf-getmacros.sh                  | 1412 +++++++++++++++++
 tests/run-get-units-split.sh                  |   18 +
 tests/run-large-elf-file.sh                   |  174 ++
 tests/run-varlocs.sh                          |  112 ++
 tests/testfile-dwp-4-cu-index-overflow.bz2    |  Bin 0 -> 4490 bytes
 .../testfile-dwp-4-cu-index-overflow.dwp.bz2  |  Bin 0 -> 5584 bytes
 tests/testfile-dwp-4-strict.bz2               |  Bin 0 -> 4169 bytes
 tests/testfile-dwp-4-strict.dwp.bz2           |  Bin 0 -> 6871 bytes
 tests/testfile-dwp-4.bz2                      |  Bin 0 -> 4194 bytes
 tests/testfile-dwp-4.dwp.bz2                  |  Bin 0 -> 10098 bytes
 tests/testfile-dwp-5-cu-index-overflow.bz2    |  Bin 0 -> 4544 bytes
 .../testfile-dwp-5-cu-index-overflow.dwp.bz2  |  Bin 0 -> 5790 bytes
 tests/testfile-dwp-5.bz2                      |  Bin 0 -> 4223 bytes
 tests/testfile-dwp-5.dwp.bz2                  |  Bin 0 -> 10313 bytes
 tests/testfile-dwp-cu-index-overflow.source   |   86 +
 tests/testfile-dwp.source                     |  102 ++
 34 files changed, 3051 insertions(+), 29 deletions(-)
 create mode 100644 libdw/dwarf_cu_dwp_section_info.c
 create mode 100644 tests/cu-dwp-section-info.c
 create mode 100755 tests/run-cu-dwp-section-info.sh
 create mode 100755 tests/testfile-dwp-4-cu-index-overflow.bz2
 create mode 100644 tests/testfile-dwp-4-cu-index-overflow.dwp.bz2
 create mode 100755 tests/testfile-dwp-4-strict.bz2
 create mode 100644 tests/testfile-dwp-4-strict.dwp.bz2
 create mode 100755 tests/testfile-dwp-4.bz2
 create mode 100644 tests/testfile-dwp-4.dwp.bz2
 create mode 100755 tests/testfile-dwp-5-cu-index-overflow.bz2
 create mode 100644 tests/testfile-dwp-5-cu-index-overflow.dwp.bz2
 create mode 100755 tests/testfile-dwp-5.bz2
 create mode 100644 tests/testfile-dwp-5.dwp.bz2
 create mode 100644 tests/testfile-dwp-cu-index-overflow.source
 create mode 100644 tests/testfile-dwp.source

-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-02-26 19:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06  9:22 [PATCH v2 0/4] elfutils: DWARF package (.dwp) file support Omar Sandoval
2023-12-06  9:22 ` [PATCH v2 1/4] libdw: Parse DWARF package file index sections Omar Sandoval
2024-02-15 17:40   ` Mark Wielaard
2023-12-06  9:22 ` [PATCH v2 2/4] libdw: Try .dwp file in __libdw_find_split_unit() Omar Sandoval
2024-02-15 23:17   ` Mark Wielaard
2023-12-06  9:22 ` [PATCH v2 3/4] libdw: Apply DWARF package file section offsets where appropriate Omar Sandoval
2024-02-16 15:00   ` Mark Wielaard
2024-02-23  0:53     ` Omar Sandoval
2024-02-23  1:03       ` Omar Sandoval
2024-02-24 14:00         ` Mark Wielaard
2024-02-26 19:31           ` Omar Sandoval
2024-02-24 13:30       ` Mark Wielaard
2023-12-06  9:22 ` [PATCH v2 4/4] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes Omar Sandoval
2024-01-04  0:53 ` [PATCH v2 0/4] elfutils: DWARF package (.dwp) file support Omar Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).