DBGCCommands.cpp revision 60c09b27d103d1f742cbd8a2fae8a254cba386a6
/* $Id$ */
/** @file
* DBGC - Debugger Console, Native Commands.
*/
/*
* Copyright (C) 2006-2012 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 *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <stdlib.h>
#include <stdio.h>
#include "DBGCInternal.h"
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** One argument of any kind. */
static const DBGCVARDESC g_aArgAny[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** Multiple string arguments (min 1). */
static const DBGCVARDESC g_aArgMultiStr[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** Filename string. */
static const DBGCVARDESC g_aArgFilename[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** 'cpu' arguments. */
static const DBGCVARDESC g_aArgCpu[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** 'help' arguments. */
static const DBGCVARDESC g_aArgHelp[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** 'info' arguments. */
static const DBGCVARDESC g_aArgInfo[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** loadimage arguments. */
static const DBGCVARDESC g_aArgLoadImage[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** loadmap arguments. */
static const DBGCVARDESC g_aArgLoadMap[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
{ 0, 1, DBGCVAR_CAT_STRING, DBGCVD_FLAGS_DEP_PREV, "name", "The module name. Empty string means default. (optional)" },
{ 0, 1, DBGCVAR_CAT_NUMBER, DBGCVD_FLAGS_DEP_PREV, "subtrahend", "Value to subtract from the addresses in the map file to rebase it correctly to address. (optional)" },
{ 0, 1, DBGCVAR_CAT_NUMBER, DBGCVD_FLAGS_DEP_PREV, "seg", "The module segment number (0-based). (optional)" },
};
/** loadseg arguments. */
static const DBGCVARDESC g_aArgLoadSeg[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
{ 0, 1, DBGCVAR_CAT_STRING, DBGCVD_FLAGS_DEP_PREV, "name", "The module name. Empty string means default. (optional)" },
};
/** loadsyms arguments. */
static const DBGCVARDESC g_aArgLoadSyms[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
{ 0, 1, DBGCVAR_CAT_POINTER, DBGCVD_FLAGS_DEP_PREV, "module address", "Module address. (optional)" },
};
/** log arguments. */
static const DBGCVARDESC g_aArgLog[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** logdest arguments. */
static const DBGCVARDESC g_aArgLogDest[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** logflags arguments. */
static const DBGCVARDESC g_aArgLogFlags[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** loadplugin, unloadplugin. */
static const DBGCVARDESC g_aArgPlugIn[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** 'set' arguments */
static const DBGCVARDESC g_aArgSet[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** 'unset' arguments */
static const DBGCVARDESC g_aArgUnset[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** writecore arguments. */
static const DBGCVARDESC g_aArgWriteCore[] =
{
/* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */
};
/** Command descriptors for the basic commands. */
const DBGCCMD g_aDbgcCmds[] =
{
/* pszCmd, cArgsMin, cArgsMax, paArgDescs, cArgDescs, fFlags, pfnHandler pszSyntax, ....pszDescription */
{ "cpu", 0, 1, &g_aArgCpu[0], RT_ELEMENTS(g_aArgCpu), 0, dbgcCmdCpu, "[idCpu]", "If no argument, display the current CPU, else change to the specified CPU." },
{ "echo", 1, ~0U, &g_aArgMultiStr[0], RT_ELEMENTS(g_aArgMultiStr), 0, dbgcCmdEcho, "<str1> [str2..[strN]]", "Displays the strings separated by one blank space and the last one followed by a newline." },
{ "format", 1, 1, &g_aArgAny[0], RT_ELEMENTS(g_aArgAny), 0, dbgcCmdFormat, "", "Evaluates an expression and formats it." },
{ "detect", 0, 0, NULL, 0, 0, dbgcCmdDetect, "", "Detects or re-detects the guest os and starts the OS specific digger." },
{ "help", 0, ~0U, &g_aArgHelp[0], RT_ELEMENTS(g_aArgHelp), 0, dbgcCmdHelp, "[cmd/op [..]]", "Display help. For help about info items try 'info help'." },
{ "info", 1, 2, &g_aArgInfo[0], RT_ELEMENTS(g_aArgInfo), 0, dbgcCmdInfo, "<info> [args]", "Display info register in the DBGF. For a list of info items try 'info help'." },
{ "loadimage", 2, 3, &g_aArgLoadImage[0], RT_ELEMENTS(g_aArgLoadImage), 0, dbgcCmdLoadImage, "<filename> <address> [name]",
"Loads the symbols of an executable image at the specified address. "
/*"Optionally giving the module a name other than the file name stem."*/ }, /** @todo implement line breaks */
{ "loadmap", 2, 5, &g_aArgLoadMap[0], RT_ELEMENTS(g_aArgLoadMap), 0, dbgcCmdLoadMap, "<filename> <address> [name] [subtrahend] [seg]",
"Loads the symbols from a map file, usually at a specified address. "
/*"Optionally giving the module a name other than the file name stem "
"and a subtrahend to subtract from the addresses."*/ },
{ "loadplugin", 1, 1, &g_aArgPlugIn[0], RT_ELEMENTS(g_aArgPlugIn), 0, dbgcCmdLoadPlugIn,"<plugin1> [plugin2..N]", "Loads one or more plugins" },
{ "loadseg", 3, 4, &g_aArgLoadSeg[0], RT_ELEMENTS(g_aArgLoadSeg), 0, dbgcCmdLoadSeg, "<filename> <address> <seg> [name]",
"Loads the symbols of a segment in the executable image at the specified address. "
/*"Optionally giving the module a name other than the file name stem."*/ },
{ "loadsyms", 1, 5, &g_aArgLoadSyms[0], RT_ELEMENTS(g_aArgLoadSyms), 0, dbgcCmdLoadSyms, "<filename> [delta] [module] [module address]", "Loads symbols from a text file. Optionally giving a delta and a module." },
{ "loadvars", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdLoadVars, "<filename>", "Load variables from file. One per line, same as the args to the set command." },
{ "log", 1, 1, &g_aArgLog[0], RT_ELEMENTS(g_aArgLog), 0, dbgcCmdLog, "<group string>", "Modifies the logging group settings (VBOX_LOG)" },
{ "logdest", 1, 1, &g_aArgLogDest[0], RT_ELEMENTS(g_aArgLogDest), 0, dbgcCmdLogDest, "<dest string>", "Modifies the logging destination (VBOX_LOG_DEST)." },
{ "logflags", 1, 1, &g_aArgLogFlags[0], RT_ELEMENTS(g_aArgLogFlags), 0, dbgcCmdLogFlags, "<flags string>", "Modifies the logging flags (VBOX_LOG_FLAGS)." },
{ "runscript", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdRunScript, "<filename>", "Runs the command listed in the script. Lines starting with '#' "
"(after removing blanks) are comment. blank lines are ignored. Stops on failure." },
{ "set", 2, 2, &g_aArgSet[0], RT_ELEMENTS(g_aArgSet), 0, dbgcCmdSet, "<var> <value>", "Sets a global variable." },
{ "unloadplugin", 1, ~0U, &g_aArgPlugIn[0], RT_ELEMENTS(g_aArgPlugIn), 0, dbgcCmdUnloadPlugIn, "<plugin1> [plugin2..N]", "Unloads one or more plugins." },
{ "unset", 1, ~0U, &g_aArgUnset[0], RT_ELEMENTS(g_aArgUnset), 0, dbgcCmdUnset, "<var1> [var1..[varN]]", "Unsets (delete) one or more global variables." },
{ "writecore", 1, 1, &g_aArgWriteCore[0], RT_ELEMENTS(g_aArgWriteCore), 0, dbgcCmdWriteCore, "<filename>", "Write core to file." },
};
/** The number of native commands. */
/** Pointer to head of the list of external commands. */
static PDBGCEXTCMDS g_pExtCmdsHead;
/**
* Finds a routine.
*
* @returns Pointer to the command descriptor.
* If the request was for an external command, the caller is responsible for
* unlocking the external command list.
* @returns NULL if not found.
* @param pDbgc The debug console instance.
* @param pachName Pointer to the routine string (not terminated).
* @param cchName Length of the routine name.
* @param fExternal Whether or not the routine is external.
*/
{
if (!fExternal)
{
/* emulation first, so commands can be overloaded (info ++). */
while (cLeft-- > 0)
{
return pCmd;
pCmd++;
}
{
return &g_aDbgcCmds[iCmd];
}
}
else
{
{
{
}
}
}
return NULL;
}
/**
* Register one or more external commands.
*
* @returns VBox status.
* @param paCommands Pointer to an array of command descriptors.
* The commands must be unique. It's not possible
* to register the same commands more than once.
* @param cCommands Number of commands.
*/
{
/*
* Lock the list.
*/
while (pCur)
{
{
return VWRN_DBGC_ALREADY_REGISTERED;
}
}
/*
* Allocate new chunk.
*/
int rc = 0;
if (pCur)
{
}
else
rc = VERR_NO_MEMORY;
return rc;
}
/**
* Deregister one or more external commands previously registered by
* DBGCRegisterCommands().
*
* @returns VBox status.
* @param paCommands Pointer to an array of command descriptors
* as given to DBGCRegisterCommands().
* @param cCommands Number of commands.
*/
{
/*
* Lock the list.
*/
while (pCur)
{
{
if (pPrev)
else
return VINF_SUCCESS;
}
}
}
/**
* Prints full command help.
*/
{
int rc;
/* the command */
"%s%-*s %-30s %s",
else
/* argument descriptions. */
{
" %-12s %s",
{
else
}
else
{
else
rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, " <%u-%u>\n", pCmd->paArgDescs[i].cTimesMin, pCmd->paArgDescs[i].cTimesMax);
}
}
return rc;
}
/**
* The 'help' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
int rc = VINF_SUCCESS;
unsigned i;
/** @todo rewrite this. */
if (!cArgs)
{
/*
* All the stuff.
*/
"VirtualBox Debugger\n"
"-------------------\n"
"\n"
"Commands:\n");
for (i = 0; i < RT_ELEMENTS(g_aDbgcCmds); i++)
"%-11s %-30s %s\n",
g_aDbgcCmds[i].pszCmd,
g_aDbgcCmds[i].pszSyntax,
"\n"
"%-11s %-30s %s\n",
if (g_pExtCmdsHead)
{
"\n"
"External Commands:\n");
".%-10s %-30s %s\n",
}
"\n"
"Operators:\n");
unsigned iPrecedence = 0;
unsigned cLeft = g_cDbgcOps;
while (cLeft > 0)
{
for (i = 0; i < g_cDbgcOps; i++)
{
"%-10s %s %s\n",
g_aDbgcOps[i].szName,
g_aDbgcOps[i].pszDescription);
cLeft--;
}
iPrecedence++;
}
}
else
{
/*
* Search for the arguments (strings).
*/
{
bool fFound = false;
/* lookup in the emulation command list first */
for (i = 0; i < pDbgc->cEmulationCmds; i++)
{
fFound = true;
}
/* lookup in the command list (even when found in the emulation) */
for (i = 0; i < RT_ELEMENTS(g_aDbgcCmds); i++)
{
fFound = true;
}
/* external commands */
if ( !fFound
&& ( *pszPattern == '.'
|| *pszPattern == '?'
|| *pszPattern == '*'))
{
{
fFound = true;
}
}
/* operators */
{
for (i = 0; i < g_cDbgcOps; i++)
{
"%-10s %s %s\n",
g_aDbgcOps[i].szName,
g_aDbgcOps[i].pszDescription);
fFound = true;
}
}
/* found? */
if (!fFound)
"error: '%s' was not found!\n",
} /* foreach argument */
}
return rc;
}
/**
* The 'quit', 'exit' and 'bye' commands.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
return VERR_DBGC_QUIT;
}
/**
* The 'stop' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Check if the VM is halted or not before trying to halt it.
*/
int rc;
if (DBGFR3IsHalted(pVM))
else
{
if (RT_SUCCESS(rc))
else
}
return rc;
}
/**
* The 'echo' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Loop thru the arguments and print them with one space between.
*/
int rc = 0;
for (unsigned i = 0; i < cArgs; i++)
{
if (RT_FAILURE(rc))
return rc;
}
}
/**
* The 'runscript' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/* check that the parser did what it's supposed to do. */
if ( cArgs != 1
/** @todo Load the script here, but someone else should do the actual
* evaluation and execution of it. */
/*
* Try open the script.
*/
if (!pFile)
/*
* Execute it line by line.
*/
int rc = 0;
unsigned iLine = 0;
char szLine[8192];
{
/* check that the line isn't too long. */
{
break;
}
iLine++;
/* strip leading blanks and check for comment / blank line. */
if ( *psz == '\0'
|| *psz == '\n'
|| *psz == '#')
continue;
/* strip trailing blanks and check for empty line (\r case). */
*--pszEnd = '\0';
/** @todo check for Control-C / Cancel at this point... */
/*
* Execute the command.
*
* This is a bit wasteful with scratch space btw., can fix it later.
* The whole return code crap should be fixed too, so that it's possible
* to know whether a command succeeded (RT_SUCCESS()) or failed, and
* more importantly why it failed.
*/
if (RT_FAILURE(rc))
{
if (rc == VERR_BUFFER_OVERFLOW)
rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: Line #%u is too long (exec overflowed)\n", iLine);
break;
}
if (rc == VWRN_DBGC_CMD_PENDING)
{
rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: VWRN_DBGC_CMD_PENDING on line #%u, script terminated\n", iLine);
break;
}
}
return rc;
}
/**
* The 'detect' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/* check that the parser did what it's supposed to do. */
if (cArgs != 0)
/*
* Perform the detection.
*/
char szName[64];
if (RT_FAILURE(rc))
if (rc == VINF_SUCCESS)
{
char szVersion[512];
if (RT_SUCCESS(rc2))
}
else
return rc;
}
/**
* The 'cpu' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/* check that the parser did what it's supposed to do. */
if ( cArgs != 0
&& ( cArgs != 1
if (!pVM)
int rc;
if (!cArgs)
else
{
/** @todo add a DBGF getter for this. */
else
{
}
}
return rc;
}
/**
* The 'info' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Validate input.
*/
if ( cArgs < 1
|| cArgs > 2
return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. quote the string.\n");
if (!pVM)
/*
* Dump it.
*/
if (RT_FAILURE(rc))
return 0;
}
/**
* The 'log' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pVM, paArgs[0].u.pszString);
}
/**
* The 'logdest' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pVM, paArgs[0].u.pszString);
}
/**
* The 'logflags' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pVM, paArgs[0].u.pszString);
}
/**
* The 'format' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
LogFlow(("dbgcCmdFormat\n"));
static const char *apszRangeDesc[] =
{
"none", "bytes", "elements"
};
int rc;
{
{
case DBGCVAR_TYPE_UNKNOWN:
"Unknown variable type!\n");
break;
case DBGCVAR_TYPE_GC_FLAT:
"Guest flat address: %%%08x range %lld %s\n",
else
"Guest flat address: %%%08x\n",
break;
case DBGCVAR_TYPE_GC_FAR:
"Guest far address: %04x:%08x range %lld %s\n",
else
"Guest far address: %04x:%08x\n",
break;
case DBGCVAR_TYPE_GC_PHYS:
"Guest physical address: %%%%%08x range %lld %s\n",
else
"Guest physical address: %%%%%08x\n",
break;
case DBGCVAR_TYPE_HC_FLAT:
"Host flat address: %%%08x range %lld %s\n",
else
"Host flat address: %%%08x\n",
break;
case DBGCVAR_TYPE_HC_PHYS:
"Host physical address: %RHp range %lld %s\n",
else
"Host physical address: %RHp\n",
break;
case DBGCVAR_TYPE_STRING:
"String, %lld bytes long: %s\n",
break;
case DBGCVAR_TYPE_SYMBOL:
"Symbol, %lld bytes long: %s\n",
break;
case DBGCVAR_TYPE_NUMBER:
"Number: hex %llx dec 0i%lld oct 0t%llo range %lld %s\n",
else
"Number: hex %llx dec 0i%lld oct 0t%llo\n",
break;
default:
"Invalid argument type %d\n",
break;
}
} /* arg loop */
return 0;
}
/**
* The 'loadimage' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Validate the parsing and make sense of the input.
* This is a mess as usual because we don't trust the parser yet.
*/
&& cArgs <= 3
if (RT_FAILURE(rc))
const char *pszModName = NULL;
if (cArgs >= 3)
{
}
/*
* Try create a module for it.
*/
rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);
if (RT_FAILURE(rc))
return VINF_SUCCESS;
}
/**
* The 'loadmap' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Validate the parsing and make sense of the input.
* This is a mess as usual because we don't trust the parser yet.
*/
&& cArgs <= 5
if (RT_FAILURE(rc))
const char *pszModName = NULL;
if (cArgs >= 3)
{
}
RTGCUINTPTR uSubtrahend = 0;
if (cArgs >= 4)
{
}
if (cArgs >= 5)
{
|| iModSeg > RTDBGSEGIDX_LAST)
return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
}
/*
* Try create a module for it.
*/
rc = DBGFR3AsLoadMap(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);
if (RT_FAILURE(rc))
return VINF_SUCCESS;
}
/**
* The 'loadseg' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Validate the parsing and make sense of the input.
* This is a mess as usual because we don't trust the parser yet.
*/
&& cArgs <= 4
if (RT_FAILURE(rc))
|| iModSeg > RTDBGSEGIDX_LAST)
return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
const char *pszModName = NULL;
if (cArgs >= 4)
{
}
/*
* Call the debug info manager about this loading.
*/
rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);
if (RT_FAILURE(rc))
return VINF_SUCCESS;
}
/**
* The 'loadsyms' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Validate the parsing and make sense of the input.
* This is a mess as usual because we don't trust the parser yet.
*/
if ( cArgs < 1
{
AssertMsgFailed(("Parse error, first argument required to be string!\n"));
}
RTGCUINTPTR Delta = 0;
RTGCUINTPTR ModuleAddress = 0;
unsigned cbModule = 0;
if (cArgs > 1)
{
unsigned iArg = 1;
{
iArg++;
}
{
{
AssertMsgFailed(("Parse error, module argument required to be string!\n"));
}
iArg++;
{
{
AssertMsgFailed(("Parse error, module argument required to be GC pointer!\n"));
}
if (RT_FAILURE(rc))
iArg++;
{
{
AssertMsgFailed(("Parse error, module argument required to be an integer!\n"));
}
iArg++;
{
AssertMsgFailed(("Parse error, too many arguments!\n"));
}
}
}
}
}
/*
* Call the debug info manager about this loading...
*/
if (RT_FAILURE(rc))
return VINF_SUCCESS;
}
/**
* The 'set' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/* parse sanity check. */
AssertMsg(paArgs[0].enmType == DBGCVAR_TYPE_STRING, ("expected string not %d as first arg!\n", paArgs[0].enmType));
/*
* A variable must start with an alpha chars and only contain alpha numerical chars.
*/
"syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", paArgs[0].u.pszString);
*pszVar++;
if (*pszVar)
"syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", paArgs[0].u.pszString);
/*
* Calc variable size.
*/
/*
* Look for existing one.
*/
{
{
/*
* Update existing variable.
*/
if (!pv)
return VERR_DBGC_PARSE_NO_MEMORY;
pVar->Var.u.pszString = (char *)memcpy(&pVar->szName[paArgs[0].u64Range + 1], paArgs[1].u.pszString, (size_t)paArgs[1].u64Range + 1);
return 0;
}
}
/*
* Allocate another.
*/
pVar->Var.u.pszString = (char *)memcpy(&pVar->szName[paArgs[0].u64Range + 1], paArgs[1].u.pszString, (size_t)paArgs[1].u64Range + 1);
/* need to reallocate the pointer array too? */
{
if (!pv)
{
return VERR_DBGC_PARSE_NO_MEMORY;
}
}
return 0;
}
/**
* The 'unset' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
for (unsigned i = 0; i < cArgs; i++)
/*
* Iterate the variables and unset them.
*/
{
/*
* Look up the variable.
*/
{
{
/*
* Shuffle the array removing this entry.
*/
}
} /* lookup */
} /* arg loop */
return 0;
}
/**
* The 'loadvars' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Don't trust the parser.
*/
if ( cArgs != 1
{
AssertMsgFailed(("Expected one string exactly!\n"));
}
/*
* Iterate the variables and unset them.
*/
if (pFile)
{
char szLine[4096];
{
/* Strip it. */
while (RT_C_IS_BLANK(*psz))
psz++;
while (i >= 0 && RT_C_IS_SPACE(psz[i]))
psz[i--] ='\0';
/* Execute it if not comment or empty line. */
if ( *psz != '\0'
&& *psz != '#'
&& *psz != ';')
{
}
}
}
else
return 0;
}
/**
* The 'showvars' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
{
if (!rc)
if (rc)
return rc;
}
return 0;
}
/**
* Extracts the plugin name from a plugin specifier that may or may not include
*
* @returns VBox status code.
*
* @param pszDst Where to return the name. At least DBGCPLUGIN_MAX_NAME
* worth of buffer space.
* @param pszPlugIn The plugin specifier to parse.
*/
{
/*
* Parse out the name stopping at the extension.
*/
return VERR_INVALID_NAME;
{
if (!*pszName)
return VERR_INVALID_NAME;
}
int ch;
&& ch != '.')
{
if ( !RT_C_IS_ALPHA(ch)
&& ( !RT_C_IS_DIGIT(ch)
|| cchName == 0))
return VERR_INVALID_NAME;
cchName++;
}
if (cchName >= DBGCPLUGIN_MAX_NAME)
return VERR_OUT_OF_RANGE;
/*
* We're very picky about the extension if there is no path.
*/
if ( ch == '.'
&& !RTPathHavePath(pszPlugIn)
return VERR_INVALID_NAME;
/*
* Copy it.
*/
return VINF_SUCCESS;
}
/**
* Locate a plug-in in list.
*
* @returns Pointer to the plug-in tracking structure.
* @param pDbgc Pointer to the DBGC instance data.
* @param pszName The name of the plug-in we're looking for.
* @param ppPrev Where to optionally return the pointer to the
* previous list member.
*/
{
while (pCur)
{
{
if (ppPrev)
return pCur;
}
/* advance */
}
return NULL;
}
/**
* Try load the specified plug-in module.
*
* @returns VINF_SUCCESS on success, path error or loader error on failure.
*
* @param pPlugIn The plugin tracing record.
* @param pszModule Module name.
*/
{
/*
* Load it and try resolve the entry point.
*/
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
}
return rc;
}
/**
* RTPathTraverseList callback.
*
* @returns See FNRTPATHTRAVERSER.
*
* @param pchPath See FNRTPATHTRAVERSER.
* @param cchPath See FNRTPATHTRAVERSER.
* @param pvUser1 The plug-in specifier.
* @param pvUser2 The plug-in tracking record.
*/
static DECLCALLBACK(int) dbgcPlugInLoadCallback(const char *pchPath, size_t cchPath, void *pvUser1, void *pvUser2)
{
/*
* Join the path and the specified plug-in module name, first with the
* prefix and then without it.
*/
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
if (RT_SUCCESS(rc))
return VINF_SUCCESS;
return VERR_TRY_AGAIN;
}
/**
* Loads a plug-in.
*
* @returns VBox status code. If pCmd is specified, it's the return from
* DBGCCmdHlpFail.
* @param pDbgc The DBGC instance data.
* @param pszName The plug-in name.
* @param pszPlugIn The plug-in module name.
* @param pCmd The command pointer if invoked by the user, NULL
* if invoked from elsewhere.
*/
{
/*
* Try load it. If specified with a path, we're assuming the user
* wants to load a plug-in from some specific location. Otherwise
* search for it.
*/
if (!pPlugIn)
return pCmd
int rc;
if (RTPathHavePath(pszPlugIn))
else
{
/* 1. The private architecture directory. */
if (RT_SUCCESS(rc))
if (RT_FAILURE(rc))
{
/* 2. The DBGC PLUGIN_PATH variable. */
if ( RT_SUCCESS(rc2)
rc = RTPathTraverseList(PathVar.u.pszString, ';', dbgcPlugInLoadCallback, (void *)pszPlugIn, pPlugIn);
if (RT_FAILURE_NP(rc))
{
/* 3. The DBGC_PLUGIN_PATH environment variable. */
if (RT_SUCCESS(rc2))
}
}
}
if (RT_FAILURE(rc))
{
return pCmd
: rc;
}
/*
* Try initialize it.
*/
if (RT_FAILURE(rc))
{
return pCmd
? DBGCCmdHlpFail(pCmdHlp, pCmd, "initialization of plug-in '%s' failed with rc=%Rrc\n", pszPlugIn, rc)
: rc;
}
/*
* Link it and we're good.
*/
return VINF_SUCCESS;
}
/**
* Automatically load plug-ins from the architecture private directory of
* VirtualBox.
*
* This is called during console init.
*
* @param pDbgc The DBGC instance data.
*/
{
/*
* Open the architecture specific directory with a filter on our prefix
* and names including a dot.
*/
const char *pszSuff = RTLdrGetSuff();
char szPath[RTPATH_MAX];
if (RT_SUCCESS(rc))
{
/*
* Now read it and try load each of the plug-in modules.
*/
{
if (RT_SUCCESS(rc))
{
char szName[DBGCPLUGIN_MAX_NAME];
if (RT_SUCCESS(rc))
}
}
}
}
/**
* The 'loadplugin' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Loop thru the plugin names.
*/
for (unsigned i = 0; i < cArgs; i++)
{
/* Extract the plug-in name. */
char szName[DBGCPLUGIN_MAX_NAME];
if (RT_FAILURE(rc))
/* Loaded? */
if (pPlugIn)
/* Load it. */
if (RT_FAILURE(rc))
return rc;
}
return VINF_SUCCESS;
}
/**
* Unload all plug-ins.
*
* @param pDbgc The DBGC instance data.
*/
{
while (pDbgc->pPlugInHead)
{
{
}
}
}
/**
* The 'unload' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
/*
* Loop thru the plugin names.
*/
for (unsigned i = 0; i < cArgs; i++)
{
/* Extract the plug-in name. */
char szName[DBGCPLUGIN_MAX_NAME];
if (RT_FAILURE(rc))
/* Loaded? */
if (!pPlugIn)
/*
* Terminate and unload it.
*/
if (pPrevPlugIn)
else
}
return VINF_SUCCESS;
}
/**
* The 'showplugins' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
if (!pPlugIn)
for (;;)
{
if (!pPlugIn)
break;
}
}
/**
* The 'harakiri' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
Log(("dbgcCmdHarakiri\n"));
for (;;)
exit(126);
}
/**
* The 'writecore' command.
*
* @returns VBox status.
* @param pCmd Pointer to the command descriptor (as registered).
* @param pCmdHlp Pointer to command helper functions.
* @param pVM Pointer to the current VM (if any).
* @param paArgs Pointer to (readonly) array of arguments.
* @param cArgs Number of arguments in the array.
*/
static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
{
Log(("dbgcCmdWriteCore\n"));
/*
* Validate input, lots of paranoia here.
*/
if ( cArgs != 1
{
AssertMsgFailed(("Expected one string exactly!\n"));
}
if (!pszDumpPath)
if (RT_FAILURE(rc))
return VINF_SUCCESS;
}
/**
* @callback_method_impl{The randu32() function implementation.}
*/
static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
{
return VINF_SUCCESS;
}