Debugging In Eclipse IDE

29 April 2007

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or in a piece of electronic hardware thus making it behave as expected.

Debugging is something that a developer can’t avoid. If he tries to avoid, then he has to pay price in terms of time and may be money. There are several ways to do debugging, but it eventually comes to finding the code responsible for the bug. Using a debugger makes finding this information sometimes an easy one.

The Core Eclipse Platform has a built-in Java debugger that provides all standard debugging functionality, including the ability to perform step execution, to set up breakpoints, to inspect variables and values, to suspend and resume threads etc. Even you can debug applications that are running on a remote machine.

To debug a project, the code needs to be compiled and run successfully. You first need to create a run configuration for your application and make sure that it starts properly. Next, you need to set up the debug configuration in a similar way using the ” right Click the Java Source/Class “,” Run ” - > ” Debug… “.

In case of an application select the class to be used as the main Java class by the debugger. It is important to put break points at point to stop debugger from complete execution of program. Also, it is important not to put multiple statements on a single line because you cannot step over or set line breakpoints on more than one statement on the same line.
Here I have put a simple program to test debugging. With a break point at one of the suspected position in code.

temp = c % 2;

Now go ” Run ” - > ” Debug “. Window to select main class will appear.

After this switch to Debug perspective.

On selecting this option this mode will appear. This will show editor on one side with break points and Variables with values on the other side. From there you can see at which point which variable has which value and could trace the problem.

del.icio.us:Debugging In Eclipse IDE  digg:Debugging In Eclipse IDE  spurl:Debugging In Eclipse IDE  wists:Debugging In Eclipse IDE  simpy:Debugging In Eclipse IDE  newsvine:Debugging In Eclipse IDE  blinklist:Debugging In Eclipse IDE  furl:Debugging In Eclipse IDE  reddit:Debugging In Eclipse IDE  fark:Debugging In Eclipse IDE  blogmarks:Debugging In Eclipse IDE  Y!:Debugging In Eclipse IDE  smarking:Debugging In Eclipse IDE  magnolia:Debugging In Eclipse IDE  segnalo:Debugging In Eclipse IDE  gifttagging:Debugging In Eclipse IDE

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Debugging In Eclipse IDE

One Response to “Debugging In Eclipse IDE”

  1. Donna Says:

    This is so general it is almost no help. What is the difference between step over and step into…I think a little more instruction would be helpful.

Leave a Reply