Changeset 37631 in vbox for trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.h
- Timestamp:
- Jun 24, 2011 1:25:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.h
r31980 r37631 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT Testcase - Core dump, header.3 * IPRT - Custom Core Dumper, Solaris. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2010 Oracle Corporation7 * Copyright (C) 2010-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 */ 26 26 27 #include <iprt/process.h> 28 #include <iprt/file.h> 27 #include <iprt/types.h> 29 28 30 29 #ifdef RT_OS_SOLARIS … … 62 61 #ifdef RT_OS_SOLARIS 63 62 /** 64 * VBOXSOLMAPINFO: Memory mapping description.63 * Memory mapping descriptor employed by the solaris core dumper. 65 64 */ 66 typedef struct VBOXSOLMAPINFO65 typedef struct RTSOLCOREMAPINFO 67 66 { 68 prmap_t pMap; /* Proc description of this mapping */ 69 int fError; /* Any error reading this mapping (errno) */ 70 struct VBOXSOLMAPINFO *pNext; /* Pointer to the next mapping */ 71 } VBOXSOLMAPINFO; 72 typedef VBOXSOLMAPINFO *PVBOXSOLMAPINFO; 67 prmap_t pMap; /**< Proc description of this mapping */ 68 int fError; /**< Any error reading this mapping (errno) */ 69 struct RTSOLCOREMAPINFO *pNext; /**< Pointer to the next mapping */ 70 } RTSOLCOREMAPINFO; 71 /** Pointer to a solaris memory mapping descriptor. */ 72 typedef RTSOLCOREMAPINFO *PRTSOLCOREMAPINFO; 73 73 74 74 /** 75 * VBOXSOLCORETYPE: Whether this is an old or new stylecore.75 * Whether this is an old or new style solaris core. 76 76 */ 77 typedef enum VBOXSOLCORETYPE77 typedef enum RTSOLCORETYPE 78 78 { 79 enmOldEra = 0x01d, /*old */80 enmNewEra = 0x5c1f1 /*sci-fi */81 } VBOXSOLCORETYPE;79 enmOldEra = 0x01d, /**< old */ 80 enmNewEra = 0x5c1f1 /**< sci-fi */ 81 } RTSOLCORETYPE; 82 82 83 83 /** 84 * VBOXSOLTHREADINFO: Per-Thread information.84 * Per-Thread information employed by the solaris core dumper. 85 85 */ 86 typedef struct VBOXSOLTHREADINFO86 typedef struct RTSOLCORETHREADINFO 87 87 { 88 lwpsinfo_t Info; /* Proc description of this thread */89 lwpstatus_t *pStatus; /* Proc description of this thread's status (can be NULL, zombie lwp) */90 struct VBOXSOLTHREADINFO *pNext; /*Pointer to the next thread */91 } VBOXSOLTHREADINFO;92 typedef VBOXSOLTHREADINFO *PVBOXSOLTHREADINFO;88 lwpsinfo_t Info; /**< Proc description of this thread */ 89 lwpstatus_t *pStatus; /**< Proc description of this thread's status (can be NULL, zombie lwp) */ 90 struct RTSOLCORETHREADINFO *pNext; /**< Pointer to the next thread */ 91 } RTSOLCORETHREADINFO; 92 typedef RTSOLCORETHREADINFO *PRTSOLCORETHREADINFO; 93 93 #endif 94 94 95 95 96 96 /** 97 * VBOXPROCESS:Current (also the core target) process information.97 * Current (also the core target) process information. 98 98 */ 99 typedef struct VBOXPROCESS99 typedef struct RTSOLCOREPROCESS 100 100 { 101 RTPROCESS Process; /* The pid of the process */102 char szExecPath[PATH_MAX]; /* Path of the executable */103 char *pszExecName; /* Name of the executable file */101 RTPROCESS Process; /**< The pid of the process */ 102 char szExecPath[PATH_MAX]; /**< Path of the executable */ 103 char *pszExecName; /**< Name of the executable file */ 104 104 #ifdef RT_OS_SOLARIS 105 psinfo_t ProcInfo; /* Process info. */106 prpsinfo_t ProcInfoOld; /* Process info. Older version (for GDB compat.) */107 pstatus_t ProcStatus; /* Process status info. */108 thread_t hCurThread; /* The current thread */109 ucontext_t *pCurThreadCtx; /* Context info. of current thread before starting to dump */110 RTFILE hAs; /* proc/<pid/as file handle */111 auxv_t *pAuxVecs; /* Aux vector of process */112 int cAuxVecs; /* Number of aux vector entries */113 P VBOXSOLMAPINFO pMapInfoHead; /*Pointer to the head of list of mappings */114 uint32_t cMappings; /* Number of mappings (count of pMapInfoHead list) */115 P VBOXSOLTHREADINFO pThreadInfoHead; /*Pointer to the head of list of threads */116 uint64_t cThreads; /* Number of threads (count of pThreadInfoHead list) */117 char szPlatform[SYS_NMLN]; /* Platform name */118 char szZoneName[ZONENAME_MAX]; /* Zone name */119 struct utsname UtsName; /* UTS name */120 void *pvCred; /* Process credential info. */121 size_t cbCred; /* Size of process credential info. */122 void *pvLdt; /* Process LDT info. */123 size_t cbLdt; /* Size of the LDT info. */124 prpriv_t *pPriv; /* Process privilege info. */125 size_t cbPriv; /* Size of process privilege info. */126 const priv_impl_info_t *pcPrivImpl; /* Process privilege implementation info. (opaque handle) */127 core_content_t CoreContent; /* What information goes in the core */105 psinfo_t ProcInfo; /**< Process info. */ 106 prpsinfo_t ProcInfoOld; /**< Process info. Older version (for GDB compat.) */ 107 pstatus_t ProcStatus; /**< Process status info. */ 108 thread_t hCurThread; /**< The current thread */ 109 ucontext_t *pCurThreadCtx; /**< Context info. of current thread before starting to dump */ 110 int fdAs; /**< proc/pid/as file handle */ 111 auxv_t *pAuxVecs; /**< Aux vector of process */ 112 int cAuxVecs; /**< Number of aux vector entries */ 113 PRTSOLCOREMAPINFO pMapInfoHead; /**< Pointer to the head of list of mappings */ 114 uint32_t cMappings; /**< Number of mappings (count of pMapInfoHead list) */ 115 PRTSOLCORETHREADINFO pThreadInfoHead; /**< Pointer to the head of list of threads */ 116 uint64_t cThreads; /**< Number of threads (count of pThreadInfoHead list) */ 117 char szPlatform[SYS_NMLN]; /**< Platform name */ 118 char szZoneName[ZONENAME_MAX]; /**< Zone name */ 119 struct utsname UtsName; /**< UTS name */ 120 void *pvCred; /**< Process credential info. */ 121 size_t cbCred; /**< Size of process credential info. */ 122 void *pvLdt; /**< Process LDT info. */ 123 size_t cbLdt; /**< Size of the LDT info. */ 124 prpriv_t *pPriv; /**< Process privilege info. */ 125 size_t cbPriv; /**< Size of process privilege info. */ 126 const priv_impl_info_t *pcPrivImpl; /**< Process privilege implementation info. (opaque handle) */ 127 core_content_t CoreContent; /**< What information goes in the core */ 128 128 #else 129 129 # error Port Me! 130 130 #endif 131 131 132 } VBOXPROCESS;133 typedef VBOXPROCESS *PVBOXPROCESS;132 } RTSOLCOREPROCESS; 133 typedef RTSOLCOREPROCESS *PRTSOLCOREPROCESS; 134 134 135 typedef int (*PFN COREREADER)(RTFILE hFile, void *pv, size_t cb);136 typedef int (*PFN COREWRITER)(RTFILEhFile, const void *pcv, size_t cb);135 typedef int (*PFNRTCOREREADER)(int fdFile, void *pv, size_t cb); 136 typedef int (*PFNRTCOREWRITER)(int fdhFile, const void *pcv, size_t cb); 137 137 138 138 /** 139 * VBOXCORE: Core file object.139 * The solaris core file object. 140 140 */ 141 typedef struct VBOXCORE141 typedef struct RTSOLCORE 142 142 { 143 char szCorePath[PATH_MAX]; /* Path of the core file */144 VBOXPROCESS VBoxProc; /*Current process information */145 void *pvCore; /* Pointer to memory area during dumping */146 size_t cbCore; /* Size of memory area during dumping */147 void *pvFree; /* Pointer to base of free range in preallocated memory area */148 bool fIsValid; /* Whether core information has been fully collected */149 PFN COREREADER pfnReader; /*Reader function */150 PFN COREWRITER pfnWriter; /*Writer function */151 RTFILE hCoreFile; /*Core file (used only while writing the core) */152 RTFOFF offWrite; /* Segment/section offset (used only while writing the core) */153 } VBOXCORE;154 typedef VBOXCORE *PVBOXCORE;143 char szCorePath[PATH_MAX]; /**< Path of the core file */ 144 RTSOLCOREPROCESS SolProc; /**< Current process information */ 145 void *pvCore; /**< Pointer to memory area during dumping */ 146 size_t cbCore; /**< Size of memory area during dumping */ 147 void *pvFree; /**< Pointer to base of free range in preallocated memory area */ 148 bool fIsValid; /**< Whether core information has been fully collected */ 149 PFNRTCOREREADER pfnReader; /**< Reader function */ 150 PFNRTCOREWRITER pfnWriter; /**< Writer function */ 151 int fdCoreFile; /**< Core file (used only while writing the core) */ 152 RTFOFF offWrite; /**< Segment/section offset (used only while writing the core) */ 153 } RTSOLCORE; 154 typedef RTSOLCORE *PRTSOLCORE; 155 155 156 typedef int (*PFN COREACCUMULATOR)(PVBOXCORE pVBoxCore);157 typedef int (*PFN CORETHREADWORKER)(PVBOXCORE pVBoxCore, void *pvThreadInfo);156 typedef int (*PFNRTSOLCOREACCUMULATOR)(PRTSOLCORE pSolCore); 157 typedef int (*PFNRTSOLCORETHREADWORKER)(PRTSOLCORE pSolCore, void *pvThreadInfo); 158 158
Note:
See TracChangeset
for help on using the changeset viewer.