Eclipse条件断点,任何字符串中断等于 [英] Eclipse conditional breakpoint, break at any string equals
问题描述
那么,我在找什么? :)
如果您有一个IDE,例如Eclipse,可以为所有变量设置getter和setter,这些设置器中的每一个,调用一个名为checkValue的函数,例如,在这个checkValue中为您要查找的特定值创建条件断点。
将需要更改代码,但作为副产品,将创建一个更干净的代码。
使用jmap并导致内存转储。检查每个转储的值是否正在寻找
使用自省和循环遍历每个变量,寻找值。 / p>
I have a large (legacy) application that I have to make a fix in, with terrible code structure and so much code smell that I'm choking. I can't really figure out where a string in the gui is populated. Therefore it would be nice if i somehow could have an expression/breakpoint once ANY string (I don't know the name of the variable, or where it is) is equal to "foobar" so I can backtrack from there.
So, what am I looking for? :)
IF you have an IDE, such as Eclipse, you can set getters and setters for all your variables then, from every one of these setters, call a function called "checkValue" for example, in this "checkValue" make a conditional breakpoint for the specific value you are looking for.
This will require code to be changed, but as a by-product, would create a cleaner code.
Use jmap and cause memory dumps. Inspect every dump for the value you are looking for
Use Introspection and cycle through every variable, looking for the value.
这篇关于Eclipse条件断点,任何字符串中断等于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!