简体   繁体   English

Java Eclipse如何在调试器中查看活动的侦听器

[英]Java Eclipse how to view active listeners in debugger

How can I see what listeners are active whilst debugging? 如何查看调试期间处于活动状态的侦听器?

I can see where I "setListener" as I step through - but as there is never a callback I am wondering if the listener is actually still alive. 我可以看到我逐步设置的“ setListener”的位置-但是由于没有回调,所以我想知道侦听器是否仍然有效。

You can point a breakpoint inside a listener code, so you can see when it has been invoked. 您可以在侦听器代码中指向一个断点,以便可以看到何时调用了该断点。 Does it help you? 有帮助吗?

  1. Mark a breakpoint at the listener variable you want to follow 在要遵循的侦听器变量上标记一个断点
  2. When the breakpoint is hit, see the Variables Pane (Show -> View -> Variables) and find in there the name of the listener variable you are following 击中断点时,请查看“变量”窗格(“显示”->“视图”->“变量”),然后在其中找到要关注的侦听器变量的名称。
  3. Right click in the variable and choose "Open Actual Type" 右键单击变量,然后选择“打开实际类型”

This open the code that your listener variable points at the next debug step. 这将打开您的侦听器变量在下一步调试中指向的代码。

=) =)

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

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