Eclipse - 显示完整的调用堆栈(就像在调试器中遇到断点时),而不会插入断点? [英] Eclipse - showing full call stack (like when it hits breakpoint in debugger) without putting in breakpoints?

查看:1512
本文介绍了Eclipse - 显示完整的调用堆栈(就像在调试器中遇到断点时),而不会插入断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一种对我来说很新的Java应用程序,所以一种方法可以弄清楚它的工作原理,并且找到更简单的东西,我以为可以在执行操作后获得完整的堆栈跟踪,以便能够基于特定的UI动作来查看正在使用哪些类。我以为这是在调试器中可能的,但似乎它只有在插入断点时才起作用,在这种情况下,这个目的的一部分是这样的,所以我不必知道可以插入的内容首先断点(因为这有助于告诉我)。



如果这是一个基本问题,我曾经搜索过,但是我没有找到正确的答案

解决方案

这不直接回答您的问题,但也可能会更好地解决您的问题。看看 BTrace 。它允许您测试运行的Java应用程序并插入您自己的一些基本代码。例如,您可以写出整个方法调用链,以帮助您通过应用程序找到方法。它与AspectJ有点相似,但目的完全不同,项目来源不需要更改:



BTrace是Java的安全,动态跟踪工具,BTrace工程通过动态(字节码)检测正在运行的Java程序的类,BTrace将跟踪操作插入正在运行的Java程序的类中,并且可以跟踪跟踪的程序类。


I'm working with a legacy Java app that is new to me so one way to figure out how it works and find things easier, I have thought would be to be able to get the full stack trace after I perform actions, so as to be able to see which classes are being used based on a particular UI action. I had thought this was possible in the debugger but it seems that it only works if I insert a breakpoint and in this case part of the purpose of this is so that I don't have to know what's being called to be able to insert the breakpoint first (as this would help tell me that).

I apologize if this is a basic question, I have searched on this but I'm not finding the correct answer.

解决方案

This doesn't directly answer your question, but maybe it will solve your problem better. Take a look at BTrace. It lets you instrument a running Java app and insert some basic code of your own. You could, for instance, have it write out entire method call chains to help you find your way through the app. It's somewhat similar to AspectJ, but with an entirely different purpose and requiring no change in the project source:

"BTrace is a safe, dynamic tracing tool for Java. BTrace works by dynamically (bytecode) instrumenting classes of a running Java program. BTrace inserts tracing actions into the classes of a running Java program and hotswaps the traced program classes."

这篇关于Eclipse - 显示完整的调用堆栈(就像在调试器中遇到断点时),而不会插入断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆