1 | /** @file
|
---|
2 | * DBGGUI - The VirtualBox Debugger GUI.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | *
|
---|
25 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
26 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
27 | * additional information or have any questions.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef ___VBox_dbggui_h
|
---|
31 | #define ___VBox_dbggui_h
|
---|
32 |
|
---|
33 | #include <VBox/types.h>
|
---|
34 | #if defined(RT_OS_WINDOWS)
|
---|
35 | # include <VirtualBox.h>
|
---|
36 | #else
|
---|
37 | # include <VirtualBox_XPCOM.h>
|
---|
38 | #endif
|
---|
39 |
|
---|
40 |
|
---|
41 | RT_C_DECLS_BEGIN
|
---|
42 |
|
---|
43 | /** @defgroup grp_dbggui VirtualBox Debugger GUI
|
---|
44 | * @{
|
---|
45 | */
|
---|
46 |
|
---|
47 | /** Pointer to the debugger GUI instance structure. */
|
---|
48 | typedef struct DBGGUI *PDBGGUI;
|
---|
49 |
|
---|
50 | /** Virtual method table for the debugger GUI. */
|
---|
51 | typedef struct DBGGUIVT
|
---|
52 | {
|
---|
53 | /** The version. (DBGGUIVT_VERSION) */
|
---|
54 | uint32_t u32Version;
|
---|
55 | /** @copydoc DBGGuiDestroy */
|
---|
56 | DECLCALLBACKMEMBER(int, pfnDestroy)(PDBGGUI pGui);
|
---|
57 | /** @copydoc DBGGuiAdjustRelativePos */
|
---|
58 | DECLCALLBACKMEMBER(void, pfnAdjustRelativePos)(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
|
---|
59 | /** @copydoc DBGGuiShowStatistics */
|
---|
60 | DECLCALLBACKMEMBER(int, pfnShowStatistics)(PDBGGUI pGui);
|
---|
61 | /** @copydoc DBGGuiShowCommandLine */
|
---|
62 | DECLCALLBACKMEMBER(int, pfnShowCommandLine)(PDBGGUI pGui);
|
---|
63 | /** @copydoc DBGGuiSetParent */
|
---|
64 | DECLCALLBACKMEMBER(void, pfnSetParent)(PDBGGUI pGui, void *pvParent);
|
---|
65 | /** @copydoc DBGGuiSetMenu */
|
---|
66 | DECLCALLBACKMEMBER(void, pfnSetMenu)(PDBGGUI pGui, void *pvMenu);
|
---|
67 | /** The end version. (DBGGUIVT_VERSION) */
|
---|
68 | uint32_t u32EndVersion;
|
---|
69 | } DBGGUIVT;
|
---|
70 | /** Pointer to the virtual method table for the debugger GUI. */
|
---|
71 | typedef DBGGUIVT const *PCDBGGUIVT;
|
---|
72 | /** The u32Version value.
|
---|
73 | * The first byte is the minor version, the 2nd byte is major version number.
|
---|
74 | * The high 16-bit word is a magic. */
|
---|
75 | #define DBGGUIVT_VERSION UINT32_C(0xbead0100)
|
---|
76 | /** Macro for determining whether two versions are compatible or not.
|
---|
77 | * @returns boolean result.
|
---|
78 | * @param uVer1 The first version number.
|
---|
79 | * @param uVer2 The second version number.
|
---|
80 | */
|
---|
81 | #define DBGGUIVT_ARE_VERSIONS_COMPATIBLE(uVer1, uVer2) \
|
---|
82 | ( ((uVer1) & UINT32_C(0xffffff00)) == ((uVer2) & UINT32_C(0xffffff00)) )
|
---|
83 |
|
---|
84 |
|
---|
85 | /**
|
---|
86 | * Creates the debugger GUI.
|
---|
87 | *
|
---|
88 | * @returns VBox status code.
|
---|
89 | * @param pSession The VirtualBox session.
|
---|
90 | * @param ppGui Where to store the pointer to the debugger instance.
|
---|
91 | * @param ppGuiVT Where to store the virtual method table pointer.
|
---|
92 | * Optional.
|
---|
93 | */
|
---|
94 | DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
95 | /** @copydoc DBGGuiCreate. */
|
---|
96 | typedef DECLCALLBACK(int) FNDBGGUICREATE(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
97 | /** Pointer to DBGGuiCreate. */
|
---|
98 | typedef FNDBGGUICREATE *PFNDBGGUICREATE;
|
---|
99 |
|
---|
100 | /**
|
---|
101 | * Creates the debugger GUI given a VM handle.
|
---|
102 | *
|
---|
103 | * @returns VBox status code.
|
---|
104 | * @param pVM The VM handle.
|
---|
105 | * @param ppGui Where to store the pointer to the debugger instance.
|
---|
106 | * @param ppGuiVT Where to store the virtual method table pointer.
|
---|
107 | * Optional.
|
---|
108 | */
|
---|
109 | DBGDECL(int) DBGGuiCreateForVM(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
110 | /** @copydoc DBGGuiCreateForVM. */
|
---|
111 | typedef DECLCALLBACK(int) FNDBGGUICREATEFORVM(PVM pVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
112 | /** Pointer to DBGGuiCreateForVM. */
|
---|
113 | typedef FNDBGGUICREATEFORVM *PFNDBGGUICREATEFORVM;
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * Destroys the debugger GUI.
|
---|
117 | *
|
---|
118 | * @returns VBox status code.
|
---|
119 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
120 | */
|
---|
121 | DBGDECL(int) DBGGuiDestroy(PDBGGUI pGui);
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * Notifies the debugger GUI that the console window (or whatever) has changed
|
---|
125 | * size or position.
|
---|
126 | *
|
---|
127 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
128 | * @param x The x-coordinate of the window the debugger is relative to.
|
---|
129 | * @param y The y-coordinate of the window the debugger is relative to.
|
---|
130 | * @param cx The width of the window the debugger is relative to.
|
---|
131 | * @param cy The height of the window the debugger is relative to.
|
---|
132 | */
|
---|
133 | DBGDECL(void) DBGGuiAdjustRelativePos(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * Shows the default statistics window.
|
---|
137 | *
|
---|
138 | * @returns VBox status code.
|
---|
139 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
140 | */
|
---|
141 | DBGDECL(int) DBGGuiShowStatistics(PDBGGUI pGui);
|
---|
142 |
|
---|
143 | /**
|
---|
144 | * Shows the default command line window.
|
---|
145 | *
|
---|
146 | * @returns VBox status code.
|
---|
147 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
148 | */
|
---|
149 | DBGDECL(int) DBGGuiShowCommandLine(PDBGGUI pGui);
|
---|
150 |
|
---|
151 | /**
|
---|
152 | * Sets the parent windows.
|
---|
153 | *
|
---|
154 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
155 | * @param pvParent Pointer to a QWidget object.
|
---|
156 | *
|
---|
157 | * @remarks This will no affect any existing windows, so call it right after
|
---|
158 | * creating the thing.
|
---|
159 | */
|
---|
160 | DBGDECL(void) DBGGuiSetParent(PDBGGUI pGui, void *pvParent);
|
---|
161 |
|
---|
162 | /**
|
---|
163 | * Sets the debug menu object.
|
---|
164 | *
|
---|
165 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
166 | * @param pvMenu Pointer to a QMenu object.
|
---|
167 | *
|
---|
168 | * @remarks Call right after creation or risk losing menu item.
|
---|
169 | */
|
---|
170 | DBGDECL(void) DBGGuiSetMenu(PDBGGUI pGui, void *pvMenu);
|
---|
171 |
|
---|
172 | /** @} */
|
---|
173 |
|
---|
174 | RT_C_DECLS_END
|
---|
175 |
|
---|
176 | #endif
|
---|
177 |
|
---|