Debugging functions : How to debug an application without any debugger?

Using OutputDebugString

If the application has no debugger, the system debugger displays the string if the filter mask allows it. (Note that this function calls the DbgPrint function to display the string. For details on how the filter mask controls what the system debugger displays, see the DbgPrint function in the Windows Driver Kit on MSDN.) If the application has no debugger and the system debugger is not active, OutputDebugString does nothing.

If you use this function, it sends a string to the debugger for display.

Communicating with the debugger

The OutputDebugString function sends a string from the process being debugged to the debugger by generating an OUTPUT_DEBUG_STRING_EVENT debugging event. A process can detect whether it is being debugged by calling the IsDebuggerPresent function.

The DebugBreak function causes a breakpoint exception in the current process. A breakpoint is a location in a program where execution is stopped to allow the developer to examine the program's code, variables, and register values and, as necessary, to make changes, continue execution, or terminate execution.

The FatalExit function terminates the current process and gives execution control to the debugger, but unlike DebugBreak, it does not generate an exception. This function should only be used as a last resort, because it does not always free the process's memory or close its files.

Ok, till now we saw Outputdebugstring, debugbreak, fatalexit and isdebuggerpresent functions. So, where can i find the other debugging functions?

You can get it from the following:




Determines whether the specified process is being debugged.


Enables a debugger to continue a thread that previously reported a debugging event.


Enables a debugger to attach to an active process and debug it.


Stops the debugger from debugging the specified process.


Causes a breakpoint exception to occur in the current process.


Causes a breakpoint exception to occur in the specified process.


Sets the action to be performed when the calling thread exits.


Transfers execution control to the debugger.


Flushes the instruction cache for the specified process.


Retrieves the context of the specified thread.


Retrieves a descriptor table entry for the specified selector and thread.


Determines whether the calling process is being debugged by a user-mode debugger.


Sends a string to the debugger for display.


Reads data from an area of memory in a specified process.


Sets the context for the specified thread.


Waits for a debugging event to occur in a process being debugged.


Retrieves the context of the specified WOW64 thread.


Sets the context of the specified WOW64 thread.


Writes data to an area of memory in a specified process.

Skip to main content