Hacker News new | ask | show | jobs
by therein 3480 days ago
Yeah, in Windows you have the `DebugBreak/__debugbreak()` function [0].

For POSIX you have `raise(SIGTRAP)` or gcc you have `__builtin_trap()` which actually has some caveats. [1]

[0] https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

[1] https://stackoverflow.com/questions/173618/is-there-a-portab...