Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] MI changes.

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.45
diff -u -r1.45 ChangeLog
--- ChangeLog	2 Dec 2002 18:36:36 -0000	1.45
+++ ChangeLog	5 Dec 2002 14:52:08 -0000
@@ -1,3 +1,36 @@
+2002-12-05 Alain Magloire
+
+	GDB/MI provides error messages in its log stream, one problem
+	is that it is not consistent, for example doing:
+	 (gdb) info threads
+         & "info threads\n"
+	which is obviously not an error.
+	So we put the error stream output par of the exception so when
+	it is relevant it shows in the Exception.
+	MI2CDIException is the bridge class.
+
+	* src/.../mi/core/cdi/BreakpoinManager.java:
+	* src/.../mi/core/cdi/CSession.java:
+	* src/.../mi/core/cdi/CTarget.java:
+	* src/.../mi/core/cdi/CThread.java:
+	* src/.../mi/core/cdi/MemoryBlock.java:
+	* src/.../mi/core/cdi/MemoryManager.java:
+	* src/.../mi/core/cdi/Register.java:
+	* src/.../mi/core/cdi/RegisterManager.java:
+	* src/.../mi/core/cdi/SourceManager.java:
+	* src/.../mi/core/cdi/Value.java:
+	* src/.../mi/core/cdi/Variable.java:
+	* src/.../mi/core/cdi/VariableManager.java:
+
+	* src/.../mi/core/command/Command.java (getMIInfo):
+	When error get the log stream and put it in the MIException.
+	* src/.../mi/core/event/MIErrorEvent.java:
+	Get the log stream error also.
+	* src/.../mi/core/MIException.java (getLogMessage): New method
+	contains buffer output.
+	* src/.../mi/core/RxThread.java (processMIOutput): get the
+	oob arrays up so it can be use in MIErrorEvent.
+
 2002-12-02 Alain Magloire
 
 	* src/.../mi/core/cdi/CTarget.java (updateState): If we
Index: src/org/eclipse/cdt/debug/mi/core/MIException.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java,v
retrieving revision 1.4
diff -u -r1.4 MIException.java
--- src/org/eclipse/cdt/debug/mi/core/MIException.java	5 Aug 2002 06:05:53 -0000	1.4
+++ src/org/eclipse/cdt/debug/mi/core/MIException.java	5 Dec 2002 14:52:08 -0000
@@ -12,7 +12,18 @@
  *
  */
 public class MIException extends Exception {
+	String log = "";
+
 	public MIException(String s) {
 		super(s);
+	}
+
+	public MIException(String s, String l) {
+		super(s);
+		log = l;
+	}
+
+	public String getLogMessage() {
+		return log;
 	}
 }
Index: src/org/eclipse/cdt/debug/mi/core/RxThread.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java,v
retrieving revision 1.39
diff -u -r1.39 RxThread.java
--- src/org/eclipse/cdt/debug/mi/core/RxThread.java	2 Dec 2002 18:36:27 -0000	1.39
+++ src/org/eclipse/cdt/debug/mi/core/RxThread.java	5 Dec 2002 14:52:08 -0000
@@ -122,6 +122,12 @@
 				int id = rr.getToken();
 				Command cmd = rxQueue.removeCommand(id);
 
+				// Clear the accumulate oobList on each new Result Command
+				// response.
+				MIOOBRecord [] oobRecords =
+					(MIOOBRecord[])oobList.toArray(new MIOOBRecord[0]); 
+				oobList.clear();
+				
 				// Check if the state changed.
 				String state = rr.getResultClass();
 				if ("running".equals(state)) {
@@ -154,17 +160,11 @@
 				} else if ("error".equals(state)) {
 					if (session.getMIInferior().isRunning()) {
 						session.getMIInferior().setSuspended();
-						MIEvent event = new MIErrorEvent(rr);
+						MIEvent event = new MIErrorEvent(rr, oobRecords);
 						session.fireEvent(event);
 					}
 				}
 
-				// Clear the accumulate oobList on each new Result Command
-				// response.
-				MIOOBRecord [] oobRecords =
-					(MIOOBRecord[])oobList.toArray(new MIOOBRecord[0]); 
-				oobList.clear();
-				
 				// Notify the waiting command.
 				if (cmd != null) {
 					synchronized (cmd) {
@@ -286,6 +286,9 @@
 					}
 				}
 			}
+			// Accumulate the Log Stream Output response for parsing.
+			// Some commands will put valuable info  in the Log Stream.
+			oobList.add(stream);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java,v
retrieving revision 1.21
diff -u -r1.21 BreakpointManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java	26 Oct 2002 20:22:04 -0000	1.21
+++ src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java	5 Dec 2002 14:52:09 -0000
@@ -145,7 +145,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			resumeInferior(state);
 		}
@@ -174,7 +174,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			// Resume the program and enable events.
 			resumeInferior(state);
@@ -202,7 +202,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			resumeInferior(state);
 		}
@@ -248,7 +248,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			resumeInferior(state);
 		}
@@ -276,7 +276,7 @@
 			}
 			// FIXME: Generate a DestroyEvent for deleted ones.
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		return (ICDIBreakpoint[]) listBreakpoints();
 	}
@@ -342,7 +342,7 @@
 				throw new CDIException("Error parsing");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			resumeInferior(state);
 		}
@@ -377,7 +377,7 @@
 				throw new CDIException("Parsing Error");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		} finally {
 			resumeInferior(state);
 		}
Index: src/org/eclipse/cdt/debug/mi/core/cdi/CObject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CObject.java,v
retrieving revision 1.2
diff -u -r1.2 CObject.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/CObject.java	26 Aug 2002 05:15:22 -0000	1.2
+++ src/org/eclipse/cdt/debug/mi/core/cdi/CObject.java	5 Dec 2002 14:52:09 -0000
@@ -8,12 +8,6 @@
 import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class CObject implements ICDIObject {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/CSession.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CSession.java,v
retrieving revision 1.21
diff -u -r1.21 CSession.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/CSession.java	22 Oct 2002 20:28:20 -0000	1.21
+++ src/org/eclipse/cdt/debug/mi/core/cdi/CSession.java	5 Dec 2002 14:52:09 -0000
@@ -204,7 +204,7 @@
 			session.postCommand(dir);
 		 	dir.getMIInfo();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java,v
retrieving revision 1.35
diff -u -r1.35 CTarget.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java	2 Dec 2002 18:35:11 -0000	1.35
+++ src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java	5 Dec 2002 14:52:09 -0000
@@ -107,7 +107,7 @@
 				}
 				currentThreadId = info.getNewThreadId();
 			} catch (MIException e) {
-				throw new CDIException(e.getMessage());
+				throw new MI2CDIException(e);
 			}
 
 			// Resetting threads may change the value of
@@ -246,7 +246,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = run.getToken();
 	}
@@ -268,7 +268,7 @@
 					throw new CDIException("No answer");
 				}
 			} catch (MIException e) {
-				throw new CDIException(e.getMessage());
+				throw new MI2CDIException(e);
 			}
 			lastExecutionToken = cont.getToken();
 		} else if (mi.getMIInferior().isTerminated()) {
@@ -293,7 +293,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = step.getToken();
 	}
@@ -312,7 +312,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = stepi.getToken();
 	}
@@ -331,7 +331,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = next.getToken();
 	}
@@ -350,7 +350,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = nexti.getToken();
 	}
@@ -369,7 +369,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = finish.getToken();
 	}
@@ -383,7 +383,7 @@
 		try {
 			mi.getMIInferior().interrupt();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -401,7 +401,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		// Unfortunately -target-detach does not generate an
 		// event so we do it here.
@@ -424,7 +424,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = finish.getToken();
 	}
@@ -451,7 +451,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		lastExecutionToken = until.getToken();
 
@@ -475,7 +475,7 @@
 			}
 			return info.getExpression();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java,v
retrieving revision 1.22
diff -u -r1.22 CThread.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java	28 Nov 2002 16:19:30 -0000	1.22
+++ src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java	5 Dec 2002 14:52:09 -0000
@@ -106,7 +106,7 @@
 			getCTarget().setCurrentThread(oldThread);
 			return info.getDepth();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 			//System.out.println(e);
 		}
 	}
@@ -189,7 +189,7 @@
 			regMgr.update();
 
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/DestroyedEvent.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/DestroyedEvent.java,v
retrieving revision 1.3
diff -u -r1.3 DestroyedEvent.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/DestroyedEvent.java	26 Aug 2002 05:20:27 -0000	1.3
+++ src/org/eclipse/cdt/debug/mi/core/cdi/DestroyedEvent.java	5 Dec 2002 14:52:09 -0000
@@ -11,12 +11,6 @@
 import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class DestroyedEvent implements ICDIDestroyedEvent {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java,v
retrieving revision 1.1
diff -u -r1.1 ErrorInfo.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java	2 Dec 2002 18:35:37 -0000	1.1
+++ src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java	5 Dec 2002 14:52:09 -0000
@@ -21,4 +21,11 @@
 		return event.getMessage();
 	}
 
+	/**
+	 * @see org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo#getDetailMessage()
+	 */
+	public String getDetailMessage() {
+		return event.getLogMessage();
+	}
+
 }
Index: src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java
diff -N src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java	5 Dec 2002 14:52:09 -0000
@@ -0,0 +1,14 @@
+package org.eclipse.cdt.debug.mi.core.cdi;
+
+import org.eclipse.cdt.debug.core.cdi.CDIException;
+import org.eclipse.cdt.debug.mi.core.MIException;
+
+/**
+ */
+public class MI2CDIException extends CDIException {
+	
+	public MI2CDIException(MIException e) {
+		super(e.getMessage(), e.getLogMessage());
+	}
+
+}
Index: src/org/eclipse/cdt/debug/mi/core/cdi/MemoryBlock.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryBlock.java,v
retrieving revision 1.11
diff -u -r1.11 MemoryBlock.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/MemoryBlock.java	29 Nov 2002 19:26:04 -0000	1.11
+++ src/org/eclipse/cdt/debug/mi/core/cdi/MemoryBlock.java	5 Dec 2002 14:52:09 -0000
@@ -177,7 +177,7 @@
 					throw new CDIException("No answer");
 				}
 			} catch (MIException e) {
-				throw new CDIException(e.getMessage());
+				throw new MI2CDIException(e);
 			}
 		}
 		// If the assign was succesfull fire a MIChangedEvent() via refresh.
Index: src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java,v
retrieving revision 1.12
diff -u -r1.12 MemoryManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java	20 Nov 2002 21:51:39 -0000	1.12
+++ src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java	5 Dec 2002 14:52:09 -0000
@@ -130,7 +130,7 @@
 			}
 			return info;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/Register.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Register.java,v
retrieving revision 1.5
diff -u -r1.5 Register.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/Register.java	5 Nov 2002 16:21:21 -0000	1.5
+++ src/org/eclipse/cdt/debug/mi/core/cdi/Register.java	5 Dec 2002 14:52:09 -0000
@@ -168,7 +168,7 @@
 					}
 				}
 			} catch (MIException e) {
-				throw new CDIException(e.getMessage());
+				throw new MI2CDIException(e);
 			}
 		} else {
 			String u = getUniqName();
@@ -214,7 +214,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		// If the assign was succesfull fire a MIRegisterChangedEvent()
 		MIRegisterChangedEvent change = new MIRegisterChangedEvent(registers.getToken(),
Index: src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java,v
retrieving revision 1.2
diff -u -r1.2 RegisterManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java	26 Oct 2002 20:24:08 -0000	1.2
+++ src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java	5 Dec 2002 14:52:09 -0000
@@ -52,7 +52,7 @@
 			}
 			return regs;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -119,7 +119,7 @@
 			MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]);
 			mi.fireEvents(events);
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java,v
retrieving revision 1.6
diff -u -r1.6 RuntimeOptions.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java	3 Sep 2002 14:47:45 -0000	1.6
+++ src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java	5 Dec 2002 14:52:09 -0000
@@ -18,12 +18,6 @@
 import org.eclipse.cdt.debug.mi.core.output.MIInfo;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class RuntimeOptions implements ICDIRuntimeOptions {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java,v
retrieving revision 1.4
diff -u -r1.4 SessionObject.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java	26 Aug 2002 05:17:09 -0000	1.4
+++ src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java	5 Dec 2002 14:52:09 -0000
@@ -9,12 +9,6 @@
 import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class SessionObject implements ICDISessionObject {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/Signal.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Signal.java,v
retrieving revision 1.2
diff -u -r1.2 Signal.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/Signal.java	26 Aug 2002 05:17:09 -0000	1.2
+++ src/org/eclipse/cdt/debug/mi/core/cdi/Signal.java	5 Dec 2002 14:52:09 -0000
@@ -9,12 +9,6 @@
 import org.eclipse.cdt.debug.mi.core.event.MISignalEvent;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class Signal extends SessionObject implements ICDISignal {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java,v
retrieving revision 1.5
diff -u -r1.5 SignalManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java	2 Oct 2002 04:44:17 -0000	1.5
+++ src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java	5 Dec 2002 14:52:09 -0000
@@ -10,12 +10,6 @@
 import org.eclipse.cdt.debug.core.cdi.ICDISignalManager;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class SignalManager extends SessionObject implements ICDISignalManager {
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java,v
retrieving revision 1.16
diff -u -r1.16 SourceManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java	20 Oct 2002 23:28:38 -0000	1.16
+++ src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java	5 Dec 2002 14:52:09 -0000
@@ -44,7 +44,7 @@
 			mi.postCommand(dir);
 			dir.getMIInfo();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -60,7 +60,7 @@
 			MIGDBShowDirectoriesInfo info = dir.getMIGDBShowDirectoriesInfo();
 			return info.getDirectories();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -72,7 +72,7 @@
 			mi.postCommand(solib);
 			solib.getMIInfo();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -85,7 +85,7 @@
 			MIGDBShowSolibSearchPathInfo info = dir.getMIGDBShowSolibSearchPathInfo();
 			return info.getDirectories();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -97,7 +97,7 @@
 			mi.postCommand(solib);
 			solib.getMIInfo();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -118,7 +118,7 @@
 			}
 			return instructions;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -149,7 +149,7 @@
 			}
 			return instructions;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -170,7 +170,7 @@
 			}
 			return mixed;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -201,7 +201,7 @@
 			}
 			return mixed;
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/Value.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Value.java,v
retrieving revision 1.12
diff -u -r1.12 Value.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/Value.java	2 Oct 2002 04:45:05 -0000	1.12
+++ src/org/eclipse/cdt/debug/mi/core/cdi/Value.java	5 Dec 2002 14:52:09 -0000
@@ -18,12 +18,6 @@
 import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class Value extends CObject implements ICDIValue {
 
@@ -120,7 +114,7 @@
 
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		return variables;
 	}
Index: src/org/eclipse/cdt/debug/mi/core/cdi/Variable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Variable.java,v
retrieving revision 1.10
diff -u -r1.10 Variable.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/Variable.java	26 Oct 2002 20:24:21 -0000	1.10
+++ src/org/eclipse/cdt/debug/mi/core/cdi/Variable.java	5 Dec 2002 14:52:09 -0000
@@ -20,7 +20,6 @@
 import org.eclipse.cdt.debug.mi.core.output.MIVarShowAttributesInfo;
 
 /**
- * @author alain
  */
 public class Variable extends CObject implements ICDIVariable {
 
@@ -89,7 +88,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 		
 		// If the assign was succesfull fire a MIVarChangedEvent()
@@ -112,7 +111,7 @@
 			}
 			return info.isEditable();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -131,7 +130,7 @@
 				throw new CDIException("No answer");
 			}
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java,v
retrieving revision 1.10
diff -u -r1.10 VariableManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java	26 Oct 2002 20:24:27 -0000	1.10
+++ src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java	5 Dec 2002 14:52:09 -0000
@@ -117,7 +117,7 @@
 			MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]);
 			mi.fireEvents(events);
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
@@ -139,7 +139,7 @@
 				element.name = name;
 				element.stackframe = stack;
 			} catch (MIException e) {
-				throw new CDIException(e.getMessage());
+				throw new MI2CDIException(e);
 			}
 		}
 		return element;
@@ -163,7 +163,7 @@
 			mi.postCommand(var);
 			var.getMIInfo();
 		} catch (MIException e) {
-			throw new CDIException(e.getMessage());
+			throw new MI2CDIException(e);
 		}
 	}
 
Index: src/org/eclipse/cdt/debug/mi/core/cdi/Watchpoint.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Watchpoint.java,v
retrieving revision 1.4
diff -u -r1.4 Watchpoint.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/Watchpoint.java	25 Nov 2002 17:07:12 -0000	1.4
+++ src/org/eclipse/cdt/debug/mi/core/cdi/Watchpoint.java	5 Dec 2002 14:52:09 -0000
@@ -10,12 +10,6 @@
 import org.eclipse.cdt.debug.mi.core.output.MIBreakPoint;
 
 /**
- * @author alain
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
 
Index: src/org/eclipse/cdt/debug/mi/core/command/Command.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java,v
retrieving revision 1.9
diff -u -r1.9 Command.java
--- src/org/eclipse/cdt/debug/mi/core/command/Command.java	26 Oct 2002 20:25:11 -0000	1.9
+++ src/org/eclipse/cdt/debug/mi/core/command/Command.java	5 Dec 2002 14:52:08 -0000
@@ -8,7 +8,10 @@
 
 import org.eclipse.cdt.debug.mi.core.MIException;
 import org.eclipse.cdt.debug.mi.core.output.MIInfo;
+import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput;
+import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord;
 import org.eclipse.cdt.debug.mi.core.output.MIOutput;
+import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord;
 
 /**
  * A base class for all mi requests.
@@ -67,8 +70,16 @@
 		if (out != null) {
 			info = new MIInfo(out);
 			if (info.isError()) {
-				String s = info.getErrorMsg();
-				throw new MIException(s);
+				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());
 			}
 		}
 		return info;
Index: src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java,v
retrieving revision 1.1
diff -u -r1.1 MIErrorEvent.java
--- src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java	2 Dec 2002 18:36:03 -0000	1.1
+++ src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java	5 Dec 2002 14:52:08 -0000
@@ -6,9 +6,11 @@
 package org.eclipse.cdt.debug.mi.core.event;
 
 import org.eclipse.cdt.debug.mi.core.output.MIConst;
-import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput;
+import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput;
+import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord;
 import org.eclipse.cdt.debug.mi.core.output.MIResult;
 import org.eclipse.cdt.debug.mi.core.output.MIResultRecord;
+import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord;
 import org.eclipse.cdt.debug.mi.core.output.MIValue;
 
 
@@ -22,14 +24,12 @@
 public class MIErrorEvent extends MIStoppedEvent {
 
 	String msg = "";
+	String log = "";
+	MIOOBRecord[] oobs;
 
-	public MIErrorEvent(MIExecAsyncOutput async) {
-		super(async);
-		parse();
-	}
-
-	public MIErrorEvent(MIResultRecord record) {
-		super(record);
+	public MIErrorEvent(MIResultRecord rr, MIOOBRecord[] o) {
+		super(rr);
+		oobs = o;
 		parse();
 	}
 
@@ -37,29 +37,37 @@
 		return msg;
 	}
 
+	public String getLogMessage() {
+		return log;
+	}
+
 	void parse () {
-		MIResult[] results = null;
-		MIExecAsyncOutput exec = getMIExecAsyncOutput();
 		MIResultRecord rr = getMIResultRecord();
-
-		if (exec != null) {
-			results = exec.getMIResults();
-		} else if (rr != null) {
-			results = rr.getMIResults();
-		}
-
-		if (results != null) {
-			for (int i = 0; i < results.length; i++) {
-				String var = results[i].getVariable();
-				MIValue value = results[i].getMIValue();
-				String str = "";
-				if (value instanceof MIConst) {
-					str = ((MIConst)value).getString();
+		if (rr != null) {
+			MIResult[] results = rr.getMIResults();
+			if (results != null) {
+				for (int i = 0; i < results.length; i++) {
+					String var = results[i].getVariable();
+					MIValue value = results[i].getMIValue();
+					String str = "";
+					if (value instanceof MIConst) {
+						str = ((MIConst)value).getString();
+					}
+
+					if (var.equals("msg")) {
+						msg = str;
+					}
 				}
-
-				if (var.equals("msg")) {
-					msg = str;
+			}
+			if (oobs != null) {
+				StringBuffer sb = new StringBuffer();
+				for (int i = 0; i < oobs.length; i++) {
+					if (oobs[i] instanceof MILogStreamOutput) {
+						MIStreamRecord o = (MIStreamRecord)oobs[i];
+						sb.append(o.getString());
+					}
 				}
+				log = sb.toString();
 			}
 		}
 	}



Back to the top