1 | /* $Id: AllPdbTypeHack.cpp 108132 2025-02-10 11:05:23Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Debug info hack for the VM and VMCPU structures.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #ifdef VBOX_VMM_TARGET_AGNOSTIC
|
---|
33 | # ifdef RT_ARCH_AMD64
|
---|
34 | # define VBOX_VMM_TARGET_X86
|
---|
35 | # elif defined(RT_ARCH_ARM64)
|
---|
36 | # define VBOX_VMM_TARGET_ARMV8
|
---|
37 | # else
|
---|
38 | # error "port me"
|
---|
39 | # endif
|
---|
40 | #endif
|
---|
41 | #include <VBox/vmm/cfgm.h>
|
---|
42 | #include <VBox/vmm/cpum.h>
|
---|
43 | #include <VBox/vmm/mm.h>
|
---|
44 | #include <VBox/vmm/pgm.h>
|
---|
45 | #include <VBox/vmm/selm.h>
|
---|
46 | #include <VBox/vmm/trpm.h>
|
---|
47 | #include <VBox/vmm/vmm.h>
|
---|
48 | #include <VBox/vmm/stam.h>
|
---|
49 | #include "../include/PDMInternal.h"
|
---|
50 | #include <VBox/vmm/pdm.h>
|
---|
51 | #if !defined(VBOX_WITH_MINIMAL_R0) || !defined(IN_RING0)
|
---|
52 | # include "../include/CPUMInternal.h"
|
---|
53 | # include "../include/CFGMInternal.h"
|
---|
54 | # include "../include/MMInternal.h"
|
---|
55 | # include "../include/PGMInternal.h"
|
---|
56 | # include "../include/SELMInternal.h"
|
---|
57 | # include "../include/TRPMInternal.h"
|
---|
58 | # include "../include/TMInternal.h"
|
---|
59 | # include "../include/IOMInternal.h"
|
---|
60 | #endif
|
---|
61 | #ifdef IN_RING3
|
---|
62 | # include "../include/SSMInternal.h"
|
---|
63 | #endif
|
---|
64 | #include "../include/VMMInternal.h"
|
---|
65 | #if !defined(VBOX_WITH_MINIMAL_R0) || !defined(IN_RING0)
|
---|
66 | # include "../include/HMInternal.h"
|
---|
67 | # include "../include/DBGFInternal.h"
|
---|
68 | # include "../include/GIMInternal.h"
|
---|
69 | # include "../include/APICInternal.h"
|
---|
70 | # include "../include/STAMInternal.h"
|
---|
71 | # include "../include/IEMInternal.h"
|
---|
72 | # include "../include/NEMInternal.h"
|
---|
73 | # include "../VMMR0/GMMR0Internal.h"
|
---|
74 | # include "../include/EMInternal.h"
|
---|
75 | #endif
|
---|
76 | #include "../include/VMInternal.h"
|
---|
77 | #include "../VMMR0/GVMMR0Internal.h"
|
---|
78 | #include <VBox/vmm/vmcc.h>
|
---|
79 | #ifdef IN_RING3
|
---|
80 | # include <VBox/vmm/uvm.h>
|
---|
81 | #endif
|
---|
82 | #include <VBox/vmm/gvm.h>
|
---|
83 |
|
---|
84 |
|
---|
85 | extern "C" {
|
---|
86 |
|
---|
87 | /* Global pointer variables as an alternative to the parameter list. Just to ensure the precense of the types. */
|
---|
88 | PVM g_PdbTypeHack1 = NULL;
|
---|
89 | PVMCPU g_PdbTypeHack2 = NULL;
|
---|
90 | PPDMCRITSECT g_PdbTypeHack3 = NULL;
|
---|
91 | PPDMCRITSECTRW g_PdbTypeHack4 = NULL;
|
---|
92 | PPDMDEVINS g_PdbTypeHack5 = NULL;
|
---|
93 | PPDMDRVINS g_PdbTypeHack6 = NULL;
|
---|
94 | PPDMUSBINS g_PdbTypeHack7 = NULL;
|
---|
95 | PCVMCPU g_PdbTypeHack8 = NULL;
|
---|
96 | CTX_SUFF(PVM) g_PdbTypeHack9 = NULL;
|
---|
97 | CTX_SUFF(PVMCPU) g_PdbTypeHack10 = NULL;
|
---|
98 |
|
---|
99 | DECLEXPORT(uint32_t) PdbTypeHack(PVM pVM, PVMCPU pVCpu, PPDMCRITSECT pCs1, PPDMCRITSECTRW pCs2);
|
---|
100 | }
|
---|
101 |
|
---|
102 | DECLEXPORT(uint32_t) PdbTypeHack(PVM pVM, PVMCPU pVCpu, PPDMCRITSECT pCs1, PPDMCRITSECTRW pCs2)
|
---|
103 | {
|
---|
104 | /* Just some dummy operations accessing each type. Probably not necessary, but
|
---|
105 | helps making sure we've included all we need to get at the internal stuff.. */
|
---|
106 | return pVM->fGlobalForcedActions
|
---|
107 | | (pVM == g_PdbTypeHack1)
|
---|
108 | | (pVM == g_PdbTypeHack9)
|
---|
109 | | pVCpu->fLocalForcedActions
|
---|
110 | | (pVCpu == g_PdbTypeHack2)
|
---|
111 | | (pVCpu == g_PdbTypeHack8)
|
---|
112 | | (pVCpu == g_PdbTypeHack10)
|
---|
113 | | pCs1->s.Core.fFlags
|
---|
114 | | (pCs1 == g_PdbTypeHack3)
|
---|
115 | | pCs2->s.Core.fFlags
|
---|
116 | | (pCs2 == g_PdbTypeHack4)
|
---|
117 | | g_PdbTypeHack5->Internal.s.idxR0Device
|
---|
118 | | (g_PdbTypeHack5 != NULL)
|
---|
119 | | (uint32_t)g_PdbTypeHack6->Internal.s.fDetaching
|
---|
120 | | (g_PdbTypeHack6 != NULL)
|
---|
121 | | (uint32_t)g_PdbTypeHack7->Internal.s.fVMSuspended
|
---|
122 | | (g_PdbTypeHack7 != NULL);
|
---|
123 | }
|
---|
124 |
|
---|