mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Change the command to grab the logerrors.
This commit is contained in:
parent
4576601158
commit
bbddb0d592
34 changed files with 51 additions and 43 deletions
|
@ -70,18 +70,26 @@ public abstract class Command
|
|||
if (out != null) {
|
||||
info = new MIInfo(out);
|
||||
if (info.isError()) {
|
||||
String mesg = info.getErrorMsg();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
MIOOBRecord[] oobs = out.getMIOOBRecords();
|
||||
for (int i = 0; i < oobs.length; i++) {
|
||||
if (oobs[i] instanceof MILogStreamOutput) {
|
||||
MIStreamRecord o = (MIStreamRecord) oobs[i];
|
||||
sb.append(o.getString());
|
||||
}
|
||||
}
|
||||
throw new MIException(mesg, sb.toString());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* throw an MIException.
|
||||
*/
|
||||
protected void throwMIException (MIInfo info, MIOutput out) throws MIException {
|
||||
String mesg = info.getErrorMsg();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
MIOOBRecord[] oobs = out.getMIOOBRecords();
|
||||
for (int i = 0; i < oobs.length; i++) {
|
||||
if (oobs[i] instanceof MILogStreamOutput) {
|
||||
MIStreamRecord o = (MIStreamRecord) oobs[i];
|
||||
sb.append(o.getString());
|
||||
}
|
||||
}
|
||||
throw new MIException(mesg, sb.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class MIBreakInsert extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIBreakInsertInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class MIBreakList extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIBreakListInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class MIBreakWatch extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIBreakWatchInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -97,7 +97,7 @@ public class MIDataDisassemble extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIDataDisassembleInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MIDataEvaluateExpression extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIDataEvaluateExpressionInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -34,7 +34,7 @@ public class MIDataListChangedRegisters extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIDataListChangedRegistersInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class MIDataListRegisterNames extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIDataListRegisterNamesInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -81,7 +81,7 @@ public class MIDataListRegisterValues extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIDataListRegisterValuesInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -139,7 +139,7 @@ public class MIDataReadMemory extends MICommand {
|
|||
if (out != null) {
|
||||
info = new MIDataReadMemoryInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MIEnvironmentPWD extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIEnvironmentPWDInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class MIGDBShow extends MICommand {
|
|||
if (out != null) {
|
||||
info = new MIGDBShowInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIGDBShowDirectories extends MIGDBShow {
|
|||
if (out != null) {
|
||||
info = new MIGDBShowDirectoriesInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class MIGDBShowExitCode extends MIDataEvaluateExpression {
|
|||
if (out != null) {
|
||||
info = new MIGDBShowExitCodeInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIGDBShowSolibSearchPath extends MIGDBShow {
|
|||
if (out != null) {
|
||||
info = new MIGDBShowSolibSearchPathInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIInfoProgram extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIInfoProgramInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIInfoSharedLibrary extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIInfoSharedLibraryInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MIInfoSignals extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIInfoSignalsInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIInfoThreads extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIInfoThreadsInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIPType extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIPTypeInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -39,7 +39,7 @@ public class MIStackInfoDepth extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIStackInfoDepthInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class MIStackListArguments extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIStackListArgumentsInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -61,7 +61,7 @@ public class MIStackListFrames extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIStackListFramesInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class MIStackListLocals extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIStackListLocalsInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class MIThreadListIds extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIThreadListIdsInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class MIThreadSelect extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIThreadSelectInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class MIVarCreate extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIVarCreateInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MIVarDelete extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIVarDeleteInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class MIVarEvaluateExpression extends MICommand {
|
|||
if (out != null) {
|
||||
info = new MIVarEvaluateExpressionInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MIVarInfoNumChildren extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIVarInfoNumChildrenInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class MIVarListChildren extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIVarListChildrenInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class MIVarShowAttributes extends MICommand
|
|||
if (out != null) {
|
||||
info = new MIVarShowAttributesInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class MIVarUpdate extends MICommand {
|
|||
if (out != null) {
|
||||
info = new MIVarUpdateInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class MIWhatis extends CLICommand
|
|||
if (out != null) {
|
||||
info = new MIWhatisInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
throwMIException(info, out);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
Loading…
Add table
Reference in a new issue