Changeset 107227 in vbox for trunk/src/VBox/VMM/VMMR3/DBGFR3Flow.cpp
- Timestamp:
- Dec 4, 2024 3:20:14 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFR3Flow.cpp
r106784 r107227 232 232 if ( uOpc == OP_ARMV8_A64_B 233 233 || uOpc == OP_ARMV8_A64_BC) 234 { 235 return pDis->armv8.enmCond == kDisArmv8InstrCond_Al 236 || pDis->armv8.enmCond == kDisArmv8InstrCond_Al1; 237 } 234 return pDis->armv8.enmCond == kDisArmv8InstrCond_Al 235 || pDis->armv8.enmCond == kDisArmv8InstrCond_Al1; 238 236 239 237 return false; 238 239 #elif defined(VBOX_VMM_TARGET_X86) 240 RT_NOREF_PV(pDis); 241 return uOpc == OP_JMP; 242 240 243 #else 241 RT_NOREF(pDis); 242 243 return uOpc == OP_JMP; 244 # error "port me" 244 245 #endif 245 246 } … … 269 270 270 271 return false; 272 273 #elif defined(VBOX_VMM_TARGET_X86) 274 RT_NOREF_PV(fOpType); 275 return uOpc == OP_CALL; 276 271 277 #else 272 RT_NOREF(fOpType); 273 return uOpc == OP_CALL; 278 # error "port me" 274 279 #endif 275 280 } … … 285 290 { 286 291 #ifdef VBOX_VMM_TARGET_ARMV8 287 if (uOpc == OP_ARMV8_A64_RET292 return uOpc == OP_ARMV8_A64_RET 288 293 || uOpc == OP_ARMV8_A64_RETAA 289 294 || uOpc == OP_ARMV8_A64_RETAB 290 295 || uOpc == OP_ARMV8_A64_ERET 291 296 || uOpc == OP_ARMV8_A64_ERETAA 292 || uOpc == OP_ARMV8_A64_ERETAB) 293 return true; 294 295 return false; 296 #else 297 if ( uOpc == OP_RETN 297 || uOpc == OP_ARMV8_A64_ERETAB; 298 299 #elif defined(VBOX_VMM_TARGET_X86) 300 return uOpc == OP_RETN 298 301 || uOpc == OP_RETF 299 302 || uOpc == OP_IRET 300 303 || uOpc == OP_SYSEXIT 301 || uOpc == OP_SYSRET )302 return true; 303 304 return false; 304 || uOpc == OP_SYSRET; 305 306 #else 307 # error "port me" 305 308 #endif 306 309 } … … 316 319 static bool dbgfR3FlowAddrEqual(PDBGFADDRESS pAddr1, PDBGFADDRESS pAddr2) 317 320 { 318 return 319 321 return pAddr1->Sel == pAddr2->Sel 322 && pAddr1->off == pAddr2->off; 320 323 } 321 324 … … 330 333 static bool dbgfR3FlowAddrLower(PDBGFADDRESS pAddr1, PDBGFADDRESS pAddr2) 331 334 { 332 return 333 335 return pAddr1->Sel == pAddr2->Sel 336 && pAddr1->off < pAddr2->off; 334 337 } 335 338 … … 344 347 static bool dbgfR3FlowAddrIntersect(PDBGFFLOWBBINT pFlowBb, PDBGFADDRESS pAddr) 345 348 { 346 return (pFlowBb->AddrStart.Sel == pAddr->Sel)347 && (pFlowBb->AddrStart.off <= pAddr->off)348 && (pFlowBb->AddrEnd.off >= pAddr->off);349 return pFlowBb->AddrStart.Sel == pAddr->Sel 350 && pFlowBb->AddrStart.off <= pAddr->off 351 && pFlowBb->AddrEnd.off >= pAddr->off; 349 352 } 350 353 … … 363 366 if (pAddr1->off >= pAddr2->off) 364 367 return pAddr1->off - pAddr2->off; 365 else 366 return pAddr2->off - pAddr1->off; 367 } 368 else 369 AssertFailed(); 370 368 return pAddr2->off - pAddr1->off; 369 } 370 AssertFailed(); 371 371 return 0; 372 372 } … … 774 774 uint32_t cbInstr, bool fRelJmp, PDBGFADDRESS pAddrJmpTarget) 775 775 { 776 int rc = VINF_SUCCESS;777 778 776 Assert(!dbgfR3FlowBranchTargetIsIndirect(pDisParam)); 779 777 780 /* Relative jumps are always from the beginning of the next instruction. */781 778 *pAddrJmpTarget = *pAddrInstr; 782 #ifdef VBOX_VMM_TARGET_ARMV8 783 /* On ARM relative jumps are always from the beginning of the curent instruction (b #0 will jump to itself for instance). */ 779 #ifdef VBOX_VMM_TARGET_X86 780 /* Relative to the next instruction. */ 781 DBGFR3AddrAdd(pAddrJmpTarget, cbInstr); 782 #elif defined(VBOX_VMM_TARGET_ARMV8) 783 /* Relative to the start of the instruction. */ 784 784 RT_NOREF(cbInstr); 785 785 #else 786 DBGFR3AddrAdd(pAddrJmpTarget, cbInstr); 786 # error "port me" 787 787 #endif 788 788 … … 799 799 iRel = (int64_t)pDisParam->uValue; 800 800 else 801 AssertFailed Stmt(rc =VERR_NOT_SUPPORTED);801 AssertFailedReturn(VERR_NOT_SUPPORTED); 802 802 803 803 if (iRel < 0) … … 816 816 } 817 817 else 818 AssertFailed Stmt(rc =VERR_INVALID_STATE);819 } 820 821 return rc;818 AssertFailedReturn(VERR_INVALID_STATE); 819 } 820 821 return VINF_SUCCESS; 822 822 } 823 823 … … 1386 1386 1387 1387 #ifdef VBOX_VMM_TARGET_ARMV8 1388 PDISOPPARAM pParam = 1389 1390 1391 1392 1388 PDISOPPARAM pParam = uOpc == OP_ARMV8_A64_B || uOpc == OP_ARMV8_A64_BC 1389 ? &DisState.Param1 1390 : uOpc == OP_ARMV8_A64_CBZ || uOpc == OP_ARMV8_A64_CBNZ 1391 ? &DisState.Param2 /* cbz/cbnz. */ 1392 : &DisState.Param3; /* tbz/tbnz. */ 1393 1393 #else 1394 1394 PDISOPPARAM pParam = &DisState.Param1; … … 1466 1466 static int dbgfR3FlowPopulate(PUVM pUVM, VMCPUID idCpu, PDBGFFLOWINT pThis, uint32_t cbDisasmMax, uint32_t fFlags) 1467 1467 { 1468 int rc = VINF_SUCCESS;1469 1468 PDBGFFLOWBBINT pFlowBb = dbgfR3FlowGetUnpopulatedBb(pThis); 1470 1471 1469 while (pFlowBb != NULL) 1472 1470 { 1473 rc = dbgfR3FlowBbProcess(pUVM, idCpu, pThis, pFlowBb, cbDisasmMax, fFlags);1474 if (RT_ FAILURE(rc))1475 break;1476 1477 pFlowBb = dbgfR3FlowGetUnpopulatedBb(pThis);1478 } 1479 1480 return rc;1471 int rc = dbgfR3FlowBbProcess(pUVM, idCpu, pThis, pFlowBb, cbDisasmMax, fFlags); 1472 if (RT_SUCCESS(rc)) 1473 pFlowBb = dbgfR3FlowGetUnpopulatedBb(pThis); 1474 else 1475 return rc; 1476 } 1477 1478 return VINF_SUCCESS; 1481 1479 } 1482 1480 … … 1506 1504 1507 1505 /* Create the control flow graph container. */ 1508 int rc = VINF_SUCCESS;1506 int rc; 1509 1507 PDBGFFLOWINT pThis = (PDBGFFLOWINT)RTMemAllocZ(sizeof(DBGFFLOWINT)); 1510 1508 if (RT_LIKELY(pThis))
Note:
See TracChangeset
for help on using the changeset viewer.