First page Back Continue Last page Overview Graphics
Ltrace and strace
Ltrace
- Lists library calls on a running program
Strace
- Lists system calls on a running program
Both can attach to a running program
Useful for seeing call before failure
Useful seeing what a 'hung' program is doing.
Use addr2line to find addresses from ltrace -i
Notes:
Ltrace and strace both look at your program from the outside; while some bugs will change behaviour while being traced it is much rarer than programs changing their behaviour when being gdb'd.
Ltrace watches library calls that have been made. If you ltrace 'seggy' you can see the calls to fprintf and the final signal which kills it.
Strace goes one level lower looking at system calls - you can see the write system calls instead of the fprintf library calls.
Passing either of these -i will show you addresses in the program where events occur. Do:
addr2line -e seggy and pass it this address to see the line.