domingo, 14 de junio de 2009

Troubleshooting functions and symbols on Solaris

Execution environments with precompiled applications can be a painfull headache without the following troubleshooting tools. Using (and mastering) them will gave us a idea of how to set up critical variables (like LD_LIBRARY_PATH) in order to make programs or other libraries work.
ldd: lists the dependencies of a process or a library.
We can show the direct dependencies or even the indirect dependencies (-U), the order loading the libraries (-i), the path in use to search for the libraries (-s) , or even all dependencies required (-v).

nm: displays the symbol table for a given object. Translated to the common language: lists the functions used in a library.
nm -r -u -v /lib/libsocket.so
Will show the library name and the function name.

This command can provide very important information when used together with a debuger like truss (or linux strace).

No hay comentarios:

Publicar un comentario