VBoxManageDebugVM.cpp revision 04b02ffb8824a60fd37777bc1f7d2f35104a274c
/* $Id$ */
/** @file
* VBoxManage - Implementation of the debugvm command.
*/
/*
* Copyright (C) 2010 Oracle Corporation
*
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxManage.h"
/**
* Handles the info sub-command.
*
* @returns Suitable exit code.
* @param a The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
CHECK_ERROR2_RET(pDebugger, Info(bstrName.raw(), bstrArgs.raw(), bstrInfo.asOutParam()), RTEXITCODE_FAILURE);
return RTEXITCODE_SUCCESS;
}
/**
* Handles the inject sub-command.
*
* @returns Suitable exit code.
* @param a The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
if (a->argc != 2)
return RTEXITCODE_SUCCESS;
}
/**
* Handles the inject sub-command.
*
* @returns Suitable exit code.
* @param pArgs The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
/*
* Parse arguments.
*/
const char *pszFilename = NULL;
const char *pszCompression = NULL;
static const RTGETOPTDEF s_aOptions[] =
{
};
int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, 0 /*fFlags*/);
{
switch (rc)
{
case 'c':
if (pszCompression)
break;
case 'f':
if (pszFilename)
break;
default:
}
}
if (!pszFilename)
/*
* Make the filename absolute before handing it on to the API.
*/
char szAbsFilename[RTPATH_MAX];
if (RT_FAILURE(rc))
CHECK_ERROR2_RET(pDebugger, DumpGuestCore(bstrFilename.raw(), bstrCompression.raw()), RTEXITCODE_FAILURE);
return RTEXITCODE_SUCCESS;
}
/**
* Handles the os sub-command.
*
* @returns Suitable exit code.
* @param a The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
if (a->argc != 2)
return RTEXITCODE_SUCCESS;
}
/**
* Handles the os sub-command.
*
* @returns Suitable exit code.
* @param a The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
if (a->argc != 2)
return RTEXITCODE_SUCCESS;
}
/**
* Handles the statistics sub-command.
*
* @returns Suitable exit code.
* @param pArgs The handler arguments.
* @param pDebugger Pointer to the debugger interface.
*/
{
/*
* Parse arguments.
*/
bool fWithDescriptions = false;
bool fReset = false;
static const RTGETOPTDEF s_aOptions[] =
{
};
int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, 0 /*fFlags*/);
{
switch (rc)
{
case 'd':
fWithDescriptions = true;
break;
case 'p':
if (pszPattern)
break;
case 'r':
fReset = true;
break;
default:
}
}
if (fReset && fWithDescriptions)
/*
* Execute the order.
*/
if (fReset)
else
{
/* if (fFormatted)
{ big mess }
else
*/
}
return RTEXITCODE_SUCCESS;
}
{
/*
* The first argument is the VM name or UUID. Open a session to it.
*/
CHECK_ERROR2_RET(pArgs->virtualBox, FindMachine(com::Bstr(pArgs->argv[0]).raw(), ptrMachine.asOutParam()), RTEXITCODE_FAILURE);
/*
* Get the associated console and machine debugger.
*/
{
{
/*
* String switch on the sub-command.
*/
else
}
}
return rcExit;
}