Difference between revisions of "Debugging Tutorial"

From SIMA wiki
Jump to: navigation, search
(Created page with " Eclipse provides a powerful debugging view. If you set a breakpoint and start the code with “debug as …” and the breakpoint is reached, the view will be activated (if y...")
 
 
Line 1: Line 1:
Eclipse provides a powerful debugging view. If you set a breakpoint and start the code with “debug as …” and the breakpoint is reached, the view will be activated (if you are not there already).
+
Eclipse provides a powerful debugging view. If you set a breakpoint and start the code with “debug as …” and the breakpoint is reached, the view will be activated (if you are not there already).
 +
 
  
 
The debug-view consists of the following (important) elements/tabs:
 
The debug-view consists of the following (important) elements/tabs:

Latest revision as of 09:08, 17 October 2012

Eclipse provides a powerful debugging view. If you set a breakpoint and start the code with “debug as …” and the breakpoint is reached, the view will be activated (if you are not there already).


The debug-view consists of the following (important) elements/tabs:

  • Debug: views the threads that are active and where you are located at (which class at what line). Further, the stack trace is viewed for each thread.
  • Variables: all variables that are accessible at the current scope. They can be displayed either by their natural structure (that is somethimes hard to read for humans. e.g. hashmaps) or with their logic structure. This behavior can be toggled by a small button at the top of this tab.
  • Code: The classes and their breakpoints are viewed their. It can be used to do some on-the-fly editing while debugging. If possible, eclipse will roll back to the top of the edited method and continue debugging. Very handy for minor changes.
  • Breakpoints: All set breakpoints (activated and deactivated ones).
  • Console: Whatever is printed to the system and error console is displayed here.

Some webressources that deal with java debugging using the eclipse framework:

  • [1]- Java Debugging with Eclipse - Tutorial
  • [2] - Debugging with the Eclipse Platform
  • [3] - 5 Tips for Debugging Java Code in Eclipse