Friday, September 16, 2005

debug a process

Thanks everyone. Again I had lots of replies, and I will copy the the
most complete answers below:

[Ric Anderson]

There are many
truss -p pid
shows what system calls a process is making.

ps -fp pid
shows general status

pldd pid
shows what dynamic libraries (.so) files a process is using.

In addition, there are a number of tools in /usr/proc/bin
that let you look at the actions of a process.

If you have lsof installed, then
lsof -p pid
will show open files for a process.

Some debuggers (e.g., gdb) can also be used with a pid
to interactively debug a running process.

[Jonathan Birchall]

It all depends on how deep you wish to go and what version of Solaris
you are using.

Truss -wall -vall -fall -o<outputfilename> -p <PID> will give you
details of system calls etc. see Man truss

You can also use the p commands see man pfiles , ptree , pmap etc.

In Solaris 10 you can also now use dtrace for a detailed view of what
the process is doing.

Using a mixture of the about should give you a fairly detailed view of
what is happening.

You can also use adb (debugger).... which also pointed me to mdb
(solaris 9)

With Ric's help, using lsof, we managed to track down the problem.

0 Comments:

Post a Comment

<< Home