VirtualBox

Changeset 5666 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 11, 2007 4:25:51 AM (17 years ago)
Author:
vboxsync
Message:

PFNSTRFORMAT should return size_t.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGConsole.cpp

    r5605 r5666  
    227227    /** Pointer to backend callback structure. */
    228228    PDBGCBACK           pBack;
     229
     230    /** Pointer to the current VM. */
     231    PVM                 pVM;
     232    /** The current debugger emulation. */
     233    const char         *pszEmulation;
     234    /** Pointer to the command and functions for the current debugger emulation. */
     235    PCDBGCCMD           paEmulationCmds;
     236    /** The number of commands paEmulationCmds points to. */
     237    unsigned            cEmulationCmds;
    229238    /** Log indicator. (If set we're writing the log to the console.) */
    230239    bool                fLog;
    231     /** Pointer to the current VM. */
    232     PVM                 pVM;
    233     /** Indicates whether or we're ready for input. */
    234     bool                fReady;
    235240
    236241    /** Indicates whether we're in guest (true) or hypervisor (false) register context. */
     
    238243    /** Indicates whether the register are terse or sparse. */
    239244    bool                fRegTerse;
     245
     246    /** Current dissassembler position. */
     247    DBGCVAR             DisasmPos;
     248    /** Current source position. (flat GC) */
     249    DBGCVAR             SourcePos;
     250    /** Current memory dump position. */
     251    DBGCVAR             DumpPos;
     252    /** Size of the previous dump element. */
     253    unsigned            cbDumpElement;
     254
     255    /** Number of variables in papVars. */
     256    unsigned            cVars;
     257    /** Array of global variables.
     258     * Global variables can be referenced using the $ operator and set
     259     * and unset using command with those names. */
     260    PDBGCNAMEDVAR      *papVars;
     261
     262    /** The list of breakpoints. (singly linked) */
     263    PDBGCBP             pFirstBp;
     264
     265    /** @name Parsing and Execution
     266     * @{ */
    240267
    241268    /** Input buffer. */
     
    252279     * This means that input is ignored up to the next newline. */
    253280    bool                fInputOverflow;
     281    /** Indicates whether or we're ready for input. */
     282    bool                fReady;
    254283
    255284    /** Scratch buffer position. */
     
    265294    int                 rcOutput;
    266295
    267     /** Number of variables in papVars. */
    268     unsigned            cVars;
    269     /** Array of global variables.
    270      * Global variables can be referenced using the $ operator and set
    271      * and unset using command with those names. */
    272     PDBGCNAMEDVAR      *papVars;
    273 
    274     /** Current dissassembler position. */
    275     DBGCVAR             DisasmPos;
    276     /** Current source position. (flat GC) */
    277     DBGCVAR             SourcePos;
    278     /** Current memory dump position. */
    279     DBGCVAR             DumpPos;
    280     /** Size of the previous dump element. */
    281     unsigned            cbDumpElement;
    282 
    283     /** The list of breakpoints. (singly linked) */
    284     PDBGCBP             pFirstBp;
     296    /** @} */
    285297} DBGC;
    286298/** Pointer to debugger console instance data. */
     
    421433*   Internal Functions                                                         *
    422434*******************************************************************************/
    423 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    424 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    425 static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    426 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    427 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    428 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    429435static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    430436static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    431437static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    432 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    433438static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    434 static DECLCALLBACK(int) dbgcCmdDisasm(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    435 static DECLCALLBACK(int) dbgcCmdSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    436 static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    437 static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    438 static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    439 static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    440 static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    441439static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    442440static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    443441static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    444 static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    445442static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    446443static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     
    454451static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    455452static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    456 static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    457453static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    458454static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     
    463459static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    464460static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     461
     462static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     463static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     464static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     465static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     466static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     467static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     468static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     469static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     470static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     471static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     472static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     473static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     474static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     475static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     476static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     477static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     478static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    465479
    466480static DECLCALLBACK(int) dbgcOpMinus(PDBGC pDbgc, PCDBGCVAR pArg, PDBGCVAR pResult);
     
    552566
    553567
    554 /** 'ba' arguments. */
    555 static const DBGCVARDESC    g_aArgBrkAcc[] =
    556 {
    557     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    558     {  1,           1,          DBGCVAR_CAT_STRING,     0,                              "access",       "The access type: x=execute, rw=read/write (alias r), w=write, i=not implemented." },
    559     {  1,           1,          DBGCVAR_CAT_NUMBER,     0,                              "size",         "The access size: 1, 2, 4, or 8. 'x' access requires 1, and 8 requires amd64 long mode." },
    560     {  1,           1,          DBGCVAR_CAT_GC_POINTER, 0,                              "address",      "The address." },
    561     {  0,           1,          DBGCVAR_CAT_NUMBER,     0,                              "passes",       "The number of passes before we trigger the breakpoint. (0 is default)" },
    562     {  0,           1,          DBGCVAR_CAT_NUMBER,     DBGCVD_FLAGS_DEP_PREV,          "max passes",   "The number of passes after which we stop triggering the breakpoint. (~0 is default)" },
    563     {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "cmds",         "String of commands to be executed when the breakpoint is hit. Quote it!" },
    564 };
    565 
    566 
    567 /** 'bc', 'bd', 'be' arguments. */
    568 static const DBGCVARDESC    g_aArgBrks[] =
    569 {
    570     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    571     {  0,           ~0,         DBGCVAR_CAT_NUMBER,     0,                              "#bp",          "Breakpoint number." },
    572     {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "all",          "All breakpoints." },
    573 };
    574 
    575 
    576 /** 'bp' arguments. */
    577 static const DBGCVARDESC    g_aArgBrkSet[] =
     568/** 'br' arguments. */
     569static const DBGCVARDESC    g_aArgBrkREM[] =
    578570{
    579571    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     
    585577
    586578
    587 /** 'br' arguments. */
    588 static const DBGCVARDESC    g_aArgBrkREM[] =
    589 {
    590     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    591     {  1,           1,          DBGCVAR_CAT_GC_POINTER, 0,                              "address",      "The address." },
    592     {  0,           1,          DBGCVAR_CAT_NUMBER,     0,                              "passes",       "The number of passes before we trigger the breakpoint. (0 is default)" },
    593     {  0,           1,          DBGCVAR_CAT_NUMBER,     DBGCVD_FLAGS_DEP_PREV,          "max passes",   "The number of passes after which we stop triggering the breakpoint. (~0 is default)" },
    594     {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "cmds",         "String of commands to be executed when the breakpoint is hit. Quote it!" },
    595 };
    596 
    597 
    598 /** 'd?' arguments. */
    599 static const DBGCVARDESC    g_aArgDumpMem[] =
    600 {
    601     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    602     {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start dumping memory." },
    603 };
    604 
    605 
    606579/** 'dg', 'dga', 'dl', 'dla' arguments. */
    607580static const DBGCVARDESC    g_aArgDumpDT[] =
     
    677650    {  1,           1,          DBGCVAR_CAT_STRING,     0,                              "info",         "The name of the info to display." },
    678651    {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "args",         "String arguments to the handler." },
    679 };
    680 
    681 
    682 
    683 /** 'ln' arguments. */
    684 static const DBGCVARDESC    g_aArgListNear[] =
    685 {
    686     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    687     {  0,           ~0,         DBGCVAR_CAT_POINTER,    0,                              "address",      "Address of the symbol to look up." },
    688     {  0,           ~0,         DBGCVAR_CAT_SYMBOL,     0,                              "symbol",       "Symbol to lookup." },
    689 };
    690 
    691 /** 'ln' return. */
    692 static const DBGCVARDESC    g_RetListNear =
    693 {
    694        1,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "The last resolved symbol/address with adjusted range."
    695652};
    696653
     
    732689
    733690
    734 /** 'm' argument. */
    735 static const DBGCVARDESC    g_aArgMemoryInfo[] =
    736 {
    737     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    738     {  1,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Pointer to obtain info about." },
    739 };
    740 
    741 
    742 /** 'r' arguments. */
    743 static const DBGCVARDESC    g_aArgReg[] =
    744 {
    745     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    746     {  0,           1,          DBGCVAR_CAT_SYMBOL,     0,                              "register",     "Register to show or set." },
    747     {  0,           1,     DBGCVAR_CAT_NUMBER_NO_RANGE, DBGCVD_FLAGS_DEP_PREV,          "value",        "New register value." },
    748 };
    749 
    750 
    751 /** 's' arguments. */
    752 static const DBGCVARDESC    g_aArgSource[] =
    753 {
    754     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    755     {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start looking for source lines." },
    756 };
    757 
    758 
    759691/** 'set' arguments */
    760692static const DBGCVARDESC    g_aArgSet[] =
     
    766698
    767699
    768 /** 'u' arguments. */
    769 static const DBGCVARDESC    g_aArgDisasm[] =
    770 {
    771     /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
    772     {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start disassembling." },
    773 };
    774 
    775 
    776 
    777 
    778 
    779 /** Command descriptors. */
     700
     701
     702
     703/** Command descriptors for the basic commands. */
    780704static const DBGCCMD    g_aCmds[] =
    781705{
    782706    /* pszCmd,      cArgsMin, cArgsMax, paArgDescs,         cArgDescs,                  pResultDesc,        fFlags,     pfnHandler          pszSyntax,          ....pszDescription */
    783     { "ba",         3,        6,        &g_aArgBrkAcc[0],   ELEMENTS(g_aArgBrkAcc),     NULL,               0,          dbgcCmdBrkAccess,   "<access> <size> <address> [passes [max passes]] [cmds]",
    784                                                                                                                                                                     "Sets a data access breakpoint." },
    785     { "bc",         1,       ~0,        &g_aArgBrks[0],     ELEMENTS(g_aArgBrks),       NULL,               0,          dbgcCmdBrkClear,    "all | <bp#> [bp# []]", "Enabled a set of breakpoints." },
    786     { "bd",         1,       ~0,        &g_aArgBrks[0],     ELEMENTS(g_aArgBrks),       NULL,               0,          dbgcCmdBrkDisable,  "all | <bp#> [bp# []]", "Disables a set of breakpoints." },
    787     { "be",         1,       ~0,        &g_aArgBrks[0],     ELEMENTS(g_aArgBrks),       NULL,               0,          dbgcCmdBrkEnable,   "all | <bp#> [bp# []]", "Enabled a set of breakpoints." },
    788     { "bl",         0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdBrkList,     "",                     "Lists all the breakpoints." },
    789     { "bp",         1,        4,        &g_aArgBrkSet[0],   ELEMENTS(g_aArgBrkSet),     NULL,               0,          dbgcCmdBrkSet,      "<address> [passes [max passes]] [cmds]",
    790                                                                                                                                                                     "Sets a breakpoint (int 3)." },
    791707    { "br",         1,        4,        &g_aArgBrkREM[0],   ELEMENTS(g_aArgBrkREM),     NULL,               0,          dbgcCmdBrkREM,      "<address> [passes [max passes]] [cmds]",
    792708                                                                                                                                                                    "Sets a recompiler specific breakpoint." },
    793709    { "bye",        0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdQuit,        "",                     "Exits the debugger." },
    794     { "d",          0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory using last element size." },
    795     { "da",         0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory as ascii string." },
    796     { "db",         0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory in bytes." },
    797     { "dd",         0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory in double words." },
    798710    { "dg",         0,       ~0,        &g_aArgDumpDT[0],   ELEMENTS(g_aArgDumpDT),     NULL,               0,          dbgcCmdDumpDT,      "[sel [..]]",           "Dump the global descriptor table (GDT)." },
    799711    { "dga",        0,       ~0,        &g_aArgDumpDT[0],   ELEMENTS(g_aArgDumpDT),     NULL,               0,          dbgcCmdDumpDT,      "[sel [..]]",           "Dump the global descriptor table (GDT) including not-present entries." },
     
    812724    { "dptg",       1,        1,        &g_aArgDumpPT[0],   ELEMENTS(g_aArgDumpPT),     NULL,               0,          dbgcCmdDumpPageTable,"<addr>",              "Dumps page table entries of the guest." },
    813725    { "dpth",       1,        1,        &g_aArgDumpPT[0],   ELEMENTS(g_aArgDumpPT),     NULL,               0,          dbgcCmdDumpPageTable,"<addr>",              "Dumps page table entries of the hypervisor." },
    814     { "dq",         0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory in quad words." },
    815726    { "dt",         0,        1,        &g_aArgDumpTSS[0],  ELEMENTS(g_aArgDumpTSS),    NULL,               0,          dbgcCmdDumpTSS,     "[tss|tss:ign|addr]",   "Dump the task state segment (TSS)." },
    816     { "dw",         0,        1,        &g_aArgDumpMem[0],  ELEMENTS(g_aArgDumpMem),    NULL,               0,          dbgcCmdDumpMem,     "[addr]",               "Dump memory in words." },
    817727    { "echo",       1,        ~0,       &g_aArgMultiStr[0], ELEMENTS(g_aArgMultiStr),   NULL,               0,          dbgcCmdEcho,        "<str1> [str2..[strN]]", "Displays the strings separated by one blank space and the last one followed by a newline." },
    818728    { "exit",       0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdQuit,        "",                     "Exits the debugger." },
    819729    { "format",     1,        1,        &g_aArgAny[0],      ELEMENTS(g_aArgAny),        NULL,               0,          dbgcCmdFormat,      "",                     "Evaluates an expression and formats it." },
    820     { "g",          0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdGo,          "",                     "Continue execution." },
    821730    { "harakiri",   0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdHarakiri,    "",                     "Kills debugger process." },
    822731    { "help",       0,        ~0,       &g_aArgHelp[0],     ELEMENTS(g_aArgHelp),       NULL,               0,          dbgcCmdHelp,        "[cmd/op [..]]",        "Display help. For help about info items try 'info help'." },
    823732    { "info",       1,        2,        &g_aArgInfo[0],     ELEMENTS(g_aArgInfo),       NULL,               0,          dbgcCmdInfo,        "<info> [args]",        "Display info register in the DBGF. For a list of info items try 'info help'." },
    824     { "k",          0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdStack,       "",                     "Callstack." },
    825     { "kg",         0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdStack,       "",                     "Callstack - guest." },
    826     { "kh",         0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdStack,       "",                     "Callstack - hypervisor." },
    827     { "ln",         0,        ~0,       &g_aArgListNear[0], ELEMENTS(g_aArgListNear),   &g_RetListNear,     0,          dbgcCmdListNear,    "[addr/sym [..]]",      "List symbols near to the address. Default address is CS:EIP." },
    828733    { "loadsyms",   1,        5,        &g_aArgLoadSyms[0], ELEMENTS(g_aArgLoadSyms),   NULL,               0,          dbgcCmdLoadSyms,    "<filename> [delta] [module] [module address]", "Loads symbols from a text file. Optionally giving a delta and a module." },
    829734    { "loadvars",   1,        1,        &g_aArgFilename[0], ELEMENTS(g_aArgFilename),   NULL,               0,          dbgcCmdLoadVars,    "<filename>",           "Load variables from file. One per line, same as the args to the set command." },
     
    831736    { "logdest",    1,        1,        &g_aArgLogDest[0],  ELEMENTS(g_aArgLogDest),    NULL,               0,          dbgcCmdLogDest,     "<dest string>",        "Modifies the logging destination (VBOX_LOG_DEST)." },
    832737    { "logflags",   1,        1,        &g_aArgLogFlags[0], ELEMENTS(g_aArgLogFlags),   NULL,               0,          dbgcCmdLogFlags,    "<flags string>",       "Modifies the logging flags (VBOX_LOG_FLAGS)." },
    833     { "m",          1,        1,        &g_aArgMemoryInfo[0],ELEMENTS(g_aArgMemoryInfo),NULL,               0,          dbgcCmdMemoryInfo,  "<addr>",               "Display information about that piece of memory." },
    834738    { "quit",       0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdQuit,        "",                     "Exits the debugger." },
    835     { "r",          0,        2,        &g_aArgReg[0],      ELEMENTS(g_aArgReg),        NULL,               0,          dbgcCmdReg,         "[reg [newval]]",       "Show or set register(s) - active reg set." },
    836     { "rg",         0,        2,        &g_aArgReg[0],      ELEMENTS(g_aArgReg),        NULL,               0,          dbgcCmdRegGuest,    "[reg [newval]]",       "Show or set register(s) - guest reg set." },
    837     { "rh",         0,        2,        &g_aArgReg[0],      ELEMENTS(g_aArgReg),        NULL,               0,          dbgcCmdRegHyper,    "[reg [newval]]",       "Show or set register(s) - hypervisor reg set." },
    838     { "rt",         0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdRegTerse,    "",                     "Toggles terse / verbose register info." },
    839739    { "runscript",  1,        1,        &g_aArgFilename[0], ELEMENTS(g_aArgFilename),   NULL,               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." },
    840     { "s",          0,        1,        &g_aArgSource[0],   ELEMENTS(g_aArgSource),     NULL,               0,          dbgcCmdSource,      "[addr]",               "Source." },
    841740    { "set",        2,        2,        &g_aArgSet[0],      ELEMENTS(g_aArgSet),        NULL,               0,          dbgcCmdSet,         "<var> <value>",        "Sets a global variable." },
    842741    { "showvars",   0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdShowVars,    "",                     "List all the defined variables." },
    843742    { "stop",       0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdStop,        "",                     "Stop execution." },
    844     { "t",          0,        0,        NULL,               0,                          NULL,               0,          dbgcCmdTrace,       "",                     "Instruction trace (step into)." },
    845     { "u",          0,        1,        &g_aArgDisasm[0],   ELEMENTS(g_aArgDisasm),     NULL,               0,          dbgcCmdDisasm,      "[addr]",               "Disassemble." },
    846743    { "unset",      1,        ~0,       &g_aArgMultiStr[0], ELEMENTS(g_aArgMultiStr),   NULL,               0,          dbgcCmdUnset,       "<var1> [var1..[varN]]", "Unsets (delete) one or more global variables." },
     744};
     745
     746
     747/** 'ba' arguments. */
     748static const DBGCVARDESC    g_aArgBrkAcc[] =
     749{
     750    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     751    {  1,           1,          DBGCVAR_CAT_STRING,     0,                              "access",       "The access type: x=execute, rw=read/write (alias r), w=write, i=not implemented." },
     752    {  1,           1,          DBGCVAR_CAT_NUMBER,     0,                              "size",         "The access size: 1, 2, 4, or 8. 'x' access requires 1, and 8 requires amd64 long mode." },
     753    {  1,           1,          DBGCVAR_CAT_GC_POINTER, 0,                              "address",      "The address." },
     754    {  0,           1,          DBGCVAR_CAT_NUMBER,     0,                              "passes",       "The number of passes before we trigger the breakpoint. (0 is default)" },
     755    {  0,           1,          DBGCVAR_CAT_NUMBER,     DBGCVD_FLAGS_DEP_PREV,          "max passes",   "The number of passes after which we stop triggering the breakpoint. (~0 is default)" },
     756    {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "cmds",         "String of commands to be executed when the breakpoint is hit. Quote it!" },
     757};
     758
     759
     760/** 'bc', 'bd', 'be' arguments. */
     761static const DBGCVARDESC    g_aArgBrks[] =
     762{
     763    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     764    {  0,           ~0,         DBGCVAR_CAT_NUMBER,     0,                              "#bp",          "Breakpoint number." },
     765    {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "all",          "All breakpoints." },
     766};
     767
     768
     769/** 'bp' arguments. */
     770static const DBGCVARDESC    g_aArgBrkSet[] =
     771{
     772    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     773    {  1,           1,          DBGCVAR_CAT_GC_POINTER, 0,                              "address",      "The address." },
     774    {  0,           1,          DBGCVAR_CAT_NUMBER,     0,                              "passes",       "The number of passes before we trigger the breakpoint. (0 is default)" },
     775    {  0,           1,          DBGCVAR_CAT_NUMBER,     DBGCVD_FLAGS_DEP_PREV,          "max passes",   "The number of passes after which we stop triggering the breakpoint. (~0 is default)" },
     776    {  0,           1,          DBGCVAR_CAT_STRING,     0,                              "cmds",         "String of commands to be executed when the breakpoint is hit. Quote it!" },
     777};
     778
     779
     780/** 'd?' arguments. */
     781static const DBGCVARDESC    g_aArgDumpMem[] =
     782{
     783    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     784    {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start dumping memory." },
     785};
     786
     787
     788/** 'ln' arguments. */
     789static const DBGCVARDESC    g_aArgListNear[] =
     790{
     791    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     792    {  0,           ~0,         DBGCVAR_CAT_POINTER,    0,                              "address",      "Address of the symbol to look up." },
     793    {  0,           ~0,         DBGCVAR_CAT_SYMBOL,     0,                              "symbol",       "Symbol to lookup." },
     794};
     795
     796/** 'ln' return. */
     797static const DBGCVARDESC    g_RetListNear =
     798{
     799       1,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "The last resolved symbol/address with adjusted range."
     800};
     801
     802
     803/** 'ls' arguments. */
     804static const DBGCVARDESC    g_aArgListSource[] =
     805{
     806    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     807    {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start looking for source lines." },
     808};
     809
     810
     811/** 'm' argument. */
     812static const DBGCVARDESC    g_aArgMemoryInfo[] =
     813{
     814    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     815    {  1,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Pointer to obtain info about." },
     816};
     817
     818
     819/** 'r' arguments. */
     820static const DBGCVARDESC    g_aArgReg[] =
     821{
     822    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     823    {  0,           1,          DBGCVAR_CAT_SYMBOL,     0,                              "register",     "Register to show or set." },
     824    {  0,           1,     DBGCVAR_CAT_NUMBER_NO_RANGE, DBGCVD_FLAGS_DEP_PREV,          "value",        "New register value." },
     825};
     826
     827
     828/** 's' arguments. */
     829static const DBGCVARDESC    g_aArgSearchMem[] =
     830{
     831    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     832    {  1,           1,          DBGCVAR_CAT_GC_POINTER, 0,                              "range",        "Register to show or set." },
     833    {  1,           ~0,         DBGCVAR_CAT_ANY,        0,                              "pattern",      "Pattern to search for." },
     834};
     835
     836
     837/** 'u' arguments. */
     838static const DBGCVARDESC    g_aArgUnassemble[] =
     839{
     840    /* cTimesMin,   cTimesMax,  enmCategory,            fFlags,                         pszName,        pszDescription */
     841    {  0,           1,          DBGCVAR_CAT_POINTER,    0,                              "address",      "Address where to start disassembling." },
     842};
     843
     844
     845/** Command descriptors for the CodeView / WinDbg emulation.
     846 * The emulation isn't attempting to be identical, only somewhat similar.
     847 */
     848static const DBGCCMD    g_aCmdsCodeView[] =
     849{
     850    /* pszCmd,      cArgsMin, cArgsMax, paArgDescs,         cArgDescs,                     pResultDesc,        fFlags,  pfnHandler          pszSyntax,          ....pszDescription */
     851    { "ba",         3,        6,        &g_aArgBrkAcc[0],   RT_ELEMENTS(g_aArgBrkAcc),     NULL,               0,       dbgcCmdBrkAccess,   "<access> <size> <address> [passes [max passes]] [cmds]",
     852                                                                                                                                                                    "Sets a data access breakpoint." },
     853    { "bc",         1,       ~0,        &g_aArgBrks[0],     RT_ELEMENTS(g_aArgBrks),       NULL,               0,       dbgcCmdBrkClear,    "all | <bp#> [bp# []]", "Enabled a set of breakpoints." },
     854    { "bd",         1,       ~0,        &g_aArgBrks[0],     RT_ELEMENTS(g_aArgBrks),       NULL,               0,       dbgcCmdBrkDisable,  "all | <bp#> [bp# []]", "Disables a set of breakpoints." },
     855    { "be",         1,       ~0,        &g_aArgBrks[0],     RT_ELEMENTS(g_aArgBrks),       NULL,               0,       dbgcCmdBrkEnable,   "all | <bp#> [bp# []]", "Enabled a set of breakpoints." },
     856    { "bl",         0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdBrkList,     "",                     "Lists all the breakpoints." },
     857    { "bp",         1,        4,        &g_aArgBrkSet[0],   RT_ELEMENTS(g_aArgBrkSet),     NULL,               0,       dbgcCmdBrkSet,      "<address> [passes [max passes]] [cmds]",
     858                                                                                                                                                                 "Sets a breakpoint (int 3)." },
     859    { "d",          0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory using last element size." },
     860    { "da",         0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory as ascii string." },
     861    { "db",         0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory in bytes." },
     862    { "dd",         0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory in double words." },
     863    { "dq",         0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory in quad words." },
     864    { "dw",         0,        1,        &g_aArgDumpMem[0],  RT_ELEMENTS(g_aArgDumpMem),    NULL,               0,       dbgcCmdDumpMem,     "[addr]",               "Dump memory in words." },
     865    { "g",          0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdGo,          "",                     "Continue execution." },
     866    { "k",          0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdStack,       "",                     "Callstack." },
     867    { "kg",         0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdStack,       "",                     "Callstack - guest." },
     868    { "kh",         0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdStack,       "",                     "Callstack - hypervisor." },
     869    { "ln",         0,        ~0,       &g_aArgListNear[0], RT_ELEMENTS(g_aArgListNear),   &g_RetListNear,     0,       dbgcCmdListNear,    "[addr/sym [..]]",      "List symbols near to the address. Default address is CS:EIP." },
     870    { "ls",         0,        1,        &g_aArgListSource[0],RT_ELEMENTS(g_aArgListSource),NULL,               0,       dbgcCmdListSource,  "[addr]",               "Source." },
     871    { "m",          1,        1,        &g_aArgMemoryInfo[0],RT_ELEMENTS(g_aArgMemoryInfo),NULL,               0,       dbgcCmdMemoryInfo,  "<addr>",               "Display information about that piece of memory." },
     872    { "r",          0,        2,        &g_aArgReg[0],      RT_ELEMENTS(g_aArgReg),        NULL,               0,       dbgcCmdReg,         "[reg [newval]]",       "Show or set register(s) - active reg set." },
     873    { "rg",         0,        2,        &g_aArgReg[0],      RT_ELEMENTS(g_aArgReg),        NULL,               0,       dbgcCmdRegGuest,    "[reg [newval]]",       "Show or set register(s) - guest reg set." },
     874    { "rh",         0,        2,        &g_aArgReg[0],      RT_ELEMENTS(g_aArgReg),        NULL,               0,       dbgcCmdRegHyper,    "[reg [newval]]",       "Show or set register(s) - hypervisor reg set." },
     875    { "rt",         0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdRegTerse,    "",                     "Toggles terse / verbose register info." },
     876    //{ "s",          2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Continue last search." },
     877    { "sa",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for an ascii string." },
     878    { "sb",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for one or more bytes." },
     879    { "sd",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for one or more double words." },
     880    { "sq",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for one or more quad words." },
     881    { "su",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for an unicode string." },
     882    { "sw",         2,       ~0,        &g_aArgSearchMem[0],RT_ELEMENTS(g_aArgSearchMem),  NULL,               0,       dbgcCmdSearchMem,   "<range> <pattern>",    "Search memory for one or more words." },
     883    { "t",          0,        0,        NULL,               0,                             NULL,               0,       dbgcCmdTrace,       "",                     "Instruction trace (step into)." },
     884    { "u",          0,        1,        &g_aArgUnassemble[0],RT_ELEMENTS(g_aArgUnassemble),NULL,               0,       dbgcCmdUnassemble,  "[addr]",               "Unassemble." },
    847885};
    848886
     
    10981136}
    10991137
     1138
    11001139/**
    11011140 * The 'help' command.
     
    11101149static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
    11111150{
     1151    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    11121152    int         rc = VINF_SUCCESS;
    11131153    unsigned    i;
     1154
    11141155    if (!cArgs)
    11151156    {
     
    11281169                                    g_aCmds[i].pszSyntax,
    11291170                                    g_aCmds[i].pszDescription);
     1171        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1172                                "\n"
     1173                                "Emulation: %s\n", pDbgc->pszEmulation);
     1174        PCDBGCCMD pCmd = pDbgc->paEmulationCmds;
     1175        for (i = 0; i < pDbgc->cEmulationCmds; i++, pCmd++)
     1176            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1177                                    "%-11s %-30s %s\n",
     1178                                    pCmd->pszCmd,
     1179                                    pCmd->pszSyntax,
     1180                                    pCmd->pszDescription);
    11301181
    11311182        if (g_pExtCmdsHead)
     
    11731224        {
    11741225            Assert(paArgs[iArg].enmType == DBGCVAR_TYPE_STRING);
    1175 
    1176             /* lookup in the command list */
    11771226            bool fFound = false;
     1227
     1228            /* lookup in the emulation command list first */
     1229            for (i = 0; i < pDbgc->cEmulationCmds; i++)
     1230                if (!strcmp(pDbgc->paEmulationCmds[i].pszCmd, paArgs[iArg].u.pszString))
     1231                {
     1232                    rc = dbgcPrintHelp(pCmdHlp, &pDbgc->paEmulationCmds[i], false);
     1233                    fFound = true;
     1234                    break;
     1235                }
     1236
     1237            /* lookup in the command list (even when found in the emulation) */
    11781238            for (i = 0; i < ELEMENTS(g_aCmds); i++)
    11791239                if (!strcmp(g_aCmds[i].pszCmd, paArgs[iArg].u.pszString))
     
    18391899 * @param   cArgs       Number of arguments in the array.
    18401900 */
    1841 static DECLCALLBACK(int) dbgcCmdDisasm(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
     1901static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
    18421902{
    18431903    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    19902050
    19912051/**
    1992  * The 's' command.
     2052 * The 'ls' command.
    19932053 *
    19942054 * @returns VBox status.
     
    19992059 * @param   cArgs       Number of arguments in the array.
    20002060 */
    2001 static DECLCALLBACK(int) dbgcCmdSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
     2061static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
    20022062{
    20032063    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    27432803            &&  !DBGCVAR_ISPOINTER(paArgs[i].enmType))
    27442804            return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number or pointer type but %d.\n", i, paArgs[i].enmType);
    2745         unsigned u64;
     2805        uint64_t u64;
    27462806        unsigned cSels = 1;
    27472807        switch (paArgs[i].enmType)
     
    28382898    RTGCUINTPTR GCPtrBase = CPUMGetGuestIDTR(pVM, &cbLimit);
    28392899    CPUMMODE enmMode = CPUMGetGuestMode(pVM);
    2840     size_t cbEntry;
     2900    unsigned cbEntry;
    28412901    switch (enmMode)
    28422902    {
     
    28702930        if (paArgs[i].u.u64Number < 256)
    28712931        {
    2872             RTGCUINTPTR iInt = paArgs[i].u.u64Number;
     2932            RTGCUINTPTR iInt = (RTGCUINTPTR)paArgs[i].u.u64Number;
    28732933            unsigned cInts = paArgs[i].enmRangeType != DBGCVAR_RANGE_NONE
    28742934                           ? paArgs[i].u64Range
     
    29623022     * Figure out the element size.
    29633023     */
    2964     size_t  cbElement;
    2965     bool    fAscii = false;
     3024    unsigned    cbElement;
     3025    bool        fAscii = false;
    29663026    switch (pCmd->pszCmd[1])
    29673027    {
     
    31033163            }
    31043164            if (u8 == '\0')
    3105                 cbLeft = cb = i + 1;
     3165                cb = cbLeft = i + 1;
    31063166            if (cbLeft - cb <= 0 && u8Prev != '\n')
    31073167                pCmdHlp->pfnPrintf(pCmdHlp, NULL, "\n");
     
    31113171         * Advance
    31123172         */
    3113         cbLeft -= cb;
     3173        cbLeft -= (int)cb;
    31143174        rc = pCmdHlp->pfnEval(pCmdHlp, &pDbgc->DumpPos, "(%Dv) + %x", &pDbgc->DumpPos, cb);
    31153175        if (VBOX_FAILURE(rc))
     
    38143874
    38153875/**
    3816  * The 'echo' command.
     3876 * The 'runscript' command.
    38173877 *
    38183878 * @returns VBox status.
     
    38953955    NOREF(pCmd); NOREF(pResult); NOREF(pVM);
    38963956    return rc;
     3957}
     3958
     3959
     3960/**
     3961 * The 's' command.
     3962 *
     3963 * @returns VBox status.
     3964 * @param   pCmd        Pointer to the command descriptor (as registered).
     3965 * @param   pCmdHlp     Pointer to command helper functions.
     3966 * @param   pVM         Pointer to the current VM (if any).
     3967 * @param   paArgs      Pointer to (readonly) array of arguments.
     3968 * @param   cArgs       Number of arguments in the array.
     3969 */
     3970static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
     3971{
     3972    /* check that the parser did what it's supposed to do. */
     3973    if (    cArgs != 1
     3974        ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING)
     3975        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
     3976    return -1;
    38973977}
    38983978
     
    45514631            while (isblank(*psz))
    45524632                psz++;
    4553             int i = strlen(psz) - 1;
     4633            int i = (int)strlen(psz) - 1;
    45544634            while (i >= 0 && isspace(psz[i]))
    45554635                psz[i--] ='\0';
     
    64186498 * @param   chArgSize       The argument size specifier, 'l' or 'L'.
    64196499 */
    6420 static DECLCALLBACK(int) dbgcStringFormatter(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    6421     const char **ppszFormat, va_list *pArgs, int cchWidth, int cchPrecision, unsigned fFlags, char chArgSize)
     6500static DECLCALLBACK(size_t) dbgcStringFormatter(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     6501                                                const char **ppszFormat, va_list *pArgs, int cchWidth,
     6502                                                int cchPrecision, unsigned fFlags, char chArgSize)
    64226503{
    64236504    NOREF(cchWidth); NOREF(cchPrecision); NOREF(fFlags); NOREF(chArgSize); NOREF(pvArg);
     
    73247405            pDbgc->fInputOverflow = false;
    73257406            pDbgc->iRead = psz - &pDbgc->achInput[0] + 1;
    7326             pDbgc->iWrite = cbRead;
     7407            pDbgc->iWrite = (unsigned)cbRead;
    73277408            pDbgc->cInputLines = 0;
    73287409            break;
     
    75577638    if (!fExternal)
    75587639    {
     7640        /* emulation first, so commands can be overloaded (info ++). */
     7641        PCDBGCCMD pCmd = pDbgc->paEmulationCmds;
     7642        unsigned cLeft = pDbgc->cEmulationCmds;
     7643        while (cLeft-- > 0)
     7644        {
     7645            if (    !strncmp(pachName, pCmd->pszCmd, cchName)
     7646                &&  !pCmd->pszCmd[cchName])
     7647                return pCmd;
     7648            pCmd++;
     7649        }
     7650
    75597651        for (unsigned iCmd = 0; iCmd < ELEMENTS(g_aCmds); iCmd++)
    75607652        {
     
    90829174    pDbgc->CmdHlp.pfnVarToBool = dbgcHlpVarToBool;
    90839175    pDbgc->pBack            = pBack;
     9176    pDbgc->pVM              = NULL;
     9177    pDbgc->pszEmulation     = "CodeView/WinDbg";
     9178    pDbgc->paEmulationCmds  = &g_aCmdsCodeView[0];
     9179    pDbgc->cEmulationCmds   = RT_ELEMENTS(g_aCmdsCodeView);
     9180    //pDbgc->fLog             = false;
     9181    pDbgc->fRegCtxGuest     = true;
     9182    pDbgc->fRegTerse        = true;
     9183    //pDbgc->DisasmPos        = {0};
     9184    //pDbgc->SourcePos        = {0};
     9185    //pDbgc->DumpPos          = {0};
     9186    //pDbgc->cbDumpElement    = 0;
     9187    //pDbgc->cVars            = 0;
     9188    //pDbgc->paVars           = NULL;
     9189    //pDbgc->pFirstBp         = NULL;
     9190    //pDbgc->uInputZero       = 0;
     9191    //pDbgc->iRead            = 0;
     9192    //pDbgc->iWrite           = 0;
     9193    //pDbgc->cInputLines      = 0;
     9194    //pDbgc->fInputOverflow   = false;
     9195    pDbgc->fReady           = true;
    90849196    pDbgc->pszScratch       = &pDbgc->achScratch[0];
    9085     pDbgc->fRegTerse        = true;
    9086     pDbgc->fRegCtxGuest     = true;
    9087     pDbgc->fLog             = false;
    9088     pDbgc->iRead            = 0;
    9089     pDbgc->iWrite           = 0;
    9090     pDbgc->fReady           = true;
    9091     pDbgc->fInputOverflow   = false;
    9092     pDbgc->cInputLines      = 0;
     9197    //pDbgc->iArg             = 0;
     9198    //pDbgc->rcOutput         = 0;
    90939199
    90949200    dbgcInitOpCharBitMap();
  • trunk/src/VBox/Runtime/common/log/logformat.cpp

    r5415 r5666  
    3535*   Internal Functions                                                         *
    3636*******************************************************************************/
    37 static DECLCALLBACK(int) rtlogFormatStr(void *pvArg, PFNRTSTROUTPUT pfnOutput,
    38                                         void *pvArgOutput, const char **ppszFormat,
    39                                         va_list *pArgs, int cchWidth, int cchPrecision,
    40                                         unsigned fFlags, char chArgSize);
     37static DECLCALLBACK(size_t) rtlogFormatStr(void *pvArg, PFNRTSTROUTPUT pfnOutput,
     38                                           void *pvArgOutput, const char **ppszFormat,
     39                                           va_list *pArgs, int cchWidth, int cchPrecision,
     40                                           unsigned fFlags, char chArgSize);
    4141
    4242
     
    7474 * @param   chArgSize       The argument size specifier, 'l' or 'L'.
    7575 */
    76 static DECLCALLBACK(int) rtlogFormatStr(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    77     const char **ppszFormat, va_list *pArgs, int cchWidth, int cchPrecision, unsigned fFlags, char chArgSize)
     76static DECLCALLBACK(size_t) rtlogFormatStr(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     77                                           const char **ppszFormat, va_list *pArgs, int cchWidth,
     78                                           int cchPrecision, unsigned fFlags, char chArgSize)
    7879{
    7980    char ch = *(*ppszFormat)++;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette