简体   繁体   English

用脚本编写Eclipse Java调试器?

[英]Scripting Eclipse Java Debugger?

When using gdb to debug there are a couple of ways to automate the actions performed when a break point is hit. 当使用gdb调试有一对夫妇 的方式来自动当一个破发点被击中执行的操作。 This is good for cases where I only have compiled code with debug symbols, not source code. 这对于我仅带有调试符号而不是源代码的编译代码的情况非常有用。 It is also nice when I want to instrument something interactively without relying on code reloading to insert print statements. 当我想以交互方式检测某些内容而又不依赖于代码重载来插入打印语句时,也很好。

Is there a way to do this with the Eclipse debugger and Java code? 有没有办法使用Eclipse调试器和Java代码来做到这一点? All I need is a way to print objects and variables and then continue from the breakpoint. 我需要的是一种打印对象和变量,然后从断点继续的方法。

You can inject code using conditional breakpoints. 您可以使用条件断点注入代码。

In this example the breakpoint never suspends because of return false; 在此示例中,断点不会因return false;挂起return false; , but always print the absolut path of a file-variable named "file"! ,但始终打印名为“ file”的文件变量的绝对路径! 在此处输入图片说明

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

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