IIEST, Shibpur

Indian Institute of Engineering Science and Technology, Shibpur

(Formerly Bengal Engineering and Science University, Shibpur)

Empowering the nation since 1856

आई आई ई एस टि, शिवपुर

भारतीय अभियांत्रिकी विज्ञान एवं प्रौद्योगिकी संस्थान, शिवपुर

(पूर्व में बंगाल इंजीनियरिंग एंड साइंस यूनिवर्सिटी)

१८५६ से देश को सशक्त बनाना

Microprocessor Laboratory, CST Department
Bengal Engineering and Science University

Experiment No. II: DEBUGGING
 

Objective: To know the debugging techniques that may be used to make your program error free.

Preamble: Locating and correcting errors in a program is know as deugging. Initial versions of the programs contain errors which can be detected through extensive testing in actual or a simulated environment. The debugging process is painstaking and success depends on logical aptitude and persevearance of the user. To facilitate debugging a KIT offers the following

Debugging facilities:

  1. Break point insertion.
  2. Examining/modifying CPU registers.
  3. Single step execution of a Program.

Break points are inserted at strategic locations in a program to check the validity of that part (starting from the beginning). If the program behaves normally up to the 1st breakpoint then it is removed and the checking is done up to the 2nd and so on; finally all the breakpoints are removed and the program is fully executed.

Sometimes, the register values may be checked at a breakpoint or the values may be modified to chnage the behaviour of the program to get the bug. Finally, in case of a deeply nested bug the program may even be executed in a single step (one instruction at a time) mode.

Through this experiment you are expected to get the following:

i) Know about common debugging tools; ii) How to select strategic position for breakpoints and iii) What are the common errors in asembly language programming.

A very simple program may not contain any error and the debugging is employed on programs written to implement non-trivial tasks; like implementing Search or a recursive algorithm.

Debugging facilities in Powerful machines: A KIT offers a naive debugging facilty due to its limited hardware and software. In a better equipped computing system powerful s/w debuggers (e.g., gdb in PC/Workstations) are aviable. Other methods for debugging are taking core dumps and trace. While the dump displayes an entire memory region a trace displays the current status of registers and selected memeory locations during the execution of the program being debugged.

Report: 1) Explain: Bug, modular programming, NOP, sub-routine, stack, relative addressing, little endian and big endian, automatic variable, Logical errors.