![]() Modify the Value of a Variable: You can modify the value of a variable by entering a new value in the “Variable” panel. Alternatively, you could set a breakpoint inside a method. You could use “Step-Return” to return back to the caller, anywhere within the method. ![]() Step-Into and Step-Return: To debug a method, you need to use “Step-Into” to step into the first statement of the method. Important: I can’s stress more that mastering the use of debugger is crucial in programming.Įxplore the features provided by the debuggers. Always terminate your current debugging session using “Terminate” or “Resume” till the end of the program. Alternatively, you can place the cursor on a particular statement, and issue “Run-To-Line” from the “Run” menu to continue execution up to the line. You could set a breakpoint at the statement immediately outside the loop e. To set a breakpoint on a particular statement, double-click the left-margin of that line or select “Toggle Breakpoint” from “Run” menu. Single-stepping thru the program and watching the values of internal variables and the outputs produced is the ultimate mean in debugging programs – because it is exactly how the computer runs your program!Īs mentioned, a breakpoint suspends program execution and let you examine the internal states of the program. You can also place your cursor at any variable to inspect the content of the variable. As illustrated in the following diagram, the highlighted line also pointed to by a blue arrow indicates the statement to be executed in the next step.Īt each of the step, examine the value of the variables in the “Variable” panel and the outputs produced by your program in the “Console” Panel, if any. The program begins execution but suspends its operation at the breakpoint, i. A blue circle appears in the left-margin indicating a breakpoint is set at that line. Set a breakpoint at main method by double-clicking on the left-margin of the line containing main. Before starting the debugger, you need to set at least one breakpoint to suspend the execution inside the program. A breakpoint suspends program execution for you to examine the internal states e. It could save you countless hours guessing on what went wrong. Able to use a graphics debugger to debug program is crucial in programming. This will save you many agonizing hours trying to figure out how to do somethings later.
0 Comments
Leave a Reply. |