Operating System - HP-UX
1849109 Members
7733 Online
104041 Solutions
New Discussion

Are there any debug tools which can detect program's hang-up location?

 
SOLVED
Go to solution
liping guo
Occasional Advisor

Are there any debug tools which can detect program's hang-up location?

I am debugging a daemon C++ program which is locked up randomly for some reason. Are
there any tools which can trace the process and detect the hang-up location. (such as which
C++ statement or function the program is locked up?).

OS: hp-ux 10.20. Language C++

Thanks,

Liping
5 REPLIES 5
Sachin Patel
Honored Contributor

Re: Are there any debug tools which can detect program's hang-up location?

I guess that will be "tusc"

Go to following site and search for tusc

http://hpux.cs.utah.edu/


Sachin
Is photography a hobby or another way to spend $
Olav Baadsvik
Esteemed Contributor
Solution

Re: Are there any debug tools which can detect program's hang-up location?



Hi,

One thing you could try is the following:


. when the program seems to hang, send
a sigabrt to the process
( kill -6 PID )
this will produce a core file.

. Use a debugger to get the call-stack.
With gdb this can be done as follows:

gdb -tui core
(gdb) info stack


Another thing you could try is to use
the debugger to attach to the running process.

Regards
Olav

Christopher Caldwell
Honored Contributor

Re: Are there any debug tools which can detect program's hang-up location?

DDE will allow you to seize a running process, set break points, examine variable, single step, etc.

http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=B3476-90015&service=hpux&path=00/00/1&title=HP/DDE%20Debugger%20User%27s%20Guide
A. Clay Stephenson
Acclaimed Contributor

Re: Are there any debug tools which can detect program's hang-up location?

I am reading into this that you have the source code for this daemon. If so, my favorite technique (and one that I always do anyway) is to place assert()'s at the beginning and return(s) of each function. You pay no penalty if you complile with -NDEBUG and otherwise you have a log of each function writen to stderr.

Again, this is my standard practice and has served me well over the years in quickly finding problems like yours.
If it ain't broke, I can fix that.
liping guo
Occasional Advisor

Re: Are there any debug tools which can detect program's hang-up location?

Hi, Dear friends,
Your information is really helpful. I am going to try them.

Thanks,

Liping