Debugging - Novell LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007 Installation Manual

Table of Contents

Advertisement

16.1 Debugging

16.1.1 Specifying the Required Library: ldd
Use the command ldd to find out which libraries would load the dynamic executable
specified as argument.
tester@linux:~> ldd /bin/ls
Static binaries do not need any dynamic libraries.
tester@linux:~> ldd /bin/sash
tester@linux:~> file /bin/sash
/bin/sash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.4, statically linked, for GNU/Linux 2.6.4, stripped
16.1.2 Library Calls of a Program Run:
The command ltrace enables you to trace the library calls of a process. This command
is used in a similar fashion to strace. The parameter -c outputs the number and du-
ration of the library calls that have occurred:
tester@linux:~> ltrace -c find ~
% time
------ ----------- ----------- --------- --------------------
34.37
33.53
12.67
11.97
2.37
308
Installation and Administration
linux-gate.so.1 =>
librt.so.1 => /lib/librt.so.1 (0xb7f97000)
libacl.so.1 => /lib/libacl.so.1 (0xb7f91000)
libc.so.6 => /lib/libc.so.6 (0xb7e79000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7e67000)
/lib/ld-linux.so.2 (0xb7fb6000)
libattr.so.1 => /lib/libattr.so.1 (0xb7e63000)
not a dynamic executable
ltrace
seconds
usecs/call
6.758937
6.593562
2.490392
2.353302
0.466754
(0xffffe000)
calls
245
27554 __errno_location
788
8358 __fprintf_chk
144
17212 strlen
239
9845 readdir64
27
16716 __ctype_get_mb_cur_max
function

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10

Table of Contents