Difference between revisions of "Team1/Debugging your programs"

From CDOT Wiki
Jump to: navigation, search
(12. Debugging Your Program)
(12. Debugging Your Program)
 
(9 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
<br/>
 
<br/>
 
[[Image:Debug3.jpg|600px ]]<br/><br/>
 
[[Image:Debug3.jpg|600px ]]<br/><br/>
'''12.3. Step Over:'''
+
'''12.3. Stop and Start Debugging:''' Click on the debug button on the top bar to start debugging.The program will run in debug mode and stops at your break point.
<br/>
+
<br />
'''12.4. Step Into:'''
+
[[Image:Debug4.jpg|600px ]]<br/><br/>
<br/>
+
<br />
'''12.5. Other Useful Function keys:'''
+
[[Image:Debug5.jpg|600px ]]<br/><br/>
 +
You can stop or resume debugging using stop or resume buttons in debug view.
 +
<br />
 +
[[Image:Debug6.jpg|600px ]]<br/><br/>
 +
'''12.4. Step Over:'''To move forward in the code and step over method calls, press F6 or use the Step Over button in the Debug view.
 +
<br />
 +
[[Image:Debug7.jpg|600px ]]<br/><br/>
 +
'''12.5. Step Into:'''To move forward in the program and step into method press F5 or use Step Into button in the Debug view.
 
<br/>
 
<br/>
'''12.6. Add Watch:'''
+
[[Image:Debug8.jpg|600px ]]<br/><br/>
 +
'''12.6. Other Useful Function keys:'''          Normal  0          false  false  false    EN-US  X-NONE  AR-SA
 +
 
 +
F7: will go to the caller of the method/ function. So this will leave the current code and go to the calling code.<br/>
 +
 
 +
F8: goes to the next break point. If no further break point is encountered then the program will normally run.  <br/>
 +
 
 +
'''12.7. Add Watch:'''To see the value of a variable or an statement, you need to add watch to it. Select the variable, right click and select "Watch" from the menu. The variable will be added as Expression in Expression view and the value of it is shown in any step of the debugger.
 
<br/>
 
<br/>
[[Image:Debug4.jpg|600px ]]<br/><br/>
+
[[Image:Debug9.jpg|600px ]]<br/><br/>
 +
[[Image:Debug10.jpg|600px ]]<br/><br/>

Latest revision as of 00:54, 31 January 2011

12. Debugging Your Program

12.1. Debugging and Debugger Perspective: In order to debug your application, select the Source folder (src), right click and select "Debug As" and choose Java Application from the menu. You will receive a pop-up message indication shifting the perspective to Debug perspective which has all the view used in debugging for convenience.Answer "Yes" to the pop-up.
Debug1.jpg

Debug2.jpg

12.2. Setting Break Points: Double Click on the gray bay at the left side of the code to set a break point at any line.
Debug3.jpg

12.3. Stop and Start Debugging: Click on the debug button on the top bar to start debugging.The program will run in debug mode and stops at your break point.
Debug4.jpg


Debug5.jpg

You can stop or resume debugging using stop or resume buttons in debug view.
Debug6.jpg

12.4. Step Over:To move forward in the code and step over method calls, press F6 or use the Step Over button in the Debug view.
Debug7.jpg

12.5. Step Into:To move forward in the program and step into method press F5 or use Step Into button in the Debug view.
Debug8.jpg

12.6. Other Useful Function keys: Normal 0 false false false EN-US X-NONE AR-SA

F7: will go to the caller of the method/ function. So this will leave the current code and go to the calling code.

F8: goes to the next break point. If no further break point is encountered then the program will normally run.

12.7. Add Watch:To see the value of a variable or an statement, you need to add watch to it. Select the variable, right click and select "Watch" from the menu. The variable will be added as Expression in Expression view and the value of it is shown in any step of the debugger.
Debug9.jpg

Debug10.jpg