Changeset 105745 in vbox for trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
- Timestamp:
- Aug 21, 2024 7:16:50 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r105724 r105745 68 68 /** The address space for resolving symbol. */ 69 69 RTDBGAS hDbgAs; 70 #if !defined(VBOX_VMM_TARGET_ARMV8) 70 71 /** Pointer to the first byte in the segment. */ 71 72 RTGCUINTPTR GCPtrSegBase; … … 74 75 /** The size of the segment minus 1. */ 75 76 RTGCUINTPTR cbSegLimit; 77 #endif 76 78 /** The guest paging mode. */ 77 79 PGMMODE enmMode; … … 94 96 * Internal Functions * 95 97 *********************************************************************************************************************************/ 96 #if !defined(VBOX_VMM_TARGET_ARMV8)97 98 static FNDISREADBYTES dbgfR3DisasInstrRead; 98 99 … … 114 115 RTGCPTR GCPtr, uint32_t fFlags, PDBGFDISASSTATE pState) 115 116 { 117 #if !defined(VBOX_VMM_TARGET_ARMV8) 116 118 pState->GCPtrSegBase = pSelInfo->GCPtrBase; 117 119 pState->GCPtrSegEnd = pSelInfo->cbLimit + 1 + (RTGCUINTPTR)pSelInfo->GCPtrBase; 118 120 pState->cbSegLimit = pSelInfo->cbLimit; 121 pState->f64Bits = enmMode >= PGMMODE_AMD64 && pSelInfo->u.Raw.Gen.u1Long; 122 #else 123 RT_NOREF(pSelInfo); 124 125 pState->f64Bits = CPUMGetGuestCodeBits(pVCpu) == 64; 126 #endif 119 127 pState->enmMode = enmMode; 120 128 pState->GCPtrPage = 0; … … 124 132 pState->pVCpu = pVCpu; 125 133 pState->fLocked = false; 126 pState->f64Bits = enmMode >= PGMMODE_AMD64 && pSelInfo->u.Raw.Gen.u1Long;127 134 128 135 DISCPUMODE enmCpuMode; … … 133 140 RT_FALL_THRU(); 134 141 case DBGF_DISAS_FLAGS_DEFAULT_MODE: 135 enmCpuMode = pState->f64Bits 136 ? DISCPUMODE_64BIT 137 : pSelInfo->u.Raw.Gen.u1DefBig 138 ? DISCPUMODE_32BIT 139 : DISCPUMODE_16BIT; 142 enmCpuMode = CPUMGetGuestDisMode(pVCpu); 140 143 break; 144 #if !defined(VBOX_VMM_TARGET_ARMV8) 141 145 case DBGF_DISAS_FLAGS_16BIT_MODE: 142 146 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: … … 149 153 enmCpuMode = DISCPUMODE_64BIT; 150 154 break; 155 #else 156 case DBGF_DISAS_FLAGS_16BIT_MODE: /** @todo r=aeichner This is a bit abusive... */ 157 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: 158 enmCpuMode = DISCPUMODE_ARMV8_T32; 159 break; 160 case DBGF_DISAS_FLAGS_32BIT_MODE: 161 enmCpuMode = DISCPUMODE_ARMV8_A32; 162 break; 163 case DBGF_DISAS_FLAGS_64BIT_MODE: 164 enmCpuMode = DISCPUMODE_ARMV8_A64; 165 break; 166 #endif 151 167 } 152 168 … … 221 237 for (;;) 222 238 { 239 #if !defined(VBOX_VMM_TARGET_ARMV8) 223 240 RTGCUINTPTR GCPtr = pDis->uInstrAddr + offInstr + pState->GCPtrSegBase; 241 #else 242 RTGCUINTPTR GCPtr = pDis->uInstrAddr + offInstr; 243 #endif 224 244 225 245 /* … … 235 255 if (pState->fLocked) 236 256 PGMPhysReleasePageMappingLock(pState->pVM, &pState->PageMapLock); 237 if (pState->enmMode <= PGMMODE_PROTECTED) 257 if (PGMMODE_WITH_PAGING(pState->enmMode)) 258 rc = PGMPhysGCPtr2CCPtrReadOnly(pState->pVCpu, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock); 259 else 238 260 rc = PGMPhysGCPhys2CCPtrReadOnly(pState->pVM, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock); 239 else240 rc = PGMPhysGCPtr2CCPtrReadOnly(pState->pVCpu, pState->GCPtrPage, &pState->pvPageR3, &pState->PageMapLock);241 261 if (RT_SUCCESS(rc)) 242 262 pState->fLocked = true; … … 249 269 } 250 270 271 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK); 272 #if !defined(VBOX_VMM_TARGET_ARMV8) 251 273 /* 252 274 * Check the segment limit. … … 258 280 * Calc how much we can read, maxing out the read. 259 281 */ 260 uint32_t cb = GUEST_PAGE_SIZE - (GCPtr & GUEST_PAGE_OFFSET_MASK);261 282 if (!pState->f64Bits) 262 283 { … … 265 286 cb = cbSeg; 266 287 } 288 #endif 267 289 if (cb > cbMaxRead) 268 290 cb = cbMaxRead; … … 298 320 DBGFADDRESS Addr; 299 321 int rc; 322 #if !defined(VBOX_VMM_TARGET_ARMV8) 300 323 /* Start with CS. */ 301 324 if ( DIS_FMT_SEL_IS_REG(u32Sel) … … 326 349 rc = VERR_SYMBOL_NOT_FOUND; 327 350 } 351 #else 352 RT_NOREF(pSelInfo, u32Sel); 353 354 DBGFR3AddrFromFlat(pState->pVM->pUVM, &Addr, uAddress); 355 rc = VINF_SUCCESS; 356 #endif 328 357 329 358 /* … … 353 382 return rc; 354 383 } 355 #endif /* VBOX_VMM_TARGET_ARMV8 */356 384 357 385 … … 383 411 384 412 #if defined(VBOX_VMM_TARGET_ARMV8) 385 RT_NOREF(pVM, pVCpu, Sel, GCPtr, rc, fFlags, pszOutput, cbOutput, pcbInstr, pDisState); 386 //AssertFailed(); /** @todo */ 387 return VERR_NOT_IMPLEMENTED; 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); 388 418 #else 389 419 /* … … 428 458 SelInfo.GCPtrBase = pSRegCS->u64Base; 429 459 SelInfo.cbLimit = pSRegCS->u32Limit; 430 SelInfo.fFlags = PGMMODE_IS_ LONG_MODE(enmMode)460 SelInfo.fFlags = PGMMODE_IS_64BIT_MODE(enmMode) 431 461 ? DBGFSELINFO_FLAGS_LONG_MODE 432 462 : enmMode != PGMMODE_REAL && !pCtx->eflags.Bits.u1VM … … 452 482 SelInfo.GCPtrBase = 0; 453 483 SelInfo.cbLimit = ~(RTGCUINTPTR)0; 454 SelInfo.fFlags = PGMMODE_IS_ LONG_MODE(enmMode)484 SelInfo.fFlags = PGMMODE_IS_64BIT_MODE(enmMode) 455 485 ? DBGFSELINFO_FLAGS_LONG_MODE 456 486 : enmMode != PGMMODE_REAL … … 512 542 } 513 543 } 544 #endif 514 545 515 546 /* … … 531 562 */ 532 563 char szBuf[512]; 564 #if defined(VBOX_VMM_TARGET_ARMV8) 565 DISFormatArmV8Ex(&State.Dis, szBuf, sizeof(szBuf), 566 DIS_FMT_FLAGS_RELATIVE_BRANCH, 567 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 568 NULL); 569 #else 533 570 DISFormatYasmEx(&State.Dis, szBuf, sizeof(szBuf), 534 571 DIS_FMT_FLAGS_RELATIVE_BRANCH, 535 572 fFlags & DBGF_DISAS_FLAGS_NO_SYMBOLS ? NULL : dbgfR3DisasGetSymbol, 536 573 &SelInfo); 574 #endif 537 575 538 576 /* … … 548 586 else if (Sel == DBGF_SEL_FLAT) 549 587 { 550 if ( enmMode >= PGMMODE_AMD64)588 if (PGMMODE_IS_64BIT_MODE(enmMode)) 551 589 cch = RTStrPrintf(pszOutput, cbOutput, "%RGv %s", GCPtr, szBuf); 552 590 else … … 555 593 else 556 594 { 557 if ( enmMode >= PGMMODE_AMD64)595 if (PGMMODE_IS_64BIT_MODE(enmMode)) 558 596 cch = RTStrPrintf(pszOutput, cbOutput, "%04x:%RGv %s", Sel, GCPtr, szBuf); 559 597 else … … 576 614 else if (Sel == DBGF_SEL_FLAT) 577 615 { 578 if ( enmMode >= PGMMODE_AMD64)616 if (PGMMODE_IS_64BIT_MODE(enmMode)) 579 617 cch = RTStrPrintf(pszOutput, cbOutput, "%RGv %.*Rhxs%*s %s", 580 618 GCPtr, … … 589 627 else 590 628 { 591 if ( enmMode >= PGMMODE_AMD64)629 if (PGMMODE_IS_64BIT_MODE(enmMode)) 592 630 cch = RTStrPrintf(pszOutput, cbOutput, "%04x:%RGv %.*Rhxs%*s %s", 593 631 Sel, GCPtr, … … 617 655 dbgfR3DisasInstrDone(&State); 618 656 return VINF_SUCCESS; 619 #endif /* !VBOX_VMM_TARGET_ARMV8*/620 657 } 621 658
Note:
See TracChangeset
for help on using the changeset viewer.