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 />

and rev, discussed already in What Code to Display, p.254. The following commands<br />

are also especially useful because of CrossWind graphical extensions:<br />

display /W expr<br />

The and buttons provide a convenient way to generate active displays<br />

of symbol and pointer values, allowing you to monitor important data as your<br />

application executes under debugger control. However, sometimes the most<br />

useful data to monitor is the result of an expression—something that does not<br />

appear in your program, and hence cannot be selected before clicking a button.<br />

In this situation, you can use the CrossWind /W format with the GDB display<br />

command to request an inspection window from the command panel. Because<br />

you type the expression argument directly, you can use any source-language<br />

expression to specify the value to monitor. An inspection window appears,<br />

which behaves just like those generated with buttons (CrossWind Buttons,<br />

p.244).<br />

frame n<br />

Displays a summary of a stack frame, in the command panel. But it also has a<br />

useful side effect: it re-displays the code in the program-display panel,<br />

centered around the line of code corresponding to that stack frame.<br />

Used without any arguments, this command provides a quick way of restoring<br />

the program-display panel context for the current stack frame, after you scroll<br />

to inspect some other region of code. Used with an argument n (a stack-frame<br />

number, or a stack-frame address), this command provides a quick way of<br />

looking at the source-code context elsewhere in the calling stack. For more<br />

information about stack frames in GDB and about the GDB frame command,<br />

see GDB User’s Guide: Examining the Stack.<br />

7<br />

Managing Targets<br />

Instead of using the Targets menu (CrossWind Menus, p.238), you can select a target<br />

from the command panel with the target wtx command. The two methods of<br />

selecting a target are interchangeable; however, it may sometimes be more<br />

convenient to use the GDB command language—for example, you might specify a<br />

target this way in your .gdbinit initialization file or in other debugger scripts.<br />

target wtx servername<br />

Connects to a target managed by the target server registered as servername in<br />

the <strong>Tornado</strong> registry, using the WTX protocol. Use this command regardless of<br />

whether your target is attached through a serial line or through an Ethernet<br />

connection; the target server subsumes such communication details. (See<br />

257

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

Saved successfully!

Ooh no, something went wrong!