mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-12-01 09:20:35 +00:00
commit
73bfcc2167
@ -1037,7 +1037,12 @@ static void printFPImmOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
double FPImm = MCOperand_isFPImm(MO) ? MCOperand_getFPImm(MO) : AArch64_AM_getFPImmFloat((int)MCOperand_getImm(MO));
|
||||
|
||||
// 8 decimal places are enough to perfectly represent permitted floats.
|
||||
#if defined(_KERNEL_MODE)
|
||||
// Issue #681: Windows kernel does not support formatting float point
|
||||
SStream_concat(O, "#<float_point_unsupported>");
|
||||
#else
|
||||
SStream_concat(O, "#%.8f", FPImm);
|
||||
#endif
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].type = ARM64_OP_FP;
|
||||
MI->flat_insn->detail->arm64.operands[MI->flat_insn->detail->arm64.op_count].fp = FPImm;
|
||||
|
@ -2103,7 +2103,13 @@ static void printT2AddrModeSoRegOperand(MCInst *MI,
|
||||
static void printFPImmOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
||||
|
||||
#if defined(_KERNEL_MODE)
|
||||
// Issue #681: Windows kernel does not support formatting float point
|
||||
SStream_concat(O, "#<float_point_unsupported>");
|
||||
#else
|
||||
SStream_concat(O, "#%e", getFPImmFloat((unsigned int)MCOperand_getImm(MO)));
|
||||
#endif
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_FP;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].fp = getFPImmFloat((unsigned int)MCOperand_getImm(MO));
|
||||
|
15
cs.c
15
cs.c
@ -21,6 +21,21 @@
|
||||
#include "windows\winkernel_mm.h"
|
||||
#endif
|
||||
|
||||
// Issue #681: Windows kernel does not support formatting float point
|
||||
#if defined(_KERNEL_MODE) && !defined(CAPSTONE_DIET)
|
||||
#if defined(CAPSTONE_HAS_ARM) || defined(CAPSTONE_HAS_ARM64)
|
||||
#define CAPSTONE_STR_INTERNAL(x) #x
|
||||
#define CAPSTONE_STR(x) CAPSTONE_STR_INTERNAL(x)
|
||||
#define CAPSTONE_MSVC_WRANING_PREFIX __FILE__ "("CAPSTONE_STR(__LINE__)") : warning message : "
|
||||
|
||||
#pragma message(CAPSTONE_MSVC_WRANING_PREFIX "Windows driver does not support full features for selected architecture(s). Define CAPSTONE_DIET to compile Capstone with only supported features. See issue #681 for details.")
|
||||
|
||||
#undef CAPSTONE_MSVC_WRANING_PREFIX
|
||||
#undef CAPSTONE_STR
|
||||
#undef CAPSTONE_STR_INTERNAL
|
||||
#endif
|
||||
#endif // defined(_KERNEL_MODE) && !defined(CAPSTONE_DIET)
|
||||
|
||||
#if !defined(CAPSTONE_HAS_OSXKERNEL) && !defined(CAPSTONE_DIET) && !defined(_KERNEL_MODE)
|
||||
#define INSN_CACHE_SIZE 32
|
||||
#else
|
||||
|
@ -56,7 +56,12 @@ static void print_insn_detail(cs_insn *ins)
|
||||
printf("\t\toperands[%u].type: IMM = 0x%x\n", i, op->imm);
|
||||
break;
|
||||
case ARM_OP_FP:
|
||||
#if defined(_KERNEL_MODE)
|
||||
// Issue #681: Windows kernel does not support formatting float point
|
||||
printf("\t\toperands[%u].type: FP = <float_point_unsupported>\n", i);
|
||||
#else
|
||||
printf("\t\toperands[%u].type: FP = %f\n", i, op->fp);
|
||||
#endif
|
||||
break;
|
||||
case ARM_OP_MEM:
|
||||
printf("\t\toperands[%u].type: MEM\n", i);
|
||||
|
@ -54,7 +54,12 @@ static void print_insn_detail(cs_insn *ins)
|
||||
printf("\t\toperands[%u].type: IMM = 0x%" PRIx64 "\n", i, op->imm);
|
||||
break;
|
||||
case ARM64_OP_FP:
|
||||
#if defined(_KERNEL_MODE)
|
||||
// Issue #681: Windows kernel does not support formatting float point
|
||||
printf("\t\toperands[%u].type: FP = <float_point_unsupported>\n", i);
|
||||
#else
|
||||
printf("\t\toperands[%u].type: FP = %f\n", i, op->fp);
|
||||
#endif
|
||||
break;
|
||||
case ARM64_OP_MEM:
|
||||
printf("\t\toperands[%u].type: MEM\n", i);
|
||||
|
Loading…
Reference in New Issue
Block a user