开发者

jdb conditional breakpoint

I remote d开发者_开发问答ebug my application using JDB, just JDB, no IDEs, is there a way in jdb to set a conditional breakpoint?

eg: stop at MyClass:80 when mystr.equals("abc")


Jdb does not support conditional breakpoints, but as a last-resort you may try compiling your program with gcj and using gdb to do the debugging, which does support conditional breakpoints. Depending on the complexity of your project this may or may not be a feasible option. There may be other lesser-known command-line debuggers that you could use as well.


Java DeBugger does not support conditional breakpoints. An alternative, if you have a "windowed environment" is to use an IDE like Eclipse and then work in Debug perspective. There you will find those kind of nice features like conditional breakpoint.


Well, a hacky way of setting up a conditional breakpoint is to create an if statement, put System.out.print("") inside and tell the jdb to stop at that line. I guess there are more comprehensive approaches to that problem though (as others have indicated).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜