I've written some code using __debugbreak()
on Windows, and I'd like to support other compilers, so I'm looking to create a more portable version of this function (Clang and GCC).
I've rejected using inline assembler for now because it does not provide a target-independent means of specifying a debug break. I've also looked at __builtin_trap()
but apparently it doesn't really permit for example step in/step over afterwards and that kind of thing. I've also looked at this question but the accepted answer doesn't actually specify the bit that I'm looking for- the bit that goes in the "...".
I've also seen some patches for Clang about supporting this, but apparently Clang still rejected code containing __debugbreak()
.
Any suggestions?