📄 563-566.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Smalltalk/X</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=31//-->
<!--PAGES=563-566//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="559-563.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch32/567-571.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading21"></A><FONT COLOR="#000077">Using the Debugger</FONT></H3>
<P>The Debugger is displayed whenever an error occurs in your Smalltalk code. It shows you where the error occurred and how the system got there. The Debugger runs in one of three modes; <TT>normal</TT>, <TT>modal</TT>, and <TT>inspecting</TT>.</P>
<P>When in normal mode and an error occurs in a process, which is not the event handler process, the debugger starts up on top of the erroneous process. This blocks all interaction with the affected process and its views. Other views are still active and respond as usual.</P>
<P>When an error occurs in the Smalltalk event handler process, the debugger starts in modal mode. While a modal debugger is active, you can not interact with any other view.</P>
<P>The inspecting mode can be entered from the ProcessMonitor by the pop-up menu and allows inspection of the state of other processes. But because the debugged process may continue to run, it is only possible to inspect a snapshot of the affected process.</P>
<P>The Debugger contains four subviews:</P>
<DL>
<DD><B>•</B> The Context Walkback List shows the context chain which lead to the error.
<DD><B>•</B> The Method Source View shows the method that caused the error.
<DD><B>•</B> The Receiver Inspector allows inspection of the receiver of the selected message.
<DD><B>•</B> The Context Inspector provides information about the arguments and local variables of this context.
</DL>
<P>The Debugger is shown in Figure 31.16.
</P>
<P><A NAME="Fig16"></A><A HREF="javascript:displayWindow('images/31-16.jpg',581,289 )"><IMG SRC="images/31-16t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/31-16.jpg',581,289)"><FONT COLOR="#000077"><B>Figure 31.16.</B></FONT></A> The Debugger.</P>
<P>The functions that are common to each view appear as a set of buttons below the context walkback list. These functions are described in Table 31.13.
</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 31.13.</B> The Debugger function buttons.
<TR>
<TH COLSPAN="2"><HR>
<TR>
<TH WIDTH="30%" ALIGN="LEFT">Button
<TH WIDTH="70%" ALIGN="LEFT">Description
<TR>
<TD COLSPAN="2"><HR>
<TR>
<TD><TT>continue</TT>
<TD>Continues execution.
<TR>
<TD><TT>terminate</TT>
<TD>Terminates the erroneous process.
<TR>
<TD><TT>abort</TT>
<TD>Abort the current activity if possible.
<TR>
<TD VALIGN="TOP"><TT>step</TT> (single step)
<TD>Lets the process continue execution until the next <TT>send</TT> is executed in the currently selected context.
<TR>
<TD><TT>send</TT> (single send)
<TD>Lets the process continue execution for one message send.
<TR>
<TD><TT>return</TT>
<TD>Continues execution as if the selected context returned.
<TR>
<TD><TT>restart</TT>
<TD>Continues execution by restarting the selected context.
<TR>
<TD COLSPAN="2"><HR>
</TABLE>
<P>The walkback subview has a pop-up menu with the functions described in Table 31.14.
</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 31.14.</B> Walkback Subview pop-up menu function.
<TR>
<TH COLSPAN="2"><HR>
<TR>
<TH WIDTH="30%" ALIGN="LEFT">Function
<TH WIDTH="70%" ALIGN="LEFT">Description
<TR>
<TD COLSPAN="2"><HR>
<TR>
<TD><TT>exit smalltalk</TT>
<TD>Leaves ST/X without saving an image.
<TR>
<TD><TT>show more</TT>
<TD>Shows 50 more contexts of the walk-back.
<TR>
<TD><TT>breakpoints</TT>
<TD>Not yet available.
<TR>
<TD><TT>trace on/off</TT>
<TD>Not yet available.
<TR>
<TD><TT>trace step</TT>
<TD>Not yet available.
<TR>
<TD COLSPAN="2"><HR>
</TABLE>
<P>A miniDebugger is entered if an error occurs within the Debugger itself. This is a line-by-line debugger that allows limited debugging without the use of a graphical user interface. It is controlled by entering commands in the Xterm window where ST/X was started. If you type <TT>?</TT> at the <TT>miniDebugger</TT> prompt, you will get a list of commands that are available for use in this stripped-down debugger.</P>
<H3><A NAME="Heading22"></A><FONT COLOR="#000077">Summary</FONT></H3>
<P>This chapter introduces you to the Smalltalk environment that is provided by the Smalltalk/X application. If you are interested in learning how to program using Smalltalk and don’t have access to one of the commercial versions of Smalltalk, then Smalltalk/X is perfect for you. Not only does Smalltalk/X come with all the tools and programming aids that are talked about in this chapter, but it also comes with many examples and some fairly complete documentation that will make learning Smalltalk easier for you.
</P>
<P>It is worth mentioning that Linux also comes with the GNU version of Smalltalk called <TT>mst</TT>. This chapter was devoted to talking about Smalltalk/X because it is much more complete than GNU Smalltalk. From here, you can learn:</P>
<DL>
<DD>About the Perl programming language, which is used for many quick-and-dirty programming tasks, in Chapter 28, “Perl.”
<DD>How to back up your system so all your Smalltalk/X programs are not lost, read Chapter 45, “Backups.”
<DD>How to set up your Linux system so people on the Internet can access your system, read Chapter 47, “Setting up an Internet Site.”
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="559-563.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch32/567-571.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -