📄
字号:
Let's take a look. These settings can be reached by selecting
Preferences from the Edit menu.</P>
<P><B><FONT size=+1>Display Settings</FONT></B></P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=423 alt="Figure 5-2: Display settings."
src="第五课 调 试.files/IcwwL5_fig2.gif" width=624
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-2: Display
settings.</I></FONT> </TD></TR></TBODY></TABLE>
<P>The Display Settings panel (Figure 5-2) contains preferences that
determine how the debugger displays information in its windows. As
you begin to use the debugger, you will find that you want certain
text to appear larger or smaller, or to be displayed in a specific
color. You can select these options here.</P>
<P>Color settings allow you to choose the text color used by
watchpoints or variable names when the code alters them. This allows
you to see if a watchpoint or variable is being changed without your
knowledge as the code executes. Watchpoints are useful if you want
to track a variable at intervals throughout the program and want it
to be conveniently displayed in a window.</P>
<P>The other settings are self-explanatory. In most cases, the
default settings will work. As you learn more about the debugger,
you may want to alter these settings. </P>
<P><B><FONT size=+1>Windowing Settings</FONT></B></P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=424 alt="Figure 5-3: Windowing Settings."
src="第五课 调 试.files/IcwwL5_fig3.gif" width=625
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-3: Windowing
Settings.</I></FONT> </TD></TR></TBODY></TABLE>
<P>When debugging, you will quickly find that your desktop is
cluttered with lots of open windows. The Windowing settings (Figure
5-3) allow you to manage windows by choosing to hide or show certain
types of windows when you start debugging. The default setting, Hide
Non-Debugging Windows, will probably suffice in most cases. </P>
<P><B><FONT size=+1>Global Settings</FONT></B></P>
<P>The Global Settings pane (Figure 5-4) contains options that
control the way the debugger operates.</P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=423 alt="Figure 5-4: Global settings."
src="第五课 调 试.files/IcwwL5_fig4.gif" width=625
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-4: Global
settings.</I></FONT> </TD></TR></TBODY></TABLE>
<P>Cache Edited Files Between Debug Sessions setting allows you to
choose how long to cache edited files between debug sessions.
Caching files can increase the speed of the debugger but will also
take up precious disk space.</P>
<P>The remaining settings are self-explanatory. The default settings
will serve you well as you begin to use the debugger. </P>
<P><B><FONT size=+1>Remote Connections</FONT></B></P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=422 alt="Figure 5-5: Remote Connections."
src="第五课 调 试.files/IcwwL5_fig5.gif" width=624
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-5: Remote
Connections.</I></FONT> </TD></TR></TBODY></TABLE>
<P>Lastly, the Remote Connections Settings (Figure 5-5) allow you to
remotely debug code across a TCP/IP network. These settings are
advanced, and the default values will work fine as you learn to
debug in CodeWarrior. </P>
<P>Note that the Java Settings and Java Debugging panels are for the
Java Programming Language and are not covered in this course.
However, other courses are available for this
language!</FONT><BR></P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#000000
size=3><B><B>Target and Project-Specific Debugger
Preferences</B></B><BR></FONT><BR></P><FONT
face="Arial, Helvetica, sans-serif" size=2>
<P>The following settings are specific to each target and project
that is debugged. You can reach them by selecting Project Name
Settings from the Edit menu, while a target is selected in the
Target tab in the CodeWarrior Project window.</P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=424
alt="Figure 5-6: Target and Project Debugger Settings."
src="第五课 调 试.files/IcwwL5_Fig6.gif" width=626
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-6: Target and
Project Debugger Settings.</I></FONT> </TD></TR></TBODY></TABLE>
<P><B><FONT size=+1>Debugger Settings</FONT></B>
<UL>
<LI>Location of Relocated Libraries, etc: If the file you are
debugging has been moved, or if you're debugging remotely over a
TCP/IP network, you must type the file's directory path into this
text box.
<LI>Stop at temp breakpoint on application launch: By default,
this option breaks the debugger (stops execution of the code) at
the beginning of your program. However, you can choose to break at
any point.
<LI>Auto-target Libraries: Check this setting to automatically
access libraries. This can assist you when debugging code that is
part of a library. The debugger will "do the right thing" (such as
loading the library and calling any initialization functions) as
you step into its code.
<LI>Log System Messages: This setting forces all system messages
to be written to a log file. This can be useful if your code is
crashing your computer, and you can't see the screen during the
crash. The messages will be written to a log file that you can
view after you restart your computer. Log files can save you many
headaches later. Learn to read them!
<LI>Data Update Interval: By setting a value here and checking
this box, you can choose how often data views are updated. The
more often you update data views, the more up-to-date the
displayed values will be in the debugger.
<LI>Cache symbolics between runs: Symbolic files (files generated
during the compile process) will be cached and referenced between
debugger runs. This can speed up the debugging process.
<LI>Stop at Watchpoints: To stop at watchpoints when they are
equal to true, check this option. Watchpoints can be very useful,
similar to breakpoints. Whereas a breakpoint will break into the
debugger on a specific line of code every time, a watchpoint
monitors a variable or area of memory and breaks into the debugger
only when the contents change. There is also a feature called a
conditional breakpoint that will halt execution when the condition
is true. Depending on your needs and the way you like to work,
these advanced features can be very helpful to you as a
programmer. </LI></UL>
<P><B><FONT size=+1>x86 Exceptions</FONT></B></P>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=423
alt="Figure 5-7: The x86 Exceptions panel."
src="第五课 调 试.files/icwwL5_fig7.gif" width=627
align=left> </TD></TR>
<TR>
<TD align=middle><FONT size=1><I>Figure 5-7: The x86
Exceptions panel.</I></FONT> </TD></TR></TBODY></TABLE>
<P>As you debug questionable code, the CodeWarrior debugger
intercepts certain oddball operations (termed exceptions) brought
about by a program bug. The IDE passes these exceptions along to
special code -- appropriately known as a handler -- that attempts to
deal with the problem gracefully.</P>
<P>However, for many exceptions, the debugger simply stays out of
the way. Why is this?</P>
<P>If you're doing advanced programming such as writing a system
library or a device driver, you may want to test how its code
handles some of these exceptions. By not intercepting many
exceptions, the debugger lets you do this. If for some reason you
want the debugger to "seize control of the moment" for specific
exceptions, you can direct it to do so with this panel. The
exceptions shown here are ones that the CodeWarrior IDE is prepared
to handle. Click on the exception types you need the debugger to
field for you, and then click Save. As mentioned previously, this is
heavy-duty programming material, so we won't go into any details
here. The debugger is a very advanced, yet very easy-to-use addition
to the CodeWarrior environment. If you learn to use it well, it will
become one of the most important tools in your software development
arsenal.</P>
<P>Note that the Other Executables and Remote Debugging panels are
for advanced users and are not covered in this course. If you ever
have a need to debug multiple-executables at a time and/or debug
over a TCP/IP network, you will know it!</FONT><BR><!-- end main lesson content --><BR></P></TD></TR></TBODY></TABLE></CENTER></DIV></TD></TR>
<TR>
<TD width="100%">
<P align=right><NOBR><INPUT onclick=self.close(); type=button value="关闭此窗口 "></NOBR>
</P></TD></TR>
<TR>
<TD width="100%">
<HR width="96%" color=#000000 noShade SIZE=1>
</TD></TR>
<TR>
<TD class=font width="100%">
<P align=center>Copyright(C) 2000 <A
href="http://www.tsinghua-solution.com.cn/"
target=_blank>北京清华北方思路信息技术有限公司</A> 版权所有<BR>未经许可,不得转载、摘登、结集出版<BR>联系电话:(8610)-62978899-146</P></TD></TR></TBODY></TABLE></CENTER></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -