Eclipse Debugger Events(Eclipse 调试器事件)
问题描述
在我的 Eclipse 插件中,我希望收到有关调试器事件的通知(例如,当单步执行或遇到断点时).通过使用以下代码订阅调试事件,我已设法使其在 JDT 环境中工作:
In my Eclipse plugin, I would like to be notified on debugger events (e.g. when stepping or a breakpoint is hit). I've managed to get this working in a JDT environment by subscribing to debug events using this code:
DebugPlugin.getDefault().addDebugEventListener(this);
这给了这个事件处理程序:
Which gives this event handler:
public void handleDebugEvents(DebugEvent[] events)
{
}
在 JDT 中,这是在 Breakpoint 或 Suspend 事件上触发的,我希望 CDT 中的行为相同.然而,事实并非如此.我在调试会话开始时只收到两个 Create 事件:
In JDT this is fired on Breakpoint or Suspend events and I was hoping the behaviour would be the same in CDT. However, it is not. I only get two Create events at the start of the debug session:
DebugEvent[org.eclipse.cdt.dsf.gdb.launching.GDBProcess@ae0aae,创建,未指定]DebugEvent[org.eclipse.debug.core.model.RuntimeProcess@920d5d, CREATE, UNSPECIFIED]
DebugEvent[org.eclipse.cdt.dsf.gdb.launching.GDBProcess@ae0aae, CREATE, UNSPECIFIED] DebugEvent[org.eclipse.debug.core.model.RuntimeProcess@920d5d, CREATE, UNSPECIFIED]
是否存在不需要特定依赖于 JDT 或 CDT 的通用解决方案?
Is there a generic solution that wouldn't require specific dependencies on JDT or CDT?
谢谢,艾伦
推荐答案
我确实找到了解决方案并在这里回答了我的其他问题:Eclipse 插件 - 在步进或中断时处理事件
I did find a solution and have answered my other question here: Eclipse plugin - handling events when stepping or breaking
艾伦
这篇关于Eclipse 调试器事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Eclipse 调试器事件


基础教程推荐
- 验证是否调用了所有 getter 方法 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 大摇大摆的枚举 2022-01-01