- Timestamp:
- Jul 19, 2013 10:52:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r46167 r47281 57 57 static FNDBGCCMD dbgcCmdLogDest; 58 58 static FNDBGCCMD dbgcCmdLogFlags; 59 static FNDBGCCMD dbgcCmdLogFlush; 59 60 static FNDBGCCMD dbgcCmdFormat; 60 61 static FNDBGCCMD dbgcCmdLoadImage; … … 161 162 { 162 163 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 163 { 1, 1, DBGCVAR_CAT_STRING, 0, "groups", "Group modifier string (quote it!)." }164 { 0, 1, DBGCVAR_CAT_STRING, 0, "groups", "Group modifier string (quote it!)." } 164 165 }; 165 166 … … 169 170 { 170 171 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 171 { 1, 1, DBGCVAR_CAT_STRING, 0, "dests", "Destination modifier string (quote it!)." }172 { 0, 1, DBGCVAR_CAT_STRING, 0, "dests", "Destination modifier string (quote it!)." } 172 173 }; 173 174 … … 177 178 { 178 179 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 179 { 1, 1, DBGCVAR_CAT_STRING, 0, "flags", "Flag modifier string (quote it!)." }180 { 0, 1, DBGCVAR_CAT_STRING, 0, "flags", "Flag modifier string (quote it!)." } 180 181 }; 181 182 … … 238 239 /*"Optionally giving the module a name other than the file name stem."*/ }, 239 240 { "loadvars", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdLoadVars, "<filename>", "Load variables from file. One per line, same as the args to the set command." }, 240 { "log", 1, 1, &g_aArgLog[0], RT_ELEMENTS(g_aArgLog), 0, dbgcCmdLog, "<group string>", "Modifies the logging group settings (VBOX_LOG)" }, 241 { "logdest", 1, 1, &g_aArgLogDest[0], RT_ELEMENTS(g_aArgLogDest), 0, dbgcCmdLogDest, "<dest string>", "Modifies the logging destination (VBOX_LOG_DEST)." }, 242 { "logflags", 1, 1, &g_aArgLogFlags[0], RT_ELEMENTS(g_aArgLogFlags), 0, dbgcCmdLogFlags, "<flags string>", "Modifies the logging flags (VBOX_LOG_FLAGS)." }, 241 { "log", 0, 1, &g_aArgLog[0], RT_ELEMENTS(g_aArgLog), 0, dbgcCmdLog, "[group string]", "Displays or modifies the logging group settings (VBOX_LOG)" }, 242 { "logdest", 0, 1, &g_aArgLogDest[0], RT_ELEMENTS(g_aArgLogDest), 0, dbgcCmdLogDest, "[dest string]", "Displays or modifies the logging destination (VBOX_LOG_DEST)." }, 243 { "logflags", 0, 1, &g_aArgLogFlags[0], RT_ELEMENTS(g_aArgLogFlags), 0, dbgcCmdLogFlags, "[flags string]", "Displays or modifies the logging flags (VBOX_LOG_FLAGS)." }, 244 { "logflush", 0, 0, NULL, 0, 0, dbgcCmdLogFlush, "", "Flushes the log buffers." }, 243 245 { "quit", 0, 0, NULL, 0, 0, dbgcCmdQuit, "", "Exits the debugger." }, 244 246 { "runscript", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdRunScript, "<filename>", "Runs the command listed in the script. Lines starting with '#' " … … 1060 1062 static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1061 1063 { 1062 int rc = DBGFR3LogModifyGroups(pUVM, paArgs[0].u.pszString); 1063 if (RT_SUCCESS(rc)) 1064 return VINF_SUCCESS; 1064 int rc; 1065 if (cArgs == 0) 1066 { 1067 char szBuf[_64K]; 1068 rc = RTLogGetGroupSettings(NULL, szBuf, sizeof(szBuf)); 1069 if (RT_FAILURE(rc)) 1070 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "RTLogGetDestinations(NULL,,%#zx)\n", sizeof(szBuf)); 1071 DBGCCmdHlpPrintf(pCmdHlp, "VBOX_LOG=%s\n", szBuf); 1072 } 1073 else 1074 { 1075 rc = DBGFR3LogModifyGroups(pUVM, paArgs[0].u.pszString); 1076 if (RT_FAILURE(rc)) 1077 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1078 } 1079 NOREF(pCmd); 1080 return VINF_SUCCESS; 1081 } 1082 1083 1084 /** 1085 * @interface_method_impl{FNDBCCMD, The 'logdest' command.} 1086 */ 1087 static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1088 { 1089 int rc; 1090 if (cArgs == 0) 1091 { 1092 char szBuf[_16K]; 1093 rc = RTLogGetDestinations(NULL, szBuf, sizeof(szBuf)); 1094 if (RT_FAILURE(rc)) 1095 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "RTLogGetDestinations(NULL,,%#zx)\n", sizeof(szBuf)); 1096 DBGCCmdHlpPrintf(pCmdHlp, "VBOX_LOG_DEST=%s\n", szBuf); 1097 } 1098 else 1099 { 1100 rc = DBGFR3LogModifyDestinations(pUVM, paArgs[0].u.pszString); 1101 if (RT_FAILURE(rc)) 1102 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1103 } 1104 NOREF(pCmd); 1105 return VINF_SUCCESS; 1106 } 1107 1108 1109 /** 1110 * @interface_method_impl{FNDBCCMD, The 'logflags' command.} 1111 */ 1112 static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1113 { 1114 int rc; 1115 if (cArgs == 0) 1116 { 1117 char szBuf[_16K]; 1118 rc = RTLogGetFlags(NULL, szBuf, sizeof(szBuf)); 1119 if (RT_FAILURE(rc)) 1120 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "RTLogGetFlags(NULL,,%#zx)\n", sizeof(szBuf)); 1121 DBGCCmdHlpPrintf(pCmdHlp, "VBOX_LOG_FLAGS=%s\n", szBuf); 1122 } 1123 else 1124 { 1125 rc = DBGFR3LogModifyFlags(pUVM, paArgs[0].u.pszString); 1126 if (RT_FAILURE(rc)) 1127 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1128 } 1129 1130 NOREF(pCmd); 1131 return rc; 1132 } 1133 1134 1135 /** 1136 * @interface_method_impl{FNDBCCMD, The 'logflush' command.} 1137 */ 1138 static DECLCALLBACK(int) dbgcCmdLogFlush(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1139 { 1140 RTLogFlush(NULL); 1141 PRTLOGGER pLogRel = RTLogRelDefaultInstance(); 1142 if (pLogRel) 1143 RTLogFlush(pLogRel); 1144 1065 1145 NOREF(pCmd); NOREF(cArgs); 1066 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1067 } 1068 1069 1070 /** 1071 * @interface_method_impl{FNDBCCMD, The 'logdest' command.} 1072 */ 1073 static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1074 { 1075 int rc = DBGFR3LogModifyDestinations(pUVM, paArgs[0].u.pszString); 1076 if (RT_SUCCESS(rc)) 1077 return VINF_SUCCESS; 1078 NOREF(pCmd); NOREF(cArgs); 1079 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1080 } 1081 1082 1083 /** 1084 * @interface_method_impl{FNDBCCMD, The 'logflags' command.} 1085 */ 1086 static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1087 { 1088 int rc = DBGFR3LogModifyFlags(pUVM, paArgs[0].u.pszString); 1089 if (RT_SUCCESS(rc)) 1090 return VINF_SUCCESS; 1091 NOREF(pCmd); NOREF(cArgs); 1092 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pUVM, paArgs[0].u.pszString); 1146 return VINF_SUCCESS; 1093 1147 } 1094 1148
Note:
See TracChangeset
for help on using the changeset viewer.