Home * Programming * Debugging

Debugging is a process of finding and reducing bugs in a computer program. A Debugger, usually in software, allows to execute the program (debugee) under its control, to set breakpoints, let the user step to single lines of his source or machine code, to inspect variables, memory and processor registers. Processors often provide special instructions for the purpose of debugging.
Hin und her und rundherum
Kriecht es, fliegt es mit Gebrumm [1]

x86 Breakpoints

8086, x86 and x86-64 have the int 3 one byte software interrupt instruction with opcode 0xCC, which might be explicitly used, or implicitly in assertions. This instruction is also used, when setting a breakpoint from a debugger, where current opcode is (temporarily) replaced by the int 3 opcode (0xCC), which when executed calls a special interrupt routine of the debugger or runtime system.

Breakpoint opcode may be inserted inside the code at compile time, for instance with x86 inline assembly or compiler intrinsic like DebugBreak [2] :
  __asm int 3

Compiler Support

Various compiler allow a special Debug build, which disables optimizations, default initialization of otherwise not initialized variables or memory, and/or enable runtime checking, like bounds checking of array access. Various integrated development environments (IDE) provide an integrated debugger.

Debugging the Search

A recursive search is quite hard to debug. Therefor chess programs may provide debug routines to use a sequence of certain moves or a zobrist key as a precondition to break the search if they occur.

See also


Forum Posts

External Links


  1. ^ Wilhelm-Busch, Max und Moritz - Fünfter Streich from Wilhelm-Busch Seiten von Jochen Schöpflin (German)
  2. ^ DebugBreak Function (Windows) from Develop for Windows 7 and Windows Vista | MSDN
  3. ^ Regression testing from Wikipedia

What links here?

Up one Level