1752618 Members
4585 Online
108788 Solutions
New Discussion юеВ

Using the debugger

 
SOLVED
Go to solution
CA1490051
Frequent Advisor

Using the debugger

Hi ,

I have the following questions. Please suggest the solution for them.

1) Can I use the WDB debugger with the aCC compiler in HP-UX 11i machine or should i use DDE only.

2) Can I use "-g" Flag to compile the source code so that i can open the executable

3) Can I open the Core dump (core File) in the debuggers ?


thanks in advance
Vikram
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Using the debugger

A. Clay Stephenson
Acclaimed Contributor

Re: Using the debugger

1) I actually prefer to use gdb since wdb is simply a GUI front-end for gdb but wither can be used.

2) The -g flag is not strictly necessary for debugging but it does make life easier because this options includes debugger data in the object file(s). The most common debugger operation is a stack trace. Without -g, you will see the machine instructions that preceded the aborted but with -g you will see the source file and line number.

3) Yes,
gdb myexe core

If compiling with -g you can also add -d options to tell the debugger where the source files are located.

The bad news is that if you have to ask this kind of stuff, you probably aren't the person that needs to be doing this.

Rather than trying to debug a complex program, I would write a small very buggy program (e.g. use a large negative subscript in an array assignment) and compile your code with -g. Allow it to die and produce a core file and debug it first. You can also run an executable under the debugger. Man gdb for details.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: Using the debugger

Why would you want to use the obsolete and unsupported DDE?
If you want a GUI, there is wdb, if you want a command line, there is gdb.

>2) Can I use "-g" Flag to compile the source code so that i can open the executable

(On Unix, you don't (windows) "open" executables, you run or debug them.)

As Clay says, using -g will help tremendously in the debugger.

>Clay: Without -g, you will see the machine instructions that preceded the aborted

On IPF, you'll also see the source and line info, even if you don't use -g.

>If compiling with -g you can also add -d options

You can also use the "dir" command to do this.

>The bad news is that if you have to ask this kind of stuff,

There is all sorts of documentation on the wdb web site:
http://www.hp.com/go/wdb

>I would write a small very buggy program (e.g. use a large negative subscript in an array assignment) and compile your code with -g.

You can also debug this with IPF's +check=bounds.