Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [327064] Maximize Restore History

Add -k option to print stack trace after each syscall

Print the stack trace of the traced process after each system call when
-k option is specified. It is implemented using libunwind to unwind the
stack and to obtain the function name pointed by the IP.

Based on the code that was originally taken from strace-plus
of Philip J. Guo.

* configure.ac: Add --with-libunwind option. Check libunwind support.
* Makefile.am: Add libunwind support.
* defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields.
[USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache,
delete_mmap_cache, print_stacktrace): New prototypes.
* mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support.
* process.c (sys_execve): Likewise.
* strace.c (usage, alloctcb, droptcb, init): Likewise.
* syscall.c (trace_syscall_exiting): Likewise.
* unwind.c: New file.
* strace.1: Document -k option.

Luca Clementi Luca Clementi 2013-07-23

Dmitry V. Levin Dmitry V. Levin 2014-05-30

added unwind.c
changed Makefile.am
changed configure.ac
changed defs.h
changed mem.c
changed process.c
changed strace.1
changed strace.c
changed syscall.c
unwind.c Diff Switch to side-by-side view
Loading...
Makefile.am Diff Switch to side-by-side view
Loading...
configure.ac Diff Switch to side-by-side view
Loading...
defs.h Diff Switch to side-by-side view
Loading...
mem.c Diff Switch to side-by-side view
Loading...
process.c Diff Switch to side-by-side view
Loading...
strace.1 Diff Switch to side-by-side view
Loading...
strace.c Diff Switch to side-by-side view
Loading...
syscall.c Diff Switch to side-by-side view
Loading...