Answer the question
In order to leave comments, you need to log in
How to view full call stack in idea?
Is there any way to get information about called methods in intellij idea?
If we put a break in some method, then we will see in the stack trace where it is called. Is there any way to see which methods were called on the way to the break?
Let's say the code is like this:
public static void main(String[] args) {
бла
бла
бла
бла
testMethod();
System.out.println("тут установили бряку");
}
private static void testMethod(){
System.out.println("i am from testmethod");
}
Answer the question
In order to leave comments, you need to log in
The stack (precisely the stack) of calls is in the Frames window of the debugger. But of course it won't show all the calls that were BEFORE the breakpoint. Will show only those that are higher in the call stack. If you set the breakpoint to "i am from testmethod" - it will show.
You can get an array of StackTraceElements and then iterate over them foreach
StackTraceElement[] ste= Thread.currentThread().getStackTrace();
for (StackTraceElement element : ste)
{
System.out.println(element.getMethodName()); // here you can display what you need
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question