Pick a Free OS

User login

Navigation

Introducing Motor, Part 2: Advanced usage

positions and highlights the first line in the main() function of your

program. Then, pressing F8 or F7 (remember the difference) you can go

through all the program source cycling into 'for' and 'while'

constructions, entering and exiting functions, etc.

"Go to cursor" command

This option allows you to stop a program at any line in the code. To

do it, just position the cursor on the line you want Motor to stop the

program and press F4. The program will execute until this line is

reached. Then Motor will let you decide what to do next. You can

terminate the debug session with Ctrl-F12.

Breakpoints

A "breakpoint" makes your program stop every time a certain line in

the source is reached. To set a breakpoint at the specific line just

position the cursor and press Ctrl-B. The line will be highlighted and

next time it is passed, motor will stop and let you do further

debugging. If you press Ctrl-B on an already highlighted line,

breakpoint is removed. A list of the breakpoints can be invoked using

Alt-B.

Inspecting Data

Evaluate/Modify Dialog

During debug, you may wish to see values of various variables to get a clear

view of what is happening in your code. The easiest way to see a value,

evaluate an expression or even modify some data is the "Evaluate/modify"

dialog. It is opened with the Alt-E key and contains the following

controls: expression to evaluate, its value and the "change" item.

Entered expressions are evaluated and their values are displayed. To

change the expression or its value, just position on an appropriate

item and press "Enter". But sometimes you might want to keep an eye on some

variable values all the time as you jump through the source code.

"Watches" is a useful feature in this case.

Watches

To watch variables or expression values, you should open the watches

window with Alt-W. Here you can add/remove watches or change values

of the variables being watched. Press ESC-ESC or Alt-W to switch back to the