mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1231 from ethereum/debugbreak
Properly define trap_instruction
This commit is contained in:
commit
cc2a6867a7
@ -93,6 +93,13 @@ static void __inline__ trap_instruction(void)
|
|||||||
/* Has same known problem and workaround
|
/* Has same known problem and workaround
|
||||||
* as Thumb mode */
|
* as Thumb mode */
|
||||||
}
|
}
|
||||||
|
#elif defined(ETH_EMSCRIPTEN)
|
||||||
|
enum { HAVE_TRAP_INSTRUCTION = 1, };
|
||||||
|
__attribute__((gnu_inline, always_inline))
|
||||||
|
static void __inline__ trap_instruction(void)
|
||||||
|
{
|
||||||
|
asm("debugger");
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
enum { HAVE_TRAP_INSTRUCTION = 0, };
|
enum { HAVE_TRAP_INSTRUCTION = 0, };
|
||||||
#endif
|
#endif
|
||||||
@ -101,11 +108,7 @@ __attribute__((gnu_inline, always_inline))
|
|||||||
static void __inline__ debug_break(void)
|
static void __inline__ debug_break(void)
|
||||||
{
|
{
|
||||||
if (HAVE_TRAP_INSTRUCTION) {
|
if (HAVE_TRAP_INSTRUCTION) {
|
||||||
#if defined(ETH_EMSCRIPTEN)
|
|
||||||
asm("debugger");
|
|
||||||
#else
|
|
||||||
trap_instruction();
|
trap_instruction();
|
||||||
#endif
|
|
||||||
} else if (DEBUG_BREAK_PREFER_BUILTIN_TRAP_TO_SIGTRAP) {
|
} else if (DEBUG_BREAK_PREFER_BUILTIN_TRAP_TO_SIGTRAP) {
|
||||||
/* raises SIGILL on Linux x86{,-64}, to continue in gdb:
|
/* raises SIGILL on Linux x86{,-64}, to continue in gdb:
|
||||||
* (gdb) handle SIGILL stop nopass
|
* (gdb) handle SIGILL stop nopass
|
||||||
|
Loading…
Reference in New Issue
Block a user