summaryrefslogtreecommitdiff
path: root/libdw/dwarf.h
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Add DW_AT_GNU_numerator, DW_AT_GNU_denominator and DW_AT_GNU_bias.Mark Wielaard2019-05-161-0/+6
| | | | | | https://sourceware.org/bugzilla/show_bug.cgi?id=24550 Signed-off-by: Mark Wielaard <mark@klomp.org>
* readelf, libdw: Add GNU DebugFission .debug_loc support.Mark Wielaard2018-05-311-0/+10
| | | | | | | | | | 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>
* readelf: Handle .debug_loclists.Mark Wielaard2018-05-291-0/+16
| | | | | | | | | 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>
* readelf: Add .debug_rnglists support.Mark Wielaard2018-05-271-0/+13
| | | | | | | | 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>
* libdw: Add GNU DebugFission attributes, tags, forms and operands.Mark Wielaard2018-05-191-0/+16
| | | | | | Most are handled just like their DWARF5 counterparts. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: Handle DWARF5 line tables in dwarf_getsrclines.Mark Wielaard2018-05-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libdw: Add new DWARF5 Dwarf expression operations.Mark Wielaard2018-03-111-0/+11
| | | | | | | | | | | | | | 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>
* readelf: Add some support for locviews.Mark Wielaard2018-03-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libdw: Recognize new DWARF5 attribute forms.Mark Wielaard2018-02-211-0/+18
| | | | | | | | | | | | | | | 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>
* libdw: Parse new DWARF5 units and CU DIEs.Mark Wielaard2018-02-211-1/+15
| | | | | | | | 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>
* readelf: Handle DW_OP_GNU_variable_value.Mark Wielaard2017-11-101-0/+1
| | | | | | | 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>
* libdw: Add DW_MACRO constants and DW_MACRO_GNU compatibility defines.Mark Wielaard2017-08-021-10/+28
| | | | | | | | | | 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>
* Handle DWARF5 defaulted member function encodings.Mark Wielaard2017-08-021-0/+8
| | | | | | | | | 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>
* libdw: DWARF5 Add DW_CC_pass_by_reference and DW_CC_pass_by_reference.Mark Wielaard2017-08-021-1/+6
| | | | Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: DWARF5 Add new DW_LANG codes and default lower array bound.Mark Wielaard2017-08-021-1/+10
| | | | | | | | | | 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>
* libdw: Add new DWARF5 character encodings.Mark Wielaard2017-08-021-0/+2
| | | | | | | 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>
* libdw: Add new DWARF5 tag constants.Mark Wielaard2017-08-021-3/+14
| | | | | | | | | | 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>
* libdw: Add DWARF5 attributes.Mark Wielaard2017-08-021-8/+59
| | | | | | | | | | | | 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>
* libdw: Correct spelling of DW_LANG_PLI in dwarf.h.Mark Wielaard2016-11-101-2/+4
| | | | | | | | | 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>
* libdw: Add DW_LANG_Haskell.Mark Wielaard2015-08-251-0/+1
| | | | | | | | | 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>
* libdw: Add DWARF5/GCC5 DW_LANG_Fortran03 and DW_LANG_Fortran08 support.Mark Wielaard2015-02-161-0/+2
| | | | | | | | | | | 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>
* libdw: Add support for DWARF5/GCC5 DW_TAG_atomic_type.Mark Wielaard2015-02-161-0/+3
| | | | | | | | | | | 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>
* dwarf.h: Add DW_LANG_C11, DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.Mark Wielaard2014-11-261-0/+4
| | | | | | | | | | | | | | 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>
* dwarf.h: Add DW_AT_noreturn.Mark Wielaard2014-11-261-0/+3
| | | | | | | | | | | 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>
* dwarf.h: Add DW_AT_GNU_deleted.Mark Wielaard2014-10-051-0/+1
| | | | | | | | | 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>
* dwarf.h: Remove non-existing DW_TAG_mutable_type.Mark Wielaard2014-06-221-2/+2
| | | | | | | | | | | | | | | 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>
* Rewrite DWARF string functions using known-dwarf macros.Mark Wielaard2012-08-171-2/+2
| | | | | | | | 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>
* libdw: Add support for DWZ multifile forms DW_FORM_GNU_ref_alt/strp_alt.Mark Wielaard2012-08-091-1/+4
| | | | | | | | | | | | | | | 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>
* Add DW_OP_GNU_parameter_ref to dwarf.h and handle it in readelf.Mark Wielaard2012-07-261-0/+1
| | | | | | | 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>
* Correct spelling of DW_LANG_ObjC in dwarf.h.Mark Wielaard2012-07-261-1/+1
| | | | | | Fix usage in dwarf_aggregate_size. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add DWARF4 DW_ATE_UTF.Mark Wielaard2012-07-261-0/+1
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* dwarf.h: Add DW_MACRO_GNU .debug_macro type encodings.Mark Wielaard2012-06-271-0/+15
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Add low-level support for .debug_macro.Mark Wielaard2012-06-271-0/+1
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Update name, license and contributor policy.Mark Wielaard2012-06-051-40/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add DW_OP_GNU_const_type/regval_type/deref_type/convert/reinterpret.Jakub Jelinek2011-05-171-1/+6
|
* Add support for call_site and entry_value to dwarf.h and readelf.Mark Wielaard2011-03-231-0/+11
| | | | | | | | | | 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.
* DWARF people changed their mind about the value.Roland McGrath2010-10-141-1/+1
|
* dwarf.h: Add DW_LANG_Go.Roland McGrath2010-10-131-0/+1
|
* Handle DW_OP_GNU_implicit_pointer.Roland McGrath2010-08-301-0/+1
|
* Add some missing DWARF constants and readelf support for them.Roland McGrath2010-06-221-0/+7
|
* dwarf.h: Fix DW_LANG_Python constant.Mark Wielaard2010-05-311-1/+1
|
* Add more DWARF4 constants.Roland McGrath2010-05-271-0/+8
|
* Add some more DW_AT_GNU_* types from gcc.Roland McGrath2010-01-051-0/+8
|
* Add DWARF attributes DW_AT_GNU_vector and DW_AT_GNU_template_name.Roland McGrath2010-01-051-1/+7
|
* Add constants from DWARF 4 working draft 3.Roland McGrath2009-07-161-1/+13
|
* Fix 32/64 CIE header format CIE_id matching.Roland McGrath2009-04-151-1/+2
|
* Add DW_CFA_GNU_negative_offset_extended.Roland McGrath2009-04-011-0/+1
|
* dwarf.h: Add DW_OP_GNU_encoded_addr.Roland McGrath2009-01-221-0/+1
|
* Merge commit 'origin/master' into roland/known-dwarfRoland McGrath2009-01-171-0/+4
|\ | | | | | | | | Conflicts: libdw/ChangeLog
| * Add DW_OP_GNU_* constants.Roland McGrath2009-01-171-1/+5
| |