Changeset 73460 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 2, 2018 9:06:59 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp
r73414 r73460 638 638 } 639 639 640 641 642 /** 643 * Internal wrapper for calling DBGFOSREG::pfnStackUnwindAssist. 644 */ 645 int dbgfR3OSStackUnwindAssist(PUVM pUVM, VMCPUID idCpu, PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, 646 PCCPUMCTX pInitialCtx, RTDBGAS hAs, uint64_t *puScratch) 647 { 648 int rc = VINF_SUCCESS; 649 if (pUVM->dbgf.s.pCurOS) 650 { 651 ASMCompilerBarrier(); 652 DBGF_OS_READ_LOCK(pUVM); 653 PDBGFOS pOS = pUVM->dbgf.s.pCurOS; 654 if (pOS) 655 rc = pOS->pReg->pfnStackUnwindAssist(pUVM, pUVM->dbgf.s.pCurOS->abData, idCpu, pFrame, 656 pState, pInitialCtx, hAs, puScratch); 657 DBGF_OS_READ_UNLOCK(pUVM); 658 } 659 return rc; 660 } 661 -
trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp
r73455 r73460 40 40 * Structures and Typedefs * 41 41 *********************************************************************************************************************************/ 42 /** Magic value for DBGFUNWINDSTATE::u32Magic (James Moody). */ 43 #define DBGFUNWINDSTATE_MAGIC UINT32_C(0x19250326) 44 /** Magic value for DBGFUNWINDSTATE::u32Magic after use. */ 45 #define DBGFUNWINDSTATE_MAGIC_DEAD UINT32_C(0x20101209) 46 47 /** 48 * Register state. 49 */ 50 typedef struct DBGFUNWINDSTATE 51 { 52 /** Structure magic (DBGFUNWINDSTATE_MAGIC) */ 53 uint32_t u32Magic; 54 /** The state architecture. */ 55 RTLDRARCH enmArch; 56 57 /** The program counter register. 58 * amd64/x86: RIP/EIP/IP 59 * sparc: PC 60 * arm32: PC / R15 61 */ 62 uint64_t uPc; 63 64 /** Return type. */ 65 DBGFRETRUNTYPE enmRetType; 66 67 /** Register state (see enmArch). */ 68 union 69 { 70 /** RTLDRARCH_AMD64, RTLDRARCH_X86_32 and RTLDRARCH_X86_16. */ 71 struct 72 { 73 /** General purpose registers indexed by X86_GREG_XXX. */ 74 uint64_t auRegs[16]; 75 /** The frame address. */ 76 RTFAR64 FrameAddr; 77 /** Set if we're in real or virtual 8086 mode. */ 78 bool fRealOrV86; 79 /** The flags register. */ 80 uint64_t uRFlags; 81 /** Trap error code. */ 82 uint64_t uErrCd; 83 /** Segment registers (indexed by X86_SREG_XXX). */ 84 uint16_t auSegs[6]; 85 86 /** Bitmap tracking register we've loaded and which content can possibly be trusted. */ 87 union 88 { 89 /** For effective clearing of the bits. */ 90 uint32_t fAll; 91 /** Detailed view. */ 92 struct 93 { 94 /** Bitmap indicating whether a GPR was loaded (parallel to auRegs). */ 95 uint16_t fRegs; 96 /** Bitmap indicating whether a segment register was loaded (parallel to auSegs). */ 97 uint8_t fSegs; 98 /** Set if uPc was loaded. */ 99 uint8_t fPc : 1; 100 /** Set if FrameAddr was loaded. */ 101 uint8_t fFrameAddr : 1; 102 /** Set if uRFlags was loaded. */ 103 uint8_t fRFlags : 1; 104 /** Set if uErrCd was loaded. */ 105 uint8_t fErrCd : 1; 106 } s; 107 } Loaded; 108 } x86; 109 110 /** @todo add ARM and others as needed. */ 111 } u; 112 113 /** 114 * Stack read callback. 115 * 116 * @returns IPRT status code. 117 * @param pThis Pointer to this structure. 118 * @param uSp The stack pointer address. 119 * @param cbToRead The number of bytes to read. 120 * @param pvDst Where to put the bytes we read. 121 */ 122 DECLCALLBACKMEMBER(int, pfnReadStack)(struct DBGFUNWINDSTATE *pThis, RTUINTPTR uSp, size_t cbToRead, void *pvDst); 123 /** User argument (usefule for pfnReadStack). */ 124 void *pvUser; 125 126 } DBGFUNWINDSTATE; 127 typedef struct DBGFUNWINDSTATE *PDBGFUNWINDSTATE; 128 typedef struct DBGFUNWINDSTATE const *PCDBGFUNWINDSTATE; 129 130 static DECLCALLBACK(int) dbgfR3StackReadCallback(PDBGFUNWINDSTATE pThis, RTUINTPTR uSp, size_t cbToRead, void *pvDst); 131 42 static DECLCALLBACK(int) dbgfR3StackReadCallback(PRTDBGUNWINDSTATE pThis, RTUINTPTR uSp, size_t cbToRead, void *pvDst); 132 43 133 44 /** … … 143 54 VMCPUID m_idCpu; 144 55 RTDBGAS m_hAs; 145 146 DBGFUNWINDSTATE m_State; 56 PCCPUMCTX m_pInitialCtx; 57 uint64_t m_uOsScratch; /**< For passing to DBGFOSREG::pfnStackUnwindAssist. */ 58 59 RTDBGUNWINDSTATE m_State; 147 60 148 61 RTDBGMOD m_hCached; … … 159 72 DBGFUNWINDCTX(PUVM pUVM, VMCPUID idCpu, PCCPUMCTX pInitialCtx, RTDBGAS hAs) 160 73 { 161 m_State.u32Magic = DBGFUNWINDSTATE_MAGIC;74 m_State.u32Magic = RTDBGUNWINDSTATE_MAGIC; 162 75 m_State.enmArch = RTLDRARCH_AMD64; 163 76 m_State.pfnReadStack = dbgfR3StackReadCallback; … … 196 109 m_idCpu = idCpu; 197 110 m_hAs = DBGFR3AsResolveAndRetain(pUVM, hAs); 111 m_pInitialCtx = pInitialCtx; 112 m_uOsScratch = 0; 198 113 199 114 m_hCached = NIL_RTDBGMOD; … … 243 158 244 159 /** 245 * @interface_method_impl{ DBGFUNWINDSTATE,pfnReadStack}246 */ 247 static DECLCALLBACK(int) dbgfR3StackReadCallback(P DBGFUNWINDSTATE pThis, RTUINTPTR uSp, size_t cbToRead, void *pvDst)160 * @interface_method_impl{RTDBGUNWINDSTATE,pfnReadStack} 161 */ 162 static DECLCALLBACK(int) dbgfR3StackReadCallback(PRTDBGUNWINDSTATE pThis, RTUINTPTR uSp, size_t cbToRead, void *pvDst) 248 163 { 249 164 Assert( pThis->enmArch == RTLDRARCH_AMD64 … … 308 223 * @param puDst The read destination. 309 224 */ 310 DECLINLINE(int) dbgUnwindLoadStackU16(P DBGFUNWINDSTATE pThis, uint64_t uSrcAddr, uint16_t *puDst)225 DECLINLINE(int) dbgUnwindLoadStackU16(PRTDBGUNWINDSTATE pThis, uint64_t uSrcAddr, uint16_t *puDst) 311 226 { 312 227 return pThis->pfnReadStack(pThis, uSrcAddr, sizeof(*puDst), puDst); … … 322 237 * @param puDst The read destination. 323 238 */ 324 DECLINLINE(int) dbgUnwindLoadStackU64(P DBGFUNWINDSTATE pThis, uint64_t uSrcAddr, uint64_t *puDst)239 DECLINLINE(int) dbgUnwindLoadStackU64(PRTDBGUNWINDSTATE pThis, uint64_t uSrcAddr, uint64_t *puDst) 325 240 { 326 241 return pThis->pfnReadStack(pThis, uSrcAddr, sizeof(*puDst), puDst); … … 362 277 * @param fErrCd Non-zero if there is an error code on the stack. 363 278 */ 364 static bool dbgUnwindPeAmd64DoOneIRet(P DBGFUNWINDSTATE pThis, uint8_t fErrCd)279 static bool dbgUnwindPeAmd64DoOneIRet(PRTDBGUNWINDSTATE pThis, uint8_t fErrCd) 365 280 { 366 281 Assert(fErrCd <= 1); … … 375 290 } 376 291 377 pThis->enmRetType = DBGFRETURNTYPE_IRET64;292 pThis->enmRetType = RTDBGRETURNTYPE_IRET64; 378 293 pThis->u.x86.FrameAddr.off = pThis->u.x86.auRegs[X86_GREG_xSP] - /* pretend rbp is pushed on the stack */ 8; 379 294 pThis->u.x86.FrameAddr.sel = pThis->u.x86.auSegs[X86_SREG_SS]; … … 419 334 */ 420 335 static bool dbgUnwindPeAmd64DoOne(RTDBGMOD hMod, PCIMAGE_RUNTIME_FUNCTION_ENTRY paFunctions, size_t cFunctions, 421 P DBGFUNWINDSTATE pThis, uint32_t uRvaRip)336 PRTDBGUNWINDSTATE pThis, uint32_t uRvaRip) 422 337 { 423 338 /* … … 681 596 * RSP should now give us the return address, so perform a RET. 682 597 */ 683 pThis->enmRetType = DBGFRETURNTYPE_NEAR64;598 pThis->enmRetType = RTDBGRETURNTYPE_NEAR64; 684 599 685 600 pThis->u.x86.FrameAddr.off = pThis->u.x86.auRegs[X86_GREG_xSP] - /* pretend rbp is pushed on the stack */ 8; … … 794 709 } 795 710 796 static int dbgfR3StackWalkCollectRegisterChanges(PUVM pUVM, PDBGFSTACKFRAME pFrame, PDBGFUNWINDSTATE pState) 711 /** 712 * Collects sure registers on frame exit. 713 * 714 * @returns VINF_SUCCESS or VERR_NO_MEMORY. 715 * @param pUVM The user mode VM handle for the allocation. 716 * @param pFrame The frame in question. 717 * @param pState The unwind state. 718 */ 719 static int dbgfR3StackWalkCollectRegisterChanges(PUVM pUVM, PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState) 797 720 { 798 721 pFrame->cSureRegs = 0; … … 931 854 pFrame->fFlags |= DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO; 932 855 pFrame->fFlags &= ~DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET; 933 if (pFrame->enmReturnFrameReturnType != DBGFRETURNTYPE_INVALID)856 if (pFrame->enmReturnFrameReturnType != RTDBGRETURNTYPE_INVALID) 934 857 { 935 858 pFrame->enmReturnType = pFrame->enmReturnFrameReturnType; 936 pFrame->enmReturnFrameReturnType = DBGFRETURNTYPE_INVALID;859 pFrame->enmReturnFrameReturnType = RTDBGRETURNTYPE_INVALID; 937 860 } 938 861 } 939 } 940 941 /* 942 * Enagage the OS layer and collect register changes. 943 */ 944 if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO) 945 { 946 /** @todo engage the OS buggers to identify trap frames and update unwindctx accordingly. */ 947 if (!fFirst) 948 { 949 int rc = dbgfR3StackWalkCollectRegisterChanges(pUnwindCtx->m_pUVM, pFrame, &pUnwindCtx->m_State); 950 if (RT_FAILURE(rc)) 951 return rc; 952 } 862 pFrame->fFlags &= ~DBGFSTACKFRAME_FLAGS_TRAP_FRAME; 953 863 } 954 864 … … 957 867 */ 958 868 /** @todo this is bogus... */ 959 unsigned cbRetAddr = DBGFReturnTypeSize(pFrame->enmReturnType);869 unsigned cbRetAddr = RTDbgReturnTypeSize(pFrame->enmReturnType); 960 870 unsigned cbStackItem; 961 871 switch (pFrame->AddrPC.fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) … … 968 878 switch (pFrame->enmReturnType) 969 879 { 970 case DBGFRETURNTYPE_FAR16:971 case DBGFRETURNTYPE_IRET16:972 case DBGFRETURNTYPE_IRET32_V86:973 case DBGFRETURNTYPE_NEAR16: cbStackItem = 2; break;974 975 case DBGFRETURNTYPE_FAR32:976 case DBGFRETURNTYPE_IRET32:977 case DBGFRETURNTYPE_IRET32_PRIV:978 case DBGFRETURNTYPE_NEAR32: cbStackItem = 4; break;979 980 case DBGFRETURNTYPE_FAR64:981 case DBGFRETURNTYPE_IRET64:982 case DBGFRETURNTYPE_NEAR64: cbStackItem = 8; break;880 case RTDBGRETURNTYPE_FAR16: 881 case RTDBGRETURNTYPE_IRET16: 882 case RTDBGRETURNTYPE_IRET32_V86: 883 case RTDBGRETURNTYPE_NEAR16: cbStackItem = 2; break; 884 885 case RTDBGRETURNTYPE_FAR32: 886 case RTDBGRETURNTYPE_IRET32: 887 case RTDBGRETURNTYPE_IRET32_PRIV: 888 case RTDBGRETURNTYPE_NEAR32: cbStackItem = 4; break; 889 890 case RTDBGRETURNTYPE_FAR64: 891 case RTDBGRETURNTYPE_IRET64: 892 case RTDBGRETURNTYPE_NEAR64: cbStackItem = 8; break; 983 893 984 894 default: … … 1024 934 if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO) 1025 935 { 1026 if ( pFrame->enmReturnType == DBGFRETURNTYPE_IRET32_PRIV1027 || pFrame->enmReturnType == DBGFRETURNTYPE_IRET64)936 if ( pFrame->enmReturnType == RTDBGRETURNTYPE_IRET32_PRIV 937 || pFrame->enmReturnType == RTDBGRETURNTYPE_IRET64) 1028 938 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnFrame, 1029 939 pUnwindCtx->m_State.u.x86.auSegs[X86_SREG_SS], pUnwindCtx->m_State.u.x86.auRegs[X86_GREG_xBP]); 1030 else if (pFrame->enmReturnType == DBGFRETURNTYPE_IRET32_V86)940 else if (pFrame->enmReturnType == RTDBGRETURNTYPE_IRET32_V86) 1031 941 DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &pFrame->AddrReturnFrame, 1032 942 ((uint32_t)pUnwindCtx->m_State.u.x86.auSegs[X86_SREG_SS] << 4) … … 1055 965 { 1056 966 pFrame->AddrReturnFrame.off &= ~(RTGCUINTPTR)1; 1057 if (pFrame->enmReturnType == DBGFRETURNTYPE_NEAR16)967 if (pFrame->enmReturnType == RTDBGRETURNTYPE_NEAR16) 1058 968 { 1059 969 pFrame->fFlags |= DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN; 1060 pFrame->enmReturnType = DBGFRETURNTYPE_FAR16;970 pFrame->enmReturnType = RTDBGRETURNTYPE_FAR16; 1061 971 cbRetAddr = 4; 1062 972 } 1063 else if (pFrame->enmReturnType == DBGFRETURNTYPE_NEAR32)973 else if (pFrame->enmReturnType == RTDBGRETURNTYPE_NEAR32) 1064 974 { 1065 975 pFrame->fFlags |= DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN; 1066 pFrame->enmReturnType = DBGFRETURNTYPE_FAR32;976 pFrame->enmReturnType = RTDBGRETURNTYPE_FAR32; 1067 977 cbRetAddr = 8; 1068 978 } … … 1070 980 else if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN) 1071 981 { 1072 if (pFrame->enmReturnType == DBGFRETURNTYPE_FAR16)982 if (pFrame->enmReturnType == RTDBGRETURNTYPE_FAR16) 1073 983 { 1074 pFrame->enmReturnType = DBGFRETURNTYPE_NEAR16;984 pFrame->enmReturnType = RTDBGRETURNTYPE_NEAR16; 1075 985 cbRetAddr = 2; 1076 986 } 1077 else if (pFrame->enmReturnType == DBGFRETURNTYPE_NEAR32)987 else if (pFrame->enmReturnType == RTDBGRETURNTYPE_NEAR32) 1078 988 { 1079 pFrame->enmReturnType = DBGFRETURNTYPE_FAR32;989 pFrame->enmReturnType = RTDBGRETURNTYPE_FAR32; 1080 990 cbRetAddr = 4; 1081 991 } … … 1094 1004 if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO) 1095 1005 { 1096 if ( pFrame->enmReturnType == DBGFRETURNTYPE_IRET32_PRIV1097 || pFrame->enmReturnType == DBGFRETURNTYPE_IRET64)1006 if ( pFrame->enmReturnType == RTDBGRETURNTYPE_IRET32_PRIV 1007 || pFrame->enmReturnType == RTDBGRETURNTYPE_IRET64) 1098 1008 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnStack, 1099 1009 pUnwindCtx->m_State.u.x86.auSegs[X86_SREG_SS], pUnwindCtx->m_State.u.x86.auRegs[X86_GREG_xSP]); 1100 else if (pFrame->enmReturnType == DBGFRETURNTYPE_IRET32_V86)1010 else if (pFrame->enmReturnType == RTDBGRETURNTYPE_IRET32_V86) 1101 1011 DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &pFrame->AddrReturnStack, 1102 1012 ((uint32_t)pUnwindCtx->m_State.u.x86.auSegs[X86_SREG_SS] << 4) … … 1120 1030 if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO) 1121 1031 { 1122 if ( DBGFReturnTypeIsNear(pFrame->enmReturnType))1032 if (RTDbgReturnTypeIsNear(pFrame->enmReturnType)) 1123 1033 { 1124 1034 pFrame->AddrReturnPC.off = pUnwindCtx->m_State.uPc; … … 1132 1042 switch (pFrame->enmReturnType) 1133 1043 { 1134 case DBGFRETURNTYPE_NEAR16:1044 case RTDBGRETURNTYPE_NEAR16: 1135 1045 if (DBGFADDRESS_IS_VALID(&pFrame->AddrReturnPC)) 1136 1046 { … … 1141 1051 DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &pFrame->AddrReturnPC, *uRet.pu16); 1142 1052 break; 1143 case DBGFRETURNTYPE_NEAR32:1053 case RTDBGRETURNTYPE_NEAR32: 1144 1054 if (DBGFADDRESS_IS_VALID(&pFrame->AddrReturnPC)) 1145 1055 { … … 1150 1060 DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &pFrame->AddrReturnPC, *uRet.pu32); 1151 1061 break; 1152 case DBGFRETURNTYPE_NEAR64:1062 case RTDBGRETURNTYPE_NEAR64: 1153 1063 if (DBGFADDRESS_IS_VALID(&pFrame->AddrReturnPC)) 1154 1064 { … … 1159 1069 DBGFR3AddrFromFlat(pUnwindCtx->m_pUVM, &pFrame->AddrReturnPC, *uRet.pu64); 1160 1070 break; 1161 case DBGFRETURNTYPE_FAR16:1071 case RTDBGRETURNTYPE_FAR16: 1162 1072 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]); 1163 1073 break; 1164 case DBGFRETURNTYPE_FAR32:1074 case RTDBGRETURNTYPE_FAR32: 1165 1075 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 1166 1076 break; 1167 case DBGFRETURNTYPE_FAR64:1077 case RTDBGRETURNTYPE_FAR64: 1168 1078 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]); 1169 1079 break; 1170 case DBGFRETURNTYPE_IRET16:1080 case RTDBGRETURNTYPE_IRET16: 1171 1081 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]); 1172 1082 break; 1173 case DBGFRETURNTYPE_IRET32:1083 case RTDBGRETURNTYPE_IRET32: 1174 1084 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 1175 1085 break; 1176 case DBGFRETURNTYPE_IRET32_PRIV:1086 case RTDBGRETURNTYPE_IRET32_PRIV: 1177 1087 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 1178 1088 break; 1179 case DBGFRETURNTYPE_IRET32_V86:1089 case RTDBGRETURNTYPE_IRET32_V86: 1180 1090 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 1181 1091 break; 1182 case DBGFRETURNTYPE_IRET64:1092 case RTDBGRETURNTYPE_IRET64: 1183 1093 DBGFR3AddrFromSelOff(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]); 1184 1094 break; … … 1214 1124 1215 1125 /* 1126 * Collect register changes. 1127 * Then call the OS layer to assist us (e.g. NT trap frames). 1128 */ 1129 if (pFrame->fFlags & DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO) 1130 { 1131 if (!fFirst) 1132 { 1133 int rc = dbgfR3StackWalkCollectRegisterChanges(pUnwindCtx->m_pUVM, pFrame, &pUnwindCtx->m_State); 1134 if (RT_FAILURE(rc)) 1135 return rc; 1136 } 1137 1138 if ( pUnwindCtx->m_pInitialCtx 1139 && pUnwindCtx->m_hAs != NIL_RTDBGAS) 1140 { 1141 int rc = dbgfR3OSStackUnwindAssist(pUnwindCtx->m_pUVM, pUnwindCtx->m_idCpu, pFrame, &pUnwindCtx->m_State, 1142 pUnwindCtx->m_pInitialCtx, pUnwindCtx->m_hAs, &pUnwindCtx->m_uOsScratch); 1143 if (RT_FAILURE(rc)) 1144 return rc; 1145 } 1146 } 1147 1148 /* 1216 1149 * Try use unwind information to locate the return frame pointer (for the 1217 1150 * next loop iteration). 1218 1151 */ 1219 1152 Assert(!(pFrame->fFlags & DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET)); 1220 pFrame->enmReturnFrameReturnType = DBGFRETURNTYPE_INVALID;1153 pFrame->enmReturnFrameReturnType = RTDBGRETURNTYPE_INVALID; 1221 1154 if (!(pFrame->fFlags & DBGFSTACKFRAME_FLAGS_LAST)) 1222 1155 { … … 1258 1191 PCDBGFADDRESS pAddrStack, 1259 1192 PCDBGFADDRESS pAddrPC, 1260 DBGFRETURNTYPE enmReturnType,1193 RTDBGRETURNTYPE enmReturnType, 1261 1194 PCDBGFSTACKFRAME *ppFirstFrame) 1262 1195 { … … 1301 1234 { 1302 1235 fAddrMask = UINT16_MAX; 1303 if (enmReturnType == DBGFRETURNTYPE_INVALID)1304 pCur->enmReturnType = DBGFRETURNTYPE_NEAR16;1236 if (enmReturnType == RTDBGRETURNTYPE_INVALID) 1237 pCur->enmReturnType = RTDBGRETURNTYPE_NEAR16; 1305 1238 } 1306 1239 else if ( enmCpuMode == CPUMMODE_PROTECTED … … 1308 1241 { 1309 1242 fAddrMask = UINT32_MAX; 1310 if (enmReturnType == DBGFRETURNTYPE_INVALID)1311 pCur->enmReturnType = DBGFRETURNTYPE_NEAR32;1243 if (enmReturnType == RTDBGRETURNTYPE_INVALID) 1244 pCur->enmReturnType = RTDBGRETURNTYPE_NEAR32; 1312 1245 } 1313 1246 else 1314 1247 { 1315 1248 fAddrMask = UINT64_MAX; 1316 if (enmReturnType == DBGFRETURNTYPE_INVALID)1317 pCur->enmReturnType = DBGFRETURNTYPE_NEAR64;1249 if (enmReturnType == RTDBGRETURNTYPE_INVALID) 1250 pCur->enmReturnType = RTDBGRETURNTYPE_NEAR64; 1318 1251 } 1319 1252 } 1320 1253 1321 if (enmReturnType == DBGFRETURNTYPE_INVALID)1254 if (enmReturnType == RTDBGRETURNTYPE_INVALID) 1322 1255 switch (pCur->AddrPC.fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) 1323 1256 { 1324 case DBGFADDRESS_FLAGS_FAR16: pCur->enmReturnType = DBGFRETURNTYPE_NEAR16; break;1325 case DBGFADDRESS_FLAGS_FAR32: pCur->enmReturnType = DBGFRETURNTYPE_NEAR32; break;1326 case DBGFADDRESS_FLAGS_FAR64: pCur->enmReturnType = DBGFRETURNTYPE_NEAR64; break;1257 case DBGFADDRESS_FLAGS_FAR16: pCur->enmReturnType = RTDBGRETURNTYPE_NEAR16; break; 1258 case DBGFADDRESS_FLAGS_FAR32: pCur->enmReturnType = RTDBGRETURNTYPE_NEAR32; break; 1259 case DBGFADDRESS_FLAGS_FAR64: pCur->enmReturnType = RTDBGRETURNTYPE_NEAR64; break; 1327 1260 case DBGFADDRESS_FLAGS_RING0: 1328 pCur->enmReturnType = HC_ARCH_BITS == 64 ? DBGFRETURNTYPE_NEAR64 : DBGFRETURNTYPE_NEAR32;1261 pCur->enmReturnType = HC_ARCH_BITS == 64 ? RTDBGRETURNTYPE_NEAR64 : RTDBGRETURNTYPE_NEAR32; 1329 1262 break; 1330 1263 default: 1331 pCur->enmReturnType = DBGFRETURNTYPE_NEAR32;1264 pCur->enmReturnType = RTDBGRETURNTYPE_NEAR32; 1332 1265 break; 1333 1266 } … … 1438 1371 PCDBGFADDRESS pAddrStack, 1439 1372 PCDBGFADDRESS pAddrPC, 1440 DBGFRETURNTYPE enmReturnType,1373 RTDBGRETURNTYPE enmReturnType, 1441 1374 PCDBGFSTACKFRAME *ppFirstFrame) 1442 1375 { … … 1455 1388 if (pAddrPC) 1456 1389 AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrPC), VERR_INVALID_PARAMETER); 1457 AssertReturn(enmReturnType >= DBGFRETURNTYPE_INVALID && enmReturnType < DBGFRETURNTYPE_END, VERR_INVALID_PARAMETER);1390 AssertReturn(enmReturnType >= RTDBGRETURNTYPE_INVALID && enmReturnType < RTDBGRETURNTYPE_END, VERR_INVALID_PARAMETER); 1458 1391 1459 1392 /* … … 1510 1443 PCDBGFADDRESS pAddrStack, 1511 1444 PCDBGFADDRESS pAddrPC, 1512 DBGFRETURNTYPE enmReturnType,1445 RTDBGRETURNTYPE enmReturnType, 1513 1446 PCDBGFSTACKFRAME *ppFirstFrame) 1514 1447 { … … 1534 1467 VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame) 1535 1468 { 1536 return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);1469 return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, NULL, NULL, NULL, RTDBGRETURNTYPE_INVALID, ppFirstFrame); 1537 1470 } 1538 1471 -
trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
r73360 r73460 473 473 PCDBGFSTACKFRAME pFirstFrame; 474 474 rc2 = DBGFR3StackWalkBeginEx(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc, 475 DBGFRETURNTYPE_INVALID, &pFirstFrame);475 RTDBGRETURNTYPE_INVALID, &pFirstFrame); 476 476 if (RT_SUCCESS(rc2)) 477 477 { -
trunk/src/VBox/VMM/VMMR3/VMMR3.def
r73417 r73460 207 207 MMR3HeapFree 208 208 MMR3HeapRealloc 209 MMR3HeapAllocU 209 210 210 211 MMR3HyperAllocOnceNoRel -
trunk/src/VBox/VMM/include/DBGFInternal.h
r73414 r73460 153 153 154 154 155 #ifdef IN_RING3 155 156 /** 156 157 * Guest OS digger instance. … … 167 168 uint8_t abData[16]; 168 169 } DBGFOS; 170 #endif 169 171 /** Pointer to guest OS digger instance. */ 170 typedef DBGFOS *PDBGFOS;172 typedef struct DBGFOS *PDBGFOS; 171 173 /** Pointer to const guest OS digger instance. */ 172 typedef DBGFOS const *PCDBGFOS;174 typedef struct DBGFOS const *PCDBGFOS; 173 175 174 176 … … 497 499 498 500 501 #ifdef IN_RING3 499 502 int dbgfR3AsInit(PUVM pUVM); 500 503 void dbgfR3AsTerm(PUVM pUVM); … … 506 509 void dbgfR3OSTermPart1(PUVM pUVM); 507 510 void dbgfR3OSTermPart2(PUVM pUVM); 511 int dbgfR3OSStackUnwindAssist(PUVM pUVM, VMCPUID idCpu, PDBGFSTACKFRAME pFrame, PRTDBGUNWINDSTATE pState, 512 PCCPUMCTX pInitialCtx, RTDBGAS hAs, uint64_t *puScratch); 508 513 int dbgfR3RegInit(PUVM pUVM); 509 514 void dbgfR3RegTerm(PUVM pUVM); … … 517 522 int dbgfR3BugCheckInit(PVM pVM); 518 523 519 520 521 #ifdef IN_RING3522 524 /** 523 525 * DBGF disassembler state (substate of DISSTATE). … … 541 543 char *pszOutput, uint32_t cbOutput, PDBGFDISSTATE pDisState); 542 544 545 #endif /* IN_RING3 */ 546 547 /** @} */ 548 543 549 #endif 544 545 /** @} */546 547 #endif
Note:
See TracChangeset
for help on using the changeset viewer.