Changeset 58800 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Nov 20, 2015 2:39:08 PM (9 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
r58598 r58800 1161 1161 1162 1162 1163 RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *psz Structure,1163 RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, const char *pszStructure, 1164 1164 const char *pszMember, size_t *poffMember) 1165 1165 { -
trunk/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
r58774 r58800 135 135 136 136 137 /** 138 * Helper for opening the specified kernel module. 139 * 140 * @param pszModule The name of the module. 141 * @param pMod Where to store the module handle. 142 * @param pCtf Where to store the CTF handle. 143 * 144 * @returns Pointer to the CTF structure for the module. 145 */ 146 static int rtR0DbgKrnlInfoModRetainEx(const char *pszModule, modctl_t **ppMod, ctf_file_t **ppCtf) 147 { 148 char *pszMod = RTStrDup(pszModule); 149 if (RT_LIKELY(pszMod)) 150 { 151 int rc = rtR0DbgKrnlInfoModRetain(pszMod, ppMod, ppCtf); 152 RTStrFree(pszMod); 153 if (RT_SUCCESS(rc)) 154 { 155 AssertPtrReturn(*ppMod, VERR_INTERNAL_ERROR_2); 156 AssertPtrReturn(*ppCtf, VERR_INTERNAL_ERROR_3); 157 } 158 return rc; 159 } 160 return VERR_NO_MEMORY; 161 } 162 163 137 164 RTR0DECL(int) RTR0DbgKrnlInfoOpen(PRTDBGKRNLINFO phKrnlInfo, uint32_t fFlags) 138 165 { … … 198 225 199 226 200 RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *psz Structure,227 RTR0DECL(int) RTR0DbgKrnlInfoQueryMember(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, const char *pszStructure, 201 228 const char *pszMember, size_t *poffMember) 202 229 { … … 210 237 RT_ASSERT_PREEMPTIBLE(); 211 238 239 ctf_file_t *pCtf = NULL; 240 modctl_t *pMod = NULL; 241 if (!pszModule) 242 { 243 pCtf = pThis->pGenUnixCTF; 244 pMod = pThis->pGenUnixMod; 245 } 246 else 247 { 248 int rc2 = rtR0DbgKrnlInfoModRetainEx(pszModule, &pMod, &pCtf); 249 if (RT_FAILURE(rc2)) 250 return rc2; 251 Assert(pMod); 252 Assert(pCtf); 253 } 254 212 255 int rc = VERR_NOT_FOUND; 213 ctf_id_t TypeIdent = ctf_lookup_by_name(p This->pGenUnixCTF, pszStructure);256 ctf_id_t TypeIdent = ctf_lookup_by_name(pCtf, pszStructure); 214 257 if (TypeIdent != CTF_ERR) 215 258 { 216 259 ctf_membinfo_t MemberInfo; 217 260 RT_ZERO(MemberInfo); 218 if (ctf_member_info(p This->pGenUnixCTF, TypeIdent, pszMember, &MemberInfo) != CTF_ERR)261 if (ctf_member_info(pCtf, TypeIdent, pszMember, &MemberInfo) != CTF_ERR) 219 262 { 220 263 *poffMember = (MemberInfo.ctm_offset >> 3); 221 return VINF_SUCCESS; 222 } 223 } 224 264 rc = VINF_SUCCESS; 265 } 266 } 267 268 if (pszModule) 269 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 225 270 return rc; 226 271 } … … 258 303 RT_ASSERT_PREEMPTIBLE(); 259 304 260 modctl_t *pMod ;261 ctf_file_t *pCtf ;305 modctl_t *pMod = NULL; 306 ctf_file_t *pCtf = NULL; 262 307 if (!pszModule) 263 308 { 264 309 pCtf = pThis->pGenUnixCTF; 265 310 pMod = pThis->pGenUnixMod; 266 NOREF(pMod);267 311 } 268 312 else 269 313 { 270 char *pszMod = RTStrDup(pszModule); 271 if (RT_LIKELY(pszMod)) 272 { 273 int rc = rtR0DbgKrnlInfoModRetain(pszMod, &pMod, &pCtf); 274 RTStrFree(pszMod); 275 if (RT_FAILURE(rc)) 276 return VERR_MODULE_NOT_FOUND; 277 AssertPtrReturn(pMod, VERR_INTERNAL_ERROR_5); 278 AssertPtrReturn(pCtf, VERR_INTERNAL_ERROR_4); 279 } 280 else 281 return VERR_NO_MEMORY; 314 int rc2 = rtR0DbgKrnlInfoModRetainEx(pszModule, &pMod, &pCtf); 315 if (RT_FAILURE(rc2)) 316 return rc2; 317 Assert(pMod); 318 Assert(pCtf); 282 319 } 283 320 … … 290 327 { 291 328 *pcbType = cbType; 292 if (pszModule) 293 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 294 return VINF_SUCCESS; 295 } 296 rc = VERR_WRONG_TYPE; 329 rc = VINF_SUCCESS; 330 } 331 else 332 rc = VERR_WRONG_TYPE; 297 333 } 298 334 -
trunk/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c
r57358 r58800 118 118 * Mandatory: Preemption offsets. 119 119 */ 120 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "cpu_t", "cpu_runrun", &g_offrtSolCpuPreempt);120 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "cpu_t", "cpu_runrun", &g_offrtSolCpuPreempt); 121 121 if (RT_FAILURE(rc)) 122 122 { … … 125 125 } 126 126 127 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "cpu_t", "cpu_kprunrun", &g_offrtSolCpuForceKernelPreempt);127 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "cpu_t", "cpu_kprunrun", &g_offrtSolCpuForceKernelPreempt); 128 128 if (RT_FAILURE(rc)) 129 129 { … … 132 132 } 133 133 134 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "kthread_t", "t_preempt", &g_offrtSolThreadPreempt);134 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "kthread_t", "t_preempt", &g_offrtSolThreadPreempt); 135 135 if (RT_FAILURE(rc)) 136 136 { … … 139 139 } 140 140 141 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "kthread_t", "t_did", &g_offrtSolThreadId);141 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "kthread_t", "t_did", &g_offrtSolThreadId); 142 142 if (RT_FAILURE(rc)) 143 143 { … … 146 146 } 147 147 148 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "kthread_t", "t_intr", &g_offrtSolThreadIntrThread);148 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "kthread_t", "t_intr", &g_offrtSolThreadIntrThread); 149 149 if (RT_FAILURE(rc)) 150 150 { … … 153 153 } 154 154 155 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "kthread_t", "t_lockp", &g_offrtSolThreadLock);155 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "kthread_t", "t_lockp", &g_offrtSolThreadLock); 156 156 if (RT_FAILURE(rc)) 157 157 { … … 160 160 } 161 161 162 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, "kthread_t", "t_procp", &g_offrtSolThreadProc);162 rc = RTR0DbgKrnlInfoQueryMember(g_hKrnlDbgInfo, NULL, "kthread_t", "t_procp", &g_offrtSolThreadProc); 163 163 if (RT_FAILURE(rc)) 164 164 {
Note:
See TracChangeset
for help on using the changeset viewer.