- Timestamp:
- Apr 18, 2008 1:25:54 PM (17 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore.cpp
r7456 r8142 153 153 154 154 /** 155 * Array for accessing 32-bit general registers in VMMREGFRAME structure156 * by register's index from disasm.157 */158 static const unsigned g_aReg32Index[] =159 {160 RT_OFFSETOF(CPUMCTXCORE, eax), /* USE_REG_EAX */161 RT_OFFSETOF(CPUMCTXCORE, ecx), /* USE_REG_ECX */162 RT_OFFSETOF(CPUMCTXCORE, edx), /* USE_REG_EDX */163 RT_OFFSETOF(CPUMCTXCORE, ebx), /* USE_REG_EBX */164 RT_OFFSETOF(CPUMCTXCORE, esp), /* USE_REG_ESP */165 RT_OFFSETOF(CPUMCTXCORE, ebp), /* USE_REG_EBP */166 RT_OFFSETOF(CPUMCTXCORE, esi), /* USE_REG_ESI */167 RT_OFFSETOF(CPUMCTXCORE, edi) /* USE_REG_EDI */168 };169 170 /**171 * Macro for accessing 32-bit general purpose registers in CPUMCTXCORE structure.172 */173 #define DIS_READ_REG32(p, idx) (*(uint32_t *)((char *)(p) + g_aReg32Index[idx]))174 #define DIS_WRITE_REG32(p, idx, val) (*(uint32_t *)((char *)(p) + g_aReg32Index[idx]) = val)175 #define DIS_PTR_REG32(p, idx) ( (uint32_t *)((char *)(p) + g_aReg32Index[idx]))176 177 /**178 * Array for accessing 16-bit general registers in CPUMCTXCORE structure179 * by register's index from disasm.180 */181 static const unsigned g_aReg16Index[] =182 {183 RT_OFFSETOF(CPUMCTXCORE, eax), /* USE_REG_AX */184 RT_OFFSETOF(CPUMCTXCORE, ecx), /* USE_REG_CX */185 RT_OFFSETOF(CPUMCTXCORE, edx), /* USE_REG_DX */186 RT_OFFSETOF(CPUMCTXCORE, ebx), /* USE_REG_BX */187 RT_OFFSETOF(CPUMCTXCORE, esp), /* USE_REG_SP */188 RT_OFFSETOF(CPUMCTXCORE, ebp), /* USE_REG_BP */189 RT_OFFSETOF(CPUMCTXCORE, esi), /* USE_REG_SI */190 RT_OFFSETOF(CPUMCTXCORE, edi) /* USE_REG_DI */191 };192 193 /**194 * Macro for accessing 16-bit general purpose registers in CPUMCTXCORE structure.195 */196 #define DIS_READ_REG16(p, idx) (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]))197 #define DIS_WRITE_REG16(p, idx, val) (*(uint16_t *)((char *)(p) + g_aReg16Index[idx]) = val)198 #define DIS_PTR_REG16(p, idx) ( (uint16_t *)((char *)(p) + g_aReg16Index[idx]))199 200 /**201 * Array for accessing 8-bit general registers in CPUMCTXCORE structure202 * by register's index from disasm.203 */204 static const unsigned g_aReg8Index[] =205 {206 RT_OFFSETOF(CPUMCTXCORE, eax), /* USE_REG_AL */207 RT_OFFSETOF(CPUMCTXCORE, ecx), /* USE_REG_CL */208 RT_OFFSETOF(CPUMCTXCORE, edx), /* USE_REG_DL */209 RT_OFFSETOF(CPUMCTXCORE, ebx), /* USE_REG_BL */210 RT_OFFSETOF(CPUMCTXCORE, eax) + 1, /* USE_REG_AH */211 RT_OFFSETOF(CPUMCTXCORE, ecx) + 1, /* USE_REG_CH */212 RT_OFFSETOF(CPUMCTXCORE, edx) + 1, /* USE_REG_DH */213 RT_OFFSETOF(CPUMCTXCORE, ebx) + 1 /* USE_REG_BH */214 };215 216 /**217 * Macro for accessing 8-bit general purpose registers in CPUMCTXCORE structure.218 */219 #define DIS_READ_REG8(p, idx) (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]))220 #define DIS_WRITE_REG8(p, idx, val) (*(uint8_t *)((char *)(p) + g_aReg8Index[idx]) = val)221 #define DIS_PTR_REG8(p, idx) ( (uint8_t *)((char *)(p) + g_aReg8Index[idx]))222 223 /**224 * Array for accessing segment registers in CPUMCTXCORE structure225 * by register's index from disasm.226 */227 static const unsigned g_aRegSegIndex[] =228 {229 RT_OFFSETOF(CPUMCTXCORE, es), /* USE_REG_ES */230 RT_OFFSETOF(CPUMCTXCORE, cs), /* USE_REG_CS */231 RT_OFFSETOF(CPUMCTXCORE, ss), /* USE_REG_SS */232 RT_OFFSETOF(CPUMCTXCORE, ds), /* USE_REG_DS */233 RT_OFFSETOF(CPUMCTXCORE, fs), /* USE_REG_FS */234 RT_OFFSETOF(CPUMCTXCORE, gs) /* USE_REG_GS */235 };236 237 static const unsigned g_aRegHidSegIndex[] =238 {239 RT_OFFSETOF(CPUMCTXCORE, esHid), /* USE_REG_ES */240 RT_OFFSETOF(CPUMCTXCORE, csHid), /* USE_REG_CS */241 RT_OFFSETOF(CPUMCTXCORE, ssHid), /* USE_REG_SS */242 RT_OFFSETOF(CPUMCTXCORE, dsHid), /* USE_REG_DS */243 RT_OFFSETOF(CPUMCTXCORE, fsHid), /* USE_REG_FS */244 RT_OFFSETOF(CPUMCTXCORE, gsHid) /* USE_REG_GS */245 };246 247 /**248 * Macro for accessing segment registers in CPUMCTXCORE structure.249 */250 #define DIS_READ_REGSEG(p, idx) (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])))251 #define DIS_WRITE_REGSEG(p, idx, val) (*((uint16_t *)((char *)(p) + g_aRegSegIndex[idx])) = val)252 253 /**254 155 * Parses one instruction. 255 156 * The result is found in pCpu. … … 446 347 //***************************************************************************** 447 348 //***************************************************************************** 448 DISDECL(int) DISGetParamSize(PDISCPUSTATE pCpu, POP_PARAMETER pParam)449 {450 int subtype = OP_PARM_VSUBTYPE(pParam->param);451 452 if (subtype == OP_PARM_v)453 {454 subtype = (pCpu->opmode == CPUMODE_32BIT) ? OP_PARM_d : OP_PARM_w;455 }456 457 switch(subtype)458 {459 case OP_PARM_b:460 return 1;461 462 case OP_PARM_w:463 return 2;464 465 case OP_PARM_d:466 return 4;467 468 case OP_PARM_q:469 case OP_PARM_dq:470 return 8;471 472 case OP_PARM_p:473 if(pCpu->addrmode == CPUMODE_32BIT)474 return 8;475 else476 return 4;477 478 default:479 if(pParam->size)480 return pParam->size;481 else //@todo dangerous!!!482 return 4;483 }484 }485 //*****************************************************************************486 //*****************************************************************************487 DISDECL(int) DISDetectSegReg(PDISCPUSTATE pCpu, POP_PARAMETER pParam)488 {489 if(pCpu->prefix & PREFIX_SEG)490 {491 /* Use specified SEG: prefix. */492 return pCpu->prefix_seg;493 }494 else495 {496 /* Guess segment register by parameter type. */497 if(pParam->flags & USE_REG_GEN32)498 {499 if(pParam->base.reg_gen32 == USE_REG_ESP || pParam->base.reg_gen32 == USE_REG_EBP)500 return USE_REG_SS;501 }502 else503 if(pParam->flags & USE_REG_GEN16)504 {505 if(pParam->base.reg_gen16 == USE_REG_SP || pParam->base.reg_gen16 == USE_REG_BP)506 return USE_REG_SS;507 }508 /* Default is use DS: for data access. */509 return USE_REG_DS;510 }511 }512 //*****************************************************************************513 //*****************************************************************************514 DISDECL(uint8_t) DISQuerySegPrefixByte(PDISCPUSTATE pCpu)515 {516 Assert(pCpu->prefix & PREFIX_SEG);517 switch(pCpu->prefix_seg)518 {519 case USE_REG_ES:520 return 0x26;521 case USE_REG_CS:522 return 0x2E;523 case USE_REG_SS:524 return 0x36;525 case USE_REG_DS:526 return 0x3E;527 case USE_REG_FS:528 return 0x64;529 case USE_REG_GS:530 return 0x65;531 default:532 AssertFailed();533 return 0;534 }535 }536 537 538 /**539 * Returns the value of the specified 8 bits general purpose register540 *541 */542 DISDECL(int) DISFetchReg8(PCPUMCTXCORE pCtx, uint32_t reg8, uint8_t *pVal)543 {544 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);545 546 *pVal = DIS_READ_REG8(pCtx, reg8);547 return VINF_SUCCESS;548 }549 550 /**551 * Returns the value of the specified 16 bits general purpose register552 *553 */554 DISDECL(int) DISFetchReg16(PCPUMCTXCORE pCtx, uint32_t reg16, uint16_t *pVal)555 {556 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);557 558 *pVal = DIS_READ_REG16(pCtx, reg16);559 return VINF_SUCCESS;560 }561 562 /**563 * Returns the value of the specified 32 bits general purpose register564 *565 */566 DISDECL(int) DISFetchReg32(PCPUMCTXCORE pCtx, uint32_t reg32, uint32_t *pVal)567 {568 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);569 570 *pVal = DIS_READ_REG32(pCtx, reg32);571 return VINF_SUCCESS;572 }573 574 /**575 * Returns the pointer to the specified 8 bits general purpose register576 *577 */578 DISDECL(int) DISPtrReg8(PCPUMCTXCORE pCtx, uint32_t reg8, uint8_t **ppReg)579 {580 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);581 582 *ppReg = DIS_PTR_REG8(pCtx, reg8);583 return VINF_SUCCESS;584 }585 586 /**587 * Returns the pointer to the specified 16 bits general purpose register588 *589 */590 DISDECL(int) DISPtrReg16(PCPUMCTXCORE pCtx, uint32_t reg16, uint16_t **ppReg)591 {592 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);593 594 *ppReg = DIS_PTR_REG16(pCtx, reg16);595 return VINF_SUCCESS;596 }597 598 /**599 * Returns the pointer to the specified 32 bits general purpose register600 *601 */602 DISDECL(int) DISPtrReg32(PCPUMCTXCORE pCtx, uint32_t reg32, uint32_t **ppReg)603 {604 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);605 606 *ppReg = DIS_PTR_REG32(pCtx, reg32);607 return VINF_SUCCESS;608 }609 610 /**611 * Returns the value of the specified segment register612 *613 */614 DISDECL(int) DISFetchRegSeg(PCPUMCTXCORE pCtx, uint32_t sel, RTSEL *pVal)615 {616 AssertReturn(sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);617 618 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));619 *pVal = DIS_READ_REGSEG(pCtx, sel);620 return VINF_SUCCESS;621 }622 623 /**624 * Returns the value of the specified segment register including a pointer to the hidden register in the supplied cpu context625 *626 */627 DISDECL(int) DISFetchRegSegEx(PCPUMCTXCORE pCtx, uint32_t sel, RTSEL *pVal, CPUMSELREGHID **ppSelHidReg)628 {629 AssertReturn(sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);630 631 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));632 *pVal = DIS_READ_REGSEG(pCtx, sel);633 *ppSelHidReg = (CPUMSELREGHID *)((char *)pCtx + g_aRegHidSegIndex[sel]);634 return VINF_SUCCESS;635 }636 637 /**638 * Updates the value of the specified 32 bits general purpose register639 *640 */641 DISDECL(int) DISWriteReg32(PCPUMCTXCORE pRegFrame, uint32_t reg32, uint32_t val32)642 {643 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);644 645 DIS_WRITE_REG32(pRegFrame, reg32, val32);646 return VINF_SUCCESS;647 }648 649 /**650 * Updates the value of the specified 16 bits general purpose register651 *652 */653 DISDECL(int) DISWriteReg16(PCPUMCTXCORE pRegFrame, uint32_t reg16, uint16_t val16)654 {655 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);656 657 DIS_WRITE_REG16(pRegFrame, reg16, val16);658 return VINF_SUCCESS;659 }660 661 /**662 * Updates the specified 8 bits general purpose register663 *664 */665 DISDECL(int) DISWriteReg8(PCPUMCTXCORE pRegFrame, uint32_t reg8, uint8_t val8)666 {667 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);668 669 DIS_WRITE_REG8(pRegFrame, reg8, val8);670 return VINF_SUCCESS;671 }672 673 /**674 * Updates the specified segment register675 *676 */677 DISDECL(int) DISWriteRegSeg(PCPUMCTXCORE pCtx, uint32_t sel, RTSEL val)678 {679 AssertReturn(sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);680 681 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));682 DIS_WRITE_REGSEG(pCtx, sel, val);683 return VINF_SUCCESS;684 }685 686 /**687 * Returns the value of the parameter in pParam688 *689 * @returns VBox error code690 * @param pCtx CPU context structure pointer691 * @param pCpu Pointer to cpu structure which have DISCPUSTATE::mode692 * set correctly.693 * @param pParam Pointer to the parameter to parse694 * @param pParamVal Pointer to parameter value (OUT)695 * @param parmtype Parameter type696 *697 * @note Currently doesn't handle FPU/XMM/MMX/3DNow! parameters correctly!!698 *699 */700 DISDECL(int) DISQueryParamVal(PCPUMCTXCORE pCtx, PDISCPUSTATE pCpu, POP_PARAMETER pParam, POP_PARAMVAL pParamVal, PARAM_TYPE parmtype)701 {702 memset(pParamVal, 0, sizeof(*pParamVal));703 704 if(pParam->flags & (USE_BASE|USE_INDEX|USE_DISPLACEMENT32|USE_DISPLACEMENT16|USE_DISPLACEMENT8))705 {706 // Effective address707 pParamVal->type = PARMTYPE_ADDRESS;708 pParamVal->size = pParam->size;709 710 if(pParam->flags & USE_BASE)711 {712 if(pParam->flags & USE_REG_GEN8)713 {714 pParamVal->flags |= PARAM_VAL8;715 if(VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen8, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;716 }717 else718 if(pParam->flags & USE_REG_GEN16)719 {720 pParamVal->flags |= PARAM_VAL16;721 if(VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen16, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;722 }723 else724 if(pParam->flags & USE_REG_GEN32)725 {726 pParamVal->flags |= PARAM_VAL32;727 if(VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen32, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;728 }729 else {730 AssertFailed();731 return VERR_INVALID_PARAMETER;732 }733 }734 // Note that scale implies index (SIB byte)735 if(pParam->flags & USE_INDEX)736 {737 uint32_t val32;738 739 pParamVal->flags |= PARAM_VAL32;740 if(VBOX_FAILURE(DISFetchReg32(pCtx, pParam->index.reg_gen, &val32))) return VERR_INVALID_PARAMETER;741 742 if(pParam->flags & USE_SCALE)743 {744 val32 *= pParam->scale;745 }746 pParamVal->val.val32 += val32;747 }748 749 if(pParam->flags & USE_DISPLACEMENT8)750 {751 if(pCpu->mode & CPUMODE_32BIT)752 {753 pParamVal->val.val32 += (int32_t)pParam->disp8;754 }755 else756 {757 pParamVal->val.val16 += (int16_t)pParam->disp8;758 }759 }760 else761 if(pParam->flags & USE_DISPLACEMENT16)762 {763 if(pCpu->mode & CPUMODE_32BIT)764 {765 pParamVal->val.val32 += (int32_t)pParam->disp16;766 }767 else768 {769 pParamVal->val.val16 += pParam->disp16;770 }771 }772 else773 if(pParam->flags & USE_DISPLACEMENT32)774 {775 if(pCpu->mode & CPUMODE_32BIT)776 {777 pParamVal->val.val32 += pParam->disp32;778 }779 else780 {781 Assert(0);782 }783 }784 return VINF_SUCCESS;785 }786 787 if(pParam->flags & (USE_REG_GEN8|USE_REG_GEN16|USE_REG_GEN32|USE_REG_FP|USE_REG_MMX|USE_REG_XMM|USE_REG_CR|USE_REG_DBG|USE_REG_SEG|USE_REG_TEST))788 {789 if(parmtype == PARAM_DEST)790 {791 // Caller needs to interpret the register according to the instruction (source/target, special value etc)792 pParamVal->type = PARMTYPE_REGISTER;793 pParamVal->size = pParam->size;794 return VINF_SUCCESS;795 }796 //else PARAM_SOURCE797 798 pParamVal->type = PARMTYPE_IMMEDIATE;799 800 if(pParam->flags & USE_REG_GEN8)801 {802 pParamVal->flags |= PARAM_VAL8;803 pParamVal->size = sizeof(uint8_t);804 if(VBOX_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen8, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER;805 }806 else807 if(pParam->flags & USE_REG_GEN16)808 {809 pParamVal->flags |= PARAM_VAL16;810 pParamVal->size = sizeof(uint16_t);811 if(VBOX_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen16, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER;812 }813 else814 if(pParam->flags & USE_REG_GEN32)815 {816 pParamVal->flags |= PARAM_VAL32;817 pParamVal->size = sizeof(uint32_t);818 if(VBOX_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen32, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER;819 }820 else821 {822 // Caller needs to interpret the register according to the instruction (source/target, special value etc)823 pParamVal->type = PARMTYPE_REGISTER;824 }825 }826 827 if(pParam->flags & USE_IMMEDIATE)828 {829 pParamVal->type = PARMTYPE_IMMEDIATE;830 if(pParam->flags & (USE_IMMEDIATE8|USE_IMMEDIATE8_REL))831 {832 pParamVal->flags |= PARAM_VAL8;833 if(pParam->size == 2)834 {835 pParamVal->size = sizeof(uint16_t);836 pParamVal->val.val16 = (uint8_t)pParam->parval;837 }838 else839 {840 pParamVal->size = sizeof(uint8_t);841 pParamVal->val.val8 = (uint8_t)pParam->parval;842 }843 }844 else845 if(pParam->flags & (USE_IMMEDIATE16|USE_IMMEDIATE16_REL|USE_IMMEDIATE_ADDR_0_16|USE_IMMEDIATE16_SX8))846 {847 pParamVal->flags |= PARAM_VAL16;848 pParamVal->size = sizeof(uint16_t);849 pParamVal->val.val16 = (uint16_t)pParam->parval;850 Assert(pParamVal->size == pParam->size || ((pParam->size == 1) && (pParam->flags & USE_IMMEDIATE16_SX8)) );851 }852 else853 if(pParam->flags & (USE_IMMEDIATE32|USE_IMMEDIATE32_REL|USE_IMMEDIATE_ADDR_0_32|USE_IMMEDIATE32_SX8))854 {855 pParamVal->flags |= PARAM_VAL32;856 pParamVal->size = sizeof(uint32_t);857 pParamVal->val.val32 = (uint32_t)pParam->parval;858 Assert(pParamVal->size == pParam->size || ((pParam->size == 1) && (pParam->flags & USE_IMMEDIATE32_SX8)) );859 }860 else861 if(pParam->flags & (USE_IMMEDIATE64))862 {863 pParamVal->flags |= PARAM_VAL64;864 pParamVal->size = sizeof(uint64_t);865 pParamVal->val.val64 = pParam->parval;866 Assert(pParamVal->size == pParam->size);867 }868 else869 if(pParam->flags & (USE_IMMEDIATE_ADDR_16_16))870 {871 pParamVal->flags |= PARAM_VALFARPTR16;872 pParamVal->size = sizeof(uint16_t)*2;873 pParamVal->val.farptr.sel = (uint16_t)RT_LOWORD(pParam->parval >> 16);874 pParamVal->val.farptr.offset = (uint32_t)RT_LOWORD(pParam->parval);875 Assert(pParamVal->size == pParam->size);876 }877 else878 if(pParam->flags & (USE_IMMEDIATE_ADDR_16_32))879 {880 pParamVal->flags |= PARAM_VALFARPTR32;881 pParamVal->size = sizeof(uint16_t) + sizeof(uint32_t);882 pParamVal->val.farptr.sel = (uint16_t)RT_LOWORD(pParam->parval >> 32);883 pParamVal->val.farptr.offset = (uint32_t)(pParam->parval & 0xFFFFFFFF);884 Assert(pParam->size == 8);885 }886 }887 return VINF_SUCCESS;888 }889 890 /**891 * Returns the pointer to a register of the parameter in pParam. We need this892 * pointer when an interpreted instruction updates a register as a side effect.893 * In CMPXCHG we know that only [r/e]ax is updated, but with XADD this could894 * be every register.895 *896 * @returns VBox error code897 * @param pCtx CPU context structure pointer898 * @param pCpu Pointer to cpu structure which have DISCPUSTATE::mode899 * set correctly.900 * @param pParam Pointer to the parameter to parse901 * @param pReg Pointer to parameter value (OUT)902 * @param cbsize Parameter size (OUT)903 *904 * @note Currently doesn't handle FPU/XMM/MMX/3DNow! parameters correctly!!905 *906 */907 DISDECL(int) DISQueryParamRegPtr(PCPUMCTXCORE pCtx, PDISCPUSTATE pCpu, POP_PARAMETER pParam, uint32_t **ppReg, size_t *pcbSize)908 {909 if(pParam->flags & (USE_REG_GEN8|USE_REG_GEN16|USE_REG_GEN32|USE_REG_FP|USE_REG_MMX|USE_REG_XMM|USE_REG_CR|USE_REG_DBG|USE_REG_SEG|USE_REG_TEST))910 {911 if(pParam->flags & USE_REG_GEN8)912 {913 uint8_t *pu8Reg;914 if(VBOX_SUCCESS(DISPtrReg8(pCtx, pParam->base.reg_gen8, &pu8Reg)))915 {916 *pcbSize = sizeof(uint8_t);917 *ppReg = (uint32_t*)pu8Reg;918 return VINF_SUCCESS;919 }920 }921 else if(pParam->flags & USE_REG_GEN16)922 {923 uint16_t *pu16Reg;924 if(VBOX_SUCCESS(DISPtrReg16(pCtx, pParam->base.reg_gen16, &pu16Reg)))925 {926 *pcbSize = sizeof(uint16_t);927 *ppReg = (uint32_t*)pu16Reg;928 return VINF_SUCCESS;929 }930 }931 else if(pParam->flags & USE_REG_GEN32)932 {933 uint32_t *pu32Reg;934 if(VBOX_SUCCESS(DISPtrReg32(pCtx, pParam->base.reg_gen32, &pu32Reg)))935 {936 *pcbSize = sizeof(uint32_t);937 *ppReg = pu32Reg;938 return VINF_SUCCESS;939 }940 }941 }942 return VERR_INVALID_PARAMETER;943 }944 //*****************************************************************************945 //*****************************************************************************946 349 unsigned ParseInstruction(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu) 947 350 { -
trunk/src/VBox/Disassembler/Makefile.kmk
r5999 r8142 31 31 endif 32 32 endif 33 DisasmR3_SOURCES = Disasm.cpp DisasmCore.cpp Disasm Tables.cpp33 DisasmR3_SOURCES = Disasm.cpp DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp 34 34 DisasmR3_DEFS = IN_DIS_R3 35 35 36 36 DisasmCoreR3_TEMPLATE = VBOXR3 37 DisasmCoreR3_SOURCES = DisasmCore.cpp Disasm Tables.cpp37 DisasmCoreR3_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp 38 38 DisasmCoreR3_DEFS = IN_DIS_R3 DIS_CORE_ONLY 39 39 40 40 DisasmGC_TEMPLATE = VBOXGC 41 DisasmGC_SOURCES = DisasmCore.cpp Disasm Tables.cpp41 DisasmGC_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp 42 42 DisasmGC_DEFS = IN_DIS_GC IN_RT_GC DIS_CORE_ONLY 43 43 44 44 DisasmR0_TEMPLATE = VBOXR0 45 DisasmR0_SOURCES = DisasmCore.cpp Disasm Tables.cpp45 DisasmR0_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp 46 46 DisasmR0_DEFS = IN_DIS_R0 IN_RT_R0 DIS_CORE_ONLY 47 47
Note:
See TracChangeset
for help on using the changeset viewer.