Use the __debugbreak()
intrinsic(requires the inclusion of <intrin.h>
).
Using __debugbreak()
is preferable to directly writing __asm { int 3 }
since inline assembly is not permitted when compiling code for the x64 architecture.
And for the record, on Linux and Mac, with GCC, I’m using __builtin_trap()
.