This is a temporary, read-only recovery of the chessprogrammingwiki while a longer-term plan is worked out. Editing is not possible right now, but will be again soon.
Chess Programming Wiki All pages Other namespaces

Debugging

Home * Programming * Debugging

Hin und her und rundherum Kriecht es, fliegt es mit Gebrumm 1Hin und her und rundherum
Kriecht es, fliegt es mit Gebrumm 1


  1. Wilhelm-Busch, Max und Moritz - Fünfter Streich from Wilhelm-Busch Seiten von Jochen Schöpflin (German)↩︎

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.

Contents
  1. x86 Breakpoints
  2. Compiler Support
  3. Debugging the Search
  4. See also
  5. Publications
  6. Forum Posts
    1. 2000 ...
    2. 2005 ...
    3. 2010 ...
    4. 2015 ...
    5. 2020 ...
  7. External Links
  8. References

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 1 :

  __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.

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. Here are Tord Romstad's suggestions in a reply to Patrice Duhamel 2:

See also

Publications

Forum Posts

2000 ...

2005 ...

Re: Testing and debugging chess engines by Tord Romstad, Winboard Forum, December 05, 2006

2010 ...

2015 ...

2020 ...

Brian W. Kernighan, Rob Pike (1999). The Practice of Programming. Addison-Wesley, ISBN: ISBN 0-201-61586-X

References

Up one Level


  1. DebugBreak Function (Windows) from Develop for Windows 7 and Windows Vista | MSDN↩︎

  2. Re: Testing and debugging chess engines by Tord Romstad, Winboard Forum, December 05, 2006↩︎

  3. Regression testing from Wikipedia↩︎

  4. Assertion (software development) from Wikipedia↩︎

What links here

Contributors: GerdIsenberg.