mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 13:03:06 +01:00
32 lines
687 B
C++
32 lines
687 B
C++
/*
|
|
* 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__
|