Sei sulla pagina 1di 9

HIT 2.

x Debugger

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005

1. INTRODUCTION ..............................................................................................................................................................3
2. FEATURES.........................................................................................................................................................................3
2.1. EXECUTION METHODS ........................................................................................................................................................3
2.1.1. Trace Into ..................................................................................................................................................................3
2.1.2. Step Over ...................................................................................................................................................................3
2.1.3. Run To Cursor ...........................................................................................................................................................4
2.2. BREAKPOINTS .....................................................................................................................................................................4
2.3. ACTIVE VARIABLE -DIALOG ................................................................................................................................................4
2.3.1. Dialog ........................................................................................................................................................................5
2.3.2. Change variable value...............................................................................................................................................6
2.3.3. Add variable to Watch-dialog....................................................................................................................................6
2.3.4. Stack frame ................................................................................................................................................................6
2.4. WATCH-WINDOW ...............................................................................................................................................................6
2.4.1. Adding variables........................................................................................................................................................7
2.4.2. Viewing values...........................................................................................................................................................7
2.5. CALL STACK -WINDOW .......................................................................................................................................................8
2.6. GOTO STEP .........................................................................................................................................................................8

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005

1.

Introduction
The HIT debugger provides runtime inspection and modifying facilities. These facilities
provide help to problem solving and error finding. The user can run macro line by line
and control macro execution in many ways, check variables and change their values.
NOTE! To have access to debug information the user must execute a macro in
interactive mode.
All these features are available under the Debug-menu.

2.

Features
2.1.

Execution methods

2.1.1. Trace Into


User can execute a macro line by line by using Trace Into command under the debugmenu. Trace Into is similar to Step Over (explained later), but it will follow the
execution into the user defined functions. Systemfunction calls like strlength(..) cannot
be traced into and they are handled similary with both Trace Into and Step Over
commands.
If a line contains several statements, they are executed at one step. For example
statement
for (i = 0; i< 10; i++) //this line is executed in one step
print(Trace test..\n);
endfor

2.1.2. Step Over


Unlike Trace Into command Step Over will execute user defined functions in one step.
This is very useful if the user encourters a function call that is unnecessary to step
throught, beacuse it might be too long or it just does not bring any interesting
information to the user. When execution bar is on the function call the user can call Step
Over (Ctrl + F10) and function will be executed completely and focus does not enter
inside the function. Execution bar will appear at the next statement line after function
call.

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005
2.1.3. Run To Cursor
Use Run To Cursor command to execute a macro to certain line. To use Run To Cursor,
place the cursor on the desired line and press Ctrl + F12 or choose it under Debugmenu.When the execution reaches that line the macro will be stopped.
Stopping line is highlighted in yellow. After line is executed it will turn to normal again,
i.e. execution will not stop automatically at the same line when it is executed next time.
2.2.

Breakpoints

Use breakpoint to stop execution at desired line of code. You can insert or remove
existing breakpoint by pressing F5 or choosing Toggle breakpoint under the Debugmenu.
Unlike Run To Cursor which also stops execution at desired line, breakpoints are not
removed when the user continues execution from that line.
Breakpoints remain active until they are removed one by one (toggle breakpoint) or by
using Remove all break points.
If the macro is executed in fast mode the breakpoints are omitted.
Breakpoints are highlighted in red.
2.3.

Active variable -dialog

Active variable -dialog displays, as the name indicates, only those variables which are
currently active.
NOTE: You cant inspect Active variables while the macro is running, i.e. the execution
must be stopped before you can open the dialog.
Active variable -dialog shows
variable name
variable scope
variable type
variable state
variable infotext

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005
you can also
change value
add variable to watch-window

2.3.1. Dialog

1. Active variables -dialog.


Variables are divided into branches according to their scope. If there are no variables of
certain scope its branch is not visible. You can expand or collapse scope branches by
pressing +/- sign located in front of the scope name. Scope branches are in expanded
state by default.

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005
Variable line contains its type (integer, string or float), name and value. If the variable is
uninitialized in place value is string <uninitialized>. If the variable is an array, the line
does not include any values, instead size of the array is shown. By pressing the +-sign in
front of the line, all the items of the array is shown (expanded). Items can be hidden by
pressing the - sign.
If infotext is defined to selected variable, it is shown at the bottom of the dialog.
2.3.2. Change variable value
Variable value can be changed through Active variables -dialog by double clicking a
variable line (or array item in the case of arrays). This invokes a dialog that shows you
the name and current value of the variable. Writing a new value and press OK-button to
assign the new value to the variable. The Change value -dialog is shown in picture 2.

2. Change-dialog
In strict mode (projects) the user have to give an explanation why variable value
was changed. This explanation is written to logfile.
2.3.3. Add variable to Watch-dialog
By pressing right button of the mouse, a popup.menu is displayed and from there you can
select Add to Watch-item to add selected variable to Watch-window.
2.3.4. Stack frame
From Stack frame-list you can select which function is the one you are interested in.
Note that this list works like call stack list (explained later) i.e. the list contains only the
functions that are currently under execution.
2.4.

Watch-window

To the Watch-window you can enter variables you like. The Watch-dialog can be open
in run time (but executing is very slow) unlike Active variables -dialog. You can also
6

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005
select yourself the variables you like to show in it and remove if you dont need it
anymore. You can also enter variables that does not exist at the current scope or even in
current macro.
2.4.1. Adding variables
Add variables to Watch-dialog through Add to Watch command under the Debug-menu
or from the Active variables -dialog.

3. Add to Watch-dialog
2.4.2. Viewing values
Watch-dialog will be updated runtime. Here is an example of Watch-dialog:

4. Watch-dialog

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005
2.5.

Call stack -window

The user can inspect the call stack via Call stack -dialog. When a function call is
executed, it is put to top of the stack. When the function exits, the call is removed (pop)
from the stack. Call stack shows you the functions that are currently under execution.
Information in call stack includes names, arguments (type,name and value), and return
types of called functions. Steps include the names of phase and the step. Event name
string is also seen in call stack just before response function data.
NOTE : Phases and steps has neither return types nor arguments!

5. Call stack -dialog


This macro has doarrays()-function as main function and it is at the bottom of the stack.
Currently executed function is test3(..).
2.6.

Goto step

The user can alter the execution by telling the interpreter to jump to selected step. Goto
step is allowed only if there are phases and steps in current macro (or in its include
files). Option is grayed if no steps are found.
To use Goto step, macro must be stopped first. Then from debug-menu choose Goto
step. A dialog (picture 6) pops up. From the dialog the user can select phases from the
phases field. By selecting a phase the steps defined in that phase are seen in steps-field.

INSTRUCTIONS
HIT 2.x Debugger
25.1.2005

6. Goto step dialog.


To tell the interpreter to go to selected step, simply select phase and step, then press goto
step -button. Interpreter jumps to that step.
If strict mode is on (projects) the user must enter an explanation why a deviation
from normal execution was made. The explanation is written to log.

Potrebbero piacerti anche