aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-10-16 00:09:24 +0800
committerGitHub <noreply@github.com>2016-10-16 00:09:24 +0800
commitcc2a6867a7986b04c3f8013f508df77eab738d19 (patch)
tree35ca141dcbb667d689fc8590e43d4a1f46db13e3
parente0bf199b911faae427d91d05a18e128e284daa37 (diff)
parentbc537c7581fecc88cee80d5554c16dfc1d5c6a94 (diff)
downloaddexon-solidity-cc2a6867a7986b04c3f8013f508df77eab738d19.tar.gz
dexon-solidity-cc2a6867a7986b04c3f8013f508df77eab738d19.tar.zst
dexon-solidity-cc2a6867a7986b04c3f8013f508df77eab738d19.zip
Merge pull request #1231 from ethereum/debugbreak
Properly define trap_instruction
-rw-r--r--libdevcore/debugbreak.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdevcore/debugbreak.h b/libdevcore/debugbreak.h
index 65612a34..f8838a5f 100644
--- a/libdevcore/debugbreak.h
+++ b/libdevcore/debugbreak.h
@@ -93,6 +93,13 @@ static void __inline__ trap_instruction(void)
/* Has same known problem and workaround
* 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
enum { HAVE_TRAP_INSTRUCTION = 0, };
#endif
@@ -101,11 +108,7 @@ __attribute__((gnu_inline, always_inline))
static void __inline__ debug_break(void)
{
if (HAVE_TRAP_INSTRUCTION) {
-#if defined(ETH_EMSCRIPTEN)
- asm("debugger");
-#else
trap_instruction();
-#endif
} else if (DEBUG_BREAK_PREFER_BUILTIN_TRAP_TO_SIGTRAP) {
/* raises SIGILL on Linux x86{,-64}, to continue in gdb:
* (gdb) handle SIGILL stop nopass