HP 3000 Manuals

Entering Commands (cont..) [ Symbolic Debugger/iX User's Guide ] MPE/iX 5.0 Documentation


Symbolic Debugger/iX User's Guide

Entering Commands (cont..) 

Entering Procedure Calls (cont.) 

Breakpoint Commands 

A breakpoint, when encountered, suspends the execution of the program at
a particular location.  HP Symbolic Debugger provides a number of
commands for setting, deleting, and managing breakpoints.  The breakpoint
commands are:

   *   Overall
          *   lb (list breakpoints)
          *   tb (toggle breakpoints)

   *   Creation
          *   b (breakpoint)
          *   ba (breakpoint address)
          *   bb (breakpoint beginning)
          *   bt (breakpoint trace)
          *   bu (breakpoint uplevel)
          *   bx (breakpoint exit)

   *   Status
          *   ab (activate breakpoint)
          *   bc (breakpoint count)
          *   db (delete breakpoint)
          *   sb (suspend breakpoint)

   *   All-Procedures
          *   bp (breakpoint procedure)
          *   bpt
          *   bpx
          *   dp (delete procedure)
          *   Dpt
          *   Dpx

   *   Global
          *   abc
          *   dbc

   *   All-Paragraph (HP COBOL II only)
          *   bpg (breakpoint paragraph)
          *   dpg (delete paragraph)
          *   tpg (trace paragraph)

   *   Auxiliary
          *   "any string"
          *   i (if)
          *   Q (Quiet)

Once a breakpoint has been encountered during program execution, you can
examine the program state, unless the breakpoint command list includes a
command that causes the child process to continue or terminate.  Examples
of these commands are the c (continue), r (run), k (kill) and q (quit)
commands.  Individual breakpoints are identified by a unique number,
which is assigned by the debugger.

Breakpoints can be activated or deactivated (suspended) individually.
When a breakpoint is suspended, information for that breakpoint is
retained, but it will not affect program execution.  There is also an
overall breakpoint mode for breakpoint activation and suspension, which
is independent of the state of any individual breakpoint.  Any given
breakpoint will affect program execution only if it is individually
activated and the overall mode is activated.  Any active breakpoint whose
location is visible in the source window will be marked with an asterisk
(*) in the leftmost screen column.  Note that only those breakpoints that
are associated with a line number are marked in the source window in
source mode.  In disassembly mode, all breakpoints are displayed whether
associated with a line or machine instruction.

Three parameters are associated with breakpoint commands, location, count 
and
command list.  These parameters are described below:

Location            You can set a breakpoint at the current location 
                    (where the prompt (>) appears in the source window)
                    or at any other executable statement or instruction.
                    You can specify the location of the breakpoint in a
                    variety of ways:

                       *   line number

                       *   procedure name

                       *   label

                       *   symbolic address (with or without offset)

                       *   absolute (numeric) address

                    Each of these ways of specifying a location is simply
                    an alternate way to specify the breakpoint address.
                    The breakpoint is encountered whenever the location 
                    is about to be executed, regardless of the path taken
                    to get there.  Only one breakpoint at a time of a
                    particular type may be set at a given location.
                    Setting a new breakpoint at the same location
                    replaces the existing one.

Count               The count is the number of times a breakpoint
                    statement or instruction is executed before the
                    program is stopped.  If the count is positive, the
                    breakpoint is permanent.  If the count is negative,
                    the breakpoint is temporary and is cleared when the
                    program stops there.  When you enter a new breakpoint
                    without a count, the breakpoint is permanent and a
                    count of 1 is used.  To change the count of an
                    existing breakpoint, use the bc (breakpoint count)
                    command.

                    An alternate way to enter a breakpoint is to enter t 
                    for a temporary breakpoint and p for a permanent
                    breakpoint.  Entering a t or p by itself sets the
                    count to -1 or 1, respectively.  You can precede a t 
                    or p with a positive integer for a count of more than
                    one.

Command List        A command list is one or more commands that are
                    executed when its associated breakpoint occurs.
                    Separate commands in a command list by semicolons.
                    Use braces {} to separate the breakpoint
                    command list from other debugger commands on the same
                    line.

                    ____________________________________________________ 

                    CAUTION  Only one active command line can exist at
                             one time.  A command line is either the
                             sequence of commands you enter at the
                             debugger prompt or the command list
                             associated with a breakpoint or assertion.
                             If a new command line is encountered before
                             all commands in the previous command line
                             are executed, those remaining commands are
                             discarded.  For example, suppose you set a
                             breakpoint in a function called func1 which
                             has the following command list:

                                  {Q;p "hello\n";c}

                             Then, from the command line you execute:

                                  >p func1();p "goodbye\n"

                             This will print hello, but not goodbye.

                    ____________________________________________________ 

Types of Breakpoints 

Breakpoints can be separated into two general classes:

   *   Individual (single) breakpoints

       These are explicitly set by the user at a given location.

   *   All-Procedure or All-Paragraph breakpoints

       These are breakpoints attached to all debuggable procedures or
       paragraphs by a single command.  They do not have a count or
       lifespan.

There are six basic types of single breakpoints.  There can only be one
type of single breakpoint at a given location in the code.

Generic                               Set with the b (breakpoint) command
                                      at a given source-line.

Address                               Set with the ba (breakpoint 
                                      address) command at a given address
                                      (which might not correspond
                                      directly to a source line).

Procedure or paragraph beginning      Set with the bb (breakpoint 
(entry)                               beginning) command at the first
                                      executable statement of a
                                      procedure.

Procedure or paragraph exit           Set with the bx (breakpoint exit)
                                      command at the common exit point of
                                      a procedure, for example, the
                                      procedure epilogue where all
                                      returns go through (usually does
                                      not correspond to a source line).

Procedure trace (entry/exit)          Set with the bt (breakpoint trace)
                                      command at the procedure entry and
                                      exit.

Uplevel                               Set with the bu (breakpoint 
                                      uplevel) command at the return
                                      address of a given procedure call,
                                      for example, the first instruction
                                      executed after a return (which
                                      might not correspond directly to a
                                      source line).

There are three basic types of all-procedure breakpoints.  These may
co-exist with other all-procedure breakpoints and/or a single breakpoint
at a given location.

Procedure (beginning)     Set with the bp (breakpoint procedure) command
                          at the first executable statement of all
                          procedures.

Procedure exit            Set with the bpx command at the common exit
                          point of all procedures.

Procedure trace           Set with the bpt command at the entry and exit
                          of all procedures.

At a given procedure entry, up to four command lists can be associated
with the location:

   *   Global breakpoint command list

       Set with the abc command.

   *   Individual procedure beginning breakpoint command list

       Set with the bb (breakpoint beginning) command.

   *   All-procedure beginning breakpoint command list

       Set with the bp (breakpoint procedure) command.

   *   All-procedure trace breakpoint command list

       Set with the bpt command.

Also, at a given procedure exit, up to four command lists can be
associated with the location:

   *   Global breakpoint command list

       Set with the abc command.

   *   Individual procedure exit breakpoint command list

       Set with the bx (breakpoint exit) command.

   *   All-procedure exit breakpoint command list

       Set with the bpx command.

   *   All-procedure trace breakpoint command list

       Set with the bpt command.

There are two basic types of all-paragraph breakpoints.  These may
co-exist with other all-paragraph breakpoints and/or a single breakpoint
at a given location.

Paragraph (beginning)     Set with the bpg (breakpoint paragraph) command
                          at the first executable statement of all
                          paragraphs.

Paragraph trace           Set with the tpg (trace paragraph) command at
                          the entry of all paragraphs.

At a given paragraph entry, up to four command lists can be associated
with the location:

   *   Global breakpoint command list

       Set with the abc command.

   *   Individual paragraph beginning breakpoint command list

       Set with the bb (breakpoint beginning) command.

   *   All-paragraph beginning breakpoint command list

       Set with the bpg (breakpoint paragraph) command.

   *   All-paragraph trace breakpoint command list

       Set with the tpg command.

At a given paragraph exit, up to two command lists can be associated with
the location:

   *   Global breakpoint command list

       Set with the abc command.

   *   Individual paragraph exit breakpoint command list

       Set with the bx (breakpoint exit) command.

Overall Breakpoint Commands 

lb (list breakpoints) 

{lb              }
{list breakpoints}
Displays all breakpoints in the program, both active and suspended, and
the overall breakpoint state.

The display shows the number, count, status and commands for each
breakpoint.  Figure 4-2 gives an example of the information that is
displayed for a typical breakpoint.  This information is also displayed
whenever a breakpoint is added or deleted.

[]
Figure 4-2. Listing a Breakpoint tb (toggle breakpoints) {tb } {toggle breakpoints} Toggles the overall breakpoint state from active to suspended or vice versa. The state of the individual breakpoints remains unchanged.


MPE/iX 5.0 Documentation