previous next top contents index framed top this page unframed
Data browsers are often created automatically when a breakpoint is reached in a debuggable program, or can created explicitly with the Show->Data Browser menu item; see Section 6.7.6.
A browser can display individual variable values, whole dynamic objects, stacks, and individual stack frames. A data browser also can also set watch conditions that are evaluated periodically during execution and can cause your program to break when the condition is met; see Section 4.3.
The data browser window contains a display area in which it displays the current object; initially, only one object at a time is visible in a data browser. However, you can create multiple panes within the same data browser window, each pane showing a different object. You can also create multiple data browsers; a new one is created each time you choose Show->Data browser.
The browser's display area can be scrolled horizontally and vertically so that you can view large objects. The display area also gets larger when you increase the size of the data browser window, so that you can see more of a large object at once.
Each displayed object is assigned a number and a title, such as “Record of class C”. All displayed objects are remembered (unless deleted) and can be redisplayed in various ways. Displayed objects are updated whenever they are redisplayed (including each time the debugger gets control).
A “POINTER button” is drawn beside each non-Zero POINTER that is a component of a displayed object, e.g., a POINTER record field. You can click on a POINTER button to display the entity pointed to; the newly displayed object becomes the currently displayed object. This allows you to traverse a data structure quickly. A POINTER button is also displayed beside each non-Zero ADDRESS or CHARADR value; clicking on the button displays raw memory starting at the specified location.
Clicking on a POINTER button next to a PROCEDURE name in the stack object sets the debugger's command context to that invocation of the PROCEDURE.
Figure 4–3. Local Variables of Program in Figure 4–2 Displayed with POINTER Buttons Shown Next to POINTER Variables
![]() |
Figure 4–4. Record Displayed after Clicking on a POINTER Button in Figure 4–3
![]() |
In the object that is the list of watched expressions, an additional button (the “watch button”) appears beside each expression (farther to the left than the POINTER button, if the watched expression is a POINTER). By clicking on the watch button for an expression, you bring up a dialog box where you can see the context where the expression is defined, set any break conditions associated with the expression, or remove the expression from the list of watched expressions.
A stack display shows all PROCEDURE frames on
the stack. Each frame is shown as
moduleName.procedureName.offset,
where offset is
the MODULE displacement indicated by the return
address. If the PROCEDURE is debuggable, its
local variables are displayed, and a
POINTER box is drawn beside it. Clicking on
this box causes that PROCEDURE invocation to
become the debugger's current PROCEDURE. Thus,
you can scroll up and down a stack and instruct
the debugger to make any debuggable frame the
current context.
If the Display Local Variables option of the Show->Options
command is set and the current PROCEDURE is compiled debuggable,
the local variables for the current PROCEDURE
context are shown in a data browser window as object number zero
(so it can
be quickly found using the first button).
When the values are first
shown, a new data browser window is created if one does not already
exist; otherwise, the most recently created data browser window is used.
This data browser window is then used for subsequent local variable
displays, with a new local variable display updating the old one.
If the Display Interface and Outer Variables option of the
Show->Options command is set,
the interface and outer variables for the
current debugger MODULE context are shown in a data browser window
selected as described above for Display Local Variables.
If both Display Local Variables and
Display Interface and Outer Variables are set, the local variable
and interface and outer variable displays are shown
together in the same data browser window as if they are values of a
single object.
Both options are set by default.
4.1. Navigation Controls
A data browser window contains the following navigation controls
(the bottom two rows of the three rows of buttons):
4.2. Display Object or Display Memory
The dspy obj and dspy mem buttons display an object's contents
or arbitrary memory in the current pane of the data browser.
Each expects its argument to be a valid POINTER, ADDRESS,
or CHARADR expression.
The argument is the expression
entered in the text widget in the upper right of the browser window.
When you define a watch expression, it must be legal in the current context (unless you use a bracketed watch expression specifier, as described below). You usually define a watch expression after having set and reached a breakpoint that puts you in the context in which the expression is meaningful.
4.3.1. Break Conditions for Watch Expressions
Break conditions can be associated with each watch expression.
The break condition is evaluated periodically, either at PROCEDURE
entry or at the execution of each statement,
to see whether the break condition is TRUE.
These break conditions are different from the conditions associated
with a breakpoint, which are evaluated only when control reaches the
location of the breakpoint.
Watch expression break conditions can be evaluated in any context
where the watch expression is valid.
Watch expression break conditions can cause the debugger to break
when the expression becomes non-Zero (or TRUE)
or Zero (or FALSE).
They can also cause a break when the expression's value changes.
This is especially useful if a variable or memory location is
being set to an incorrect value, but you do not know where the value
was set.
4.3.2. Controlling the Data Section or Coroutine in Which
an Expression Is Watched
By default, an expression containing a local variable is watched
only in the coroutine and data section where you started watching it,
and an expression that does not contain local variables only in the
data section where you started watching it
(if there is a MODULE context but no data
section for that MODULE,
an expression without local variables is watched for
every data section of the MODULE).
For example,
if you have a local variable named i in the PROCEDURE
proc
that is the debugger's current command context, and you specify
a watch expression as i, you watch i only for the current data
section (say, the data section for MYMOD at
'H123450) and current coroutine (say, CO1).
If you call proc in a different data section of MYMOD
(say, 'H234560),
or in a different coroutine (say CO2),
the watched value of i is not updated.
You can have control over the data section and coroutine in which an expression is watched by prefixing the expression with a bracketed watch expression specifier of the form:
[{coroutineName:}moduleName{.procedureName}]
where the parts in curly braces are optional. procedureName is required if the expression contains local variables.
For example, to watch the variable i mentioned above in all data sections of MYMOD and in all coroutines, use:
[myMod.proc]i
To watch i in all data sections of MYMOD but only in the coroutine CO2, use:
[co2:myMod.proc]i
(There is currently no way to watch a local variable in a particular data section but in all coroutines.)
To watch an outer variable ov of MYMOD in all data sections for MYMOD, use:
[myMod]ov
The data browser contains the following controls for watching expressions:
4.4.1. The Watch Expr Window
The Watch Expr window allows break conditions to be associated
with a watched expression.
Break conditions can be evaluated at each statement, or at each PROCEDURE entry (the default). All break conditions are evaluated at the same time; i.e., it is not possible to define some break conditions that are evaluated only at PROCEDURE entries and others that are evaluated at statements.
The Watch Expr window contains the following displays and controls:
Note: If a break condition associated with a watch expression is not explicitly removed after it is reached, the debugger may break again because of the same condition. In the case of a Zero or NonZero condition, the debugger breaks on each statement (if watch expression break conditions are being evaluated at the statement level) or PROCEDURE entry (if watch expression break conditions are being evaluated at the PROCEDURE level) until the expression again becomes non-Zero or Zero, respectively. In the case of a Changes Value condition, the debugger breaks each time the expression acquires a value different from its last evaluated value.
Note: This is a global option that controls all break conditions, not just the one whose definition is currently being shown. It is included in this window for convenience; it can also be set with the Show->Options command.
You can click on the L button to interrupt program execution while a break condition is in effect. When you click on L, the debugger remembers that you did so. Each time the debugger prepares to evaluate break conditions (at each PROCEDURE entry or at each statement), it first checks to see if you have clicked on L. If so it breaks without evaluating break conditions, then forgets that you clicked on L. This is especially important when evaluating break conditions at statements since programs can run for a very long time and you can become curious as to how far execution has gotten.
Suppose you really need to evaluate a break condition at statements, but this slows your program too much. An alternate approach is as follows:
Motif-Based MAINSAIL Tools Reference Guide, Chapter 4