Java - 是否可以输出带有方法签名的堆栈跟踪?

发布于 2024-12-13 22:11:43 字数 222 浏览 2 评论 0原文

是否可以输出当前堆栈跟踪带有方法签名?我正在尝试调试一些混淆的代码,这些代码有大量具有相同名称的方法,只是参数和返回类型不同。

有些事情不起作用

Thread.currentThread().getStackTrace();
new Throwable().getStackTrace();
// etc..

Is it possible to output the current stacktrace with method signatures? I'm trying to debug some obfuscated code that has a ton of methods with the same name that just differ in arguments and return type.

Some things that will not work:

Thread.currentThread().getStackTrace();
new Throwable().getStackTrace();
// etc..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

若言繁花未落 2024-12-20 22:11:43

不,但您可以在故障排除时使用 AspectJ 进行检测,以获得更完整的信息,而无需添加日志记录。

根据您尝试调试的内容的性质以及您对所涉及的任何数据的了解程度,您可能能够或多或少精确地定位目标。

Nope, but you could instrument with AspectJ while troubleshooting to get more complete info without adding logging.

Depending on the nature of what you're trying to debug and how much you know about any data involved you might be able to target more or less precisely.

桃酥萝莉 2024-12-20 22:11:43

不可能。堆栈跟踪不包含该信息。

Not possible. The stacktrace does't contain that info.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文