Operating System - HP-UX
1833802 Members
2235 Online
110063 Solutions
New Discussion

how to use gdb on HPUX 11.00

 
SOLVED
Go to solution
Shivkumar
Super Advisor

how to use gdb on HPUX 11.00

Hi,

I just installed debugger tool. The files are shown as below:-

[sksonkar@bigguy:/var/adm/crash/shiv/WDB/WDB/opt/langtools/bin]$ll
total 12080
-r--r--r-- 1 bin bin 3184 Apr 8 23:15 faq
-r-xr-xr-x 1 bin bin 2164793 Apr 8 23:15 gdb32
-r-xr-xr-x 1 bin bin 2164207 Apr 8 23:15 gdb64
-r-xr-xr-x 1 bin bin 6334 Apr 8 23:15 vdb
-r-xr-xr-x 1 bin bin 1203155 Apr 8 23:15 vdbterm
-r-xr-xr-x 1 bin bin 639270 Apr 8 23:15 vdbvim

I am seeing gdb32 and gdb64 above. Are these correct ?

I want to debug apache process. I guess i need to generate first apache core file..right ??
Can someone suggest how use these tool along with syntax?

Appreciate your help.

PS: Please ignore the installed directory structure as i found space there only.
It is a dev box.

Thanks,
Shiv

3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: how to use gdb on HPUX 11.00

gdb will only be partially useful unless you actually compile the source with the -g option and turn off the optimizer. This includes debugger infomation in the object files so that when a stack trace is done, you see not only the functions (which are available w/o -g) but also the exact line no in the source file where the problem occurs. You are correct in that you must let the application generate a corefile. You then launcch gdb executable core and normally a stack trace will be done automatically. Now having explained all this, if you have to ask then a stack trace is likely not to do you much good.
If it ain't broke, I can fix that.
Chan 007
Honored Contributor

Re: how to use gdb on HPUX 11.00

Shiv,

I think the 1st link has info that you asked for. Honestly I have no idea, just did a google and posted to you.

You can mark "0" if this is of no use.

http://httpd.apache.org/dev/debugging.html

http://www.cs.cmu.edu/~gilpin/tutorial/

Chan
Arunvijai_4
Honored Contributor

Re: how to use gdb on HPUX 11.00

Hi Shiv,

Most likely you have installed GDB for 11.11 in 11.0. Anyways, that doesn't matter. You can use gdb32 to debug a 32bit app. First, find out which httpd you want to debug. (Use file option to find 32 or 64 bit). If you have a core file, you can start straight away.

# gdb httpd core

If you know the PID of httpd, you can attach GDB to running process,

gdb>attach


Some useful links,
http://users.actcom.co.il/~choo/lupg/tutorials/debugging/debugging-with-gdb.html
http://www.delorie.com/gnu/docs/gdb/gdb_toc.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"