Debugging


Debugging is very important feature in programming. Its objective is to find errors in the programs. In case of syntax errors, the error messages are shown on the screen which makes the removal of such errors easier. Run time errors and linker errors are also debugged by the error messages. But in case of logical errors, no error messages appear, so such types of errors are difficult to detect.
           
C provides us a facility to see the compilation and execution of our program line by line. The next statement will not execute until you tell the debugger to continue. In this way, you can reach the line in your code that contain errors and then examine the value of the variables and the programs output or modify expressions in your program before you tell the debugger to execute the next line. You can debug the program either by Trace into or Step over option from the Run menu item.
         
   The Trace into command executes your program statement-by-statement along with executing each line of the function that is called. You can also use hot key F7 to execute it.
            
The Step over command also executes the statement one at a time, but unlike Trace into command it doesn’t trace into any function that is called. The hot key for executing this command is F8.

          
  If you want to move to the next statement(s) in the program then you would have to keep on pressing F7 or F8 depending on the method of debugging till program ends.

Previous                                                                                  Next

Powered by Blogger.