[RFC] print stack trace after each syscall

Luca Clementi luca.clementi at gmail.com
Tue Jun 25 06:41:21 UTC 2013


On Mon, Jun 24, 2013 at 8:42 AM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Monday 24 June 2013 03:18:58 Luca Clementi wrote:
>> --- a/configure.ac
>> +++ b/configure.ac
>>
>> +dnl  libunwind tests
>> +AC_CHECK_HEADERS([libunwind-ptrace.h libunwind.h])
>
> add a proper --with/--enable flag for this.  the default should be to
> autodetect the headers and not fail if support isn't found.
>




>> +if test "x$ac_cv_header_libunwind_ptrace_h" == "xyes" &&
>> +     test "x$ac_cv_header_libunwind_h" == "xyes"; then :
>
> "==" is not POSIX shell.  use "=" instead.  that trailing ":" is pointless
>
>> +     AC_CHECK_LIB([unwind], [backtrace],[],[
>> +             AC_MSG_FAILURE([Unable to find libunwind])
>> +             ])
>> +        AC_CHECK_LIB([unwind-$arch], [_U${arch}_create_addr_space],[], [
>> +                           AC_MSG_FAILURE([Unable to find libunwind-$arch])
>> +     ])
>
> is the $arch stuff really necessary ?  isn't linking to -lunwind sufficient ?

Actually what I do need is the libunwind-ptrace, but the problem is
that -lunwind-ptrace depends on -lunwind-$arch (basically they put all
the arch dependent code in there) so if you test libunwind-ptrace you
need to have the -lunwind-$arch in your linker flags if not the test
fails.


I will all your (Denys and Mike) reviews and send a new patch.

Luca

>
>> --- a/defs.h
>> +++ b/defs.h
>>
>> +struct mmap_cache_t {
>> +     // example entry:
>> +     // 7fabbb09b000-7fabbb09f000 r--p 00179000 fc:00 1180246
>> /lib/libc-2.11.1.so
>
> we use /* comments */ rather than // comments
> -mike




More information about the Strace-devel mailing list