- Timestamp:
- Nov 11, 2007 4:25:51 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r5605 r5666 474 474 * @param chArgSize The argument size specifier, 'l' or 'L'. 475 475 */ 476 typedef DECLCALLBACK(int) FNSTRFORMAT(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 477 const char **ppszFormat, va_list *pArgs, int cchWidth, int cchPrecision, unsigned fFlags, char chArgSize); 476 typedef DECLCALLBACK(size_t) FNSTRFORMAT(void *pvArg, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 477 const char **ppszFormat, va_list *pArgs, int cchWidth, 478 int cchPrecision, unsigned fFlags, char chArgSize); 478 479 /** Pointer to a FNSTRFORMAT() function. */ 479 480 typedef FNSTRFORMAT *PFNSTRFORMAT; -
trunk/src/VBox/Debugger/DBGConsole.cpp
r5605 r5666 227 227 /** Pointer to backend callback structure. */ 228 228 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; 229 238 /** Log indicator. (If set we're writing the log to the console.) */ 230 239 bool fLog; 231 /** Pointer to the current VM. */232 PVM pVM;233 /** Indicates whether or we're ready for input. */234 bool fReady;235 240 236 241 /** Indicates whether we're in guest (true) or hypervisor (false) register context. */ … … 238 243 /** Indicates whether the register are terse or sparse. */ 239 244 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 * @{ */ 240 267 241 268 /** Input buffer. */ … … 252 279 * This means that input is ignored up to the next newline. */ 253 280 bool fInputOverflow; 281 /** Indicates whether or we're ready for input. */ 282 bool fReady; 254 283 255 284 /** Scratch buffer position. */ … … 265 294 int rcOutput; 266 295 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 /** @} */ 285 297 } DBGC; 286 298 /** Pointer to debugger console instance data. */ … … 421 433 * Internal Functions * 422 434 *******************************************************************************/ 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);429 435 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 430 436 static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 431 437 static 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);433 438 static 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);441 439 static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 442 440 static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 443 441 static 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);445 442 static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 446 443 static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); … … 454 451 static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 455 452 static 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);457 453 static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 458 454 static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); … … 463 459 static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 464 460 static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 461 462 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 463 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 464 static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 465 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 466 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 467 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 468 static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 469 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 470 static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 471 static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 472 static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 473 static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 474 static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 475 static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 476 static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 477 static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 478 static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 465 479 466 480 static DECLCALLBACK(int) dbgcOpMinus(PDBGC pDbgc, PCDBGCVAR pArg, PDBGCVAR pResult); … … 552 566 553 567 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. */ 569 static const DBGCVARDESC g_aArgBrkREM[] = 578 570 { 579 571 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ … … 585 577 586 578 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 606 579 /** 'dg', 'dga', 'dl', 'dla' arguments. */ 607 580 static const DBGCVARDESC g_aArgDumpDT[] = … … 677 650 { 1, 1, DBGCVAR_CAT_STRING, 0, "info", "The name of the info to display." }, 678 651 { 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."695 652 }; 696 653 … … 732 689 733 690 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 759 691 /** 'set' arguments */ 760 692 static const DBGCVARDESC g_aArgSet[] = … … 766 698 767 699 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. */ 780 704 static const DBGCCMD g_aCmds[] = 781 705 { 782 706 /* 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)." },791 707 { "br", 1, 4, &g_aArgBrkREM[0], ELEMENTS(g_aArgBrkREM), NULL, 0, dbgcCmdBrkREM, "<address> [passes [max passes]] [cmds]", 792 708 "Sets a recompiler specific breakpoint." }, 793 709 { "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." },798 710 { "dg", 0, ~0, &g_aArgDumpDT[0], ELEMENTS(g_aArgDumpDT), NULL, 0, dbgcCmdDumpDT, "[sel [..]]", "Dump the global descriptor table (GDT)." }, 799 711 { "dga", 0, ~0, &g_aArgDumpDT[0], ELEMENTS(g_aArgDumpDT), NULL, 0, dbgcCmdDumpDT, "[sel [..]]", "Dump the global descriptor table (GDT) including not-present entries." }, … … 812 724 { "dptg", 1, 1, &g_aArgDumpPT[0], ELEMENTS(g_aArgDumpPT), NULL, 0, dbgcCmdDumpPageTable,"<addr>", "Dumps page table entries of the guest." }, 813 725 { "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." },815 726 { "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." },817 727 { "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." }, 818 728 { "exit", 0, 0, NULL, 0, NULL, 0, dbgcCmdQuit, "", "Exits the debugger." }, 819 729 { "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." },821 730 { "harakiri", 0, 0, NULL, 0, NULL, 0, dbgcCmdHarakiri, "", "Kills debugger process." }, 822 731 { "help", 0, ~0, &g_aArgHelp[0], ELEMENTS(g_aArgHelp), NULL, 0, dbgcCmdHelp, "[cmd/op [..]]", "Display help. For help about info items try 'info help'." }, 823 732 { "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." },828 733 { "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." }, 829 734 { "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." }, … … 831 736 { "logdest", 1, 1, &g_aArgLogDest[0], ELEMENTS(g_aArgLogDest), NULL, 0, dbgcCmdLogDest, "<dest string>", "Modifies the logging destination (VBOX_LOG_DEST)." }, 832 737 { "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." },834 738 { "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." },839 739 { "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." },841 740 { "set", 2, 2, &g_aArgSet[0], ELEMENTS(g_aArgSet), NULL, 0, dbgcCmdSet, "<var> <value>", "Sets a global variable." }, 842 741 { "showvars", 0, 0, NULL, 0, NULL, 0, dbgcCmdShowVars, "", "List all the defined variables." }, 843 742 { "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." },846 743 { "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. */ 748 static 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. */ 761 static 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. */ 770 static 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. */ 781 static 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. */ 789 static 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. */ 797 static 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. */ 804 static 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. */ 812 static 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. */ 820 static 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. */ 829 static 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. */ 838 static 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 */ 848 static 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." }, 847 885 }; 848 886 … … 1098 1136 } 1099 1137 1138 1100 1139 /** 1101 1140 * The 'help' command. … … 1110 1149 static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 1111 1150 { 1151 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1112 1152 int rc = VINF_SUCCESS; 1113 1153 unsigned i; 1154 1114 1155 if (!cArgs) 1115 1156 { … … 1128 1169 g_aCmds[i].pszSyntax, 1129 1170 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); 1130 1181 1131 1182 if (g_pExtCmdsHead) … … 1173 1224 { 1174 1225 Assert(paArgs[iArg].enmType == DBGCVAR_TYPE_STRING); 1175 1176 /* lookup in the command list */1177 1226 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) */ 1178 1238 for (i = 0; i < ELEMENTS(g_aCmds); i++) 1179 1239 if (!strcmp(g_aCmds[i].pszCmd, paArgs[iArg].u.pszString)) … … 1839 1899 * @param cArgs Number of arguments in the array. 1840 1900 */ 1841 static DECLCALLBACK(int) dbgcCmd Disasm(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)1901 static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 1842 1902 { 1843 1903 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1990 2050 1991 2051 /** 1992 * The ' s' command.2052 * The 'ls' command. 1993 2053 * 1994 2054 * @returns VBox status. … … 1999 2059 * @param cArgs Number of arguments in the array. 2000 2060 */ 2001 static DECLCALLBACK(int) dbgcCmd Source(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)2061 static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 2002 2062 { 2003 2063 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2743 2803 && !DBGCVAR_ISPOINTER(paArgs[i].enmType)) 2744 2804 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number or pointer type but %d.\n", i, paArgs[i].enmType); 2745 u nsignedu64;2805 uint64_t u64; 2746 2806 unsigned cSels = 1; 2747 2807 switch (paArgs[i].enmType) … … 2838 2898 RTGCUINTPTR GCPtrBase = CPUMGetGuestIDTR(pVM, &cbLimit); 2839 2899 CPUMMODE enmMode = CPUMGetGuestMode(pVM); 2840 size_tcbEntry;2900 unsigned cbEntry; 2841 2901 switch (enmMode) 2842 2902 { … … 2870 2930 if (paArgs[i].u.u64Number < 256) 2871 2931 { 2872 RTGCUINTPTR iInt = paArgs[i].u.u64Number;2932 RTGCUINTPTR iInt = (RTGCUINTPTR)paArgs[i].u.u64Number; 2873 2933 unsigned cInts = paArgs[i].enmRangeType != DBGCVAR_RANGE_NONE 2874 2934 ? paArgs[i].u64Range … … 2962 3022 * Figure out the element size. 2963 3023 */ 2964 size_tcbElement;2965 bool fAscii = false;3024 unsigned cbElement; 3025 bool fAscii = false; 2966 3026 switch (pCmd->pszCmd[1]) 2967 3027 { … … 3103 3163 } 3104 3164 if (u8 == '\0') 3105 cb Left = cb= i + 1;3165 cb = cbLeft = i + 1; 3106 3166 if (cbLeft - cb <= 0 && u8Prev != '\n') 3107 3167 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "\n"); … … 3111 3171 * Advance 3112 3172 */ 3113 cbLeft -= cb;3173 cbLeft -= (int)cb; 3114 3174 rc = pCmdHlp->pfnEval(pCmdHlp, &pDbgc->DumpPos, "(%Dv) + %x", &pDbgc->DumpPos, cb); 3115 3175 if (VBOX_FAILURE(rc)) … … 3814 3874 3815 3875 /** 3816 * The ' echo' command.3876 * The 'runscript' command. 3817 3877 * 3818 3878 * @returns VBox status. … … 3895 3955 NOREF(pCmd); NOREF(pResult); NOREF(pVM); 3896 3956 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 */ 3970 static 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; 3897 3977 } 3898 3978 … … 4551 4631 while (isblank(*psz)) 4552 4632 psz++; 4553 int i = strlen(psz) - 1;4633 int i = (int)strlen(psz) - 1; 4554 4634 while (i >= 0 && isspace(psz[i])) 4555 4635 psz[i--] ='\0'; … … 6418 6498 * @param chArgSize The argument size specifier, 'l' or 'L'. 6419 6499 */ 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) 6500 static 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) 6422 6503 { 6423 6504 NOREF(cchWidth); NOREF(cchPrecision); NOREF(fFlags); NOREF(chArgSize); NOREF(pvArg); … … 7324 7405 pDbgc->fInputOverflow = false; 7325 7406 pDbgc->iRead = psz - &pDbgc->achInput[0] + 1; 7326 pDbgc->iWrite = cbRead;7407 pDbgc->iWrite = (unsigned)cbRead; 7327 7408 pDbgc->cInputLines = 0; 7328 7409 break; … … 7557 7638 if (!fExternal) 7558 7639 { 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 7559 7651 for (unsigned iCmd = 0; iCmd < ELEMENTS(g_aCmds); iCmd++) 7560 7652 { … … 9082 9174 pDbgc->CmdHlp.pfnVarToBool = dbgcHlpVarToBool; 9083 9175 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; 9084 9196 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; 9093 9199 9094 9200 dbgcInitOpCharBitMap(); -
trunk/src/VBox/Runtime/common/log/logformat.cpp
r5415 r5666 35 35 * Internal Functions * 36 36 *******************************************************************************/ 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);37 static 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); 41 41 42 42 … … 74 74 * @param chArgSize The argument size specifier, 'l' or 'L'. 75 75 */ 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) 76 static 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) 78 79 { 79 80 char ch = *(*ppszFormat)++;
Note:
See TracChangeset
for help on using the changeset viewer.