Changeset 107227 in vbox for trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
- Timestamp:
- Dec 4, 2024 3:20:14 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r106743 r107227 68 68 /** The address space for resolving symbol. */ 69 69 RTDBGAS hDbgAs; 70 #if !defined(VBOX_VMM_TARGET_ARMV8)70 #ifdef VBOX_VMM_TARGET_X86 71 71 /** Pointer to the first byte in the segment. */ 72 72 RTGCUINTPTR GCPtrSegBase; … … 115 115 RTGCPTR GCPtr, uint32_t fFlags, PDBGFDISASSTATE pState) 116 116 { 117 #if !defined(VBOX_VMM_TARGET_ARMV8) 117 #ifndef VBOX_VMM_TARGET_X86 118 RT_NOREF_PV(pSelInfo); 119 pState->f64Bits = CPUMIsGuestIn64BitCode(pVCpu); 120 #else 118 121 pState->GCPtrSegBase = pSelInfo->GCPtrBase; 119 122 pState->GCPtrSegEnd = pSelInfo->cbLimit + 1 + (RTGCUINTPTR)pSelInfo->GCPtrBase; 120 123 pState->cbSegLimit = pSelInfo->cbLimit; 121 124 pState->f64Bits = enmMode >= PGMMODE_AMD64 && pSelInfo->u.Raw.Gen.u1Long; 122 #else123 RT_NOREF(pSelInfo);124 125 pState->f64Bits = CPUMGetGuestCodeBits(pVCpu) == 64;126 125 #endif 127 126 pState->enmMode = enmMode; … … 142 141 enmCpuMode = CPUMGetGuestDisMode(pVCpu); 143 142 break; 144 #if !defined(VBOX_VMM_TARGET_ARMV8)143 #ifdef VBOX_VMM_TARGET_X86 145 144 case DBGF_DISAS_FLAGS_16BIT_MODE: 146 145 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: … … 153 152 enmCpuMode = DISCPUMODE_64BIT; 154 153 break; 155 #el se154 #elif defined(VBOX_VMM_TARGET_ARMV8) 156 155 case DBGF_DISAS_FLAGS_16BIT_MODE: /** @todo r=aeichner This is a bit abusive... */ 157 156 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: … … 164 163 enmCpuMode = DISCPUMODE_ARMV8_A64; 165 164 break; 165 #else 166 # error "port me" 166 167 #endif 167 168 } … … 237 238 for (;;) 238 239 { 239 #if !defined(VBOX_VMM_TARGET_ARMV8)240 #ifdef VBOX_VMM_TARGET_X86 240 241 RTGCUINTPTR GCPtr = pDis->uInstrAddr + offInstr + pState->GCPtrSegBase; 241 242 #else … … 269 270 } 270 271 271 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK); 272 #if !defined(VBOX_VMM_TARGET_ARMV8) 272 #ifdef VBOX_VMM_TARGET_X86 273 273 /* 274 274 * Check the segment limit. … … 276 276 if (!pState->f64Bits && pDis->uInstrAddr + offInstr > pState->cbSegLimit) 277 277 return VERR_OUT_OF_SELECTOR_BOUNDS; 278 #endif 278 279 279 280 /* 280 281 * Calc how much we can read, maxing out the read. 281 282 */ 283 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK); 284 #ifdef VBOX_VMM_TARGET_X86 282 285 if (!pState->f64Bits) 283 286 { … … 313 316 { 314 317 PDBGFDISASSTATE pState = (PDBGFDISASSTATE)pDis; 315 PCDBGFSELINFO pSelInfo = (PCDBGFSELINFO)pvUser;316 318 317 319 /* … … 320 322 DBGFADDRESS Addr; 321 323 int rc; 322 #if !defined(VBOX_VMM_TARGET_ARMV8) 324 #ifdef VBOX_VMM_TARGET_X86 325 PCDBGFSELINFO pSelInfo = (PCDBGFSELINFO)pvUser; 326 323 327 /* Start with CS. */ 324 328 if ( DIS_FMT_SEL_IS_REG(u32Sel) … … 349 353 rc = VERR_SYMBOL_NOT_FOUND; 350 354 } 355 351 356 #else 352 RT_NOREF(pSelInfo, u32Sel); 353 357 RT_NOREF(pvUser, u32Sel); 354 358 DBGFR3AddrFromFlat(pState->pVM->pUVM, &Addr, uAddress); 355 359 rc = VINF_SUCCESS; … … 410 414 int rc; 411 415 412 #if defined(VBOX_VMM_TARGET_ARMV8) 413 DBGFSELINFO SelInfo; RT_ZERO(SelInfo); 414 const PGMMODE enmMode = PGMGetGuestMode(pVCpu); 415 const bool fRealModeAddress = false; 416 if (fFlags & DBGF_DISAS_FLAGS_CURRENT_GUEST) 417 GCPtr = CPUMGetGuestFlatPC(pVCpu); 418 #else 416 #ifdef VBOX_VMM_TARGET_X86 419 417 /* 420 418 * Get the Sel and GCPtr if fFlags requests that. … … 542 540 } 543 541 } 544 #endif 542 543 #else /* !VBOX_VMM_TARGET_X86 */ 544 const PGMMODE enmMode = PGMGetGuestMode(pVCpu); 545 const bool fRealModeAddress = false; 546 if (fFlags & DBGF_DISAS_FLAGS_CURRENT_GUEST) 547 GCPtr = CPUMGetGuestFlatPC(pVCpu); 548 #endif /* !VBOX_VMM_TARGET_X86 */ 545 549 546 550 /* … … 548 552 */ 549 553 DBGFDISASSTATE State; 554 #ifdef VBOX_VMM_TARGET_X86 550 555 rc = dbgfR3DisasInstrFirst(pVM, pVCpu, &SelInfo, enmMode, GCPtr, fFlags, &State); 556 #else 557 rc = dbgfR3DisasInstrFirst(pVM, pVCpu, NULL, enmMode, GCPtr, fFlags, &State); 558 #endif 551 559 if (RT_FAILURE(rc)) 552 560 { … … 562 570 */ 563 571 char szBuf[512]; 564 #if defined(VBOX_VMM_TARGET_ARMV8)572 #ifdef VBOX_VMM_TARGET_ARMV8 565 573 DISFormatArmV8Ex(&State.Dis, szBuf, sizeof(szBuf), 566 574 DIS_FMT_FLAGS_RELATIVE_BRANCH, 567 575 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 568 576 NULL); 569 #el se577 #elif defined(VBOX_VMM_TARGET_X86) 570 578 DISFormatYasmEx(&State.Dis, szBuf, sizeof(szBuf), 571 579 DIS_FMT_FLAGS_RELATIVE_BRANCH, 572 580 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 573 581 &SelInfo); 582 #else 583 # error "port me" 574 584 #endif 575 585 … … 651 661 pDisState->Param3 = State.Dis.aParams[2]; 652 662 pDisState->Param4 = State.Dis.aParams[3]; 653 #if defined(VBOX_VMM_TARGET_ARMV8)663 #ifdef VBOX_VMM_TARGET_ARMV8 654 664 memcpy(&pDisState->armv8, &State.Dis.armv8, sizeof(State.Dis.armv8)); 665 #elif defined(VBOX_VMM_TARGET_X86) 666 memcpy(&pDisState->x86, &State.Dis.x86, sizeof(State.Dis.x86)); 655 667 #else 656 memcpy(&pDisState->x86, &State.Dis.x86, sizeof(State.Dis.x86)); 668 # error "port me" 657 669 #endif 658 670 }
Note:
See TracChangeset
for help on using the changeset viewer.