- Timestamp:
- Aug 24, 2010 2:12:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCOps.cpp
r31926 r31928 94 94 /* Get the 64-bit right side value. */ \ 95 95 uint64_t u64Right; \ 96 int rc = dbgcOpHelperGetNumber( pDbgc, pArg2, &u64Right); \97 if ( fIsDiv&& RT_SUCCESS(rc) && !u64Right) /* div/0 kludge */ \98 DBGCVAR_INIT_NUMBER( pResult, UINT64_MAX); \96 int rc = dbgcOpHelperGetNumber((pDbgc), (pArg2), &u64Right); \ 97 if ((fIsDiv) && RT_SUCCESS(rc) && !u64Right) /* div/0 kludge */ \ 98 DBGCVAR_INIT_NUMBER((pResult), UINT64_MAX); \ 99 99 else if (RT_SUCCESS(rc)) \ 100 100 { \ 101 101 /* Apply it to the left hand side. */ \ 102 if ( pArg1->enmType == DBGCVAR_TYPE_SYMBOL \103 || pArg1->enmType == DBGCVAR_TYPE_STRING) \102 if ( (pArg1)->enmType == DBGCVAR_TYPE_SYMBOL \ 103 || (pArg1)->enmType == DBGCVAR_TYPE_STRING) \ 104 104 { \ 105 rc = dbgcSymbolGet( pDbgc, pArg1->u.pszString, DBGCVAR_TYPE_ANY, pResult); \105 rc = dbgcSymbolGet((pDbgc), (pArg1)->u.pszString, DBGCVAR_TYPE_ANY, (pResult)); \ 106 106 if (RT_FAILURE(rc)) \ 107 107 return rc; \ 108 108 } \ 109 109 else \ 110 * pResult = *pArg1; \111 switch ( pResult->enmType) \110 *(pResult) = *(pArg1); \ 111 switch ((pResult)->enmType) \ 112 112 { \ 113 113 case DBGCVAR_TYPE_GC_FLAT: \ 114 pResult->u.GCFlat = pResult->u.GCFlat Operator u64Right; \114 (pResult)->u.GCFlat = (pResult)->u.GCFlat Operator u64Right; \ 115 115 break; \ 116 116 case DBGCVAR_TYPE_GC_FAR: \ 117 pResult->u.GCFar.off = pResult->u.GCFar.off Operator u64Right; \117 (pResult)->u.GCFar.off = (pResult)->u.GCFar.off Operator u64Right; \ 118 118 break; \ 119 119 case DBGCVAR_TYPE_GC_PHYS: \ 120 pResult->u.GCPhys = pResult->u.GCPhys Operator u64Right; \120 (pResult)->u.GCPhys = (pResult)->u.GCPhys Operator u64Right; \ 121 121 break; \ 122 122 case DBGCVAR_TYPE_HC_FLAT: \ 123 pResult->u.pvHCFlat = (void *)((uintptr_t)pResult->u.pvHCFlat Operator u64Right); \123 (pResult)->u.pvHCFlat = (void *)((uintptr_t)(pResult)->u.pvHCFlat Operator u64Right); \ 124 124 break; \ 125 125 case DBGCVAR_TYPE_HC_FAR: \ 126 pResult->u.HCFar.off = pResult->u.HCFar.off Operator u64Right; \126 (pResult)->u.HCFar.off = (pResult)->u.HCFar.off Operator u64Right; \ 127 127 break; \ 128 128 case DBGCVAR_TYPE_HC_PHYS: \ 129 pResult->u.HCPhys = pResult->u.HCPhys Operator u64Right; \129 (pResult)->u.HCPhys = (pResult)->u.HCPhys Operator u64Right; \ 130 130 break; \ 131 131 case DBGCVAR_TYPE_NUMBER: \ 132 pResult->u.u64Number = pResult->u.u64Number Operator u64Right; \132 (pResult)->u.u64Number = (pResult)->u.u64Number Operator u64Right; \ 133 133 break; \ 134 134 default: \ … … 137 137 } \ 138 138 return rc; \ 139 } while (0) 140 141 142 /** 143 * Switch the factors/whatver so we preserve pointers. 144 * Far pointers are considered more important that physical and flat pointers. 145 * 146 * @param pArg1 The left side argument. Input & output. 147 * @param pArg2 The right side argument. Input & output. 148 */ 149 #define DBGC_GEN_ARIT_POINTER_TO_THE_LEFT(pArg1, pArg2) \ 150 do \ 151 { \ 152 if ( DBGCVAR_ISPOINTER((pArg2)->enmType) \ 153 && ( !DBGCVAR_ISPOINTER((pArg1)->enmType) \ 154 || ( DBGCVAR_IS_FAR_PTR((pArg2)->enmType) \ 155 && !DBGCVAR_IS_FAR_PTR((pArg1)->enmType)))) \ 156 { \ 157 PCDBGCVAR pTmp = (pArg1); \ 158 (pArg2) = (pArg1); \ 159 (pArg1) = pTmp; \ 160 } \ 139 161 } while (0) 140 162 … … 845 867 { 846 868 LogFlow(("dbgcOpMult\n")); 847 848 /* 849 * Switch the factors so we preserve pointers, far pointers are considered more 850 * important that physical and flat pointers. 851 */ 852 if ( DBGCVAR_ISPOINTER(pArg2->enmType) 853 && ( !DBGCVAR_ISPOINTER(pArg1->enmType) 854 || ( DBGCVAR_IS_FAR_PTR(pArg2->enmType) 855 && !DBGCVAR_IS_FAR_PTR(pArg1->enmType)))) 856 { 857 PCDBGCVAR pTmp = pArg1; 858 pArg2 = pArg1; 859 pArg1 = pTmp; 860 } 861 869 DBGC_GEN_ARIT_POINTER_TO_THE_LEFT(pArg1, pArg2); 862 870 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, *, false); 863 871 } … … 1402 1410 { 1403 1411 LogFlow(("dbgcOpBitwiseAnd\n")); 1412 DBGC_GEN_ARIT_POINTER_TO_THE_LEFT(pArg1, pArg2); 1404 1413 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, &, false); 1405 1414 } … … 1420 1429 { 1421 1430 LogFlow(("dbgcOpBitwiseXor\n")); 1431 DBGC_GEN_ARIT_POINTER_TO_THE_LEFT(pArg1, pArg2); 1422 1432 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, ^, false); 1423 1433 } … … 1438 1448 { 1439 1449 LogFlow(("dbgcOpBitwiseOr\n")); 1450 DBGC_GEN_ARIT_POINTER_TO_THE_LEFT(pArg1, pArg2); 1440 1451 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, |, false); 1441 1452 } … … 1456 1467 { 1457 1468 LogFlow(("dbgcOpBooleanAnd\n")); 1469 /** @todo force numeric return value? */ 1458 1470 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, &&, false); 1459 1471 } … … 1474 1486 { 1475 1487 LogFlow(("dbgcOpBooleanOr\n")); 1488 /** @todo force numeric return value? */ 1476 1489 DBGC_GEN_ARIT_BINARY_OP(pDbgc, pArg1, pArg2, pResult, ||, false); 1477 1490 }
Note:
See TracChangeset
for help on using the changeset viewer.