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