- Timestamp:
- Jan 12, 2024 10:51:18 AM (13 months ago)
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/.scm-settings
r98103 r102855 28 28 /*.h: --guard-relative-to-dir . --guard-prefix DEBUGGER_INCLUDED_SRC_ 29 29 30 # Forbid PAGE_SIZE, PAGE_SIZE and PAGE_OFFSET_MASK w/o GUEST_ or HOST_ prefix. 31 /*.cpp: --only-guest-host-page 32 /*.h: --only-guest-host-page 33 34 # Forbid ASMMemIsZeroPage and ASMMemZeroPage. 35 /*.cpp: --no-ASMMemPage-use 36 /*.h: --no-ASMMemPage-use -
trunk/src/VBox/Debugger/DBGCCmdHlp.cpp
r100120 r102855 414 414 * Calc read size. 415 415 */ 416 size_t cb = RT_MIN( PAGE_SIZE, cbLeft);416 size_t cb = RT_MIN(GUEST_PAGE_SIZE, cbLeft); 417 417 switch (pVarPointer->enmType) 418 418 { 419 case DBGCVAR_TYPE_GC_FLAT: cb = RT_MIN(cb, PAGE_SIZE - (Var.u.GCFlat &PAGE_OFFSET_MASK)); break;420 case DBGCVAR_TYPE_GC_PHYS: cb = RT_MIN(cb, PAGE_SIZE - (Var.u.GCPhys &PAGE_OFFSET_MASK)); break;421 case DBGCVAR_TYPE_HC_FLAT: cb = RT_MIN(cb, PAGE_SIZE - ((uintptr_t)Var.u.pvHCFlat &PAGE_OFFSET_MASK)); break;422 case DBGCVAR_TYPE_HC_PHYS: cb = RT_MIN(cb, PAGE_SIZE - ((size_t)Var.u.HCPhys &PAGE_OFFSET_MASK)); break; /* size_t: MSC has braindead loss of data warnings! */419 case DBGCVAR_TYPE_GC_FLAT: cb = RT_MIN(cb, GUEST_PAGE_SIZE - (Var.u.GCFlat & GUEST_PAGE_OFFSET_MASK)); break; 420 case DBGCVAR_TYPE_GC_PHYS: cb = RT_MIN(cb, GUEST_PAGE_SIZE - (Var.u.GCPhys & GUEST_PAGE_OFFSET_MASK)); break; 421 case DBGCVAR_TYPE_HC_FLAT: cb = RT_MIN(cb, GUEST_PAGE_SIZE - ((uintptr_t)Var.u.pvHCFlat & GUEST_PAGE_OFFSET_MASK)); break; 422 case DBGCVAR_TYPE_HC_PHYS: cb = RT_MIN(cb, GUEST_PAGE_SIZE - ((size_t)Var.u.HCPhys & GUEST_PAGE_OFFSET_MASK)); break; /* size_t: MSC has braindead loss of data warnings! */ 423 423 default: break; 424 424 } … … 604 604 605 605 /* calc size. */ 606 size_t cbChunk = PAGE_SIZE;607 cbChunk -= (uintptr_t)Var.u.pvHCFlat & PAGE_OFFSET_MASK;606 size_t cbChunk = GUEST_PAGE_SIZE; 607 cbChunk -= (uintptr_t)Var.u.pvHCFlat & GUEST_PAGE_OFFSET_MASK; 608 608 if (cbChunk > cbWrite) 609 609 cbChunk = cbWrite; -
trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
r102093 r102855 3212 3212 uint32_t cbLimit = pDesc->Gen.u16LimitLow | (pDesc->Gen.u4LimitHigh << 16); 3213 3213 if (pDesc->Gen.u1Granularity) 3214 cbLimit <<= PAGE_SHIFT;3214 cbLimit <<= GUEST_PAGE_SHIFT; 3215 3215 3216 3216 rc = DBGCCmdHlpPrintf(pCmdHlp, "%04x %s Bas=%08x Lim=%08x DPL=%d %s %s %s %s AVL=%d L=%d%s\n", … … 3266 3266 uint32_t cbLimit = pDesc->Gen.u16LimitLow | (pDesc->Gen.u4LimitHigh << 16); 3267 3267 if (pDesc->Gen.u1Granularity) 3268 cbLimit <<= PAGE_SHIFT;3268 cbLimit <<= GUEST_PAGE_SHIFT; 3269 3269 3270 3270 rc = DBGCCmdHlpPrintf(pCmdHlp, "%04x %s Bas=%08x Lim=%08x DPL=%d %s %s %s %s AVL=%d R=%d%s\n", … … 3976 3976 if (fPAE) 3977 3977 return DBGCCmdHlpPrintf(pCmdHlp, "PDE indexing is only implemented for 32-bit paging.\n"); 3978 if (VarDefault.u.u64Number >= PAGE_SIZE / cbEntry)3979 return DBGCCmdHlpPrintf(pCmdHlp, "PDE index is out of range [0..%d].\n", PAGE_SIZE / cbEntry - 1);3978 if (VarDefault.u.u64Number >= GUEST_PAGE_SIZE / cbEntry) 3979 return DBGCCmdHlpPrintf(pCmdHlp, "PDE index is out of range [0..%d].\n", GUEST_PAGE_SIZE / cbEntry - 1); 3980 3980 VarDefault.u.u64Number <<= X86_PD_SHIFT; 3981 3981 VarDefault.enmType = DBGCVAR_TYPE_GC_FLAT; … … 4006 4006 default: cEntries = 10; break; 4007 4007 } 4008 cEntriesMax = PAGE_SIZE / cbEntry;4008 cEntriesMax = GUEST_PAGE_SIZE / cbEntry; 4009 4009 } 4010 4010 else … … 4015 4015 switch (paArgs[0].enmRangeType) 4016 4016 { 4017 case DBGCVAR_RANGE_BYTES: cEntries = paArgs[0].u64Range / PAGE_SIZE; break;4017 case DBGCVAR_RANGE_BYTES: cEntries = paArgs[0].u64Range / GUEST_PAGE_SIZE; break; 4018 4018 case DBGCVAR_RANGE_ELEMENTS: cEntries = paArgs[0].u64Range; break; 4019 4019 default: cEntries = 10; break; … … 4083 4083 VarPDEAddr.u.u64Number += iEntry * sizeof(X86PDE); 4084 4084 } 4085 cEntriesMax = ( PAGE_SIZE - iEntry) / cbEntry;4085 cEntriesMax = (GUEST_PAGE_SIZE - iEntry) / cbEntry; 4086 4086 } 4087 4087 … … 4220 4220 4221 4221 uint64_t cbRange; 4222 rc = DBGCCmdHlpVarGetRange(pCmdHlp, pRange, PAGE_SIZE,PAGE_SIZE * 8, &cbRange);4222 rc = DBGCCmdHlpVarGetRange(pCmdHlp, pRange, GUEST_PAGE_SIZE, GUEST_PAGE_SIZE * 8, &cbRange); 4223 4223 if (RT_FAILURE(rc)) 4224 4224 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to obtain the range of %DV: %Rrc", pRange, rc); … … 4353 4353 default: cEntries = 10; break; 4354 4354 } 4355 cEntriesMax = PAGE_SIZE / cbEntry;4355 cEntriesMax = GUEST_PAGE_SIZE / cbEntry; 4356 4356 } 4357 4357 else … … 4362 4362 switch (paArgs[0].enmRangeType) 4363 4363 { 4364 case DBGCVAR_RANGE_BYTES: cEntries = paArgs[0].u64Range / PAGE_SIZE; break;4364 case DBGCVAR_RANGE_BYTES: cEntries = paArgs[0].u64Range / GUEST_PAGE_SIZE; break; 4365 4365 case DBGCVAR_RANGE_ELEMENTS: cEntries = paArgs[0].u64Range; break; 4366 4366 default: cEntries = 10; break; … … 4378 4378 VarGCPtr.enmType = DBGCVAR_TYPE_GC_FLAT; 4379 4379 } 4380 VarGCPtr.u.GCFlat &= ~(RTGCPTR) PAGE_OFFSET_MASK;4380 VarGCPtr.u.GCFlat &= ~(RTGCPTR)GUEST_PAGE_OFFSET_MASK; 4381 4381 4382 4382 /* … … 4451 4451 VarPTEAddr.u.u64Number += iEntry * sizeof(X86PTE); 4452 4452 } 4453 cEntriesMax = ( PAGE_SIZE - iEntry) / cbEntry;4453 cEntriesMax = (GUEST_PAGE_SIZE - iEntry) / cbEntry; 4454 4454 } 4455 4455 … … 4511 4511 VarPTEAddr.u.u64Number += cbEntry; 4512 4512 if (iEntry != ~0U) 4513 VarGCPtr.u.GCFlat += PAGE_SIZE;4513 VarGCPtr.u.GCFlat += GUEST_PAGE_SIZE; 4514 4514 } while (cEntries-- > 0); 4515 4515 -
trunk/src/VBox/Debugger/DBGPlugInDarwin.cpp
r98103 r102855 458 458 * Check that all the pages are present. 459 459 */ 460 cbSeg += uSegAddr & X86_PAGE_OFFSET_MASK;461 uSegAddr &= ~(uint64_t) X86_PAGE_OFFSET_MASK;460 cbSeg += uSegAddr & GUEST_PAGE_OFFSET_MASK; 461 uSegAddr &= ~(uint64_t)GUEST_PAGE_OFFSET_MASK; 462 462 for (;;) 463 463 { … … 473 473 474 474 /* Advance */ 475 if (cbSeg <= X86_PAGE_SIZE)475 if (cbSeg <= GUEST_PAGE_SIZE) 476 476 return true; 477 cbSeg -= X86_PAGE_SIZE;478 uSegAddr += X86_PAGE_SIZE;477 cbSeg -= GUEST_PAGE_SIZE; 478 uSegAddr += GUEST_PAGE_SIZE; 479 479 } 480 480 } … … 522 522 union 523 523 { 524 uint8_t ab[2 * X86_PAGE_4K_SIZE];524 uint8_t ab[2 * GUEST_PAGE_SIZE]; 525 525 mach_header_64_t Hdr64; 526 526 mach_header_32_t Hdr32; … … 530 530 DBGFADDRESS ModAddr; 531 531 int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, 532 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr), uBuf.ab, X86_PAGE_4K_SIZE);532 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr), uBuf.ab, GUEST_PAGE_SIZE); 533 533 if (RT_FAILURE(rc)) 534 534 return rc; … … 551 551 return VERR_BAD_EXE_FORMAT; 552 552 AssertCompileMembersSameSizeAndOffset(mach_header_64_t, sizeofcmds, mach_header_32_t, sizeofcmds); 553 if (uBuf.Hdr32.sizeofcmds > X86_PAGE_4K_SIZE * 2 - sizeof(mach_header_64_t))553 if (uBuf.Hdr32.sizeofcmds > GUEST_PAGE_SIZE * 2 - sizeof(mach_header_64_t)) 554 554 return VERR_BAD_EXE_FORMAT; 555 555 556 556 /* Do we need to read a 2nd page to get all the load commands? If so, do it. */ 557 if (uBuf.Hdr32.sizeofcmds + (f64Bit ? sizeof(mach_header_64_t) : sizeof(mach_header_32_t)) > X86_PAGE_4K_SIZE)558 { 559 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr + X86_PAGE_4K_SIZE),560 &uBuf.ab[ X86_PAGE_4K_SIZE], X86_PAGE_4K_SIZE);557 if (uBuf.Hdr32.sizeofcmds + (f64Bit ? sizeof(mach_header_64_t) : sizeof(mach_header_32_t)) > GUEST_PAGE_SIZE) 558 { 559 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &ModAddr, uModAddr + GUEST_PAGE_SIZE), 560 &uBuf.ab[GUEST_PAGE_SIZE], GUEST_PAGE_SIZE); 561 561 if (RT_FAILURE(rc)) 562 562 return rc; … … 1011 1011 for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, s_aRanges[iRange].uStart); 1012 1012 KernelAddr.FlatPtr < s_aRanges[iRange].uEnd; 1013 KernelAddr.FlatPtr += X86_PAGE_4K_SIZE)1013 KernelAddr.FlatPtr += GUEST_PAGE_SIZE) 1014 1014 { 1015 1015 static const uint8_t s_abNeedle[16 + 16] = … … 1023 1023 if (RT_FAILURE(rc)) 1024 1024 break; 1025 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & X86_PAGE_4K_OFFSET_MASK);1025 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & GUEST_PAGE_OFFSET_MASK); 1026 1026 1027 1027 /* … … 1030 1030 union 1031 1031 { 1032 uint8_t ab[ X86_PAGE_4K_SIZE];1032 uint8_t ab[GUEST_PAGE_SIZE]; 1033 1033 mach_header_64_t Hdr64; 1034 1034 mach_header_32_t Hdr32; 1035 1035 } uBuf; 1036 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, uBuf.ab, X86_PAGE_4K_SIZE);1036 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, uBuf.ab, GUEST_PAGE_SIZE); 1037 1037 if (RT_FAILURE(rc)) 1038 1038 continue; … … 1052 1052 continue; 1053 1053 AssertCompileMembersSameSizeAndOffset(mach_header_64_t, sizeofcmds, mach_header_32_t, sizeofcmds); 1054 if (uBuf.Hdr32.sizeofcmds > X86_PAGE_4K_SIZE * 2 - sizeof(mach_header_64_t))1054 if (uBuf.Hdr32.sizeofcmds > GUEST_PAGE_SIZE * 2 - sizeof(mach_header_64_t)) 1055 1055 continue; 1056 1056 -
trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp
r99739 r102855 1293 1293 union 1294 1294 { 1295 uint8_t au8[ 0x2000];1296 RTUTF16 wsz[ 0x2000/2];1295 uint8_t au8[GUEST_PAGE_SIZE * 2]; 1296 RTUTF16 wsz[GUEST_PAGE_SIZE]; 1297 1297 NTKUSERSHAREDDATA UserSharedData; 1298 1298 } u; … … 1304 1304 */ 1305 1305 pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64); 1306 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);1306 rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, GUEST_PAGE_SIZE); 1307 1307 if (RT_SUCCESS(rc)) 1308 1308 { … … 1515 1515 for (pVMM->pfnDBGFR3AddrFromFlat(pUVM, &KernelAddr, uKrnlStart); 1516 1516 KernelAddr.FlatPtr < uKrnlEnd; 1517 KernelAddr.FlatPtr += PAGE_SIZE)1517 KernelAddr.FlatPtr += GUEST_PAGE_SIZE) 1518 1518 { 1519 1519 bool fNt31 = false; … … 1532 1532 if (RT_FAILURE(rc)) 1533 1533 break; 1534 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & PAGE_OFFSET_MASK);1534 pVMM->pfnDBGFR3AddrSub(&KernelAddr, KernelAddr.FlatPtr & GUEST_PAGE_OFFSET_MASK); 1535 1535 1536 1536 /* MZ + PE header. */
Note:
See TracChangeset
for help on using the changeset viewer.