System.Diagnostics.Debugger.Break()喜欢使用java?

编程入门 行业动态 更新时间:2024-10-27 16:26:50
本文介绍了System.Diagnostics.Debugger.Break()喜欢使用java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

解决方案

是否有一种方法来发送Java中的断点,如System.Diagnostics.Debugger.Break()在C# >是的,我想要这样的东西,所以我在C天实现了一个非常简单的解决方案。如果你想要一个轻量级的答案,这可能是有用的。

public class DebugHelper { public static breakHere() { int i = 0; //在IDE中设置断点} }

使用这种方法。在你的代码中放置一个断点在int i = 0;线。并在调试代码中调用该方法。这是一个快速的答案,得到一些动态的调试和比一个变量的手表更快。

示例...

$($) $($) { if(null == value) DebugHelper.breakHere(); } }

当然在C中,您可以放置​​正确的ASM断点指令;-)对于我来说,这个工作对我来说很少见,我想要这样的东西。

Is there a method to signal a breakpoint in Java like System.Diagnostics.Debugger.Break() in C#?

解决方案

yes I wanted something like this, so I implemented a pretty simple solution from my C days. This may be useful if you want a lightweight answer.

public class DebugHelper { public static breakHere() { int i = 0; // Set breakpoint on this line in your IDE } }

To use this method. Put a breakpoint in your code on the "int i = 0;" line. And call that method in the code you are debugging. It is a quick answer to getting some dynamic debugging and faster than a watch on a variable.

Example ...

private something(...) { for( ... ) { if( null == value ) DebugHelper.breakHere(); } }

Of course in C, you can put the right ASM breakpoint instruction ;-) This works fine for me on the rare occasions I want something like this.

更多推荐

System.Diagnostics.Debugger.Break()喜欢使用java?

本文发布于:2023-11-07 04:26:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565567.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:喜欢   Diagnostics   System   Debugger   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!