www.delorie.com/djgpp/faq/debugging/corruption.html   search  
When I use the debugger, my I/O is corrupted

My program corrupts files and screen writes, and otherwise behaves strangely when run under a debugger.

Do you use transfer buffer to move data between your program and conventional (under 1 MByte) memory? Then it might be that the debugger corrupts your I/O. The debugger itself uses the transfer buffer for disk read requests and screen writes. If you single step through any of your app routines which use the transfer buffer you may alter the correct behavior.

To work around this, don't step with the debugger through your functions which use the transfer buffer.

If you don't know what a transfer buffer is, you probably aren't using it, and stepping through your own functions won't hurt it. Just don't step through the libc functions.

  webmaster     delorie software   privacy  
  Copyright © 1995     Updated Feb 1995