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.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

Tcl: An Add-Symbols Command for the File Menu<br />

As explained in What Modules to Debug, p.253, you sometimes need to tell the<br />

debugger explicitly to load symbols for modules that were downloaded to the<br />

target using other programs (such as the shell).<br />

Example 7-3 illustrates a File menu command Add Symbols to handle this through<br />

the graphical user interface, instead of typing the add-symbol-file command.<br />

Example 7-3<br />

Add-Symbols Command<br />

# MENU COMMAND: "Add Symbols", additional entry under "File"<br />

menuButtonCreate File "Add Symbols..." S { xwindAddSyms }<br />

#############################################################################<br />

#<br />

#<br />

# xwindAddSyms - called from File menu to add symbols from chosen object file<br />

#<br />

# This routine implements the "Add Symbols" command in the File menu.<br />

# It prompts the user for a filename; if the user selects one, it tells<br />

# GDB to load symbols from that file.<br />

#<br />

# SYNOPSIS:<br />

# xwindAddSyms<br />

#<br />

# RETURNS: N/A<br />

#<br />

# ERRORS: N/A<br />

#<br />

proc xwindAddSyms {} {<br />

set result [noticePost fileselect "Symbols from file" Add "*.\[o|out\]"]<br />

if {$result != ""} {<br />

# we violate good taste here by not capturing or testing the result<br />

# of catch, because GDB poats an error message in the command panel<br />

# when the file cannot be loaded.<br />

}<br />

}<br />

catch {downtcl gdb add-symbol-file $result}<br />

278

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

Saved successfully!

Ooh no, something went wrong!