Changeset 73460 in vbox for trunk/include/VBox
- Timestamp:
- Aug 2, 2018 9:06:59 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/dbgf.h
r73444 r73460 1209 1209 #ifdef IN_RING3 /* The stack API only works in ring-3. */ 1210 1210 1211 /**1212 * Return type.1213 */1214 typedef enum DBGFRETRUNTYPE1215 {1216 /** The usual invalid 0 value. */1217 DBGFRETURNTYPE_INVALID = 0,1218 /** Near 16-bit return. */1219 DBGFRETURNTYPE_NEAR16,1220 /** Near 32-bit return. */1221 DBGFRETURNTYPE_NEAR32,1222 /** Near 64-bit return. */1223 DBGFRETURNTYPE_NEAR64,1224 /** Far 16:16 return. */1225 DBGFRETURNTYPE_FAR16,1226 /** Far 16:32 return. */1227 DBGFRETURNTYPE_FAR32,1228 /** Far 16:64 return. */1229 DBGFRETURNTYPE_FAR64,1230 /** 16-bit iret return (e.g. real or 286 protect mode). */1231 DBGFRETURNTYPE_IRET16,1232 /** 32-bit iret return. */1233 DBGFRETURNTYPE_IRET32,1234 /** 32-bit iret return. */1235 DBGFRETURNTYPE_IRET32_PRIV,1236 /** 32-bit iret return to V86 mode. */1237 DBGFRETURNTYPE_IRET32_V86,1238 /** @todo 64-bit iret return. */1239 DBGFRETURNTYPE_IRET64,1240 /** The end of the valid return types. */1241 DBGFRETURNTYPE_END,1242 /** The usual 32-bit blowup. */1243 DBGFRETURNTYPE_32BIT_HACK = 0x7fffffff1244 } DBGFRETURNTYPE;1245 1246 /**1247 * Figures the size of the return state on the stack.1248 *1249 * @returns number of bytes. 0 if invalid parameter.1250 * @param enmRetType The type of return.1251 */1252 DECLINLINE(unsigned) DBGFReturnTypeSize(DBGFRETURNTYPE enmRetType)1253 {1254 switch (enmRetType)1255 {1256 case DBGFRETURNTYPE_NEAR16: return 2;1257 case DBGFRETURNTYPE_NEAR32: return 4;1258 case DBGFRETURNTYPE_NEAR64: return 8;1259 case DBGFRETURNTYPE_FAR16: return 4;1260 case DBGFRETURNTYPE_FAR32: return 4;1261 case DBGFRETURNTYPE_FAR64: return 8;1262 case DBGFRETURNTYPE_IRET16: return 6;1263 case DBGFRETURNTYPE_IRET32: return 4*3;1264 case DBGFRETURNTYPE_IRET32_PRIV: return 4*5;1265 case DBGFRETURNTYPE_IRET32_V86: return 4*9;1266 case DBGFRETURNTYPE_IRET64:1267 default:1268 return 0;1269 }1270 }1271 1272 /**1273 * Check if near return.1274 *1275 * @returns true if near, false if far or iret.1276 * @param enmRetType The type of return.1277 */1278 DECLINLINE(bool) DBGFReturnTypeIsNear(DBGFRETURNTYPE enmRetType)1279 {1280 return enmRetType == DBGFRETURNTYPE_NEAR321281 || enmRetType == DBGFRETURNTYPE_NEAR641282 || enmRetType == DBGFRETURNTYPE_NEAR16;1283 }1284 1285 1286 1211 /** Pointer to stack frame info. */ 1287 1212 typedef struct DBGFSTACKFRAME *PDBGFSTACKFRAME; … … 1295 1220 /** Frame number. */ 1296 1221 uint32_t iFrame; 1297 /** Frame flags . */1222 /** Frame flags (DBGFSTACKFRAME_FLAGS_XXX). */ 1298 1223 uint32_t fFlags; 1299 1224 /** The stack address of the frame. … … 1311 1236 DBGFADDRESS AddrFrame; 1312 1237 /** The way this frame returns to the next one. */ 1313 DBGFRETURNTYPEenmReturnType;1238 RTDBGRETURNTYPE enmReturnType; 1314 1239 1315 1240 /** The way the next frame returns. 1316 1241 * Only valid when DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET is set. */ 1317 DBGFRETURNTYPEenmReturnFrameReturnType;1242 RTDBGRETURNTYPE enmReturnFrameReturnType; 1318 1243 /** The return frame address. 1319 1244 * The off member is [e|r]bp and the Sel member is ss. */ … … 1358 1283 } DBGFSTACKFRAME; 1359 1284 1360 /** @name DBGFSTACKFRAME Flags.1285 /** @name DBGFSTACKFRAME_FLAGS_XXX - DBGFSTACKFRAME Flags. 1361 1286 * @{ */ 1362 1287 /** This is the last stack frame we can read. … … 1375 1300 /** Real mode or V86 frame. */ 1376 1301 # define DBGFSTACKFRAME_FLAGS_REAL_V86 RT_BIT(7) 1302 /** Is a trap frame (NT term). */ 1303 # define DBGFSTACKFRAME_FLAGS_TRAP_FRAME RT_BIT(8) 1304 1377 1305 /** Used Odd/even heuristics for far/near return. */ 1378 # define DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN RT_BIT( 8)1306 # define DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN RT_BIT(29) 1379 1307 /** Set if we used unwind info to construct the frame. (Kind of internal.) */ 1380 1308 # define DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO RT_BIT(30) … … 1404 1332 VMMR3DECL(int) DBGFR3StackWalkBeginEx(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame, 1405 1333 PCDBGFADDRESS pAddrStack,PCDBGFADDRESS pAddrPC, 1406 DBGFRETURNTYPE enmReturnType, PCDBGFSTACKFRAME *ppFirstFrame);1334 RTDBGRETURNTYPE enmReturnType, PCDBGFSTACKFRAME *ppFirstFrame); 1407 1335 VMMR3DECL(PCDBGFSTACKFRAME) DBGFR3StackWalkNext(PCDBGFSTACKFRAME pCurrent); 1408 1336 VMMR3DECL(void) DBGFR3StackWalkEnd(PCDBGFSTACKFRAME pFirstFrame); … … 2124 2052 2125 2053 2054 #ifdef IN_RING3 2055 2126 2056 /** 2127 2057 * Guest OS digger interface identifier. … … 2256 2186 */ 2257 2187 DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf); 2188 2189 /** 2190 * Stack unwind assist callback. 2191 * 2192 * This is only called after pfnInit(). 2193 * 2194 * @returns VBox status code (allocation error or something of similar fatality). 2195 * @param pUVM The user mode VM handle. 2196 * @param pvData Pointer to the instance data. 2197 * @param idCpu The CPU that's unwinding it's stack. 2198 * @param pFrame The current frame. Okay to modify it a little. 2199 * @param pState The unwind state. Okay to modify it. 2200 * @param pInitialCtx The initial register context. 2201 * @param hAs The address space being used for the unwind. 2202 * @param puScratch Scratch area (initialized to zero, no dtor). 2203 */ 2204 DECLCALLBACKMEMBER(int, pfnStackUnwindAssist)(PUVM pUVM, void *pvData, VMCPUID idCpu, PDBGFSTACKFRAME pFrame, 2205 PRTDBGUNWINDSTATE pState, PCCPUMCTX pInitialCtx, RTDBGAS hAs, 2206 uint64_t *puScratch); 2258 2207 2259 2208 /** Trailing magic (DBGFOSREG_MAGIC). */ … … 2321 2270 2322 2271 2323 #ifdef IN_RING32324 2272 2325 2273 /** @defgroup grp_dbgf_plug_in The DBGF Plug-in Interface
Note:
See TracChangeset
for help on using the changeset viewer.