When I program C/C++ with Visual Studio I often use __asm nop;
command to insert a noop code in order to have something to break on. For instance:
if (someCondition())
{
__asm nop;
}
I have no idea what to do when the condition occurs, but I want to stop the execution and examine the current state. Sometimes someCondition()
is simple enough to create a conditional breakpoint, but conditional breakpoints slow down the execution significantly, besides it is not always possible.
Now, in C# I break into the debugger directly either by calling System.Diagnostics.Debugger.Break()
or System.Diagnostics.Debugger.Launch()
.
Now I am forced to program Java and until now I have found no better alternative than just do System.out.println("bla-bla")
and set a breakpoint there. Again, please consider the case when a conditional breakpoint is not feasible.
So, I wonder - is there an __asm nop
or System.Diagnostics.Debugger.Break()
alternative in Java?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…