⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-debugger8.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Debugger   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-debugger.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-debugger7.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-customize.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="85600">8.8  &nbsp;&nbsp;Tcl: Debugger Customization</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85602"> </a>Like every other Tornado tool, the debugger's graphical user interface is "soft" (amenable to customizing) because it is written in Tcl, which is an interpreted language. The <i class="title">Tornado API Reference: GUI Tcl Library</i> describes the graphical building blocks available. You can also study the Tcl implementation of the debugger graphical interface itself, in <b class="file">host\resource\tcl\CrossWind.win32.tcl</b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85604">8.8.1  &nbsp;&nbsp;Tcl: Debugger Initialization Files</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85606"> </a>You can write Tcl code to customize the debugger's graphical presentation in a file called <b class="file">crosswind.tcl</b>. The debugger looks for this file in two places: first under <b class="file">c:\tornado</b> (or whatever directory you specify with the environment variable <b class="symbol_UC">WIND_BASE</b>), and then in the directory specified by the <b class="symbol_UC">HOME</b> environment variable (if that environment variable is defined). Use this file to collect your custom modifications, or to incorporate shared modifications from a central repository of Tcl extensions at your site.</p><dd><p class="Body"><a name="85609"> </a>Recall that the debugger uses two separate Tcl interpreters. Previous sections described the <b class="file">.gdbinit</b> and <b class="file">gdb.tcl</b> initialization files for the debugger command language (see <a href="c-debugger7.html#85425"><i class="title">8.7&nbsp;Tcl: Debugger Automation</i></a>). The following outline summarizes the role of all the Tornado debugger customization files. The files are listed in the order in which they execute:</p></dl><dl class="margin"><dd><div class="Item"><a name="85613"> </a><b class="file">%</b><b class="symbol_UC">WIND_BASE</b><b class="file">%\.wind\gdb.tcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="85614"> </a>Use this file to customize the Tcl interpreter built into GDB itself (for example, to define Tcl procedures for new GDB commands). This file is unique to the Tornado debugger (that is, it is not shared by any other GDB configuration you might install).</div><br><dd><div class="Indent"><a name="85615"> </a>The version of this file under <b class="file">%</b><b class="symbol_UC">WIND_BASE</b><b class="file">%</b> (for example, in <b class="file">c:\tornado\.wind</b>) is shared by everyone who uses Tornado on the same PC.</div><br></dl><dd><div class="Item"><a name="85616"> </a><b class="file">%</b><b class="symbol_UC">HOME</b><b class="file">%\.wind\gdb.tcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="85617"> </a>If more than one developer uses the same PC as a Tornado host, you can use this file just like the shared version of <b class="file">gdb.tcl</b> described above, but for user-specific customizations; each user can specify a different directory in the <b class="symbol_UC">HOME</b> environment variable.</div><br></dl><dd><div class="Item"><a name="85618"> </a><b class="file">%</b><b class="symbol_UC">HOME</b><b class="file">%\.gdbinit</b> </div><dl class="margin"><dd><div class="Indent"><a name="85619"> </a>Use this file for any initialization you want to perform in GDB's command language rather than in Tcl. This file is not unique to the Tornado debugger; it is shared by any other GDB configuration you may install.</div><br></dl><dd><div class="Item"><a name="85620"> </a><b class="file">.gdbinit</b> </div><dl class="margin"><dd><div class="Indent"><a name="86177"> </a>Akin to the <b class="file">.gdbinit</b> in your home directory, the version of this file in the current working directory also contains commands in GDB's command language, and is not unique to the Tornado configuration of GDB. However, this file is specific to a particular working directory; thus it may be an appropriate place to record application-specific debugger settings.</div><br></dl><dd><div class="Item"><a name="85621"> </a><b class="file">%</b><b class="symbol_UC">WIND_BASE</b><b class="file">%\.wind\crosswind.tcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="86710"> </a>Use this file to customize the debugger's graphical presentation, using Tcl--for example, to define new buttons or menu commands. This file is unique to the Tornado debugger (that is, it is not shared by any other GDB configuration you might install).</div><br><dd><div class="Indent"><a name="86711"> </a>The version of this file under <b class="file">%</b><b class="symbol_UC">WIND_BASE</b><b class="file">%</b> is shared by everyone who uses Tornado on the same PC.</div><br></dl><dd><div class="Item"><a name="85624"> </a><b class="file">%</b><b class="symbol_UC">HOME</b><b class="file">%\.wind\crosswind.tcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="85625"> </a>If other developers use the same PC as a Tornado host, you can use this file in the same way as the shared version of <b class="file">crosswind.tcl</b> described above, but for user-specific customizations; each user can specify a different directory in the <b class="symbol_UC">HOME</b> environment variable.</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="85626"> </a>You can prevent the Tornado debugger from looking for the two <b class="file">.gdbinit</b> files, if you choose, by setting the internal GDB parameter <b class="symbol_lc">inhibit-gdbinit</b> to <b class="keyword">yes</b>. Because the initialization files execute in the order they are listed above, you have the opportunity to set this parameter before the debugger reads either <b class="file">.gdbinit</b> file. To do this, insert the following in <b class="file">gdb.tcl</b>:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85628">gdb set inhibit-gdbinit yes </a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85629">8.8.2  &nbsp;&nbsp;Tcl: Passing Control between the Two Tornado Debugger Interpreters</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85631"> </a>You can use the following specialized Tcl commands to pass control between the two Tornado debugger (CrossWind) Tcl interpreters:</p></dl><dl class="margin"><dd><div class="Item"><a name="85633"> </a><b class="tclProc">uptcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="86185"> </a>From the Tcl interpreter integrated with the GDB command parser, <b class="tclProc">uptcl</b> executes the remainder of the line in the Tornado debugger graphical-interface Tcl interpreter. <b class="tclProc">uptcl</b> does not return a result.</div><br></dl><dd><div class="Item"><a name="85635"> </a><b class="tclProc">downtcl</b> </div><dl class="margin"><dd><div class="Indent"><a name="86187"> </a>From the graphical-interface layer, <b class="tclProc">downtcl</b> executes the remainder of the line in the Tcl interpreter integrated with GDB. The result of <b class="tclProc">downtcl</b> is whatever GDB output the command generates. Use <b class="tclProc">downtcl</b> rather than <b class="tclProc">writeDebugInput </b>if your goal is to capture the result for presentation in the graphical layer.</div><br></dl><dd><div class="Item"><a name="85636"> </a><b class="tclProc">writeDebugInput</b> </div><dl class="margin"><dd><div class="Indent"><a name="85638"> </a>From the graphical-interface layer, <b class="tclProc">writeDebugInput </b>passes its string argument to GDB, exactly as if you had typed the argument in the command panel. A newline is not assumed; if you are writing a command and want it to be executed, include the newline character (<b>\n</b>) at the end of the string. Use <b class="tclProc">writeDebugInput</b> rather than <b class="tclProc">downtcl</b> if your goal is to make information appear in the command panel (this can be useful for providing information to other GDB prompts besides the command prompt).</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="85639"> </a>The major use of <b class="tclProc">uptcl</b> is to experiment with customizing or extending the graphical interface. For example, if you have a file <b class="file">myXWind</b> containing experimental Tcl code for extending the interface, you can try it out by entering the following in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Debugger</font></b> window:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85640"></b><tt class="output">(gdb) </tt><b>tcl upctl source myXWind</a></b></pre></dl><dd><p class="Body"><a name="85641"> </a>By contrast, <b class="tclProc">downtcl</b> and <b class="tclProc">writeDebugInput</b> are likely to be embedded in Tcl procedures, because (in conjunction with the commands discussed in <a href="c-debugger7.html#85499"><i class="title">8.7.3&nbsp;Tcl: Invoking GDB Facilities</i></a>) they are the path to debugger functionality from the graphical front end. </p><dd><p class="Body"><a name="85648"> </a>Most of the examples in <a href="c-debugger8.html#85650"><i class="title">8.8.3&nbsp;Tcl: Experimenting with Tornado Debugger Extensions</i></a>, below, center around calls to <b class="tclProc">downtcl</b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85650">8.8.3  &nbsp;&nbsp;Tcl: Experimenting with Tornado Debugger Extensions</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85655"> </a>The examples in this section use the Tcl extensions summarized in <a href="c-debugger8.html#85659">Table&nbsp;8-2</a>. For detailed descriptions of these and other Tornado graphical building blocks in Tcl, see <i class="title">Tornado API Guide: UI Tcl</i> or <i class="title">Tornado Online Manuals: Tornado API</i>.<p class="table"><h4 class="EntityTitle"><a name="85659"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 8-2:&nbsp;&nbsp;Tornado UI Tcl Procedures Used in Debugger Extensions</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85663"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Tcl Extension</font></b></div></th><td width="10">&nbsp;</td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85665"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -