Changeset 41729 in vbox for trunk/src/VBox/Disassembler
- Timestamp:
- Jun 14, 2012 11:24:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmReg.cpp
r41727 r41729 500 500 * 501 501 */ 502 DISDECL(int) DISQueryParamVal(PCPUMCTXCORE pCtx, PDISCPUSTATE pCpu, PDISOPPARAM pParam, P OP_PARAMVAL pParamVal, PARAM_TYPEparmtype)502 DISDECL(int) DISQueryParamVal(PCPUMCTXCORE pCtx, PDISCPUSTATE pCpu, PDISOPPARAM pParam, PDISQPVPARAMVAL pParamVal, DISQPVWHICH parmtype) 503 503 { 504 504 memset(pParamVal, 0, sizeof(*pParamVal)); … … 507 507 { 508 508 // Effective address 509 pParamVal->type = PARMTYPE_ADDRESS;509 pParamVal->type = DISQPV_TYPE_ADDRESS; 510 510 pParamVal->size = pParam->cb; 511 511 … … 514 514 if (pParam->fUse & DISUSE_REG_GEN8) 515 515 { 516 pParamVal->flags |= PARAM_VAL8;516 pParamVal->flags |= DISQPV_FLAG_8; 517 517 if (RT_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER; 518 518 } … … 520 520 if (pParam->fUse & DISUSE_REG_GEN16) 521 521 { 522 pParamVal->flags |= PARAM_VAL16;522 pParamVal->flags |= DISQPV_FLAG_16; 523 523 if (RT_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER; 524 524 } … … 526 526 if (pParam->fUse & DISUSE_REG_GEN32) 527 527 { 528 pParamVal->flags |= PARAM_VAL32;528 pParamVal->flags |= DISQPV_FLAG_32; 529 529 if (RT_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER; 530 530 } … … 532 532 if (pParam->fUse & DISUSE_REG_GEN64) 533 533 { 534 pParamVal->flags |= PARAM_VAL64;534 pParamVal->flags |= DISQPV_FLAG_64; 535 535 if (RT_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER; 536 536 } … … 548 548 uint16_t val16; 549 549 550 pParamVal->flags |= PARAM_VAL16;550 pParamVal->flags |= DISQPV_FLAG_16; 551 551 if (RT_FAILURE(DISFetchReg16(pCtx, pParam->index.reg_gen, &val16))) return VERR_INVALID_PARAMETER; 552 552 … … 560 560 uint32_t val32; 561 561 562 pParamVal->flags |= PARAM_VAL32;562 pParamVal->flags |= DISQPV_FLAG_32; 563 563 if (RT_FAILURE(DISFetchReg32(pCtx, pParam->index.reg_gen, &val32))) return VERR_INVALID_PARAMETER; 564 564 … … 573 573 uint64_t val64; 574 574 575 pParamVal->flags |= PARAM_VAL64;575 pParamVal->flags |= DISQPV_FLAG_64; 576 576 if (RT_FAILURE(DISFetchReg64(pCtx, pParam->index.reg_gen, &val64))) return VERR_INVALID_PARAMETER; 577 577 … … 632 632 if (pParam->fUse & (DISUSE_REG_GEN8|DISUSE_REG_GEN16|DISUSE_REG_GEN32|DISUSE_REG_GEN64|DISUSE_REG_FP|DISUSE_REG_MMX|DISUSE_REG_XMM|DISUSE_REG_CR|DISUSE_REG_DBG|DISUSE_REG_SEG|DISUSE_REG_TEST)) 633 633 { 634 if (parmtype == PARAM_DEST)634 if (parmtype == DISQPVWHICH_DST) 635 635 { 636 636 // Caller needs to interpret the register according to the instruction (source/target, special value etc) 637 pParamVal->type = PARMTYPE_REGISTER;637 pParamVal->type = DISQPV_TYPE_REGISTER; 638 638 pParamVal->size = pParam->cb; 639 639 return VINF_SUCCESS; 640 640 } 641 //else PARAM_SOURCE642 643 pParamVal->type = PARMTYPE_IMMEDIATE;641 //else DISQPVWHICH_SRC 642 643 pParamVal->type = DISQPV_TYPE_IMMEDIATE; 644 644 645 645 if (pParam->fUse & DISUSE_REG_GEN8) 646 646 { 647 pParamVal->flags |= PARAM_VAL8;647 pParamVal->flags |= DISQPV_FLAG_8; 648 648 pParamVal->size = sizeof(uint8_t); 649 649 if (RT_FAILURE(DISFetchReg8(pCtx, pParam->base.reg_gen, &pParamVal->val.val8))) return VERR_INVALID_PARAMETER; … … 652 652 if (pParam->fUse & DISUSE_REG_GEN16) 653 653 { 654 pParamVal->flags |= PARAM_VAL16;654 pParamVal->flags |= DISQPV_FLAG_16; 655 655 pParamVal->size = sizeof(uint16_t); 656 656 if (RT_FAILURE(DISFetchReg16(pCtx, pParam->base.reg_gen, &pParamVal->val.val16))) return VERR_INVALID_PARAMETER; … … 659 659 if (pParam->fUse & DISUSE_REG_GEN32) 660 660 { 661 pParamVal->flags |= PARAM_VAL32;661 pParamVal->flags |= DISQPV_FLAG_32; 662 662 pParamVal->size = sizeof(uint32_t); 663 663 if (RT_FAILURE(DISFetchReg32(pCtx, pParam->base.reg_gen, &pParamVal->val.val32))) return VERR_INVALID_PARAMETER; … … 666 666 if (pParam->fUse & DISUSE_REG_GEN64) 667 667 { 668 pParamVal->flags |= PARAM_VAL64;668 pParamVal->flags |= DISQPV_FLAG_64; 669 669 pParamVal->size = sizeof(uint64_t); 670 670 if (RT_FAILURE(DISFetchReg64(pCtx, pParam->base.reg_gen, &pParamVal->val.val64))) return VERR_INVALID_PARAMETER; … … 673 673 { 674 674 // Caller needs to interpret the register according to the instruction (source/target, special value etc) 675 pParamVal->type = PARMTYPE_REGISTER;675 pParamVal->type = DISQPV_TYPE_REGISTER; 676 676 } 677 677 Assert(!(pParam->fUse & DISUSE_IMMEDIATE)); … … 681 681 if (pParam->fUse & DISUSE_IMMEDIATE) 682 682 { 683 pParamVal->type = PARMTYPE_IMMEDIATE;683 pParamVal->type = DISQPV_TYPE_IMMEDIATE; 684 684 if (pParam->fUse & (DISUSE_IMMEDIATE8|DISUSE_IMMEDIATE8_REL)) 685 685 { 686 pParamVal->flags |= PARAM_VAL8;686 pParamVal->flags |= DISQPV_FLAG_8; 687 687 if (pParam->cb == 2) 688 688 { … … 699 699 if (pParam->fUse & (DISUSE_IMMEDIATE16|DISUSE_IMMEDIATE16_REL|DISUSE_IMMEDIATE_ADDR_0_16|DISUSE_IMMEDIATE16_SX8)) 700 700 { 701 pParamVal->flags |= PARAM_VAL16;701 pParamVal->flags |= DISQPV_FLAG_16; 702 702 pParamVal->size = sizeof(uint16_t); 703 703 pParamVal->val.val16 = (uint16_t)pParam->parval; … … 707 707 if (pParam->fUse & (DISUSE_IMMEDIATE32|DISUSE_IMMEDIATE32_REL|DISUSE_IMMEDIATE_ADDR_0_32|DISUSE_IMMEDIATE32_SX8)) 708 708 { 709 pParamVal->flags |= PARAM_VAL32;709 pParamVal->flags |= DISQPV_FLAG_32; 710 710 pParamVal->size = sizeof(uint32_t); 711 711 pParamVal->val.val32 = (uint32_t)pParam->parval; … … 715 715 if (pParam->fUse & (DISUSE_IMMEDIATE64 | DISUSE_IMMEDIATE64_REL | DISUSE_IMMEDIATE64_SX8)) 716 716 { 717 pParamVal->flags |= PARAM_VAL64;717 pParamVal->flags |= DISQPV_FLAG_64; 718 718 pParamVal->size = sizeof(uint64_t); 719 719 pParamVal->val.val64 = pParam->parval; … … 723 723 if (pParam->fUse & (DISUSE_IMMEDIATE_ADDR_16_16)) 724 724 { 725 pParamVal->flags |= PARAM_VALFARPTR16;725 pParamVal->flags |= DISQPV_FLAG_FARPTR16; 726 726 pParamVal->size = sizeof(uint16_t)*2; 727 727 pParamVal->val.farptr.sel = (uint16_t)RT_LOWORD(pParam->parval >> 16); … … 732 732 if (pParam->fUse & (DISUSE_IMMEDIATE_ADDR_16_32)) 733 733 { 734 pParamVal->flags |= PARAM_VALFARPTR32;734 pParamVal->flags |= DISQPV_FLAG_FARPTR32; 735 735 pParamVal->size = sizeof(uint16_t) + sizeof(uint32_t); 736 736 pParamVal->val.farptr.sel = (uint16_t)RT_LOWORD(pParam->parval >> 32);
Note:
See TracChangeset
for help on using the changeset viewer.