| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 22)

Debugging Parameters

The Debugging Parameters system table controls the kind of error feedback G2 provides while a KB is running.

G2 saves the values of Warning-message-level, Tracing-message-level, and Breakpoint-level in this table with the KB.

Controlling Error Signalling

The Warning-message-level attribute controls the general error messages that G2 displays in the operator logbook while a KB is running.

This value... Informs G2 to...
0
Not to display any warning messages
1
Display messages when it encounters errors in a KB, such as a rule that it cannot interpret.
2
Display all level 1 messages, plus messages about missing information, such as a reference to an undefined function.
3
Display all level 2 messages and messages about conditions that are interesting but do not necessarily indicate that something is wrong. For example, a level 3 message can inform you that a particular reference in a rule does not denote an existing object, but this may not be a problem. Rather, it may be an expected side effect of the rule.

Controlling Debugging Trace Messages

The Tracing-message-level attribute controls the trace messages that G2 displays in the operator logbook. Trace messages tell you what steps G2 is taking to evaluate expressions and to invoke rules, and the results of those steps.

This value... Informs G2 to...
0
Not display any trace messages.
1
Display messages each time it begins or finishes evaluating any variable, function, generic formula, or generic simulation formula, or when G2 begins or finishes invoking any rule and when G2 begins and finishes executing any procedures and methods. The G2 Simulator, which can use generic simulation formulas, is a superseded capability. For more information, see Appendix F, Superseded Practices.
2
Display all level 1 messages plus messages for rules at the following times: when evaluating the antecedent and when G2 performs each action in the consequent.
3
Display all level 2 messages plus messages at each step when G2 evaluates any expression, generic reference, recursive function, and so on.

Specifying Breakpoints for Debugging

The Breakpoint-level attribute tells G2 to halt a running KB at particular times, called breakpoints, to display a trace message, and to wait for you to acknowledge the message.

The messages that G2 displays at breakpoints are identical to those of the corresponding level of trace messages. At a breakpoint, however, in addition to displaying the message, G2 halts and displays a dialog like this:


G2 cannot continue until you click on one of the choices.

This choice... Has this effect...
Disable-debugging
Changes the value of the Tracing-and-breakpoints-enabled? attribute to no, and continues running.
Pause
Pauses G2 so that you can debug your action, rule, or procedure.
Continue
Resumes G2. This is the default. Select it by pressing the Return key.

Because G2 stops at breakpoints, it does not run in real time when breakpoints are set. Thus, you should never set breakpoints when G2 is controlling an application in real time. Breakpoints are convenient, however, when you are running a simulation that does not run in real time, because you can halt as long as you like at a breakpoint without altering the simulation behavior.

The G2 Simulator, which can provide simulation that does not run in real time, is a superseded capability. For more information, see Appendix F, Superseded Practices.

When you use breakpoint debugging, it is best to change to simulated time. This has the effect of suspending the real-time clock during debugging. For more information about using simulated time, see Timing Parameters.

Enabling Tracing and Breakpoints for Debugging

The Tracing-and-breakpoints-enabled? attribute controls whether G2 can display messages or set breakpoints, regardless of the value of any other system table attribute or the attribute of any item. When the attribute is set to yes, G2 looks at the system table attributes and particular attribute tables to see which attributes are set and what breakpoints and messages it should provide.

When set to no, G2 does not stop for any breakpoints and does not display any trace messages or run-time warning messages.

Each time you load a KB, G2 sets the value of this system table attribute to no. By default, G2 does not stop for any breakpoints and does not display any trace messages or run-time warning messages.

Class-Specific Attributes of Debugging Parameters

The class-specific attributes of the Debugging Parameters system table are:

Attribute Description
Warning-message-level
Controls the general error signalling that G2 performs while a KB is running.
Allowable values:
{0 (no warning messages) | 1 (kb errors only) |
2 (kb errors and deficiencies) | 3 (kb errors, deficiencies, and other conditions) }

Default value:
2 (kb errors and deficiencies)


Tracing-message-level
Controls the trace messages that G2 displays in the operator logbook.
Allowable values:
{0 (no trace messages) | 1 (trace messages on entry and exit ) |
2 (trace messages at major steps) | 3 (trace messages at
every step) }

Default value:
0 (no trace messages)


Breakpoint-level
Tells G2 to halt a running KB at particular times, called breakpoints, display a trace message, and wait for you to acknowledge the message.
Allowable values:
{0 (no breakpoints) | 1 (breakpoints on entry and exit) |
2 (breakpoints at major steps) | 3 (breakpoints at every step) }

Default value:
0 (no breakpoints)


Tracing-and-breakpoints-enabled?
Controls whether G2 can display messages or set breakpoints, regardless of the value of any other system table attribute or the attribute of any item.
Allowable values:
{yes | no}
Default value:
no

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 22)

Copyright © 1997 Gensym Corporation, Inc.