简体   繁体   English

如何在类或包中的所有类或JDB中的正则表达式上的所有方法上设置断点?

[英]How can I set breakpoints on all methods in class or in all class in package or by regex in JDB?

Official docs say how set individual breakpoint on source line or class method: 官方文档说如何在源代码行或类方法上设置单个断点:

http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/jdb.html http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/jdb.html

But I am interesting to make debug session in which I travel through all methods in selected package. 但是我进行调试会话很有趣,在该会话中,我将遍历所选软件包中的所有方法。

I use BTrace to get trace of program. 我使用BTrace跟踪程序。 In BTrace I write regex pattern to match classes, methods and actions to be performed in runtime. 在BTrace中,我编写了正则表达式模式以匹配要在运行时执行的类,方法和操作。

But unfortunately this instrument have limited capability to print argument of methods if they are out of primitive type. 但是不幸的是,如果该方法不属于原始类型,则该工具打印方法参数的能力有限。

By jdb I can dump any type but I does not know how to set 200 breakpoints automatically for all methods and classes in package. 通过jdb,我可以转储任何类型,但是我不知道如何为包中的所有方法和类自动设置200个断点。

Use IDE debug tools. 使用IDE调试工具。 For example eclipse with http://java.decompiler.free.fr can help you. 例如,使用http://java.decompiler.free.fr进行月食可以帮助您。

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

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