dbg-r0drv-solaris.c revision 3881f502abf425b3ca3525e8259fa209dccb1752
/* $Id$ */
/** @file
* IPRT - Kernel debug information, Ring-0 Driver, Solaris Code.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "the-solaris-kernel.h"
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/**
* Solaris kernel debug info instance data.
*/
typedef struct RTDBGKRNLINFOINT
{
/** Magic value (RTDBGKRNLINFO_MAGIC). */
/** The number of threads referencing this object. */
/** Pointer to the genunix CTF handle. */
/** Pointer to the genunix module handle. */
/** Pointer to the solaris kernel debug info instance data. */
typedef struct RTDBGKRNLINFOINT *PRTDBGKRNLINFOINT;
/** Magic value for RTDBGKRNLINFOINT::u32Magic. (John Carmack) */
/**
* Retains a kernel module and opens the CTF data associated with it.
*
* @param pszModule The name of the module to open.
* @param ppMod Where to store the module handle.
* @param ppCTF Where to store the module's CTF handle.
*
* @return IPRT status code.
*/
{
int rc = VINF_SUCCESS;
if (ModId != -1)
{
if (*ppMod)
{
/*
* Hold mod_lock as ctf_modopen may update the module with uncompressed CTF data.
*/
int err;
if (*ppCTF)
return VINF_SUCCESS;
else
{
}
}
else
{
}
}
else
{
}
return rc;
}
/**
* Releases the kernel module and closes its CTF data.
*
* @param pMod Pointer to the module handle.
* @param pCTF Pointer to the module's CTF handle.
*/
{
}
{
if (!pThis)
return VERR_NO_MEMORY;
char szGenUnixModName[] = "genunix";
if (RT_SUCCESS(rc))
{
*phKrnlInfo = pThis;
return VINF_SUCCESS;
}
return rc;
}
{
return cRefs;
}
{
AssertMsgReturn(pThis->u32Magic == RTDBGKRNLINFO_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), UINT32_MAX);
if (cRefs == 0)
{
}
return cRefs;
}
{
AssertMsgReturn(pThis->u32Magic == RTDBGKRNLINFO_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
int rc = VERR_NOT_FOUND;
{
{
return VINF_SUCCESS;
}
}
return rc;
}
{
AssertMsgReturn(pThis->u32Magic == RTDBGKRNLINFO_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
if (*ppvSymbol)
return VINF_SUCCESS;
return VERR_SYMBOL_NOT_FOUND;
}