Re: [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.

2017-10-26 Thread Mark Wielaard
On Tue, 2017-10-24 at 14:35 +0200, Mark Wielaard wrote: > The GCC8 -Wpacked-not-aligned warns if a structure field with explicit > padding in a packed structure will be misaligned. m68k prstatus core > notes are described by a packed structure which has such aligned structure > fields.

Re: [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.

2017-10-30 Thread Mark Wielaard
On Thu, 2017-10-26 at 16:28 +0200, Mark Wielaard wrote: > The GCC8 -Wpacked-not-aligned warns if a structure field with > explicit padding in a packed structure will be misaligned. m68k > prstatus core notes are described by a packed structure which has > such aligned structure fiel

[PATCH] config: files under /usr/lib/sysctl.d (_sysctldir) aren't %config.

2017-11-02 Thread Mark Wielaard
Admin can place the real config file under /etc/sysctl.d as override. https://bugzilla.redhat.com/show_bug.cgi?id=1506660 Signed-off-by: Mark Wielaard --- config/ChangeLog| 5 + config/elfutils.spec.in | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config

[PATCH 2/3] libdw: Update acceptable forms and attributes for dwarf_getlocation.

2017-11-04 Thread Mark Wielaard
be a reference to diffent kinds of sections (based on attribute). Update the attribute list based on the latest DWARF5 encodings table. Note that DW_AT_call_origin wasn't added because that seems to be a typo in the DWARF5 spec. http://dwarfstd.org/ShowIssue.php?issue=171103.1 Signed-off-by:

[PATCH 3/3] libdw: Handle DW_OP_GNU_variable_value.

2017-11-04 Thread Mark Wielaard
with expressions or location lists (the original varlocs test only prints out variables and arguments of function DIEs). Signed-off-by: Mark Wielaard --- libdw/ChangeLog| 7 ++ libdw/dwarf_getlocation.c | 1 + libdw/dwarf_getlocation_attr.c | 1 + libdw

[PATCH 1/3] readelf: Handle DW_OP_GNU_variable_value.

2017-11-04 Thread Mark Wielaard
Also format both DW_OP_call_ref and DW_OP_GNU_variable_value argument as a normal DIE reference. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 libdw/dwarf.h | 1 + src/ChangeLog | 5 + src/readelf.c | 5 +++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git

[PATCH] DwarfExtensions: Document DW_OP_GNU_variable_value.

2017-11-04 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- DwarfExtensions | 1 + 1 file changed, 1 insertion(+) diff --git a/DwarfExtensions b/DwarfExtensions index ba5ab41..9a2b844 100644 --- a/DwarfExtensions +++ b/DwarfExtensions @@ -106,6 +106,7 @@ DW_OP_GNU_parameter_ref 0xfa http://gcc.gnu.org/ml/gcc-patches

[PATCH] config: Rely on systemd_requires for sysctl_apply default-yama-scope.

2017-11-08 Thread Mark Wielaard
. Signed-off-by: Mark Wielaard --- config/ChangeLog| 5 + config/elfutils.spec.in | 7 +++ 2 files changed, 12 insertions(+) diff --git a/config/ChangeLog b/config/ChangeLog index ae40cc0..83263bd 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2017-11

Re: [PATCH] config: files under /usr/lib/sysctl.d (_sysctldir) aren't %config.

2017-11-10 Thread Mark Wielaard
On Thu, 2017-11-02 at 16:53 +0100, Mark Wielaard wrote: > Admin can place the real config file under /etc/sysctl.d as override. > https://bugzilla.redhat.com/show_bug.cgi?id=1506660 Pushed to master.

Re: [PATCH 1/3] readelf: Handle DW_OP_GNU_variable_value.

2017-11-10 Thread Mark Wielaard
On Sun, 2017-11-05 at 00:31 +0100, Mark Wielaard wrote: > Also format both DW_OP_call_ref and DW_OP_GNU_variable_value argument > as a normal DIE reference. Pushed to master.

Re: [PATCH 2/3] libdw: Update acceptable forms and attributes for dwarf_getlocation.

2017-11-10 Thread Mark Wielaard
On Sun, 2017-11-05 at 00:31 +0100, Mark Wielaard wrote: > dwarf_getlocation has to know which attributes can contain a DWARF > expression or location list because the form alone might be ambiguous. > > Since DWARF4 there is DW_FORM_exprloc so always accept that. But for older > DW

Re: [PATCH 3/3] libdw: Handle DW_OP_GNU_variable_value.

2017-11-10 Thread Mark Wielaard
On Sun, 2017-11-05 at 00:31 +0100, Mark Wielaard wrote: > Handle DW_OP_GNU_variable_value in dwarf_getlocation[_attr,_die]. > DW_OP_GNU_variable_value takes one argument a DIE reference that > describes a value given by a location of const_value attribute. > > To test handling of

[PATCH] tests: Add varlocs-self and exprlocs-self tests.

2017-11-10 Thread Mark Wielaard
Make sure the testcases (library functions they use) don't crash, triggers self-check/asserts or leaks memory under valgrind. This also helps making sure newer DWARF constructs are handled (when building with -gdwarf-5). Signed-off-by: Mark Wielaard --- tests/ChangeLog

Re: [PATCH] tests: Add varlocs-self and exprlocs-self tests.

2017-11-15 Thread Mark Wielaard
On Fri, 2017-11-10 at 17:12 +0100, Mark Wielaard wrote: > Make sure the testcases (library functions they use) don't crash, > triggers self-check/asserts or leaks memory under valgrind. This > also helps making sure newer DWARF constructs are handled (when > building with -gdw

Re: [PATCH] tests: Add varlocs-self and exprlocs-self tests.

2017-11-16 Thread Mark Wielaard
On Wed, 2017-11-15 at 21:01 +0100, Mark Wielaard wrote: > On Fri, 2017-11-10 at 17:12 +0100, Mark Wielaard wrote: > > Make sure the testcases (library functions they use) don't crash, > > triggers self-check/asserts or leaks memory under valgrind. This > > also hel

Re: [PATCH] Add replacement endian.h and byteswap.h to libgnu

2017-11-16 Thread Mark Wielaard
an having to maintain our own versions. Cheers, Mark

Re: [PATCH] readelf: Print DIE offset in attribute reading error messages.

2017-11-16 Thread Mark Wielaard
On Tue, 2017-10-03 at 16:59 +0200, Mark Wielaard wrote: > When processing large files it is useful to know the DIE offset if > printing of attributes fails (especially when redirecting the output). > With this change the error message looks like: > >   eu-readelf: DIE [2aeb8

[PATCH] libdwfl: Don't dereference possibly unaligned auxv entry pointer from core.

2017-11-20 Thread Mark Wielaard
not use an array of auxv entries trick. This makes make distcheck (which enables sanitize-undefined by default) pass again using GCC8. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 12 libdwfl/link_map.c | 38 +++--- 2 files changed, 31

Re: [PATCH] readelf: Print DIE offset in attribute reading error messages.

2017-11-21 Thread Mark Wielaard
On Thu, 2017-11-16 at 15:31 +0100, Mark Wielaard wrote: > On Tue, 2017-10-03 at 16:59 +0200, Mark Wielaard wrote: > > When processing large files it is useful to know the DIE offset if > > printing of attributes fails (especially when redirecting the output). > > With this cha

Re: [PATCH] readelf: Print DIE offset in attribute reading error messages.

2017-11-22 Thread Mark Wielaard
On Tue, 2017-11-21 at 12:19 -0700, Tom Tromey wrote: > > > > > > "Mark" == Mark Wielaard writes: > > Mark> This has been really useful to debug some DWARF format issues, but it > Mark> could be even more useful. Since we know the attribute name and

Re: [PATCH] readelf: Print DIE offset in attribute reading error messages.

2017-11-22 Thread Mark Wielaard
On Tue, 2017-11-21 at 11:21 +0100, Mark Wielaard wrote: > On Thu, 2017-11-16 at 15:31 +0100, Mark Wielaard wrote: > > On Tue, 2017-10-03 at 16:59 +0200, Mark Wielaard wrote: > > > When processing large files it is useful to know the DIE offset if > > > printing of attrib

Re: [PATCH] readelf: Print DIE offset in attribute reading error messages.

2017-11-24 Thread Mark Wielaard
On Thu, 2017-11-23 at 09:39 +0100, Dodji Seketeli wrote: > Indeed, thank you or doing this.  I wish I had these facilities sooner > when I was tracking the cause of my issues.  So no doubt this work is > going to be useful. Thanks. I pushed my second variant to master now. Cheers, Mark

Re: [PATCH] libdwfl: Don't dereference possibly unaligned auxv entry pointer from core.

2017-11-24 Thread Mark Wielaard
On Mon, 2017-11-20 at 14:15 +0100, Mark Wielaard wrote: > The notes in a core file that contain the auxv entries might not be > naturally aligned. The code already tried to account for that, but > the GCC 8 undefined behaviour sanitizer found we were till dereferencing > the actua

[PATCH 4/5] readelf: Print CU, base address and unresolved .debug_range entries.

2017-11-29 Thread Mark Wielaard
Also adjust the formatting for the resolved addresses to print them on separate lines so they nicely line up even when the addresses are resolved to symbol+offset names. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 47

[PATCH 3/5] readelf: Print actual file for decl_file and call_file attributes.

2017-11-29 Thread Mark Wielaard
if you are just looking at the DIE tree. Otherwise you'll have to cross match the number by hand with the corresponding line table entry. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 22 ++ tests/Chan

[PATCH 1/5] readelf: Adjust print_ops formatting.

2017-11-29 Thread Mark Wielaard
Use only 2 spaces for index (there are never 1, the most seen in the wild is 64). Adjust re-indenting after GNU_entry_value. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 src/readelf.c | 58 - tests

[PATCH 2/5] readelf: Print abbrev code for DIE with --debug-dump=info.

2017-11-29 Thread Mark Wielaard
If there is anything wrong with a DIE it is useful to know what the abbrev code was so you can lookup the abbrev description. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 +++ src/readelf.c | 9 --- tests/ChangeLog | 5 tests

Various eu-readelf --debug-dump improvements

2017-11-29 Thread Mark Wielaard
While working on the DWARF5 support I found various cases where the eu-readelf --debug-dump could be improved to provide a bit more information that helped debug issues. The following changes are not DWARF5 specific, but improve the --debug-dump output to make a more useful (IMHO). [PATCH 1/5] rea

[PATCH 5/5] readelf: Print CU, base address and unresolved .debug_loc entries.

2017-11-29 Thread Mark Wielaard
Also adjust the formatting for the resolved addresses to print them on separate lines so they nicely line up even when the addresses are resolved to symbol+offset names. And print the operands starting on a new line. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5

[PATCH] readelf: Hook up -g, --section-groups to display the section groups.

2017-11-29 Thread Mark Wielaard
It was already possible to display the section groups using -a, but the argp options didn't yet have an -g, --section-groups entry to just display the section groups. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/readelf.c | 1 + 2 files changed, 5 insertions(+) diff --git

[PATCH] readelf: Print arguments to DW_OP_call2 and DW_OP_call4 as DIE offsets.

2017-12-07 Thread Mark Wielaard
That makes it easier to follow the call to the actual DIE. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c56c323..364a30f 100644 --- a/src/ChangeLog +++ b/src

Re: [PATCH] readelf: Print arguments to DW_OP_call2 and DW_OP_call4 as DIE offsets.

2017-12-07 Thread Mark Wielaard
On Thu, Dec 07, 2017 at 04:32:39PM +0100, Mark Wielaard wrote: > That makes it easier to follow the call to the actual DIE. That only made it more clear we weren't handling DW_OP_call2/4 correctly. We were not updating the data pointer. Now includes a somewhat interesting Ada testcas

Re: Various eu-readelf --debug-dump improvements

2017-12-10 Thread Mark Wielaard
On Wed, 2017-11-29 at 17:05 +0100, Mark Wielaard wrote: > While working on the DWARF5 support I found various cases where the > eu-readelf --debug-dump could be improved to provide a bit more information > that helped debug issues. The following changes are not DWARF5 specific, > but

Re: [PATCH] readelf: Hook up -g, --section-groups to display the section groups.

2017-12-10 Thread Mark Wielaard
On Thu, Nov 30, 2017 at 12:14:07AM +0100, Mark Wielaard wrote: > It was already possible to display the section groups using -a, but > the argp options didn't yet have an -g, --section-groups entry to > just display the section groups. Pushed this to master.

Re: [PATCH] readelf: Print arguments to DW_OP_call2 and DW_OP_call4 as DIE offsets.

2017-12-11 Thread Mark Wielaard
On Thu, 2017-12-07 at 22:39 +0100, Mark Wielaard wrote: > DW_OP_call2 and DW_OP_call4 didn't correctly advance the data pointer. > This caused print_ops to produce garbage operands. Also format the > arguments as DIE offsets. That makes it easier to follow the call to > the actua

Re: [PATCH] config: Add pkgincludedir to Cflags

2017-12-11 Thread Mark Wielaard
t subdir, so #include and #include , etc. Wouldn't this change how people include the headers? Do we want to change it? Thanks, Mark

Re: [PATCH] Fix 22546: dwarf_aggregate_size() works with multi-dimensional arrays

2017-12-12 Thread Mark Wielaard
that demonstrates the bug (the test > fails without the functional part of this patch). > > Fixes: https://sourceware.org/bugzilla/show_bug.cgi?id=22546 Thanks. As said in the bug report, this looks good. Pushed to master. Cheers, Mark

[PATCH] libdw: dwarf_aggregate_size should not don't peel the given DIE.

2017-12-12 Thread Mark Wielaard
Reserve memory for a new DIE first. The caller might not care, but it isn't really nice to change the DIE the caller gave us. See also https://sourceware.org/bugzilla/show_bug.cgi?id=22546#c5 Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_aggregate_s

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-14 Thread Mark Wielaard
the range in  > __libdw_in_section. > + >   2017-11-03  Mark Wielaard   >     * dwarf_getlocation.c (__libdw_intern_expression): Handle > diff --git a/libdw/libdwP.h b/libdw/libdwP.h > index 78c0013..e092d8e 100644 > --- a/libdw/libdwP.h > +++ b/libdw/libdwP.h > @@ -643,7 +643,8

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-14 Thread Mark Wielaard
his can then also be used by the "fake" CUs like created in dwarf_getmacros. Thanks, Mark

Re: [PATCH] libdw: dwarf_aggregate_size should not don't peel the given DIE.

2017-12-15 Thread Mark Wielaard
On Tue, 2017-12-12 at 10:51 +0100, Mark Wielaard wrote: > Reserve memory for a new DIE first. The caller might not care, but it > isn't really nice to change the DIE the caller gave us. > > See also https://sourceware.org/bugzilla/show_bug.cgi?id=22546#c5 Pushed to master.

[PATCH] readelf: Try to continue after encountering bogus ELF Note data.

2017-12-18 Thread Mark Wielaard
There might be other sections or segments with ELF Notes that are readable. Also adjust error message depending on whether or not we actually got any data for the ELF Note segment or section. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 6 +++--- 2 files changed, 8

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-20 Thread Mark Wielaard
On Thu, 2017-12-14 at 14:55 +0100, Ulf Hermann wrote: > On 12/14/2017 02:43 PM, Mark Wielaard wrote: > > The transformation seems correct. But if we can overflow/underflow > > here, do we have the same problem in __libdw_offset_in_section > > where we > >   check data-&g

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-20 Thread Mark Wielaard
On Thu, 2017-12-14 at 14:53 +0100, Ulf Hermann wrote: > On 12/14/2017 02:51 PM, Mark Wielaard wrote: > > This is clever and indeed cu_sec_idx () is not generic enough. > > But this is also somewhat inefficient. I am working on DWARF5 support > > and there a CU can come fro

Re: [PATCH] readelf: Try to continue after encountering bogus ELF Note data.

2017-12-21 Thread Mark Wielaard
On Mon, Dec 18, 2017 at 12:41:09PM +0100, Mark Wielaard wrote: > There might be other sections or segments with ELF Notes that are > readable. Also adjust error message depending on whether or not we > actually got any data for the ELF Note segment or section. Pushed to master.

Re: [PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-21 Thread Mark Wielaard
On Thu, Dec 21, 2017 at 02:48:15PM +0100, Ulf Hermann wrote: > > yes, but the original code really was not correct. The attached patch > > fixes it by adding an explicit sec_idx field to the Dwarf_CU struct > > that is set whenever a struct Dwarf_CU is created, so that we never > > have to guess. >

Re: [PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-21 Thread Mark Wielaard
On Thu, Dec 21, 2017 at 02:47:49PM +0100, Ulf Hermann wrote: > > It is surprising we didn't see more issues with this code. There is > > also the fake loc cu that fetches data from a different section. I > > updated both functions as attached. > > Looks good to me. Thanks for taking a look. Pushe

[PATCH] tests: Try to use coredumpctl to extract core files.

2017-12-23 Thread Mark Wielaard
make -j). Signed-off-by: Mark Wielaard --- tests/ChangeLog | 5 + tests/backtrace-subr.sh | 33 +++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index e16a3d04..c70d7abd 100644 --- a/tests/ChangeLog

Re: [PATCH] tests: Try to use coredumpctl to extract core files.

2017-12-24 Thread Mark Wielaard
On Sat, Dec 23, 2017 at 11:31:42PM +0100, Mark Wielaard wrote: > If systemd-coredump is installed we have to use coredumpctl to extract > the core file to test. Unfortunately systemd-coredump/coredumpctl seem > to be somewhat fragile if multiple core dumps are generated/extracted >

[PATCH 1/2] libdw: New get_uleb128_unchecked to use with already checked Dwarf_Abbrev.

2017-12-26 Thread Mark Wielaard
fe to read directly. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 10 ++ libdw/dwarf_child.c | 19 +-- libdw/dwarf_getabbrevattr.c | 10 +- libdw/dwarf_getattrs.c | 20 +--- libdw/dwarf_hasattr.c

[PATCH 2/2] libdw: Reduce size of struct Dwarf_Abbrev.

2017-12-26 Thread Mark Wielaard
If we don't cache the attrcnt and use bitfields for the has_children and code we can reduce the size of struct Dwarf Abbrev from 32 to 24 bytes on 64bit architectures and from 28 to 20 bytes on 32bit arches. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 7 +++

Simpler abbrev parsing using less memory

2017-12-26 Thread Mark Wielaard
g-dump=info libstdc++.so.debug goes down from 1.79 to 1.71 secs. And max rss goes down from 15.296 to 14.684 kbytes. Cheers, Mark

[COMMITTED] libdw: Check there is .debug_info/types section data in __libdw_offdie.

2017-12-28 Thread Mark Wielaard
If a Dwarf_Die was requested from an offset into a section data that didn't exist we would crash. Crashing is bad even if given bad input. Just return an error in that case. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 libdw/dwarf_offdie.c | 4 ++-- 2 files chang

[COMMITTED] readelf: Format offset as DIE index (hex).

2017-12-28 Thread Mark Wielaard
That makes it so much easier to find the actual DIE offset in the output. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 994b1e17..9d6ec830 100644 --- a/src

Re: [PATCH] tests: Try to use coredumpctl to extract core files.

2017-12-28 Thread Mark Wielaard
On Sun, Dec 24, 2017 at 04:10:45PM +0100, Mark Wielaard wrote: > On Sat, Dec 23, 2017 at 11:31:42PM +0100, Mark Wielaard wrote: > > If systemd-coredump is installed we have to use coredumpctl to extract > > the core file to test. Unfortunately systemd-coredump/coredumpctl seem >

[COMMITTED] readelf: Use dwarf_form_name for printing (unknown) forms.

2018-01-01 Thread Mark Wielaard
dwarf_form_string and dwarf_form_name is that the first returns NULL if the form is unknown and the second returns an hexadecimal string representation in that case. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff

Re: Simpler abbrev parsing using less memory

2018-01-01 Thread Mark Wielaard
On Tue, Dec 26, 2017 at 08:38:38PM +0100, Mark Wielaard wrote: > [PATCH 1/2] libdw: New get_uleb128_unchecked to use with already >checked Dwarf_Abbrev. > > So the first patch introduces a get_uleb128_unchecked function that > is used for re-reading such

Re: [PATCH] libdw: dwarf_formsdata should return a signed value

2018-01-14 Thread Mark Wielaard
estfile-sizes4.s: New test source. + * run-aggregate-size.sh: Check testfile-sizes4.o v size 257. + 2017-12-23 Mark Wielaard * backtrace-subr.sh (check_native_core): Use a lock file and try diff --git a/tests/Makefile.am b/tests/Makefile.am index 64cb5bd9..1fce4474 100644 --

Re: [PATCH] libdw: dwarf_formsdata should return a signed value

2018-01-15 Thread Mark Wielaard
uildbot/ It doesn't yet have a "try" bot. Which would be helpful in these kind of cases. Cheers, Mark P.S. Sending HTML email on the other hand... :) The mailinglist will just drop it (or did you get a bounce message?)

Re: [PATCH] libdw: dwarf_formsdata should return a signed value

2018-01-15 Thread Mark Wielaard
On Mon, Jan 15, 2018 at 12:34:27PM +0100, Petr Machata wrote: > 2018-01-15 9:23 GMT+01:00 Mark Wielaard : > > On Mon, 2018-01-15 at 00:06 +0100, Petr Machata wrote: > >> Ugh, sorry about that. It's been a while since I last posted, I > >> forgot the routine! > &

[PATCH] libdw: Resolve alt file on first use.

2018-01-22 Thread Mark Wielaard
on the existing allfcts test which already tries to set the alt file, but is too simplistic to find it in some subdir (relative to the main debug file). Signed-off-by: Mark Wielaard --- libdw/ChangeLog| 19 ++ libdw/Makefile.am | 4 +- libdw/dwarf_begin_elf.c

[COMMITTED] readelf: Fix crash on reading loc data or range data with bad/no CUs.

2018-01-25 Thread Mark Wielaard
compared to the last_cu and used because it was unequal. Fix this by explicitly initializing cu to last_cu (which is NULL on first use). Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src

[COMMITTED] tests: Check symtabshdr instead of symtabndx in elfstrmerge.c.

2018-01-25 Thread Mark Wielaard
Some gcc omptimization levels (-Og in particular) didn't see that when symtabndx != 0, then symtabshdr was certain to be initialized. Change the symtabndx == 0 check to symtabshdr == NULL and initialize symtabshdr to work around that. Signed-off-by: Mark Wielaard --- tests/ChangeLog

[PATCH] libdw: Add dwarf_die_addr_die function.

2018-01-25 Thread Mark Wielaard
dwarf .dwo (or the .dwp) file. The only limitation, compared to using a Dwarf_Off and dwarf_dieoffset, is that it only works during runtime while the main Dwarf object is valid (till dwarf_end has been called on it). Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 9

Re: [PATCH] libdw: Resolve alt file on first use.

2018-01-25 Thread Mark Wielaard
On Mon, 2018-01-22 at 12:30 +0100, Mark Wielaard wrote: > +static void > +find_debug_altlink (Dwarf *dbg) > +{ > +  const char *altname; > +  const void *build_id; > +  ssize_t build_id_len = INTUSE(dwelf_dwarf_gnu_

Re: [PATCH] libdw: Resolve alt file on first use.

2018-01-29 Thread Mark Wielaard
On Thu, 2018-01-25 at 16:28 +0100, Mark Wielaard wrote: > Testing under valgrind showed that this should be build_id_len <= 0. > When dwelf_dwarf_gnu_debugaltlink returns 0 it means there was no > .gnu_debugaltlink section at all. A negative return value means the > data found was c

[PATCH] libdw: Parse new DWARF5 units and CU DIEs.

2018-01-30 Thread Mark Wielaard
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 --- libdw/ChangeLog

[PATCH] libdw: Add new dwarf_get_units function to iterate over all units.

2018-01-30 Thread Mark Wielaard
RF5 unit header information (which it gets through dwarf_cu_die). The new interface hides which section exactly to iterate on (by design). readelf works around that by "cheating". It sets up a Dwarf_CU so that it gets the data from the right section, using the (normally) internal data struct

Re: [PATCH] dwz.c: special-case SHT_NOBITS sections

2018-02-06 Thread Mark Wielaard
dso->shdr[j].sh_offset >     = (last_shoff + dso->shdr[j].sh_addralign - 1) >   & ~(dso->shdr[j].sh_addralign - (GElf_Off) 1); > -   last_shoff = dso->shdr[j].sh_offset + dso- > >shdr[j].sh_size; > +   last_shoff = dso->shdr[j].sh_offset; > +   if (dso->shdr[j].sh_type != SHT_NOBITS) > + last_shoff += dso->shdr[j].sh_size; >     if (addsec != -1 && j == addsec) >   last_shoff += addsize; >   } The last two hunks look correct to me. Cheers, Mark

[PATCH] Recognize new DWARF5 attribute forms.

2018-02-08 Thread Mark Wielaard
_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 --- libdw/ChangeLog| 10 ++ libdw/dw

Re: [PATCH v2] Add fallthrough attributes

2018-02-09 Thread Mark Wielaard
9d512c The idea is that those versions of GCC that support -Wimplicit-fallthrough also have support for the __attribute__ ((fallthrough)) statement. So they can always be used together. Cheers, Mark

[PATCH] libdw: Handle DWARF5 DW_FORM_implicit_const. Add dwarf_getabbrevattr_data.

2018-02-09 Thread Mark Wielaard
the DW_FORM_implicit_const value. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 19 +++ libdw/dwarf_child.c | 14 +- libdw/dwarf_formsdata.c | 7 ++- libdw/dwarf_formudata.c | 7 ++- libdw/dwarf_getabbrev.c | 7

[PATCH] libdw: Add support for DWARF5 DW_FORM_data16.

2018-02-09 Thread Mark Wielaard
64bits. This does mean we don't try to convert the value but just return it as a block of 16 raw bytes. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_formblock.c | 12 +++- src/ChangeLog | 4 src/readelf.c | 3 ++- 4

Re: [PATCH v3] Use fallthrough attribute

2018-02-09 Thread Mark Wielaard
no longer sufficient. Thanks, this look good. I added ChangeLog entries and pushed it to master. Cheers, Mark

ChangeLog entries (Was: [PATCH v3] Use fallthrough attribute)

2018-02-10 Thread Mark Wielaard
On Fri, 2018-02-09 at 22:36 -0500, Frank Ch. Eigler wrote: > On Sat, Feb 10, 2018 at 03:26:43AM +0100, Mark Wielaard wrote: > > > I added ChangeLog entries and pushed it to master. > > What's a ChangeLog entry?  :-) Yeah, yeah, I know. I am the last one to care. Really,

Re: [PATCH] libdw: Add dwarf_die_addr_die function.

2018-02-13 Thread Mark Wielaard
On Thu, 2018-01-25 at 16:06 +0100, Mark Wielaard wrote: > Currently storing a lot of Dwarf_Dies might be inefficient since it > costs a lot of memory since the sizeof (Dwarf_Die) == 32 bytes on 64bit > arches. You can try storing just the Dwarf_Off from dwarf_dieoffset. > Which is

[COMMITTED] Include sys/ptrace.h as early as possible.

2018-02-15 Thread Mark Wielaard
order fixes these issues. Signed-off-by: Mark Wielaard --- backends/ChangeLog | 4 backends/ppc_initreg.c | 5 +++-- libdwfl/ChangeLog | 4 libdwfl/linux-pid-attach.c | 2 +- tests/ChangeLog| 6 ++ tests/backtrace-child.c| 2 +- tests/backtrace

Re: [COMMITTED] Include sys/ptrace.h as early as possible.

2018-02-15 Thread Mark Wielaard
der) systems. Cheers, Mark

[PATCH] tests: Accept any core if no core with the "correct" pid can be found.

2018-02-16 Thread Mark Wielaard
In some containers our view of pids is confused. We see the container pid namespace, but the core is generated using the host pid namespace. Since tests are run in a new fresh directory any core here is most like is ours. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 5 + tests

[COMMITTED] libelf: Sync elf.h from glibc.

2018-02-18 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 4 +++ libelf/elf.h | 96 ++-- 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 55ab25c..62e8911 100644 --- a/libelf/ChangeLog

[PATCH] libebl: Allow SHT_NOTE as relocation target type.

2018-02-21 Thread Mark Wielaard
find any reason an SHT_NOTE section cannot have relocations against it. So this patch allows them. Signed-off-by: Mark Wielaard --- libebl/ChangeLog | 5 + libebl/eblcheckreloctargettype.c | 1 + 2 files changed, 6 insertions(+) diff --git a/libebl/ChangeLog b/libebl

Re: [PATCH] libdw: Parse new DWARF5 units and CU DIEs.

2018-02-21 Thread Mark Wielaard
On Tue, 2018-01-30 at 13:33 +0100, Mark Wielaard wrote: > 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. I pushe

Re: [PATCH] libdw: Add new dwarf_get_units function to iterate over all units.

2018-02-21 Thread Mark Wielaard
On Tue, 2018-01-30 at 13:34 +0100, Mark Wielaard wrote: > The dwarf_nextcu and dwarf_next_unit functions provide information to > construct the offset to construct the associated CU DIE using dwarf_offdie > or dwarf_offdie_types.  This requires the user to know beforehand where > to

Re: [PATCH] Recognize new DWARF5 attribute forms.

2018-02-21 Thread Mark Wielaard
On Thu, 2018-02-08 at 17:06 +0100, Mark Wielaard wrote: > 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 zer

Re: [PATCH] libdw: Handle DWARF5 DW_FORM_implicit_const. Add dwarf_getabbrevattr_data.

2018-02-21 Thread Mark Wielaard
On Fri, 2018-02-09 at 18:25 +0100, Mark Wielaard wrote: > Handle the new DW_FORM_implicit_const. The value of this form is embedded > in the abbrev data (as sleb128) and not in the info DIE data. This also > adds a new function dwarf_getabbrevattr_data which allows getting any >

Re: [PATCH] libdw: Add support for DWARF5 DW_FORM_data16.

2018-02-21 Thread Mark Wielaard
On Fri, 2018-02-09 at 21:58 +0100, Mark Wielaard wrote: > The DWARF5 spec says DW_FORM_data16 is constant class (128bit value). > But we treat it as if it is block class. So to use a attribute that is > encoded as DW_FORM_data16 use dwarf_formblock, not dwarf_form[us]data. > >

Re: [PATCH] libebl: Allow SHT_NOTE as relocation target type.

2018-02-22 Thread Mark Wielaard
On Wed, 2018-02-21 at 16:36 +0100, Mark Wielaard wrote: > eu-elflint uses ebl_check_reloc_target_type to determine whether a section > is a valid relocation target. In Fedora rawhide there are new ELF notes > (annobin) which have relocations against them in ET_REL files. eu-elflint &g

Re: [PATCH, dwarflint] Explicitly qualify specializations of elfutils::to_string

2018-02-26 Thread Mark Wielaard
On 23.02.2018. 17:47, Djordje Todorovic wrote: > This looks good to me, but Mark or someone else must approve. Looks good to me to. Thanks. Pushed to dwarflint branch. Cheers, Mark

[PATCH] elflint: Make sure we can read a whole element when iterating over group.

2018-02-26 Thread Mark Wielaard
Change the for loop so that we can always read a full element. https://sourceware.org/bugzilla/show_bug.cgi?id=22892 Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/elflint.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index

[PATCH] readelf: Add some support for locviews.

2018-03-01 Thread Mark Wielaard
nizes the DW_AT_GNU_locviews attribute as a loclistptr when encoded as a sec_offset form. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 6 libdw/dwarf.h | 2 ++ libdw/dwarf_formudata.c | 1 + src/ChangeLog | 15 ++ src/readelf.c

[PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name).

2018-03-05 Thread Mark Wielaard
Some systems apparently don't provide canonicalize_file_name. Since canonicalize_file_name (path) is defined as realpath(path, NULL) just use realpath everywhere. https://sourceware.org/bugzilla/show_bug.cgi?id=21009 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog

Re: [PATCH] readelf: Add some support for locviews.

2018-03-05 Thread Mark Wielaard
On Thu, 2018-03-01 at 14:55 +0100, Mark Wielaard wrote: > 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

[PATCH] libdw: Add new DWARF5 Dwarf expression operations.

2018-03-06 Thread Mark Wielaard
. DW_OP_addrx and DW_OP_constx are recognized but not interpreted yet. Signed-off-by: Mark Wielaard --- libdw/ChangeLog| 19 +++ libdw/dwarf.h | 11 +++ libdw/dwarf_getlocation.c | 12 +++- libdw

Re: [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name).

2018-03-09 Thread Mark Wielaard
On Mon, Mar 05, 2018 at 02:24:56PM +0100, Mark Wielaard wrote: > Some systems apparently don't provide canonicalize_file_name. Since > canonicalize_file_name (path) is defined as realpath(path, NULL) just > use realpath everywhere. Pushed to master.

Re: [PATCH] libdw: Add new DWARF5 Dwarf expression operations.

2018-03-11 Thread Mark Wielaard
On Tue, 2018-03-06 at 19:55 +0100, Mark Wielaard wrote: > 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

[PATCH] libebl: Handle SYMTAB_SHNDX in ebl_dynamic_tag_name.

2018-03-16 Thread Mark Wielaard
SYMTAB_SHNDX was introduced when elf.h was imported, but not yet handled in ebl_dynamic_tag_name. Handle it and add an eu_static_assert to make sure stdtags always contains DT_NUM entries. https://sourceware.org/bugzilla/show_bug.cgi?id=22976 Signed-off-by: Mark Wielaard --- libebl/ChangeLog

[PATCH] libdwfl: Use process_vm_readv when available.

2018-03-17 Thread Mark Wielaard
. Signed-off-by: Mark Wielaard --- ChangeLog | 4 +++ configure.ac | 6 ++-- libdwfl/ChangeLog | 11 +++ libdwfl/libdwflP.h | 14 - libdwfl/linux-pid-attach.c | 74 +- 5 files changed, 105

[PATCH] readelf: Report error when decl_file or call_file attribute is invalid.

2018-03-20 Thread Mark Wielaard
Report an error for why the DW_AT_decl_file or DW_AT_call_file cannot be resolved to a file name. This is likely invalid DWARF, a missing DW_AT_stmt_list attribute on the CU or a missing .debug_line section. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 + src/readelf.c | 18

Re: How to associate Elf with Dwfl_Module returned by dwfl_report_module

2018-03-20 Thread Mark Wielaard
elf is called. The callback can then set the Elf*. But that does mean you have to keep track yourself (or immediately call dwfl_module_getelf). I would like to understand better what is really going wrong with dwfl_report_elf before diving into using dwfl_module_report. Cheers, Mark

Re: [PATCH] libdwfl: Use process_vm_readv when available.

2018-03-20 Thread Mark Wielaard
On Sun, Mar 18, 2018 at 01:43:23AM +0100, Mark Wielaard wrote: > If possible use process_vm_readv to read 4K blocks instead of fetching > each word individually with ptrace. For unwinding this often means we > only have to do one process_vm_readv of the stack instead of dozens of >

<    4   5   6   7   8   9   10   11   12   13   >