--- old/src/cpu/x86/vm/debug_x86.cpp 2014-11-26 07:18:19.028356000 +0100 +++ new/src/cpu/x86/vm/debug_x86.cpp 2014-11-26 07:18:18.250300000 +0100 @@ -32,3 +32,22 @@ #include "utilities/top.hpp" void pd_ps(frame f) {} + + +#ifndef PRODUCT +// a sequence of bytes which, when used as opcodes, will cause a SIGILL +const uint8_t illegal_instruction_sequence[8] = { + #if defined(AMD64) + // 06 => invalid instruction for x64 + 0x06 + #elif defined(IA32) + // Note: privileged instructions won't work, because they cause a SIGSEGV + // on Linux, not a SIGILL. "0f 0e" and "0f 0f" are invalid opcodes which + // will cause real SIGILL resp. EXCEPTION_ILLEGAL_INSTRUCTION. + 0x0f, 0x0f, + // Note: just in case this does not work, use a HLT which should be privilegued. + 0xF4 + #endif +}; +#endif +