Changeset 8800 in vbox for trunk/src/VBox/Debugger/DBGCCommands.cpp
- Timestamp:
- May 14, 2008 3:03:54 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30800
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r8155 r8800 67 67 static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 68 68 static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 69 static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 69 70 70 71 … … 167 168 { "exit", 0, 0, NULL, 0, NULL, 0, dbgcCmdQuit, "", "Exits the debugger." }, 168 169 { "format", 1, 1, &g_aArgAny[0], ELEMENTS(g_aArgAny), NULL, 0, dbgcCmdFormat, "", "Evaluates an expression and formats it." }, 170 { "detect", 0, 0, NULL, 0, NULL, 0, dbgcCmdDetect, "", "Detects or re-detects the guest os and starts the OS specific digger." }, 169 171 { "harakiri", 0, 0, NULL, 0, NULL, 0, dbgcCmdHarakiri, "", "Kills debugger process." }, 170 172 { "help", 0, ~0, &g_aArgHelp[0], ELEMENTS(g_aArgHelp), NULL, 0, dbgcCmdHelp, "[cmd/op [..]]", "Display help. For help about info items try 'info help'." }, … … 716 718 717 719 NOREF(pCmd); NOREF(pResult); NOREF(pVM); 720 return rc; 721 } 722 723 724 /** 725 * The 'detect' command. 726 * 727 * @returns VBox status. 728 * @param pCmd Pointer to the command descriptor (as registered). 729 * @param pCmdHlp Pointer to command helper functions. 730 * @param pVM Pointer to the current VM (if any). 731 * @param paArgs Pointer to (readonly) array of arguments. 732 * @param cArgs Number of arguments in the array. 733 */ 734 static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 735 { 736 /* check that the parser did what it's supposed to do. */ 737 if (cArgs != 0) 738 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n"); 739 740 /* 741 * Perform the detection. 742 */ 743 char szName[64]; 744 int rc = DBGFR3OSDetect(pVM, szName, sizeof(szName)); 745 if (RT_FAILURE(rc)) 746 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect()."); 747 if (rc == VINF_SUCCESS) 748 { 749 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Guest OS: %s\n", szName); 750 char szVersion[64]; 751 int rc2 = DBGFR3OSQueryNameAndVersion(pVM, NULL, 0, szVersion, sizeof(szVersion)); 752 if (RT_SUCCESS(rc2)) 753 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Version : %s\n", szVersion); 754 } 755 else 756 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Unable to figure out which guest OS it is, sorry.\n"); 757 NOREF(pCmd); NOREF(pResult); NOREF(paArgs); 718 758 return rc; 719 759 }
Note:
See TracChangeset
for help on using the changeset viewer.