Changeset 40663 in vbox
- Timestamp:
- Mar 27, 2012 1:14:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dbg.h
r40661 r40663 1148 1148 1149 1149 1150 /** @name Proposed Kernel Structure API 1150 /** @name Kernel Debug Info API 1151 * 1152 * This is a specialized API for obtaining symbols and structure information 1153 * about the running kernel. It is relatively OS specific. Its purpose and 1154 * operation is doesn't map all that well onto RTDbgMod, so a few dedicated 1155 * functions was created for it. 1156 * 1151 1157 * @{ */ 1152 /** Handle to the kernel structures database. */ 1153 typedef struct RTDBGKRNLSTRUCTSINT *RTDBGKRNLSTRUCTS; 1154 /** Pointer to a kernel structures database handle. */ 1155 typedef RTDBGKRNLSTRUCTS *PRTDBGKRNLSTRUCTS; 1156 1157 RTR0DECL(int) RTR0DbgKrnlStructsOpen(PRTDBGKRNLSTRUCTS phKrnlStructs, uint32_t fFlags); 1158 RTR0DECL(uint32_t) RTR0DbgKrnlStructsRetain(RTDBGKRNLSTRUCTS hKrnlStructs); 1159 RTR0DECL(uint32_t) RTR0DbgKrnlStructsRelease(RTDBGKRNLSTRUCTS hKrnlStructs); 1160 RTR0DECL(int) RTR0DbgKrnlStructsQueryMember(RTDBGKRNLSTRUCTS hKrnlStructs, const char *pszStructure, 1161 const char *pszMember, size_t *poffMember); 1158 1159 /** Handle to the kernel debug info. */ 1160 typedef struct RTDBGKRNLINFOINT *RTDBGKRNLINFO; 1161 /** Pointer to a kernel debug info handle. */ 1162 typedef RTDBGKRNLINFO *PRTDBGKRNLINFO; 1163 /** Nil kernel debug info handle. */ 1164 #define NIL_RTDBGKRNLINFO ((RTDBGKRNLINFO)0) 1165 1166 /** 1167 * Opens the kernel debug info 1168 * 1169 * @returns IPRT status code. Can fail for any number of reasons. 1170 * 1171 * @param phKrnlInfo Where to return the kernel debug info handle on 1172 * success. 1173 * @param fFlags Flags reserved for future use. Must be zero. 1174 */ 1175 RTR0DECL(int) RTR0DbgKrnlInfoOpen(PRTDBGKRNLINFO phKrnlInfo, uint32_t fFlags); 1176 1177 /** 1178 * Retains a refernece to the kernel debug info handle. 1179 * 1180 * @returns New reference count, UINT32_MAX on invalid handle (asserted). 1181 * @param hKrnlInfo The kernel info handle. 1182 */ 1183 RTR0DECL(uint32_t) RTR0DbgKrnlInfoRetain(RTDBGKRNLINFO hKrnlInfo); 1184 1185 1186 /** 1187 * Releases a refernece to the kernel debug info handle, destroying it when the 1188 * counter reaches zero. 1189 * 1190 * @returns New reference count, UINT32_MAX on invalid handle (asserted). 1191 * @param hKrnlInfo The kernel info handle. NIL_RTDBGKRNLINFO is 1192 * quietly ignored. 1193 */ 1194 RTR0DECL(uint32_t) RTR0DbgKrnlInfoRelease(RTDBGKRNLINFO hKrnlInfo); 1195 1196 /** 1197 * Queries the offset of a member of a kernel structure. 1198 * 1199 * @returns IPRT status code. 1200 * @retval VINF_SUCCESS and offset at @a poffMember. 1201 * @retval VERR_NOT_FOUND if the structure or the member was not found. 1202 * @retval VERR_INVALID_HANDLE if hKrnlInfo is bad. 1203 * @retval VERR_INVALID_POINTER if any of the pointers are bad. 1204 * 1205 * @param hKrnlInfo The kernel info handle. 1206 * @param pszStructure The structure name. 1207 * @param pszMember The member name. 1208 * @param poffMember Where to return the offset. 1209 */ 1210 RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *pszStructure, 1211 const char *pszMember, size_t *poffMember); 1212 1213 1214 /** 1215 * Queries the value (usually the address) of a kernel symbol. 1216 * 1217 * This may go looking for the symbol in other modules, in which case it will 1218 * always check the kernel symbol table first. 1219 * 1220 * @returns IPRT status code. 1221 * @retval VINF_SUCCESS and value at @a ppvSymbol. 1222 * @retval VERR_SYMBOL_NOT_FOUND 1223 * @retval VERR_INVALID_HANDLE if hKrnlInfo is bad. 1224 * @retval VERR_INVALID_POINTER if any of the pointers are bad. 1225 * 1226 * @param hKrnlInfo The kernel info handle. 1227 * @param pszModule Reserved for future extensions. Pass NULL. 1228 * @param pszSymbol The C name of the symbol. 1229 * @param ppvSymbol Where to return the symbol value. 1230 * 1231 * @sa RTLdrGetSymbol. 1232 */ 1233 RTR0DECL(int) RTR0DbgKrnlInfoQuerySymbol(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, 1234 const char *pszSymbol, void **ppvSymbol); 1162 1235 /** @} */ 1163 1236
Note:
See TracChangeset
for help on using the changeset viewer.