diff options
author | David Inglis | 2002-11-01 15:04:43 +0000 |
---|---|---|
committer | David Inglis | 2002-11-01 15:04:43 +0000 |
commit | 075e29a48edade7b86a7eb80f61830f55ced631b (patch) | |
tree | 939c1e047015fcbf5cb8c3ba9001e4ccd8b91426 /debug | |
parent | 2d39f23eeea9b264b6aee65d7341abb37d37cb49 (diff) | |
download | org.eclipse.cdt-075e29a48edade7b86a7eb80f61830f55ced631b.tar.gz org.eclipse.cdt-075e29a48edade7b86a7eb80f61830f55ced631b.tar.xz org.eclipse.cdt-075e29a48edade7b86a7eb80f61830f55ced631b.zip |
let throw MIException in createSession
Diffstat (limited to 'debug')
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 4 | ||||
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java | 48 |
2 files changed, 24 insertions, 28 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 19994f50f1c..177a8225766 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,7 @@ +2002-11-1 David Inglis + * src/.../mi/core/MIPlugin.java + throw MIExceptions in createSession (not rethorwn IOExceptions) + 2002-10-30 Alain Magloire * src/.../core/cdi/MemoryBlock.java (setDirty): When need a diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java index 8ed8b69366d..871596ffc96 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java @@ -115,16 +115,12 @@ public class MIPlugin extends Plugin { MISession session = createMISession(pgdb, pty, MISession.PROGRAM); // For windows we need to start the inferior in a new console window // to separate the Inferior std{in,out,err} from gdb std{in,out,err} - try { - CommandFactory factory = session.getCommandFactory(); - MIGDBSet set = factory.createMIGDBSet(new String[]{"new-console"}); - session.postCommand(set); - MIInfo info = set.getMIInfo(); - if (info == null) { - throw new IOException("No answer"); - } - } catch (MIException e) { - //throw new IOException("Failed to attach"); + CommandFactory factory = session.getCommandFactory(); + MIGDBSet set = factory.createMIGDBSet(new String[]{"new-console"}); + session.postCommand(set); + MIInfo info = set.getMIInfo(); + if (info == null) { + throw new MIException("No answer"); } return new CSession(session, false); } @@ -161,27 +157,23 @@ public class MIPlugin extends Plugin { Process pgdb = ProcessFactory.getFactory().exec(args); MISession session = createMISession(pgdb, null, MISession.ATTACH); MIInfo info = null; - try { - CommandFactory factory = session.getCommandFactory(); - if (targetParams != null && targetParams.length > 0) { - MITargetSelect target = factory.createMITargetSelect(targetParams); - session.postCommand(target); - info = target.getMIInfo(); - if (info == null) { - throw new IOException("No answer"); - } - } - MITargetAttach attach = factory.createMITargetAttach(pid); - session.postCommand(attach); - info = attach.getMIInfo(); + CommandFactory factory = session.getCommandFactory(); + if (targetParams != null && targetParams.length > 0) { + MITargetSelect target = factory.createMITargetSelect(targetParams); + session.postCommand(target); + info = target.getMIInfo(); if (info == null) { - throw new IOException("No answer"); + throw new MIException("No answer"); } - //@@@ We have to manually set the suspended state when we attach - session.getMIInferior().setSuspended(); - } catch (MIException e) { - throw new IOException("Failed to attach"); } + MITargetAttach attach = factory.createMITargetAttach(pid); + session.postCommand(attach); + info = attach.getMIInfo(); + if (info == null) { + throw new MIException("No answer"); + } + //@@@ We have to manually set the suspended state when we attach + session.getMIInferior().setSuspended(); return new CSession(session, true); } |