6 out of 12 rated this helpful - Rate this topic

DebugBreak function

Applies to: desktop apps only

Causes a breakpoint exception to occur in the current process. This allows the calling thread to signal the debugger to handle the exception.

To cause a breakpoint exception in another process, use the DebugBreakProcess function.

Syntax

void WINAPI DebugBreak(void);

Parameters

This function has no parameters.

Return value

This function does not return a value.

Remarks

If the process is not being debugged, the function uses the search logic of a standard exception handler. In most cases, this causes the calling process to terminate because of an unhandled breakpoint exception.

Examples

For an example, see Using an Exception Handler.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Communicating with the Debugger
Debugging Functions
DebugActiveProcess
DebugBreakProcess

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
How to prevent breaking into the kernel debugger
You can specify the /noumex flag in the kernel debugger settings (see bcdedit /dbgsettings /?), to cause user-mode exceptions to be ignored by the kernel debugger.
DebugBreak and /debug boot option
If this function is called on a machine where the /debug boot option has been configured, the machine will halt when this call is made. The implication of the /debug boot option is that a kernel debugger is attached to the system. If you attach a kernel debugger to the system, you will be able to continue executation (g or F5 in windbg.exe)