| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=24550
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
| |
GNU DebugFission .debug_loc location lists uses the .debug_loc section
in the split dwarf .dwo file. The encoding is a mix of old style DWARF
.debug_loc and new style .debug_loclists.
Add two testcases for the readelf and libdw decoders.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
The new DWARF5 .debug_loclists sections are like .debug_rnglists, but
plus locations. For Split Dwarf GCC generates the .debug_loclists fully
in the split .dwo file. Any references to addresses need to be resolved
through the skeleton .debug_addr section.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
Parse the .debug_rnglists section for DWARF5 --debug-dump=ranges.
Add testcase to show both "normal" and "split" DWARF variants are
handled for DWARF4 and DWARF5.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
| |
Most are handled just like their DWARF5 counterparts.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In DWARF5 the actual line number table format doesn't change, except for
not allowing DW_LNE_define_file (but we still just accept it). The
changes are the header having new fields for address and segment
selector sizes, and new formats for the directory and file names tables.
The directory and file name tables are much more flexible in DWARF5, but
we only interpret the actual names and file/dir index relationships,
skipping/ignoring any other information. There also is no new interface
yet to get at the new directory and file properties.
There is some small confusion about the file name table indexing. Older
DWARF versions explicitly called the first file name table 1. DWARF5
implies the first index is 0 (but for file attributes, zero means not
associated with a file). We get away with that by having an actual zero
index for older DWARF versions (the null_fill). It looks like gcc gets
around it by explicitly duplicating the first (0) and second (1) file
name entry in the table. This can also be seen in the new testcase.
The patch looks big because of moving a few initializations around
and because the code that is different for older/newer DWARF got moved
under if statements. But the original old DWARF code path didn't really
change.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DW_OP_implicit_pointer, DW_OP_entry_value, DW_OP_const_type,
DW_OP_regval_type, DW_OP_deref_type, DW_OP_xderef_type,
DW_OP_convert and OP_reinterpret are implemented like their
pre-DWARF5 GNU variants.
DW_OP_xderef_type is implemented as a (non-CU relative) variant of
DW_OP_deref_type.
DW_OP_addrx and DW_OP_constx are recognized but not interpreted yet.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds minimal support for locviews as output by GCC8.
It changes readelf to keep track of loclistptrs from DW_AT_GNU_locviews
and prints the locview pairs for those. Since there is no terminator
we have to keep track of where the next loclist entry starts.
The --debug-dump=loc output looks as follows:
CU [ 714] base: +0x0000000000003020 <elf_hash>
[ b4] view pair 1, 2
[ b6] range 4, 7f
+0x0000000000003024 <elf_hash+0x4>..
+0x000000000000309e <elf_hash+0x7e>
[ 0] reg5
[ d9] view pair 3, 1
view pair 1, 2
[ dd] range 4, 4c
+0x0000000000003024 <elf_hash+0x4>..
+0x000000000000306b <elf_hash+0x4b>
[ 0] reg5
range 4c, 7f
+0x000000000000306c <elf_hash+0x4c>..
+0x000000000000309e <elf_hash+0x7e>
[ 0] reg2
Note that in the above output the view pairs correspond to the ranges
immediately following in the loc list. This is how GCC8 currently
outputs the locview pairs and ranges, but this is not guaranteed and
you'll need to look at the location and GNU_locviews attributes of the
DIE to know which really match up together. We might want to adjust the
output to make this more clear.
This does not yet add an locview accessor to libdw. It just recognizes
the DW_AT_GNU_locviews attribute as a loclistptr when encoded as a
sec_offset form.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This just makes sure we know how the new forms are encoded.
It doesn't yet handle them in the dwarf_form* functions.
But it does make it possible to skip them when reading DWARF5.
DW_FORM_implicit_const has zero size (the value is in the abbrev,
not in the info). DW_FORM_addrx[1234], DW_FORM_strx[1234],
DW_FORM_ref_sup[48] and DW_FORM_data16 have constant size.
DW_FORM_strp_sup and DW_FORM_line_strp are offset size.
DW_FORM_addrx, DW_FORM_strx, DW_FORM_loclistx and DW_FORM_rnglistx
encode a uleb128.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
Parse DWARF5 units, add the unit_type to the Dwarf_CU and generalize some
code calculating the header length and getting at the first DIE of a unit.
Unit headers can have different sizes depending on the unit type.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
| |
Also format both DW_OP_call_ref and DW_OP_GNU_variable_value argument
as a normal DIE reference.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
| |
Accept version 5 .debug_macro format, which is identical to the GNU
version 4 format. No real support yet for the new supplementary object
file (sup) and indirect string references (strx). GCC doesn't generate
them yet. readelf does recognize them, but doesn't try to decode them.
dwarf_getmacros currently rejects the new formats.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
Add DW_DEFAULTED_no, DW_DEFAULTED_in_class and DW_DEFAULTED_out_of_class
to dwarf.h.
Print value (no, in_class or out_of_class) of DW_AT_defaulted in readelf.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
| |
Add DW_LANG_OpenCL, DW_LANG_Modula3, DW_LANG_C_plus_plus_03,
DW_LANG_OCaml, DW_LANG_Rust, DW_LANG_Swift, DW_LANG_Julia,
DW_LANG_Dylan, DW_LANG_RenderScript and DW_LANG_BLISS to dwarf.h.
Update default language array lower bounds in dwarf_aggregate_size.c.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
| |
Add DW_ATE_UCS and DW_ATE_ASCII for Fortran 2003 string kinds ASCII
(ISO/IEC 646:1991) and ISO_10646 (UCS-4 in ISO/IEC 10646:2000).
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
| |
Add DW_TAG_coarray_type, DW_TAG_generic_subrange, DW_TAG_dynamic_type,
DW_TAG_call_site, DW_TAG_call_site_parameter, DW_TAG_skeleton_unit,
DW_TAG_immutable_type.
Just the constants, no further interpretion yet.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new DWARF5 attribute constant names to the attributes enum.
Also add reserved comments between non-consecutive (reserved) numbers.
Remove DW_AT_subscr_data, DW_AT_element_list and DW_AT_member from the
enum list and turn them into compatibility defines because they are
not part of DWARF2+. That way code that directly references them still
compiles but they won't show up in known-dwarf.h.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
The name used in the standard and other DWARF implementations for
Programming Language One, PL/I, is DW_LANG_PLI (not DW_LANG_PL1).
Fix usage in dwarf_aggregate_size.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
See http://www.dwarfstd.org/ShowIssue.php?issue=120218.1
GHC emits this language code (0x18).
Also updated https://fedorahosted.org/elfutils/wiki/DwarfExtensions
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
GCC5 adds support for the new Fortran 2003 and 2008 standard DWARF5
language codes. Add them to dwarf.h and handle them in dwarf_aggregate_size.
http://dwarfstd.org/ShowIssue.php?issue=141121.1
Also documented at https://fedorahosted.org/elfutils/wiki/DwarfExtensions
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
GCC5 adds support for the new C11 _Atomic DWARF5 DW_TAG_atomic_type
qualifier. Add it to dwarf.h and handle it in dwarf_peel_type.
http://dwarfstd.org/ShowIssue.php?issue=131112.1
Also documented at https://fedorahosted.org/elfutils/wiki/DwarfExtensions
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following patch is needed to recognize the new DW_LANG constants
that GCC 5 might emit as implemented by this GCC patch:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02852.html
Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions
GCC 5 can emit these new DWARFv5 draft language constants. Handle them in
dwarf_aggregate_size and dwarf_getfuncs. Also handle DW_LANG_Go in
dwarf_aggregate_size (lower bound for array is zero for Go).
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
DW_AT_noreturn is added by GCC5 for functions that don't return to their
caller. It is set on a DW_TAG_subprogram for the traditional GNU noreturn
attribute, the C11 _Noreturn keyword or C++11 [[noreturn]] attribute. It
is a new DWARF5 extension. This is a constant only addition to dwarf.h.
No other part of elfutils currently depends on this attribute.
Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
DW_AT_GNU_deleted is added by G++ for C++11 deleted special member
functions (= delete;). This is a constant only addition to dwarf.h.
No other part of elfutils currently depends on this attribute.
Also added to https://fedorahosted.org/elfutils/wiki/DwarfExtensions
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DW_TAG_mutable_type was only mentioned in an early draft of DWARFv3.
But was removed because there are no C++ mutable qualified types. It was
replaced by a new attribute DW_AT_mutable on DW_TAG_member DIEs. The new
attribute is available in dwarf.h.
http://dwarfstd.org/ShowIssue.php?issue=050223.1
DW_TAG_mutable_type was only used internally in some backends (which
just ignored it anyway). dwarves did use it to turn it into a string
value, libabigail used it and ignored it (patches to remove sent).
GCC, GDB and binutils don't use nor define it.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
readelf and tests were using hard coded string tables to produce DWARF
string constants. Use the known-dwarf macros to redefine these and
reduce code. Technique comes from dwarf branch dwarfstrings.c.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DWZ multifile forms http://www.dwarfstd.org/ShowIssue.php?issue=120604.1
DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt reference an alternative
debuginfo file. dwarf_begin and dwarf_begin_elf will try to use this
automatically. There are no user visible changes to the libdw interface.
dwarf_formref_die, dwarf_formstring and dwarf_formudata can now return
a Dwarf_Die which comes from a CU in the alternative Dwarf descriptor.
__libdw_read_offset was adjusted to take an alternative Dwarf descriptor
into account.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
DW_OP_GNU_parameter_ref takes as operand a 4 byte CU relative reference
to the abstract optimized away DW_TAG_formal_parameter.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
| |
Fix usage in dwarf_aggregate_size.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
top-level:
- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.
backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:
- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.
config:
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
src, tests:
- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.
Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
New tags DW_TAG_GNU_call_site and DW_TAG_GNU_call_site_parameter.
New attributes DW_AT_GNU_call_site_value,
DW_AT_GNU_call_site_data_value, DW_AT_GNU_call_site_target,
DW_AT_GNU_call_site_target_clobbered, DW_AT_GNU_tail_call,
DW_AT_GNU_all_tail_call_sites, DW_AT_GNU_all_call_sites,
and DW_AT_GNU_all_source_call_sites.
New operation DW_OP_GNU_entry_value.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
libdw/ChangeLog
|
| | |
|