[Ltrace-devel] [PATCH] Add support for using elfutils as unwinder.

Petr Machata pmachata at redhat.com
Wed Jan 8 16:11:08 UTC 2014


Mark Wielaard <mjw at redhat.com> writes:

>> Here you rely on the fact that DWARF_CB_ABORT is > 0, which is not
>> obvious (though likely always true).  But dwfl_getthread_frames doesn't
>> care about particular value returned from the callback as long as it's
>> non-zero, so why not change the DWARF_CB_ABORT above to 1?
>
> Done and added a comment to frame_callback explaining the function
> return values -1, 0, 1.

Awesome.

> +AC_CHECK_LIB([dw], [dwfl_getthread_frames], [have_libdw_dwfl_frames=yes])
> +  AC_SUBST(libdw_LIBS)
> +  AC_DEFINE([HAVE_LIBDW], [1], [we have elfutils libdw])
> +  LDFLAGS="${saved_LDFLAGS}"

This is all unconditional and leads to build errors on systems without
suitable elfutils.  Should there be something like this?

@@ -150,9 +150,11 @@ dnl And whether libdw.so provides the unwinding functions.
 saved_LDFLAGS="${LDFLAGS}"
 LDFLAGS="${LDFLAGS} ${AM_LDFLAGS}"
 AC_CHECK_LIB([dw], [dwfl_getthread_frames], [have_libdw_dwfl_frames=yes])
+if test x"$have_libdw_dwfl_frames" = xyes; then
   AC_SUBST(libdw_LIBS)
   AC_DEFINE([HAVE_LIBDW], [1], [we have elfutils libdw])
   LDFLAGS="${saved_LDFLAGS}"
+fi
 AC_MSG_CHECKING([whether to use elfutils libdwfl unwinding support])
 case "${enable_elfutils}" in
 (yes|maybe)

Thanks,
PM



More information about the Ltrace-devel mailing list