最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Breakpoint on method call for one instance - Stack Overflow

programmeradmin0浏览0评论

(Java, Eclipse) I have a variable instance on which I call a method (like o.setValue(...) ) in between this and the output, something, somewhere (in the very complex legacy codebase with custom Annotations & Bindings and Reflection) calls the .setValue() method from some superclass.

var i = ...;
i.setValue(true); //setValue() Inherited from some superclass
i.getValue()==true
[Framework / Reflection / Annotation magic]
i.getValue()!=true; //where was setValue() called on my instance?

I want to find out where. Thus, I want to set a conditional breakpoint (in Eclipse, Java) that tiggers exactly if my Instances setValue() method is called. How can I do that?

I did try a conditional Breakpoint, but the condition is evaluated in the scope of .setValue(), and my instance usually doesn't have any special properties, because it's before a complex change or the values are too general (null or true etc.).

The easiest/ most elegant/ general way would be via its address, but that value is in a different scope/Module.

Thus, how would I get my instance address into the Breakpoint condition, and accessible in all Modules/scopes.

发布评论

评论列表(0)

  1. 暂无评论