954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Is there any way to trace out the code execution step by step,simple to complex prog?

Hello Everyone,

Can we see the code execution step by step on an editor.

mrabrar09
Newbie Poster
17 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

What IDE are you using?

dij_0983
Junior Poster in Training
50 posts since Nov 2011
Reputation Points: 10
Solved Threads: 1
 

Am using

IBM Rational Software Development Platform

Version: 6.0.0
Build id: 20041117_2230

(c) Copyright IBM Corp. and others 2000, 2004. All rights reserved.


This product is powered by Eclipse technology. ( http://www.eclipse.org )

mrabrar09
Newbie Poster
17 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

If it's Eclipse-based you just have to run your app in debug mode for full execution & variable tracing

JamesCherrill
Posting Genius
Moderator
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

Actually i have written a small program on division, now i want see the control flow means how the line of code is executing and calling the methods and function step by step.

But when am run the program in debug mode nothing is showing

mrabrar09
Newbie Poster
17 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Actually i have written a small program on division, now i want see the control flow means how the line of code is executing and calling the methods and function step by step.

But when am run the program in debug mode nothing is showing

You must first place a breakpoint. You place somewhere in your code and when you debug, the code runs up until that point and stops. You can then see all the values of the variables that have been initialized up to that point. Then you have some options where you can continue line by line and observe the code and the values.

To place a breakpoint in eclipse simply right click at the left side of the editor where the line numbers are.

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

Thanks for reply

Ok....

I can place breakpoints any where in code or only at specified place.

Regards,
Abrar.

mrabrar09
Newbie Poster
17 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Anywhere you want. Normally you put one at the place where you want to start tracing, eg on the first line of the main method.

JamesCherrill
Posting Genius
Moderator
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

I mostly debug in SpringSource (which is Eclipse based) so I'm just speaking about Eclipse and SpringSource here.

you can start debugging, jumpt to the next executed line, to the next executed line in the same class, to the next line you run over which has a breakpoint on it, ...
the different steps you choose by pushing f5-f6-f7-f8.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: