Re: linux-pid-attach.c on non-Linux hosts

2014-04-22 Thread Kurt Roeckx
On Wed, Apr 23, 2014 at 12:26:53AM +0200, Mark Wielaard wrote: > On Tue, 2014-04-22 at 21:52 +0200, Kurt Roeckx wrote: > > The attached patch seems to be working for me on kFreeBSD. > > Looks reasonable to me. The other arch backends that provide an initregs > could probably use the same condition

Re: linux-pid-attach.c on non-Linux hosts

2014-04-22 Thread Mark Wielaard
On Tue, 2014-04-22 at 21:52 +0200, Kurt Roeckx wrote: > The attached patch seems to be working for me on kFreeBSD. Looks reasonable to me. The other arch backends that provide an initregs could probably use the same conditional (but that can wait till someone actually needs it/can test it). Would

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Mark Wielaard
On Tue, 2014-04-22 at 08:58 -0700, Richard Henderson wrote: > On 04/22/2014 08:52 AM, Josh Stone wrote: > > So in total: > > > > struct { signed int i:7; } __s = { .i = __b }; > > (var) |= (typeof (var)) __s.i * ((typeof (var)) 1 << ((nth) * 7)); > > > > Better? > > Yes, that's what I had in

[PATCH] readelf: handle_core_item make sure variable length array isn't zero size.

2014-04-22 Thread Mark Wielaard
The printed array should have at least space for the terminating zero char. Found by gcc -fsanitize=undefined while running run-readelf-vmcoreinfo.sh. runtime error: variable length array bound evaluates to non-positive value 0 Signed-off-by: Mark Wielaard --- src/ChangeLog |5 + src/rea

[PATCH] libdwfl: __libdwfl_frame_reg_[gs]et use uint64_t when checking bits.

2014-04-22 Thread Mark Wielaard
Found by gcc -fsanitize=undefined while running the backtrace-core-ppc test. runtime error: shift exponent 45 is too large for 32-bit type 'unsigned int' Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog |6 ++ libdwfl/frame_unwind.c |4 ++-- 2 files changed, 8 insertions(+), 2

[PATCH] readelf.c (print_gdb_index_section): Use unsigned int for 31 bits left shift.

2014-04-22 Thread Mark Wielaard
Found by gcc -fsanitize=undefined. left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Mark Wielaard --- src/ChangeLog |5 + src/readelf.c |2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5eb69d6..87

Re: linux-pid-attach.c on non-Linux hosts

2014-04-22 Thread Kurt Roeckx
On Tue, Apr 22, 2014 at 01:28:20PM +0200, Mark Wielaard wrote: > Hi Kurt, > > On Mon, 2014-04-21 at 22:39 +0200, Kurt Roeckx wrote: > > It seems linux-pid-attach.c doesn't build on any of the non-Linux > > hosts, which is probably normal given it's name. FreeBSD has a > > problem with the everyth

Re: Dwarf unwind test failures on various arches

2014-04-22 Thread Kurt Roeckx
On Tue, Apr 22, 2014 at 01:45:43PM +0200, Mark Wielaard wrote: > On Mon, 2014-04-21 at 23:40 +0200, Kurt Roeckx wrote: > > I'm seeing various test suite failures in the 0.158 on various > > arches. I'm currently looing at powerpc since that's the only > > Debian release architecture that's having

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Richard Henderson
On 04/22/2014 08:52 AM, Josh Stone wrote: > The trick in the original was that "(typeof (var)) __s.i" would extend > the sign from the 7th bit, which I don't your mask will do. Yes, that was another cut/paste error. Not a great batting average this morning... ;-) > So in total: > > struct { s

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Josh Stone
On 04/22/2014 08:01 AM, Richard Henderson wrote: > On 04/22/2014 07:55 AM, Mark Wielaard wrote: >> On Thu, 2013-12-12 at 11:06 -0800, Josh Stone wrote: >>> On 12/12/2013 04:13 AM, Petr Machata wrote: Josh Stone writes: > +#define get_sleb128_step(var, addr, nth) \ >

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Richard Henderson
On 04/22/2014 08:01 AM, Richard Henderson wrote: > (typeof (var)) (__b & 0x7f) * (1 << ((nth) * 7)); Bah. That 1 needs to be typeof (var) too. r~

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Richard Henderson
On 04/22/2014 07:55 AM, Mark Wielaard wrote: > On Thu, 2013-12-12 at 11:06 -0800, Josh Stone wrote: >> On 12/12/2013 04:13 AM, Petr Machata wrote: >>> Josh Stone writes: +#define get_sleb128_step(var, addr, nth)\ do {

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2014-04-22 Thread Mark Wielaard
On Thu, 2013-12-12 at 11:06 -0800, Josh Stone wrote: > On 12/12/2013 04:13 AM, Petr Machata wrote: > > Josh Stone writes: > >> +#define get_sleb128_step(var, addr, nth)\ > >>do { \ > >> +unsigned char __b = *(addr)++;

Re: Dwarf unwind test failures on various arches

2014-04-22 Thread Mark Wielaard
On Mon, 2014-04-21 at 23:40 +0200, Kurt Roeckx wrote: > I'm seeing various test suite failures in the 0.158 on various > arches. I'm currently looing at powerpc since that's the only > Debian release architecture that's having the problem, but I see > it on various non-release arches too. Thanks

Re: linux-pid-attach.c on non-Linux hosts

2014-04-22 Thread Mark Wielaard
Hi Kurt, On Mon, 2014-04-21 at 22:39 +0200, Kurt Roeckx wrote: > It seems linux-pid-attach.c doesn't build on any of the non-Linux > hosts, which is probably normal given it's name. FreeBSD has a > problem with the everything related to pthread while Hurd seems > to only have a problem with sysca

Re: [PATCH] Update .gitignore file

2014-04-22 Thread Florian Weimer
On 04/15/2014 07:55 PM, Mike Frysinger wrote: i have no problem with encouraging people to build out of tree (i love that functionality). sometimes though, it's easier to just build in tree to do quick tests. i also don't think it's a big deal to support, or to just take patches tweaking the g

Re: [PATCH v3 5/6] Move .gnu_debugaltlink handling from libdw to libdwfl

2014-04-22 Thread Florian Weimer
On 04/15/2014 05:11 PM, Florian Weimer wrote: Also use dwelf_dwarf_gnu_debugaltlink to locate the alternate debugging information. I will post an updated version of this patch once the other parts have stabilized a bit. I still have trouble with ChangeLog merging, and want to minimize the n

Re: [PATCH v3 4/6] tests/allfcts.c: Install alternate debug information

2014-04-22 Thread Florian Weimer
On 04/18/2014 01:58 PM, Mark Wielaard wrote: On Tue, 2014-04-15 at 16:58 +0200, Florian Weimer wrote: This change also adds more error checking and reporting. + * allfcts.c (setup_alt): New function. + (main): Call it. Implementation additional error checking and + reporting.

Re: [PATCH v3 3/6] libdwelf: Add dwelf_dwarf_gnu_debugaltlink

2014-04-22 Thread Florian Weimer
On 04/18/2014 01:02 PM, Mark Wielaard wrote: On Tue, 2014-04-15 at 14:49 +0200, Florian Weimer wrote: +2014-04-15 Florian Weimer + + * dwelf_dwarf_gnu_debugaltlink.c: New file. + * Makefile.am (libdwelf_a_SOURCES): Add it. + * libdwelf.h (dwelf_dwarf_gnu_debugaltlink): Decla

Re: [PATCH v3 2/6] libdw: Add dwarf_getalt, dwarf_setalt

2014-04-22 Thread Florian Weimer
On 04/18/2014 12:35 PM, Mark Wielaard wrote: So I think the documentation for dwarf_setalt is fine now. But for dwarf_getalt I made you add a confusing sentence "Unless..." lets just remove that. Could you post an updated patch with that documentation change. The code is fine, so I want to add