Ltrace

From LQWiki
Jump to navigation Jump to search

ltrace is a program that intercepts and records dynamic library calls by the executed process and the signals which are received by that process. It can also intercept and print the system calls executed by the program.

Example

This example has been taken from SUSE Linux 11.3:

tweedleburg:~ # yast -i ltrace
tweedleburg:~ # which ls
/bin/ls
tweedleburg:~ # ltrace /bin/ls
__libc_start_main(0x4077c0, 1, 0x7fffa594b778, 0x410440, 0x4104d0 <unfinished ...>
strrchr("/bin/ls", '/')                                                                                  = "/ls"
setlocale(6, "")                                                                                         = "LC_CTYPE=en_US.UTF-8;LC_NUMERIC="...
bindtextdomain("coreutils", "/usr/share/locale")                                                         = "/usr/share/locale"
textdomain("coreutils")                                                                                  = "coreutils"
__cxa_atexit(0x40a560, 0, 0, 0x736c6974756572, 0x619460)                                                 = 0
isatty(1)                                                                                                = 1
getenv("QUOTING_STYLE")                                                                                  = NULL
getenv("LS_BLOCK_SIZE")                                                                                  = NULL
[...]

How to install it

Most probably you will be able to install ltrace by means of your distribution as described under installing software.

See also

External Links