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 corrupt. In both

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_debugaltlink) (dbg, > > +    &

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

2018-01-22 Thread Mark Wielaard
Hi, While working on split dwarf, which requires libdw to search for and open multiple .dwo (or .dwp) files, I realized we really should be a little user fiendlier and do the same for alt files. So this patch lifts some of the code that finds, opens and tracks separate Dwarf files and uses it for