eclipse debug程序
在使用Eclipse工具开发时,只知道一些简单的debug命令,对于在debug过程中过滤运行中某个属性值等情况却不知道如何做。其实Eclipse以及集成了这样的功能,简单操作如下:
1、在Eclipse中设置一个断点
2、右键断点,选择 Breakpoint properties
3、选择弹出框下面的Enable Condition,然后在框中填写代码就可以了。
如在spring容器初始化的时候,想查看name为myBean的初始化,则可以在初始化bean的地方设置断点,然后在Enable Condtion中编写代码:beanName.equals("myBean"),当初始化到myBean时就会被断住了。
其他类似。。。
另使用Eclipse debug jboss的启动过程,将jboss的启动参数中的suspend=y,然后点击Eclipse的debug即可。如
set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000