简体   繁体   English

Eclipse条件断点模板?

[英]Eclipse conditional breakpoint templates?

After more years than I care to remember using Eclipse I've only just come across conditional breakpoints. 经历了比我想记得要使用Eclipse多年的时间之后,我才刚刚遇到条件断点。 They've already been very useful, but it's occurred to me that you may end up writing the same conditions over and over again. 它们已经非常有用,但是对我来说,您可能最终会一遍又一遍地写相同的条件。 Is there any way to create some standard templates for conditions? 有什么办法为条件创建一些标准模板吗? For instance, the answer to this question has a great example of a condition that would be a contender for templating, line numbers/method names etc would be substituted rather than writing the entire condition again. 例如, 此问题的答案很好地说明了一个条件,该条件将成为模板的竞争者,而行号/方法名称等将被替换,而不是再次写入整个条件。 The idea would be that these templates are shared across an entire team. 想法是这些模板在整个团队中共享。 Is this something that is currently possible in Eclipse? 这是Eclipse中当前可能的吗? If not, would it be possible to write some kind of plugin to do this? 如果没有,是否可以编写某种插件来做到这一点?

AFAIK this is not currently possible. AFAIK目前无法实现。 You can however reuse a previously entered condition. 但是,您可以重复使用先前输入的条件。

Honestly something more compilcated seems overkill to me, I have known this feature for maybe 10 years and never feel the need for that. 老实说,对我而言,更精巧的编译似乎太过分了,也许我已经知道此功能已有10年了,却从未觉得有此必要。 In practice I never used something more complicated than one or two equals conditions. 实际上,我从来没有使用过比一两个相等条件更复杂的东西。
Plus I would even argue that if you end up debugging regularly a similar piece of code, you have either more general coding quality or organisationnal problems. 另外,我什至会争辩说,如果您最终定期调试相似的代码段,则可能会遇到更一般的编码质量或组织上的问题。

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

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