What can I use instead of "int 3" instruction in a 64-bit application?

Andrey Karpov
Articles: 565

The 64-bit version of Visual C++ compiler does not support inline assembler, so you cannot write code like "__asm int 3". But there is one more, less known mechanism to create interrupts during debugging – __debugbreak(). This is an intrinsic function of the VisualC++ compiler defined in vc\include\intrin.h which actually has the same functionality as int 3. Unlike int 3, this function is cross-platform. The Win32 function DebugBreak() has a similar functionality.


Use PVS-Studio to search for bugs in C, C++, C# and Java

We offer you to check your project code with PVS-Studio. Just one bug found in the project will show you the benefits of the static code analysis methodology better than a dozen of the articles.

goto PVS-Studio;

Andrey Karpov
Articles: 565

Bugs Found

Checked Projects
Collected Errors
14 526
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →