1 | /** @file
|
---|
2 | * DBGGUI - The VirtualBox Debugger GUI. (VBoxDbg)
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2013 Oracle Corporation
|
---|
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 |
|
---|
26 | #ifndef ___VBox_dbggui_h
|
---|
27 | #define ___VBox_dbggui_h
|
---|
28 |
|
---|
29 | #include <VBox/types.h>
|
---|
30 |
|
---|
31 |
|
---|
32 | RT_C_DECLS_BEGIN
|
---|
33 |
|
---|
34 | /** @defgroup grp_dbggui VirtualBox Debugger GUI
|
---|
35 | * @{
|
---|
36 | */
|
---|
37 |
|
---|
38 | /** Pointer to the debugger GUI instance structure. */
|
---|
39 | typedef struct DBGGUI *PDBGGUI;
|
---|
40 |
|
---|
41 | /** Virtual method table for the debugger GUI. */
|
---|
42 | typedef struct DBGGUIVT
|
---|
43 | {
|
---|
44 | /** The version. (DBGGUIVT_VERSION) */
|
---|
45 | uint32_t u32Version;
|
---|
46 | /** @copydoc DBGGuiDestroy */
|
---|
47 | DECLCALLBACKMEMBER(int, pfnDestroy)(PDBGGUI pGui);
|
---|
48 | /** @copydoc DBGGuiAdjustRelativePos */
|
---|
49 | DECLCALLBACKMEMBER(void, pfnAdjustRelativePos)(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
|
---|
50 | /** @copydoc DBGGuiShowStatistics */
|
---|
51 | DECLCALLBACKMEMBER(int, pfnShowStatistics)(PDBGGUI pGui);
|
---|
52 | /** @copydoc DBGGuiShowCommandLine */
|
---|
53 | DECLCALLBACKMEMBER(int, pfnShowCommandLine)(PDBGGUI pGui);
|
---|
54 | /** @copydoc DBGGuiSetParent */
|
---|
55 | DECLCALLBACKMEMBER(void, pfnSetParent)(PDBGGUI pGui, void *pvParent);
|
---|
56 | /** @copydoc DBGGuiSetMenu */
|
---|
57 | DECLCALLBACKMEMBER(void, pfnSetMenu)(PDBGGUI pGui, void *pvMenu);
|
---|
58 | /** The end version. (DBGGUIVT_VERSION) */
|
---|
59 | uint32_t u32EndVersion;
|
---|
60 | } DBGGUIVT;
|
---|
61 | /** Pointer to the virtual method table for the debugger GUI. */
|
---|
62 | typedef DBGGUIVT const *PCDBGGUIVT;
|
---|
63 | /** The u32Version value.
|
---|
64 | * The first byte is the minor version, the 2nd byte is major version number.
|
---|
65 | * The high 16-bit word is a magic. */
|
---|
66 | #define DBGGUIVT_VERSION UINT32_C(0xbead0100)
|
---|
67 | /** Macro for determining whether two versions are compatible or not.
|
---|
68 | * @returns boolean result.
|
---|
69 | * @param uVer1 The first version number.
|
---|
70 | * @param uVer2 The second version number.
|
---|
71 | */
|
---|
72 | #define DBGGUIVT_ARE_VERSIONS_COMPATIBLE(uVer1, uVer2) \
|
---|
73 | ( ((uVer1) & UINT32_C(0xffffff00)) == ((uVer2) & UINT32_C(0xffffff00)) )
|
---|
74 |
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * Creates the debugger GUI.
|
---|
78 | *
|
---|
79 | * @returns VBox status code.
|
---|
80 | * @param pSession The VirtualBox session.
|
---|
81 | * @param ppGui Where to store the pointer to the debugger instance.
|
---|
82 | * @param ppGuiVT Where to store the virtual method table pointer.
|
---|
83 | * Optional.
|
---|
84 | */
|
---|
85 | DBGDECL(int) DBGGuiCreate(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
86 | /** @copydoc DBGGuiCreate. */
|
---|
87 | typedef DECLCALLBACK(int) FNDBGGUICREATE(ISession *pSession, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
88 | /** Pointer to DBGGuiCreate. */
|
---|
89 | typedef FNDBGGUICREATE *PFNDBGGUICREATE;
|
---|
90 |
|
---|
91 | /**
|
---|
92 | * Creates the debugger GUI given a VM handle.
|
---|
93 | *
|
---|
94 | * @returns VBox status code.
|
---|
95 | * @param pUVM The VM handle.
|
---|
96 | * @param ppGui Where to store the pointer to the debugger instance.
|
---|
97 | * @param ppGuiVT Where to store the virtual method table pointer.
|
---|
98 | * Optional.
|
---|
99 | */
|
---|
100 | DBGDECL(int) DBGGuiCreateForVM(PUVM pUVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
101 | /** @copydoc DBGGuiCreateForVM. */
|
---|
102 | typedef DECLCALLBACK(int) FNDBGGUICREATEFORVM(PUVM pUVM, PDBGGUI *ppGui, PCDBGGUIVT *ppGuiVT);
|
---|
103 | /** Pointer to DBGGuiCreateForVM. */
|
---|
104 | typedef FNDBGGUICREATEFORVM *PFNDBGGUICREATEFORVM;
|
---|
105 |
|
---|
106 | /**
|
---|
107 | * Destroys the debugger GUI.
|
---|
108 | *
|
---|
109 | * @returns VBox status code.
|
---|
110 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
111 | */
|
---|
112 | DBGDECL(int) DBGGuiDestroy(PDBGGUI pGui);
|
---|
113 |
|
---|
114 | /**
|
---|
115 | * Notifies the debugger GUI that the console window (or whatever) has changed
|
---|
116 | * size or position.
|
---|
117 | *
|
---|
118 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
119 | * @param x The x-coordinate of the window the debugger is relative to.
|
---|
120 | * @param y The y-coordinate of the window the debugger is relative to.
|
---|
121 | * @param cx The width of the window the debugger is relative to.
|
---|
122 | * @param cy The height of the window the debugger is relative to.
|
---|
123 | */
|
---|
124 | DBGDECL(void) DBGGuiAdjustRelativePos(PDBGGUI pGui, int x, int y, unsigned cx, unsigned cy);
|
---|
125 |
|
---|
126 | /**
|
---|
127 | * Shows the default statistics window.
|
---|
128 | *
|
---|
129 | * @returns VBox status code.
|
---|
130 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
131 | */
|
---|
132 | DBGDECL(int) DBGGuiShowStatistics(PDBGGUI pGui);
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * Shows the default command line window.
|
---|
136 | *
|
---|
137 | * @returns VBox status code.
|
---|
138 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
139 | */
|
---|
140 | DBGDECL(int) DBGGuiShowCommandLine(PDBGGUI pGui);
|
---|
141 |
|
---|
142 | /**
|
---|
143 | * Sets the parent windows.
|
---|
144 | *
|
---|
145 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
146 | * @param pvParent Pointer to a QWidget object.
|
---|
147 | *
|
---|
148 | * @remarks This will no affect any existing windows, so call it right after
|
---|
149 | * creating the thing.
|
---|
150 | */
|
---|
151 | DBGDECL(void) DBGGuiSetParent(PDBGGUI pGui, void *pvParent);
|
---|
152 |
|
---|
153 | /**
|
---|
154 | * Sets the debug menu object.
|
---|
155 | *
|
---|
156 | * @param pGui The instance returned by DBGGuiCreate().
|
---|
157 | * @param pvMenu Pointer to a QMenu object.
|
---|
158 | *
|
---|
159 | * @remarks Call right after creation or risk losing menu item.
|
---|
160 | */
|
---|
161 | DBGDECL(void) DBGGuiSetMenu(PDBGGUI pGui, void *pvMenu);
|
---|
162 |
|
---|
163 | /** @} */
|
---|
164 |
|
---|
165 | RT_C_DECLS_END
|
---|
166 |
|
---|
167 | #endif
|
---|
168 |
|
---|