Changeset 58772 in vbox
- Timestamp:
- Nov 19, 2015 3:57:35 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/iprt/dbg.h (modified) (1 diff)
-
include/iprt/mangling.h (modified) (1 diff)
-
src/VBox/HostDrivers/Support/SUPDrv.cpp (modified) (1 diff)
-
src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dbg.h
r57944 r58772 1623 1623 RTR0DECL(int) RTR0DbgKrnlInfoQuerySymbol(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, 1624 1624 const char *pszSymbol, void **ppvSymbol); 1625 1626 1627 /** 1628 * Queries the size (in bytes) of a kernel data type. 1629 * 1630 * @returns IPRT status code. 1631 * @retval VINF_SUCCESS and size at @a pcbType. 1632 * @retval VERR_NOT_FOUND if the type was not found. 1633 * @retval VERR_INVALID_HANDLE if hKrnlInfo is bad. 1634 * @retval VERR_INVALID_POINTER if any of the pointers are bad. 1635 * @retval VERR_WRONG_TYPE if the type was not a valid data type (e.g. a 1636 * function) 1637 * 1638 * @param hKrnlInfo The kernel info handle. 1639 * @param pszModule The name of the module to search, pass NULL to 1640 * search the default kernel module. 1641 * @param pszType The type name. 1642 * @param pcbType Where to return the size of the type. 1643 */ 1644 RTR0DECL(int) RTR0DbgKrnlInfoQuerySize(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, 1645 const char *pszType, size_t *pcbType); 1625 1646 /** @} */ 1626 1647 -
trunk/include/iprt/mangling.h
r58747 r58772 1419 1419 # define RTR0DbgKrnlInfoOpen RT_MANGLER(RTR0DbgKrnlInfoOpen) /* r0drv */ 1420 1420 # define RTR0DbgKrnlInfoQueryMember RT_MANGLER(RTR0DbgKrnlInfoQueryMember) /* r0drv */ 1421 # define RTR0DbgKrnlInfoQuerySize RT_MANGLER(RTR0DbgKrnlInfoQuerySize) /* r0drv */ 1421 1422 # define RTR0DbgKrnlInfoQuerySymbol RT_MANGLER(RTR0DbgKrnlInfoQuerySymbol) /* r0drv */ 1422 1423 # define RTR0DbgKrnlInfoRelease RT_MANGLER(RTR0DbgKrnlInfoRelease) /* r0drv */ -
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r58340 r58772 330 330 { "RTR0DbgKrnlInfoOpen", (void *)RTR0DbgKrnlInfoOpen }, /* only-darwin, only-solaris */ 331 331 { "RTR0DbgKrnlInfoQueryMember", (void *)RTR0DbgKrnlInfoQueryMember }, /* only-darwin, only-solaris */ 332 # if defined(RT_OS_SOLARIS) 333 { "RTR0DbgKrnlInfoQuerySize", (void *)RTR0DbgKrnlInfoQuerySize }, /* only-solaris */ 334 # endif 332 335 { "RTR0DbgKrnlInfoQuerySymbol", (void *)RTR0DbgKrnlInfoQuerySymbol }, /* only-darwin, only-solaris */ 333 336 { "RTR0DbgKrnlInfoRelease", (void *)RTR0DbgKrnlInfoRelease }, /* only-darwin, only-solaris */ -
trunk/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
r57358 r58772 247 247 } 248 248 249 250 RTR0DECL(int) RTR0DbgKrnlInfoQuerySize(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, const char *pszType, size_t *pcbType) 251 { 252 PRTDBGKRNLINFOINT pThis = hKrnlInfo; 253 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 254 AssertMsgReturn(pThis->u32Magic == RTDBGKRNLINFO_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); 255 AssertPtrReturn(pszType, VERR_INVALID_PARAMETER); 256 AssertPtrReturn(pcbType, VERR_INVALID_PARAMETER); 257 if (g_frtSolInitDone) 258 RT_ASSERT_PREEMPTIBLE(); 259 260 modctl_t *pMod; 261 ctf_file_t *pCtf; 262 if (!pszModule) 263 { 264 pCtf = pThis->pGenUnixCTF; 265 pMod = pThis->pGenUnixMod; 266 NOREF(pMod); 267 } 268 else 269 { 270 char *pszMod = RTStrDup(pszModule); 271 int rc = rtR0DbgKrnlInfoModRetain(pszMod, &pMod, &pCtf); 272 RTStrFree(pszMod); 273 if (RT_FAILURE(rc)) 274 return VERR_MODULE_NOT_FOUND; 275 AssertPtrReturn(pMod, VERR_INTERNAL_ERROR_5); 276 AssertPtrReturn(pCtf, VERR_INTERNAL_ERROR_4); 277 } 278 279 int rc = VERR_NOT_FOUND; 280 ctf_id_t TypeIdent = ctf_lookup_by_name(pCtf, pszType); 281 if (TypeIdent != CTF_ERR) 282 { 283 ssize_t cbType = ctf_type_size(pCtf, TypeIdent); 284 if (cbType > 0) 285 { 286 *pcbType = cbType; 287 if (pszModule) 288 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 289 return VINF_SUCCESS; 290 } 291 rc = VERR_WRONG_TYPE; 292 } 293 294 if (pszModule) 295 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 296 return rc; 297 } 298
Note:
See TracChangeset
for help on using the changeset viewer.

