https://sourceware.org/bugzilla/show_bug.cgi?id=28573
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
commit 6facc8c4f2265fb531a115f6aac928e96454e8cc
Author: Mark Wielaard <[email protected]>
Date: Wed Jul 29 09:54:30 2026 +0200
libdw: Add Dwarf_Type (plain, dwo, gnu_lto) support for dwarf_begin
This introduces three new libdw functions dwarf_begin_type,
dwarf_begin_elf_type and dwarf_type.
When a file contained multiple types of DWARF, plain DWARF, DWO or
GNU_LTO, dwarf_begin and dwarf_begin_elf would use the plain DWARF
when available, otherwise use the DWO sections and finally the GNU_LTO
sections to construct a Dwarf handle. This meant that if a file
contained multiple types you would only be able to get one. And you
couldn't explicitly say you only wanted a Dwarf handle for a specific
type. Also you had no clear way of determining which type of Dwarf
handle you got.
The new dwarf_begin_type and dwarf_begin_elf_type allow explicitly
specifying a specific type of DWARF you want. And the dwarf_type
function will return the actual type of DWARF you got.
* libdw/libdw.h (Dwarf_Type): New enum.
(dwarf_begin_type): New function declaration.
(dwarf_begin_elf_type): Likewise.
(dwarf_get_type): Likewise.
* libdw/libdw.map (ELFUTILS_0.196): New section with new
function symbols based on ELFUTILS_0.194_EXPERIMENTAL.
* libdw/libdwP.h (enum dwarf_type): Removed.
(struct Dwarf): Make Dwarf_Type type.
(INTDECL): dwarf_begin_elf_type, dwarf_begin_type,
dwarf_get_type.
* libdw/dwarf_begin.c (dwarf_begin): Rename to and make a
wrapper around...
(dwarf_begin_type): ... this new function.
* libdw/dwarf_begin_elf.c (scn_dwarf_type): Return a
Dwarf_Type.
(check_section): Use Dwarf_Type instead of enum dwarf_type.
(global_read): Add requested_type argument. Split in
DWARF_T_AUTO case and specific type case.
(scngrp_read): Likewise.
(dwarf_begin_elf): Rename to and make a wrapper around..,
(dwarf_begin_elf_type): ... this new function.
(dwarf_get_type): New function.
* tests/Makefile.am (check_PROGRAMS): Add dwarf-type.
(TESTS): Add run-dwarf-type.sh.
(EXTRA_DIST): Likewise.
(dwarf_type_LDADD): New.
* tests/dwarf-type.c: New test.
* tests/run-dwarf-type.sh: New test wrapper.
https://sourceware.org/bugzilla/show_bug.cgi?id=28573
Signed-off-by: Mark Wielaard <[email protected]>
--
You are receiving this mail because:
You are on the CC list for the bug.