Closed invertego closed 2 months ago
I can move the immediate directly into the definition of BRK if desired (i.e. #define BRK 0xd43e0000
). I did it this way to make the choice of immediate more readily apparent.
The hint is not part of the instruction, its an argument, so it is better this way.
Implement SLJIT_BREAKPOINT with the same instruction emitted by MSVC for the debugbreak intrinsic (brk #0xf000) and by Clang for builtin_debugtrap. On Windows, this triggers a breakpoint exception just as int3 does on x86. The previously emitted instruction (brk #0) triggers an illegal instruction exception instead.
LLDB also has special handling for this brk variant on Windows and macOS, automatically advancing to the next instruction so execution can be easily continued.
Fixes #266