< prev index next >
src/cpu/x86/vm/debug_x86.cpp
Print this page
rev 7417 : improve secondary signal handling
*** 30,34 ****
--- 30,53 ----
#include "runtime/os.hpp"
#include "utilities/debug.hpp"
#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
+
< prev index next >