[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] small MI plugin change
|
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.25
diff -u -r1.25 ChangeLog
--- ChangeLog 31 Oct 2002 00:15:58 -0000 1.25
+++ ChangeLog 1 Nov 2002 15:02:50 -0000
@@ -1,3 +1,7 @@
+2002-11-1 David Inglis
+ * src/.../mi/core/MIPlugin.java
+ throw MIExceptions in createSession (don't re-thorw as IOExceptions)
+
2002-10-30 Alain Magloire
* src/.../core/cdi/MemoryBlock.java (setDirty): When need a
Index: src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java,v
retrieving revision 1.30
diff -u -r1.30 MIPlugin.java
--- src/org/eclipse/cdt/debug/mi/core/MIPlugin.java 21 Oct 2002 02:55:00 -0000 1.30
+++ src/org/eclipse/cdt/debug/mi/core/MIPlugin.java 1 Nov 2002 15:02:50 -0000
@@ -115,16 +115,12 @@
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 @@
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);
}