Search code examples
debuggingdosutility

DEBUG utility at command prompt in windows 7


I compiled some C code on my computer that has windows 7 installed. I wanted to debug the executable at command prompt. I could enter the debug utility and display the segments but when I tried to run the executable with G command, I got the message "This program cannot be run in DOS mode.".

Does being at command prompt mean that you are in DOS mode, even if you have windows installed?

Does the DEBUG utility that runs at command prompt only runs 16-bit DOS executables, not 32-bit ones?


Solution

  • Read about the debug program on Wikipedia. It is not a tool you should use to debug C code.

    There is no 16 bit compatible software on Windows anymore. If you are looking for debuggers look at Debugging tools for Windows. This package will give you a suite of debugging tools like ntsd, cdb (console debuggers), WinDBG (GUI around ntsd). Good windbg tutorial is here.

    There is also the Visual Studio Express (free version of Visual Studio) that has good set of debuggers for C code.