02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7<br />

Debugger<br />

form filename:num (the source file name, a colon, and a line number). For a full<br />

description of linespec formats, see GDB User’s Guide: Printing Source Lines.<br />

search regexp<br />

Displays code centered around the first line (in the current source file) that<br />

contains the regular expression regexp, instead of specifying what line to<br />

display. The command rev is similar, but searches backwards from the current<br />

context. See GDB User’s Guide: Searching Source Files.<br />

break fn<br />

Sets a breakpoint at fn. Instead of first displaying source code, then setting<br />

breakpoints using the graphical interface, you can set a breakpoint directly (if<br />

you know where to go!). The argument fn can be a function name or a line<br />

number. See GDB User’s Guide: Setting Breakpoints.<br />

The break command does not produce a display directly, but sets things up so<br />

that there is at least one place where your program suspends. You can use run<br />

to start the program (except in system mode); when the program suspends at<br />

the breakpoint, the display panel shows the context.<br />

7<br />

Executing Your Program<br />

Just as with the <strong>Tornado</strong> shell, you can execute any subroutine in your application<br />

from the debugger. Use the following commands:<br />

run routine args<br />

This is the principal command used to begin execution under debugger<br />

control. Execution begins at routine; you can specify an argument list after the<br />

routine name, with the arguments separated by spaces. The argument list may<br />

not contain floating-point or double-precision values. (This command is not<br />

available in system mode; use the shell to get tasks started in that mode. See<br />

5.2.6 Using the Shell for System Mode Debugging, p.170.)<br />

call expr<br />

If a task is already running (and suspended, so that the debugger has control),<br />

you can evaluate any source-language expression (including subroutine calls)<br />

with the call command. This provides a way of exploring the effects of other<br />

subroutines without abandoning the suspended call. Subroutine arguments in<br />

the expression expr may be of any type, including floating point or double<br />

precision.<br />

When you run a routine from the debugger using one of these commands, the<br />

routine runs until it encounters a breakpoint or a signal, or until it completes<br />

execution. The normal practice is to set one or more breakpoints in contexts of<br />

255

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!