public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/14] elfutils: DWARF package (.dwp) file support
@ 2023-09-27 18:20 Omar Sandoval
  2023-09-27 18:20 ` [PATCH 01/14] libdw: Make try_split_file static Omar Sandoval
                   ` (16 more replies)
  0 siblings, 17 replies; 38+ messages in thread
From: Omar Sandoval @ 2023-09-27 18:20 UTC (permalink / raw)
  To: elfutils-devel

From: Omar Sandoval <osandov@fb.com>

Hi,

This patch series adds support for DWARF package files to libdw and the
elfutils tools. It supports the GNU DebugFission format for DWARF 4 [1]
and the format standardized in DWARF 5 (section 7.3.5 "DWARF Package
Files"). It supports both automatically opening the .dwp file for a
skeleton unit and examining the .dwp file alone, just like for .dwo
files.

Patch 1 is a trivial cleanup I found while developing this. Patches 2-6
are fixes for unrelated bugs in split DWARF and/or DWARF 5 that I
encountered while adding test cases for this series. I didn't add test
cases explicitly for those fixes because they are covered by the dwp
tests later in the series.

The actual dwp support is in patches 7-10 and 13, including test cases.
Patches 11 and 12 enable testing macro information in dwp files. Patch
14 adds support and tests for an LLVM extension to the dwp format.

More details in the individual commit messages.

Thanks!
Omar

P.S. drgn's dwp branch [2] demonstrates how the new
dwarf_cu_dwp_section_info function will be used. With this patch series,
drgn's test suite passes against a Linux kernel build using .dwp.

1: https://gcc.gnu.org/wiki/DebugFissionDWP
2: https://github.com/osandov/drgn/tree/dwp

Omar Sandoval (14):
  libdw: Make try_split_file static
  libdw: Handle split DWARF in dwarf_entrypc
  libdw: Handle DW_AT_ranges in split DWARF 5 skeleton in dwarf_ranges
  libdw: Handle other string forms in dwarf_macro_param2
  libdw: Fix dwarf_macro_getsrcfiles for DWARF 5
  libdw: Handle split DWARF in dwarf_macro_getsrcfiles
  libdw: Recognize .debug_[ct]u_index sections in dwarf_elf_begin
  libdw: Parse DWARF package file index sections
  libdw, libdwfl: Save original path of ELF file
  libdw: Try .dwp file in __libdw_find_split_unit()
  tests: Handle DW_MACRO_{define,undef}_{strx,sup} in dwarf-getmacros
  tests: Optionally dump all units in dwarf-getmacros
  libdw: Apply DWARF package file section offsets where appropriate
  libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file
    indexes

 libdw/ChangeLog                               |   72 +
 libdw/Makefile.am                             |    2 +-
 libdw/dwarf_begin_elf.c                       |   88 +-
 libdw/dwarf_cu_dwp_section_info.c             |  529 ++++++
 libdw/dwarf_end.c                             |   27 +-
 libdw/dwarf_entrypc.c                         |   12 +-
 libdw/dwarf_error.c                           |    1 +
 libdw/dwarf_getlocation.c                     |    6 +
 libdw/dwarf_getmacros.c                       |   54 +-
 libdw/dwarf_macro_getsrcfiles.c               |    8 +-
 libdw/dwarf_macro_param2.c                    |   21 +-
 libdw/dwarf_ranges.c                          |    4 +-
 libdw/libdw.h                                 |   23 +
 libdw/libdw.map                               |    5 +
 libdw/libdwP.h                                |  112 +-
 libdw/libdw_find_split_unit.c                 |   77 +-
 libdw/libdw_findcu.c                          |    8 +
 libdwfl/ChangeLog                             |    9 +
 libdwfl/dwfl_module.c                         |    2 +-
 libdwfl/dwfl_module_getdwarf.c                |   11 +-
 libdwfl/libdwflP.h                            |    2 +-
 libdwfl/offline.c                             |    4 +-
 tests/.gitignore                              |    1 +
 tests/ChangeLog                               |   36 +
 tests/Makefile.am                             |   15 +-
 tests/cu-dwp-section-info.c                   |   74 +
 tests/dwarf-getmacros.c                       |   55 +-
 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                          |  126 +-
 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 ++
 45 files changed, 3337 insertions(+), 121 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.41.0


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

end of thread, other threads:[~2023-11-07 17:13 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27 18:20 [PATCH 00/14] elfutils: DWARF package (.dwp) file support Omar Sandoval
2023-09-27 18:20 ` [PATCH 01/14] libdw: Make try_split_file static Omar Sandoval
2023-10-03 16:09   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 02/14] libdw: Handle split DWARF in dwarf_entrypc Omar Sandoval
2023-10-03 16:10   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 03/14] libdw: Handle DW_AT_ranges in split DWARF 5 skeleton in dwarf_ranges Omar Sandoval
2023-10-03 16:10   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 04/14] libdw: Handle other string forms in dwarf_macro_param2 Omar Sandoval
2023-10-03 16:11   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 05/14] libdw: Fix dwarf_macro_getsrcfiles for DWARF 5 Omar Sandoval
2023-10-03 21:29   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 06/14] libdw: Handle split DWARF in dwarf_macro_getsrcfiles Omar Sandoval
2023-10-03 21:49   ` Mark Wielaard
2023-09-27 18:20 ` [PATCH 07/14] libdw: Recognize .debug_[ct]u_index sections in dwarf_elf_begin Omar Sandoval
2023-11-01 14:03   ` Mark Wielaard
2023-11-01 17:30     ` Omar Sandoval
2023-09-27 18:20 ` [PATCH 08/14] libdw: Parse DWARF package file index sections Omar Sandoval
2023-11-01 23:07   ` Mark Wielaard
2023-11-07  6:45     ` Omar Sandoval
2023-09-27 18:20 ` [PATCH 09/14] libdw, libdwfl: Save original path of ELF file Omar Sandoval
2023-11-02 17:04   ` Mark Wielaard
2023-11-07  6:46     ` Omar Sandoval
2023-09-27 18:20 ` [PATCH 10/14] libdw: Try .dwp file in __libdw_find_split_unit() Omar Sandoval
2023-11-02 19:56   ` Mark Wielaard
2023-11-07  7:07     ` Omar Sandoval
2023-09-27 18:21 ` [PATCH 11/14] tests: Handle DW_MACRO_{define,undef}_{strx,sup} in dwarf-getmacros Omar Sandoval
2023-11-02 20:30   ` [PATCH 11/14] tests: Handle DW_MACRO_{define, undef}_{strx, sup} " Mark Wielaard
2023-09-27 18:21 ` [PATCH 12/14] tests: Optionally dump all units " Omar Sandoval
2023-11-02 20:39   ` Mark Wielaard
2023-09-27 18:21 ` [PATCH 13/14] libdw: Apply DWARF package file section offsets where appropriate Omar Sandoval
2023-11-02 22:20   ` Mark Wielaard
2023-11-07 16:55     ` Omar Sandoval
2023-09-27 18:21 ` [PATCH 14/14] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes Omar Sandoval
2023-09-27 19:20 ` [PATCH 00/14] elfutils: DWARF package (.dwp) file support Frank Ch. Eigler
2023-09-27 20:17   ` Omar Sandoval
2023-10-03 21:54 ` Mark Wielaard
2023-11-02 23:05 ` Mark Wielaard
2023-11-07 17:13   ` 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).