简体   繁体   English

在Eclipse中调试时停止代码执行而不终止线程

[英]Stop code execution while debugging in Eclipse without terminating the thread

Is there a way how to stop debugging when program hits the breakpoint (ie I don't want to execute the code after it) without stopping entire application server (I am programming apps in Java, server is JBoss)? 有没有办法如何在程序到达断点时停止调试(即我不想在它之后执行代码)而不停止整个应用程序服务器(我用Java编程应用程序,服务器是JBoss)?

I know only one way how to stop debug - red button with title Terminate which shuts down the server. 我只知道如何停止调试的一种方法 - 标题为Terminate的红色按钮关闭服务器。 So is there anything else? 那还有什么吗?

While debugging, context menu offers you to force a return. 在调试时, 上下文菜单会强制您返回。 This instantly leaves the method and will take you back to the caller. 这会立即离开方法并将您带回呼叫者。 One can also use Alt + Shift + F . 也可以使用Alt + Shift + F.

You can hit the disconnect button. 您可以点击断开连接按钮。 See the attached image. 请参见附图。 This will continue execution and stopping debugging without stopping the server. 这将继续执行并停止调试而不停止服务器。 在此输入图像描述

If you mean "I do not want the code after my breakpoint to execute", then you could use a conditional breakpoint to execute a return from that method. 如果您的意思是“我不希望执行断点后的代码”,那么您可以使用条件断点来执行该方法的return

(Note that you can execute any code you like in a conditional breakpoint. It does not have to be just a condition.) (请注意,您可以在条件断点中执行任何您喜欢的代码。它不一定只是一个条件。)

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

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