VBoxDbg.cpp revision 696794b62240bc5b7b6456a664b46821d184a8fb
/* $Id$ */
/** @file
* VBox Debugger GUI.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#define VBOX_COM_NO_ATL
#include "VBoxDbgGui.h"
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/**
* Debugger GUI instance data.
*/
typedef struct DBGGUI
{
/** Magic number (DBGGUI_MAGIC). */
/** Pointer to the Debugger GUI manager object. */
} DBGGUI;
/** DBGGUI magic value (Werner Heisenberg). */
#define DBGGUI_MAGIC 0x19011205
/** Invalid DBGGUI magic value. */
#define DBGGUI_MAGIC_DEAD 0x19760201
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** Virtual method table for simplifying dynamic linking. */
static const DBGGUIVT g_dbgGuiVT =
{
};
/**
* Internal worker for DBGGuiCreate and DBGGuiCreateForVM.
*
* @returns VBox status code.
* @param pSession The ISession interface. (DBGGuiCreate)
* @param pVM The VM handle. (DBGGuiCreateForVM)
* @param ppGui See DBGGuiCreate.
* @param ppGuiVT See DBGGuiCreate.
*/
{
/*
* Allocate and initialize the Debugger GUI handle.
*/
if (!pGui)
return VERR_NO_MEMORY;
int rc;
if (pSession)
else
if (VBOX_SUCCESS(rc))
{
/*
* Successfully initialized.
*/
if (ppGuiVT)
*ppGuiVT = &g_dbgGuiVT;
return rc;
}
/*
* Failed, cleanup.
*/
delete pGui->pVBoxDbgGui;
if (ppGuiVT)
return rc;
}
/**
* Creates the debugger GUI.
*
* @returns VBox status code.
* @param pSession The Virtual Box session.
* @param ppGui Where to store the pointer to the debugger instance.
* @param ppGuiVT Where to store the virtual method table pointer.
* Optional.
*/
{
}
/**
* Creates the debugger GUI given a VM handle.
*
* @returns VBox status code.
* @param pVM The VM handle.
* @param ppGui Where to store the pointer to the debugger instance.
* @param ppGuiVT Where to store the virtual method table pointer.
* Optional.
*/
{
}
/**
* Destroys the debugger GUI.
*
* @returns VBox status code.
* @param pGui The instance returned by DBGGuiCreate().
*/
{
/*
* Validate.
*/
if (!pGui)
return VERR_INVALID_PARAMETER;
AssertMsgReturn(pGui->u32Magic == DBGGUI_MAGIC, ("u32Magic=%#x\n", pGui->u32Magic), VERR_INVALID_PARAMETER);
/*
* Do the job.
*/
delete pGui->pVBoxDbgGui;
return VINF_SUCCESS;
}
/**
* Notifies the debugger GUI that the console window (or whatever) has changed
* size or position.
*
* @param pGui The instance returned by DBGGuiCreate().
* @param x The x-coordinate of the window the debugger is relative to.
* @param y The y-coordinate of the window the debugger is relative to.
* @param cx The width of the window the debugger is relative to.
* @param cy The height of the window the debugger is relative to.
*/
{
AssertMsgReturn(pGui->u32Magic == DBGGUI_MAGIC, ("u32Magic=%#x\n", pGui->u32Magic), (void)VERR_INVALID_PARAMETER);
}
/**
* Shows the default statistics window.
*
* @returns VBox status code.
* @param pGui The instance returned by DBGGuiCreate().
*/
{
AssertMsgReturn(pGui->u32Magic == DBGGUI_MAGIC, ("u32Magic=%#x\n", pGui->u32Magic), VERR_INVALID_PARAMETER);
}
/**
* Shows the default command line window.
*
* @returns VBox status code.
* @param pGui The instance returned by DBGGuiCreate().
*/
{
AssertMsgReturn(pGui->u32Magic == DBGGUI_MAGIC, ("u32Magic=%#x\n", pGui->u32Magic), VERR_INVALID_PARAMETER);
}