简体   繁体   English

我怎么知道在Eclipse中以调试或运行模式运行的应用程序

[英]How can i know an application running in debug or run mode in eclipse

I do start/stop my application more than 15 to 20 times every day. 我每天启动/停止我的应用程序超过15到20次。 Every time i start app in debug mode only. 每次我仅在调试模式下启动应用程序。 But some times the debug(break points) would not work, then i will get confuse that is my app running in debug or run mode. 但是有时候调试(断点)无法正常工作,那么我会感到困惑,那就是我的应用程序是在调试还是运行模式下运行的。

Do you have any idea to find out. 你有什么想法要找出。

Even some times, I started my app in debug mode and it runs in debug mode for some time, suddenly works as run mode, it would not consider my break points. 甚至有时候,我在调试模式下启动我的应用程序,并且它在调试模式下运行了一段时间,突然以运行模式工作,它不会考虑我的断点。 so, if i restart my app in debug mode only, i can do debug again. 因此,如果我仅以调试模式重新启动应用程序,则可以再次进行调试。

While the application is running, open the Debug view in Eclipse. 在应用程序运行时,在Eclipse中打开“调试”视图。 If all that you see in the tree is a path to your Java distribution under the project name then you are in run mode. 如果您在树中看到的所有内容都是项目名称下的Java发行版的路径,则您处于运行模式。 If you are in debug mode then you will see the above information plus all the threads that are currently running in your application. 如果处于调试模式,则将看到以上信息以及应用程序中当前正在运行的所有线程。

When you launch your application, the mode into which it runs is indicated in the "server" panel, like this : 启动应用程序时,“服务器”面板中将指示其运行方式,如下所示: 在此处输入图片说明
or 要么
在此处输入图片说明

Sometimes, when the debug mode doesn't work(for example it can't start), I remove all the break points, then I set them again. 有时,当调试模式不起作用(例如无法启动)时,我会删除所有断点,然后再次设置它们。

Make sure what you run 1st. 确保您运行第一项。 Debug mode should display you code with variables in debug tab in eclipse while program is running. 在程序运行时,调试模式应在eclipse中的调试选项卡中显示带有变量的代码。

Is your application a standalone application or a server hosted application which you remote debug? 您的应用程序是远程调试的独立应用程序还是服务器托管的应用程序? In both cases as soon as the debugger is connected to whatever local or remote process the signs left to your debuger icon get enabled. 在这两种情况下,只要将调试器连接到任何本地或远程进程,调试器图标上留下的标志都会启用。 Those are in a row a few arrows (Step back, Step into, Step over) a green Arrow for Resume, a Suspend Icon, one for Stop and one for Disconnect. 这些是连续的几个箭头(后退,进入,跳过),一个绿色的箭头表示恢复,一个暂停图标,一个表示停止,一个表示断开。

If you open the debug View (Window->Show View->Other... type in "Debug") you should as well see if your Debugger is currently connected to any process. 如果打开调试视图(在“调试”中键入“窗口”->“显示视图”->“其他...”),则还应该查看调试器当前是否已连接到任何进程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM