1 | /* $Id: DBGFR0.cpp 93655 2022-02-08 13:56:01Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DBGF - Debugger Facility, R0 part.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2020-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*********************************************************************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_DBGF
|
---|
23 | #include "DBGFInternal.h"
|
---|
24 | #include <VBox/vmm/gvm.h>
|
---|
25 | #include <VBox/vmm/gvmm.h>
|
---|
26 | #include <VBox/vmm/vmm.h>
|
---|
27 |
|
---|
28 | #include <VBox/log.h>
|
---|
29 | #include <VBox/sup.h>
|
---|
30 | #include <iprt/asm.h>
|
---|
31 | #include <iprt/assert.h>
|
---|
32 | #include <iprt/errcore.h>
|
---|
33 | #include <iprt/ctype.h>
|
---|
34 | #include <iprt/mem.h>
|
---|
35 | #include <iprt/memobj.h>
|
---|
36 | #include <iprt/process.h>
|
---|
37 | #include <iprt/string.h>
|
---|
38 |
|
---|
39 | #include "dtrace/VBoxVMM.h"
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Initializes the per-VM data for the DBGF.
|
---|
45 | *
|
---|
46 | * This is called from under the GVMM lock, so it only need to initialize the
|
---|
47 | * data so DBGFR0CleanupVM and others will work smoothly.
|
---|
48 | *
|
---|
49 | * @param pGVM Pointer to the global VM structure.
|
---|
50 | */
|
---|
51 | VMMR0_INT_DECL(void) DBGFR0InitPerVMData(PGVM pGVM)
|
---|
52 | {
|
---|
53 | AssertCompile(sizeof(pGVM->dbgfr0.s) <= sizeof(pGVM->dbgfr0.padding));
|
---|
54 | pGVM->dbgfr0.s.pTracerR0 = NULL;
|
---|
55 |
|
---|
56 | dbgfR0BpInit(pGVM);
|
---|
57 | }
|
---|
58 |
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Cleans up any loose ends before the GVM structure is destroyed.
|
---|
62 | */
|
---|
63 | VMMR0_INT_DECL(void) DBGFR0CleanupVM(PGVM pGVM)
|
---|
64 | {
|
---|
65 | #ifdef VBOX_WITH_DBGF_TRACING
|
---|
66 | if (pGVM->dbgfr0.s.pTracerR0)
|
---|
67 | dbgfR0TracerDestroy(pGVM, pGVM->dbgfr0.s.pTracerR0);
|
---|
68 | pGVM->dbgfr0.s.pTracerR0 = NULL;
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | dbgfR0BpDestroy(pGVM);
|
---|
72 | }
|
---|
73 |
|
---|