| 12345678910111213141516171819202122232425262728293031 |
- /*
- * Copyright 2010-2012 Branimir Karadzic. All rights reserved.
- * License: http://www.opensource.org/licenses/BSD-2-Clause
- */
- #ifndef __BX_DEBUG_H__
- #define __BX_DEBUG_H__
- #include "bx.h"
- namespace bx
- {
- inline void debugBreak()
- {
- #if BX_COMPILER_MSVC
- __debugbreak();
- #elif BX_CPU_ARM
- asm("bkpt 0");
- #elif !BX_PLATFORM_NACL && BX_CPU_X86 && (BX_COMPILER_GCC || BX_COMPILER_CLANG)
- // NaCl doesn't like int 3:
- // NativeClient: NaCl module load failed: Validation failure. File violates Native Client safety rules.
- __asm__ ("int $3");
- #else // cross platform implementation
- int* int3 = (int*)3L;
- *int3 = 3;
- #endif // BX
- }
- } // namespace bx
- #endif // __BX_DEBUG_H__
|