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

📄 debug2.html

📁 jbuilder教程~!快来下载吧~! 这个很好快来啊~
💻 HTML
📖 第 1 页 / 共 3 页
字号:


<a name="the_run_to_end_of_method_command"></a>
<h3><b><font color="#000080" size="2">运行到一个方法的结尾</font></b></h3>
<!--BNDX="Run To End Of Method command;methods:running to end of;debugging:running to the end of a method"-->
<p><a href="../ui/menus/mrun.html">Run|Run To End Of Method</a> 命令运行你的程序直到它到达当前方法的结尾。 如果你已 stepped into 你想跳过的方法,这个命令是有用的。 <!--************************************************************--></p>     
 <!--************************************************************-->


<a name="running_to_the_cursor_location"></a>
<h3><font size="2" color="#000080"><b>运行到光标位置</b></font></h3>
<!--BNDX="cursor location:running to;Run To Cursor command;debugging:running to the cursor location"-->
<p>你可以运行你的程序到发生问题值得怀疑的地方前。在那个点上,检查所有的数据值是正确的。然后,运行你的程序的另一个位置,在那儿检查数据值。 </p>
<p>要运行到一个特定的程序位置,</p>

<ol>
<li>在编辑器里,把光标定位到你想开始(或恢复)调试的那行代码上。</li>

<li>选中<a href="../ui/menus/mrun.html">Run|Run To Cursor</a> 或者 右击并选中 Run To Cursor。</li>     
</ol>

<p>当运行到光标处,程序不中断地执行直到编辑器中的光标标记的位置。当执行遇到光标标记的代码,调试器重新取得控制,挂起你的程序,在那行代码上放置执行点。更多的关于执行点的信息,参阅 <a href="#the_execution_point">&quot;The execution point.&quot;</a></p>     

<p>这个命令加速了调试过程,它允许你快速地经过没有错误的代码。 <!--************************************************************-->     
</p>



<a name="viewing_method_calls"></a>
<h3><b><font size="2" color="#000080">观察方法调要</font></b></h3>
<!--BNDX="method calls:viewing;calls to methods:viewing;debugging:viewing method calls"-->
<p><a href="debug.html">Threads, call stacks, and data 视图</a>显示了程序中的所有的线程组。对于每一个线程,显示了一系列使程序为当前状态的的方法调要。每一个栈结构展开显示了可得到的数据。</p>     
<p>如果你的程序编译时带有调试信息(默认情况),这个视图同样显示了传递给一个方法调要的参数。每一个方法跟随着一个列表,这个列表详述了方法调用中的参数。另外,这个视图显示了每个方法的位置(reside)。它列出了方法调用的那一行,类名,源名(source name)。</p>     

<p>要观察特定方法调用中源代码名和数据状态,点击那个方法。<!--************************************************************-->
</p>



<a name="locating_a_method_call"></a>
<h3><b><font color="#000080" size="2">定位一个方法调用</font></b></h3>
<!--BNDX="method calls:locating;locating:a method call"-->
<p>你可以在方法调用的源代码中定位从而允许你退回到调试过程中。 </p>
<p>要定位一个方法调用,</p>

<ol>
<li>点击 Threads, call stack and data 窗格中的方法。这样使你来到编辑器中,光标处在这个方法调用的那行代码上。</li>     

<li>在编辑中右击并选中 Run To Cursor 命令。</li>     
</ol>

<!--************************************************************-->


<a name="controlling_which_classes_to_trace_into"></a>
<h3><font size="2" color="#000080"><b>控制跟踪进哪个类</b></font></h3>
<!--BNDX="tracing into classes;enabling tracing into classes;disabling tracing into classes;debugging:controlling tracing into classs"-->
<blockquote class="bsku"> Classes with tracing disabled 对话框和视图  JBuilder Professional and Enterprise 的属性。</blockquote>     


<p>要严密地检查你程序的一部分,你可以让调试器仅跟踪仅你想步进的文件。通过这个方法,你可以集中精力于一个已知的问题区域,而不是手工地步进整个程序的每一行代码。例如,你通常不想步进 JavaSoft 库中的类,因为你不想检查(troubleshoot)它们;你通常会检查和改正你自己的类。     
</p>

<p>要决定跟踪或不跟踪什么类,</p>

<ul>
<li>如果处在一个调试过程,选中 <a href="debug.html">Classes with tracing disabled 视图</a>。这个视图显示了所有每被跟踪的类。      

<p><img src="images/db_classes_with_trace_disabled.gif"></p>
</li>

<li>如果不处在一个调试过程,选中 Run|View Classes With Tracing Disabled 。 显示<a href="../ui/dialogs/dlgtracingdisabled.html">Classes With Tracing Disabled 对话框</a>。       

<p><img src="images/db_dlg_classes_with_trace_disabled.gif"></p>
</li>
</ul>

<p>可以用同一种方法来操作视图和对话框。
<br>
</p>

<p>你可以在任何时候 enable 或 disable  Classes with tracing disabled 视图中的类或包。只要右击这个类或包并选中 Step Into Class 选项。当禁止(disable,默认情况),类或包不会被跟踪进。当允许(enabled),将被跟踪进。注意这两种情况下的图标变化:</p>     

<ul>
<li>当可以跟踪,图标为: &#160;<img src="images/db_tracing_enabled.gif"></li>     

<li>当不可以跟踪,图标为: &#160;<img src="images/db_tracing_disabled.gif"></li>     
</ul>

<p><span class="bscan">注意:</span>当你禁止对一个包的跟踪,你就禁止了对这个包中所有类的跟踪。</p>
<p>通过选择一个类或包并按<kbd>Delete</kbd>键,或者选择它,右击并选中 Remove Class/Package ,你可以把它从一个列表中移走。要移走所有的类和包,右击视图中的空白处并选中 Remove All.</p>     

<p>要向列表添加一个类或包,右击视图中的空白处并选中 Add Class Or Package,出现了  Disable Tracing 对话框 ,在那里输入想要禁止跟踪的类或包的名字。</p>     

<p>变化会马上发生。你不需要重新启动你调试过程。</p>

<p> Classes with tracing disabled 视图中的类及它们的 enabled/disabled 状态被包存在工程文件中。</p>     

<p>一旦你已选择了你不想跟踪的类,使用调试器工具栏上的 Smart Step 图标 &#160;<img src="images/db_toolbar_smartstep.gif" align="top">&#160; 来控制跟踪。     
当这个属性打开,每一步操作使用在<a href="debug.html">Classes with tracing disabled 视图</a>中列出的类以及在  Project Properties 对话框中<a href="../ui/dialogs/dlgdebugpage.html">Debug 页</a>上的 Smart Step 选项: </p>     

<ul>
<li>Classes with tracing disabled 视图允许你设置什么类将不被跟踪进。</li>     

<li>Project Properties 对话框 Debug页上的 Smart Step 选项为每一个被跟踪进的类控制步进行为。</li>     
</ul>

<p>当 Smart Step 被关闭,Classes with tracing disabled 视图中的类连同 Smart Step 选项就被忽略掉了,所以你将可能 step into 所有这些类。 <!--************************************************************-->     
</p>



<a name="tracing_into_classes_with_no_source_available"></a>
<h4><font color="#000080" size="2"><b>Tracing into classes with no source   
available</b></font></h4>  
<!--BNDX="Trace Into settings:for classes with no source available;debugging:tracing into classes with no source available"-->
<p>If you turn Smart Step off when you&#39;re using a class but don&#39;t have its source file available, a stub source file is generated and appears as you trace through your code. The stub source file shows only the method signatures for the class. To avoid seeing stub source, keep the class in the <a href="debug.html">Classes with tracing disabled view</a> and leave Smart Step on.<a name="stub_source"></a> </p>     

<p class="bvh">Stub source files
 <!--BNDX="stubs:source files;files:stub source"-->
</p>

<p>If stub source is generated for files for which you have source available, check the source path. The debugger looks in your source path for source files. (The source path is described in the topic called <a href="project.html">Source Path</a> in the chapter &quot;Creating and managing projects.&quot;) The .java file being debugged has to exist in a branch that is the same as its package name.</p>

<p>For example, if your source path contains one item:</p>

<p><code><font size="2">c:\MyProjects\Test\src</font></code></p>

<p>and your .java file is in a package called <code>mypackage,</code> the debugger expects the .java file to exist in the directory:</p>

<p><code><font size="2">c:\MyProjects\Test\src\mypackage</font></code></p>

<p>The package name is appended to the source item name. If you have multiple source items, the debugger will try to locate all of them using the scheme outlined above. If the debugger can&#39;t locate the source file, it generates stub source.</p>

<p>A stub source file is displayed in the content pane. It contains a header and method stubs.</p>

<p class="bfig">Stub source file</p>



<p><img src="images/db_stub_source.gif"> <!--***********************************************************************-->
</p>



<a name="setting_a_breakpoint_in_a_class_overrides_tracing_disabled"></a>
<h4><font color="#000080" size="2"><b>断点和跟踪禁止设置</b></font></h4>
<!--BNDX="breakpoints:overriding Tracing Disabled;debugging:breakpoints and tracing disabled settings"-->
<p>在 Classes with tracing disabled 视图中的一个类中设置断点使跟踪设置无效;你将在那个类中中断因为你明确地指示调试器运行到那个断点。 </p>
<p>一个警告对话框,  <a href="../ui/dialogs/dlgbreakindisabled.html">Stopped In Class With Tracing Disabled 对话框,</a> 将显示,只要:</p>

<ul>
<li>Smart Step 打开,并且</li>

<li> Project Properties 对话框<a href="../ui/dialogs/dlgdebugpage.html">Debug 页</a>的 Warn If Break In Class With Tracing Disabled 选项被选中。</li>
</ul>

<p class="bfig">Stopped In Class With Tracing Disabled 对话框</p>


<p><img src="images/db_dlg_stopped_in_class_trace_disable.gif"></p>

<p>在这种情况下,在断点后击步进将导致调试器跳出这个类。如果要留在这个类里,关掉 Smart Step ,使用步进图标。</p>

</body>
</html>

⌨️ 快捷键说明

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