I have to track the flow of execution in eclipse
10,006
CTRL + ALT + H shows you the call hierarchy for a method. Perhaps that's what you wanted.
So it you highlight a method and click CTRL + ALT + H, it shows, in the Call Hierarchy window, all the methods the call that method, and for each of those methods, all the methods that call them, and so on ...
Related videos on Youtube
Author by
BelieveToLive
Updated on June 04, 2022Comments
-
BelieveToLive almost 2 years
I know how to debug in eclipse, but I want to know an effective way of finding the flow of execution from a method.
E g:
class A { method S() {} method S1() { B.SS() } method S2() { A.S1() } } class B { method SS() { A.S() } method SS1() { B.SS2() } method SS2() { A.S2() } }
Given these two classes, how can I trace the flow of the methods from
A.S2()
toA.S()
other than debugging?-
DevOps85 over 9 yearsF5 into debug = "Step into"
-
BelieveToLive over 9 yearsI just gave a flow. But I m asking in real time scenario. Just gave an example so as to clear with the concept rather giving bunch of codes and making it complex.
-
-
hfontanez over 9 yearsThis should be a last resort. There a methods to step through code without the need of "print" statements. My experience is that they tend to stay in the code when it is fixed.
-
hfontanez over 9 yearsAnd do what afterwards? This doesn't answer the question at all. Your suggestion is incomplete.
-
hfontanez over 9 yearsIf this reply answers your question, please mark it as the answer. Additionally, you can do what Antonio Balduzzi suggested and run on debug mode by placing a breakpoint somewhere in the code and step through the code by pressing 'F5'. You can start the application on debug mode by selecting the debug button on the tool bar, or you can right-click the class that contains the main method and select "Debug As --> Java application"