popl %eax
ret
-
+
+/* Undefined instruction (generates SIGILL) */
+.globl VG_(helper_undefined_instruction)
+VG_(helper_undefined_instruction):
+1: ud2
+ jmp 1b
+
##--------------------------------------------------------------------##
##--- end vg_helpers.S ---##
##--------------------------------------------------------------------##
extern void VG_(helper_DAS);
extern void VG_(helper_DAA);
+extern void VG_(helper_undefined_instruction);
+
/* NOT A FUNCTION; this is a bogus RETURN ADDRESS. */
extern void VG_(signalreturn_bogusRA)( void );
extern Int VGOFF_(helper_DAS);
extern Int VGOFF_(helper_DAA);
+extern Int VGOFF_(helper_undefined_instruction);
+
extern Int VGOFF_(handle_esp_assignment); /* :: Addr -> void */
/* For storing extension-specific helpers, determined at runtime. The addr
Int VGOFF_(helper_DAS) = INVALID_OFFSET;
Int VGOFF_(helper_DAA) = INVALID_OFFSET;
Int VGOFF_(handle_esp_assignment) = INVALID_OFFSET;
+Int VGOFF_(helper_undefined_instruction) = INVALID_OFFSET;
/* MAX_NONCOMPACT_HELPERS can be increased easily. If MAX_COMPACT_HELPERS is
* increased too much, they won't really be compact any more... */
VGOFF_(helper_DAA)
= alloc_BaB_1_set( (Addr) & VG_(helper_DAA) );
+ VGOFF_(helper_undefined_instruction)
+ = alloc_BaB_1_set( (Addr) & VG_(helper_undefined_instruction) );
+
/* Allocate slots for noncompact helpers */
assign_helpers_in_baseBlock(VG_(n_noncompact_helpers),
VG_(noncompact_helper_offsets),
"MMX, SSE, SSE2 or 3DNow!\n" );
VG_(printf)("instruction. Valgrind does not currently "
"support such instructions. Sorry.\n" );
- VG_(unimplemented)("unhandled x86 0x0F 2-byte opcode");
+ uInstr0(cb, CALLM_S, 0);
+ uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_undefined_instruction));
+ uInstr0(cb, CALLM_E, 0);
+
+ /* just because everything else insists the last instruction
+ of a BB is a jmp */
+ uInstr1(cb, JMP, 0, Literal, 0);
+ uCond(cb, CondAlways);
+ uLiteral(cb, eip);
+ *isEnd = True;
}
break;