📄 c_b.htm
字号:
<title>The b Command</title><h1>b</h1><!--INDEX "breakpoint number" brkcmd "b command" -->The b command sets and displays breakpoints.<p></dl><h2>Format</h2><dl><dd>The format for the b command is:<p><pre>bb <var>adr..</var>b <var>adr</var> -s <var>str</var></pre><p>where:<p><table><tr><td width=50><var>adr</var></td><td> specifies an address for the breakpoint. Up to 32 breakpoints addresses can be set.</td></tr><tr><td>-s <var>str</var></td><td> executes the command string when the breakpoint is hit.</td></tr></table><p>Invoking the b command with no options causes the <a href="mondef.htm">Monitor</a> to print a list of the current breakpoints. <p></dl><h2>Functional Description</h2><dl><dd>The b command sets a breakpoint at the specified address or addresses. Multiple addresses may be specified. Specified addresses must be word-aligned. <p>This command is effectively a "pass-thru" to the <a href="c_when.htm">when</a> command. Issuing the command, "<samp>b main</samp>" is equivalent to issuing the command, "<samp>when @pc==main stop</samp>". However, unlike the <samp>when</samp> command, the <samp>b</samp> command cantake multiple addresses.<p>The <a href="mondef.htm">Monitor</a> automatically assigns a number to each breakpoint. The <a href="mondef.htm">Monitor</a> allocates the lowest available breakpoint number from 0 to 31 to any new breakpoint. <p>The <a href="mondef.htm">Monitor</a> reports a new breakpoint's number immediately after the breakpoint is set (see the examples at the end of this subsection for illustration of this). The assigned numbers can be used in the <a href="c_db.htm">db</a> (Delete Breakpoint) command.<p><b>The brkcmd Variable </b><p>When a breakpoint is reached, the command list specified in the environment variable brkcmd is executed. The default setting for brkcmd is:<p><pre>brkcmd = "l @pc 1"</pre>This command "<samp>l @pc 1</samp>", specifies that when the breakpointoccurs, the <a href="mondef.htm">Monitor</a> will disassemble one line starting at the addressof the program counter.<p>You can change the breakpoint command variable with the set command. For example, you can include additional monitor commands in the brkcmd variable. You must separate additional commands on the command line with a semicolon. For example, entering the following command lists one line after reaching a breakpoint, and then displays all the register values.<p><pre>set brkcmd "l @epc 1;r *"</pre>By default, breakpoints are cleared when the load command is executed. See the section on the load command later in this document for details on how to override automatic breakpoint clearing after a download operation.<p>Some examples illustrating the use of the b command follow.<p><table><tr><td><samp>PMON> b a002000c </samp></td><td>Set a breakpoint at 0xa002000c.</td></tr><tr><td><samp>Bpt 1 = a002000c</td></tr><tr><td><samp>PMON> b <br>Bpt 0 = 8002022c<br>Bpt 1 = a002000c</samp></td><td valign=top>Display all breakpoints.</td></tr><tr><td valign=top><samp>PMON> b 80021248 -s "r" </samp></td><td>Set a breakpoint at 0x80021248. Display registers when the breakpoint is encountered.</td></tr></table><p></dl><h2>See Also </h2><dl><dd><a href="c_db.htm">db</a>,<a href="c_when.htm">when</a>, and <a href="c_load.htm">load</a> commands.</dl><p><hr><b>Navigation:</b> <a href="index.htm">Document Home</a> | <a href="doctoc.htm">Document Contents</a> | <a href="docindex.htm">Document Index</a> <p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -