1825950 Members
3054 Online
109690 Solutions
New Discussion

GDB on HP UNIX Machines

 
CA1490051
Frequent Advisor

GDB on HP UNIX Machines

Hi All,

The need is we have to compile our code with gcc and g++ compiler.
So we downloaded gcc version 4.2.1 and we are able to work successfully on our HP UNIx 11i (PA-RISC ) Machine.

But, when we try to debug our code by compiling the g++ and gcc compilers using "-g" flag the debugger behaves strangely.

As soon as i open the executable through wdb, a message is displayed saying breakpoint for main is set in the Source that doesnt exist in the PATH.

So , my doubt is can we use the HP UNIX "gdb" and "wdb" on the executables that are generated by gcc compilers.

Also, where to get the gcc compilers for HP UNIX Itanium machine.

Can some one help me to solve these issues?

thanks and regards
Vikram


12 REPLIES 12
Murat SULUHAN
Honored Contributor

Re: GDB on HP UNIX Machines

Hi Vikram

you can look at following url for gcc

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-4.2.2/

Be carefull about dependencies

Best Regards
Murat
Murat Suluhan
Dennis Handly
Acclaimed Contributor

Re: GDB on HP UNIX Machines

WDB/GDB has some support for gcc/g++ but is isn't perfect as you found.
Make sure you are on the latest wdb, 5.7:
http://www.hp.com/go/wdb
CA1490051
Frequent Advisor

Re: GDB on HP UNIX Machines

Hi Dennis,

It means we cannot use WDB to debug the coredumps produced from gcc 4.2.1 compilers.

But, we have to do this. Please let me know to achive this.

even if we can achive through gdb, it is OK for us. But i want to know the exact versions of gdb and gcc and the site where i can download the depot file for gdb for different gcc versions.

thanks and regards
Vikram
James R. Ferguson
Acclaimed Contributor

Re: GDB on HP UNIX Machines

James R. Ferguson
Acclaimed Contributor

Re: GDB on HP UNIX Machines

Hi (again) Vikram:

It would seem that a better source for 'gdb' than the porting center might be:

http://sources.redhat.com/gdb/

Regards!

...JRF...
CA1490051
Frequent Advisor

Re: GDB on HP UNIX Machines

Hi JRF,

thank you very much. But, can i use the GDB 6.7.X from the Linux site in HP UNIX 11i PA RISC and also Itanium.

Though i havnt installed still and tried,
i wanted to clearify before installing.

Please let me know if i have to take any special care to use the same.

thanks and regards
Vikram
Dennis Handly
Acclaimed Contributor

Re: GDB on HP UNIX Machines

>It means we cannot use WDB to debug the coredumps produced from gcc 4.2.1 compilers.

Are you saying you tried this and it doesn't work? What version of wdb are you using?

>Source that doesn't exist in the PATH.

If this is your only error, just use the "dir" command to add source directories.

>But i want to know the exact versions of gdb and gcc and the site where i can download the depot file for gdb for different gcc versions.

First try using the latest wdb (on my link above) before you fall back to the foreign devil gdb.
CA1490051
Frequent Advisor

Re: GDB on HP UNIX Machines

Hi Dennis,

Now i am able to open the executable and the core file using the wdb graphical version.

Noe i am trying to debug a core dump. Before i explain the problem a overview of my directory structure is as follows

I have my source files as
MAINDIR - DIR1 -Src
- Hdr
- DIR2 - Src
- Hdr
..
..


I have a makefile in MAINDIR which runs the Makefiles Present in all the Sub Directories.

The Makefiles present in the sub directories compiles the Source codes and generates the shared libraries.

these shared libraries are stored in a common directory in
MAINDIR
- DIREXEANDLIB

Now i am trying to run the Executable present in the DIREXEANDLIB
The gdb debugger in the wdb is able to show me the function from which the core is generated.

But i am not able to open the Source files and set break points in the Source functions both in gdb and wdb.
the Debugger says source file not find in the Path.
am i missing out something here.
Cam any one Please help me to come out of this.




Dennis Handly
Acclaimed Contributor

Re: GDB on HP UNIX Machines

>overview of my directory structure is as follows:
MAINDIR - DIR1 -Src
- Hdr
- DIR2 - Src
- Hdr

(Your spacing is removed unless you check the box when submitting.)

Assuming you have:
./DIR1/Src
./DIR1/Hdr ??
./DIR2/Src
./DIR2/Hdr ??
./DIREXEANDLIB

>But i am not able to open the Source files

If you are in DIREXEANDLIB, you need to use paths to your source files:
(gdb) dir ../DIR1/Src ../DIR2/Src

(or use absolute paths)

You shouldn't have to add the header paths since the compiler records everything relative to the compilation directory.

See "7.3 Specifying source directories" in the wdb documentation:
http://h21007.www2.hp.com/portal/download/files/unprot/devresource/Tools/wdb/doc/gdb57.pdf

Note on IPF you wouldn't have to do this unless you moved the sources.
Dennis Handly
Acclaimed Contributor

Re: GDB on HP UNIX Machines

>ME: Note on IPF you wouldn't have to do this unless you moved the sources.

Hmm, when I use gcc 3.3.2 and wdb 5.7.4, it appears I don't need the dir command.
CA1490051
Frequent Advisor

Re: GDB on HP UNIX Machines

Hi Dennis,

Ok ultimately i will go to gcc-3.3.2 which you are also using i tried to get this depot
in the site u sent for 4.2.2 but i am not able to find it.

can you please send me the proper link to download the same.

thanks and regards
Vikram
Dennis Handly
Acclaimed Contributor

Re: GDB on HP UNIX Machines

>ultimately i will go to gcc-3.3.2

Why? I assume if 3.3.2 has this feature then 4.2.2 will.

>can you please send me the proper link to download the same.

I have no clue. It just magically appeared in the lab, 4 years ago. :-)