Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] Zylin CDT patches status

It is time for the annual status update on Zylin CDT patches :-)

The remaining patches are:

- This is the biggie. Fixes to make the GDB console more like Insight's.
- Some weirdo problem with stack frames showing as corrupted when
  evaluating expressions. Inscrutinable workaround found. I expect
  this "Zylin CDT improvement" to be ephemeral. :-)
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=110141


Also, I'm currently testing out mapping source containers to see if they
put all the CygWin source lookup issues are put to bed. I'd like to add
a default /cygdrive/X -> X:\ source container to the Zylin Embedded
plugin, but haven't figured out how to do that yet. 


-- 
Øyvind Harboe
http://www.zylin.com
Index: cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java,v
retrieving revision 1.15
diff -u -r1.15 Thread.java
--- cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java	29 Jul 2005 02:12:00 -0000	1.15
+++ cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -170,6 +170,15 @@
 					// First try fails, retry. gdb patches up the corrupt frame
 					// so retry should give us a frame count that is safe.
 					mi.postCommand(depth);
+					/* FIX!!!! Why does this fix the problem with stack frames not displaying correctly???? */
+					try
+					{
+						java.lang.Thread.sleep(200);
+					} catch (InterruptedException e1)
+					{
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
 					info = depth.getMIStackInfoDepthInfo();
 					if (info == null) {
 						throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
@@ -508,8 +517,7 @@
 			Session session = (Session)getTarget().getSession();
 			VariableManager varMgr = session.getVariableManager();
 			return varMgr.createThreadStorage((ThreadStorageDescriptor)varDesc);
-		}
+}
 		return null;
 	}
-
 }
Index: mi/org/eclipse/cdt/debug/mi/core/MISession.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java,v
retrieving revision 1.12
diff -u -r1.12 MISession.java
--- mi/org/eclipse/cdt/debug/mi/core/MISession.java	31 Aug 2005 17:35:33 -0000	1.12
+++ mi/org/eclipse/cdt/debug/mi/core/MISession.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -67,7 +67,7 @@
 	MIProcess gdbProcess;
 	InputStream inChannel;
 	OutputStream outChannel;
-
+	
 	TxThread txThread;
 	RxThread rxThread;
 	EventThread eventThread;
@@ -121,7 +121,7 @@
 			setCommandFactory(new CommandFactory(MIVersion.MI2));
 		}
 	}
-	
+
 	/**
 	 * Create the gdb session.
 	 *
@@ -141,6 +141,7 @@
 
 		sessionType = type;
 
+
 		parser = new MIParser();
 
 		inferior = new MIInferior(this, tty);
@@ -148,7 +149,7 @@
 		txQueue = new CommandQueue();
 		rxQueue = new CommandQueue();
 		eventQueue = new Queue();
-		
+
 		txThread = new TxThread(this);
 		rxThread = new RxThread(this);
 		eventThread = new EventThread(this);
@@ -178,7 +179,7 @@
 		} catch (IllegalThreadStateException e) {
 			// Ok, it means the process is alive.
 		}
-		
+
 		if (monitor.isCanceled()) {
 			throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
 		}
@@ -186,7 +187,7 @@
 		txThread.start();
 		rxThread.start();
 		eventThread.start();
-			
+
 		try {
 			if (monitor.isCanceled()) {
 				throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
@@ -215,26 +216,26 @@
 		// Disable a certain number of irritations from gdb.
 		// Like confirmation and screen size.
 		MIGDBSet confirm = getCommandFactory().createMIGDBSet(new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$
-		postCommand(confirm, launchTimeout);
-		confirm.getMIInfo();
+			postCommand(confirm, launchTimeout);
+			confirm.getMIInfo(); 
 		if (monitor.isCanceled()) {
 			throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
 		}
 
 		MIGDBSet width = getCommandFactory().createMIGDBSet(new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
-		postCommand(width, launchTimeout);
-		width.getMIInfo();
+			postCommand(width, launchTimeout);
+			width.getMIInfo(); 
 		if (monitor.isCanceled()) {
 			throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
 		}
 
 		MIGDBSet height = getCommandFactory().createMIGDBSet(new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
-		postCommand(height, launchTimeout);
-		height.getMIInfo();
+			postCommand(height, launchTimeout);
+			height.getMIInfo();
 		if (monitor.isCanceled()) {
 			throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
 		}
-		
+
 		useInterpreterExecConsole = canUseInterpreterExecConsole();
 		if (monitor.isCanceled()) {
 			throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$
@@ -251,29 +252,29 @@
 	
 	protected boolean canUseInterpreterExecConsole() {
 		// Try to discover if "-interpreter-exec" is supported.
-		try {
+			try {
 			MIInterpreterExecConsole echo = getCommandFactory().createMIInterpreterExecConsole("echo"); //$NON-NLS-1$
 			postCommand(echo);
-			echo.getMIInfo();
+				echo.getMIInfo();
 			return true;
-		} catch (MIException e) {
-			//
-		}
+			} catch (MIException e) {
+				//
+			}
 		return false;
 	}
-	
+
 	protected String getCLIPrompt() throws MIException {
-		// Get GDB's prompt
+			// Get GDB's prompt
 		MIGDBShowPrompt prompt = getCommandFactory().createMIGDBShowPrompt();
-		postCommand(prompt);
-		MIGDBShowInfo infoPrompt = prompt.getMIGDBShowInfo();
-		String value = infoPrompt.getValue();
-		if (value != null && value.length() > 0) {
+			postCommand(prompt);
+			MIGDBShowInfo infoPrompt = prompt.getMIGDBShowInfo();
+			String value = infoPrompt.getValue();
+			if (value != null && value.length() > 0) {
 			return value.trim();
-		}
+			}
 		return null;
-	}
-
+			}
+			
 	/**
 	 * get MI Console Stream.
 	 * The parser will make available the MI console stream output.
@@ -435,7 +436,7 @@
 		}
 		postCommand0(cmd, timeout);
 	}
-	
+
 	/**
 	 * if timeout < 0 the operation will not try to way for
 	 * answer from gdb.
@@ -447,7 +448,7 @@
 	public synchronized void postCommand0(Command cmd, long timeout) throws MIException {
 		// TRACING: print the command;
 		if (MIPlugin.getDefault().isDebugging()) {
-			MIPlugin.getDefault().debugLog(cmd.toString());
+		MIPlugin.getDefault().debugLog(cmd.toString());
 		}
 
 		txQueue.addCommand(cmd);
@@ -621,6 +622,7 @@
 		super.notifyObservers(arg);
 	}
 
+
 	OutputStream getConsolePipe() {
 		return miOutConsolePipe;
 	}
@@ -674,4 +676,44 @@
 		}
 	}
 
+	private Command inflightCmd;
+	private boolean showOutput=true; // show first command
+	/**
+	 * Set this cmd as in flight
+	 * 
+	 * @param console
+	 */
+	public void inflightConsoleCmd(Command cmd) {
+		inflightCmd=cmd;
+		showOutput=showOutput||!cmd.isSilent();
+	}
+
+	/**
+	 * @param cmd
+	 */
+	public void retireCmd(Command cmd) {
+	    if (inflightCmd!=null&&cmd!=null) {
+	        if (cmd.getToken()==inflightCmd.getToken()) {	            
+	            inflightCmd=null;
+	        } else {
+	            int x=0;
+	        }
+	    }
+	}
+
+	/**
+	 * Are we in silent mode?
+	 * 
+	 * @return
+	 */
+	public boolean silent() {
+		return !showOutput;
+	}
+
+	public void processedPrompt()
+	{
+		showOutput=false;
+	}
+
+	
 }
Index: mi/org/eclipse/cdt/debug/mi/core/RxThread.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java,v
retrieving revision 1.7
diff -u -r1.7 RxThread.java
--- mi/org/eclipse/cdt/debug/mi/core/RxThread.java	28 Aug 2005 03:21:50 -0000	1.7
+++ mi/org/eclipse/cdt/debug/mi/core/RxThread.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -87,10 +87,23 @@
 			while ((line = reader.readLine()) != null) {
 				// TRACING: print the output.
 				if (MIPlugin.getDefault().isDebugging()) {
-					MIPlugin.getDefault().debugLog(line);
+				MIPlugin.getDefault().debugLog(line);
 				}
 				setPrompt(line);
 				processMIOutput(line + "\n"); //$NON-NLS-1$
+				if (inPrimaryPrompt()) {
+					if (!session.silent())
+					{
+						OutputStream console = session.getConsolePipe();
+						if (console!=null)
+						{
+							console.write(line.getBytes());
+							console.flush();
+						}
+					}
+					session.processedPrompt();
+				}
+
 			}
 		} catch (IOException e) {
 			//e.printStackTrace();
@@ -167,6 +180,8 @@
 			if (rr != null) {
 				int id = rr.getToken();
 				Command cmd = rxQueue.removeCommand(id);
+				
+			    session.retireCmd(cmd);
 
 				// Clear the accumulate oobList on each new Result Command
 				// response.
@@ -319,6 +334,24 @@
 			}
 		} else if (async instanceof MIStatusAsyncOutput) {
 			// Nothing done .. but what about +download??
+			// This is meant for the gdb console.
+			OutputStream log = session.getLogPipe();
+			if (log != null) {
+			    MIStatusAsyncOutput out = (MIStatusAsyncOutput) async;
+			    for (int i=0; i<out.getMIResults().length; i++) {
+					String str = out.getMIResults()[i].getVariable();
+					if (str != null) {
+						try {
+							log.write((str + "\n").getBytes());
+							log.flush();
+						} catch (IOException e) {
+						}
+					}
+			    }
+			}
+		    
+		    
+		    
 		} else if (async instanceof MINotifyAsyncOutput) {
 			// Nothing
 		}
@@ -326,6 +359,7 @@
 
 	void processMIOOBRecord(MIStreamRecord stream) {
 		if (stream instanceof MIConsoleStreamOutput) {
+			if (!session.silent()) {
 			OutputStream console = session.getConsolePipe();
 			if (console != null) {
 				MIConsoleStreamOutput out = (MIConsoleStreamOutput) stream;
@@ -339,11 +373,13 @@
 					} catch (IOException e) {
 					}
 				}
+				}
 			}
 			// Accumulate the Console Stream Output response for parsing.
 			// Some commands will put valuable info  in the Console Stream.
 			oobList.add(stream);
 		} else if (stream instanceof MITargetStreamOutput) {
+			if (true/*!session.silent()*/) {
 			OutputStream target = session.getMIInferior().getPipedOutputStream();
 			if (target != null) {
 				MITargetStreamOutput out = (MITargetStreamOutput) stream;
@@ -355,8 +391,25 @@
 					} catch (IOException e) {
 					}
 				}
+				} else {
+					/* dump to GDB console as a fallback... */
+					OutputStream console = session.getConsolePipe();
+					if (console != null) {
+						MITargetStreamOutput out = (MITargetStreamOutput) stream;
+						String str = out.getString();
+						// Process the console stream too.
+						if (str != null) {
+							try {
+								console.write(str.getBytes());
+								console.flush();
+							} catch (IOException e) {
+							}
+						}
+					}
+				}
 			}
 		} else if (stream instanceof MILogStreamOutput) {
+			if (!session.silent()) {
 			// This is meant for the gdb console.
 			OutputStream log = session.getLogPipe();
 			if (log != null) {
@@ -369,11 +422,34 @@
 					} catch (IOException e) {
 					}
 				}
+				}
 			}
 			// Accumulate the Log Stream Output response for parsing.
 			// Some commands will put valuable info  in the Log Stream.
 			oobList.add(stream);
-		}
+		} else 
+		{
+			try
+			{
+				MIStreamRecord out = (MIStreamRecord) stream;
+				/* unknown type, just dump output to console */
+				if (!session.silent()) {
+					OutputStream console = session.getConsolePipe();
+					if (console != null) {
+						String str = out.getString();
+						if (str != null) {
+							try {
+								console.write(str.getBytes());
+								console.flush();
+							} catch (IOException e) {
+							}
+						}
+					}
+				}
+			} catch (RuntimeException e)
+			{
+			}
+		} 
 	}
 
 	/**
Index: mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java,v
retrieving revision 1.7
diff -u -r1.7 SessionProcess.java
--- mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java	27 Jun 2005 15:24:55 -0000	1.7
+++ mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -92,11 +92,13 @@
 						cmd = new RawCommand(str);
 					} else if (session.useExecConsole() && str.length() > 0 
 							&& !CLIProcessor.isSteppingOperation(str)) {
+					    // FIX!!! Does not work on my GDB for "load"
 						CommandFactory factory = session.getCommandFactory();
 						cmd = factory.createMIInterpreterExecConsole(str);
 					} else {
 						cmd = new CLICommand(str);
 					}
+					cmd.setSilent(false);
 					try {
 						// Do not wait around for the answer.
 						session.postCommand(cmd, -1);
Index: mi/org/eclipse/cdt/debug/mi/core/TxThread.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/TxThread.java,v
retrieving revision 1.5
diff -u -r1.5 TxThread.java
--- mi/org/eclipse/cdt/debug/mi/core/TxThread.java	23 Jun 2005 16:01:00 -0000	1.5
+++ mi/org/eclipse/cdt/debug/mi/core/TxThread.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -71,6 +71,7 @@
 						} else if (cmd instanceof MIInterpreterExecConsole) {
 							cli.processStateChanges((MIInterpreterExecConsole)cmd);
 						}
+						session.inflightConsoleCmd(cmd);
 
 						// shove in the pipe
 						if (out != null) {
Index: mi/org/eclipse/cdt/debug/mi/core/command/Command.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java,v
retrieving revision 1.3
diff -u -r1.3 Command.java
--- mi/org/eclipse/cdt/debug/mi/core/command/Command.java	23 Jun 2005 16:00:59 -0000	1.3
+++ mi/org/eclipse/cdt/debug/mi/core/command/Command.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -104,4 +104,20 @@
 		throw new MIException(mesg, details);
 	}
 
+	private boolean silent = true;
+
+	/**
+	 * @return Returns the silent.
+	 */
+	public boolean isSilent() {
+		return silent;
+	}
+
+	/**
+	 * @param silent The silent to set.
+	 */
+	public void setSilent(boolean silent) {
+		this.silent = silent;
+	}
+
 }
Index: mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java,v
retrieving revision 1.5
diff -u -r1.5 MIStackInfoDepth.java
--- mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java	27 Jun 2005 15:24:55 -0000	1.5
+++ mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java	29 Sep 2005 07:50:14 -0000
@@ -44,6 +44,12 @@
 		if (out != null) {
 			info = new MIStackInfoDepthInfo(out);
 			if (info.isError()) {
+				/* do not throw an exception here. It is completely
+				 * normal for the stack not to be corrupt while e.g.
+                 * debugging interrupts or thread switches.'
+                 *
+                 * A dialog is *much* to intrusive.
+                 */
 				throwMIException(info, out);
 			}
 		}
Index: mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java,v
retrieving revision 1.5
diff -u -r1.5 MIStackListArguments.java
--- mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java	27 Jun 2005 15:24:55 -0000	1.5
+++ mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java	29 Sep 2005 07:50:14 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -62,11 +62,20 @@
 		MIInfo info = null;
 		MIOutput out = getMIOutput();
 		if (out != null) {
-			info = new MIStackListArgumentsInfo(out);
+			info = createMIStackListArgumentsInfo(out);
 			if (info.isError()) {
 				throwMIException(info, out);
 			}
 		}
 		return info;
 	}
+
+	/**
+	 * @param out
+	 * @return
+	 */
+	protected MIStackListArgumentsInfo createMIStackListArgumentsInfo(MIOutput out)
+	{
+		return new MIStackListArgumentsInfo(out);
+	}
 }
Index: mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java,v
retrieving revision 1.6
diff -u -r1.6 MIConst.java
--- mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java	23 Jun 2005 16:00:59 -0000	1.6
+++ mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java	29 Sep 2005 07:50:15 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -65,7 +65,7 @@
 			buffer.append('\\');
 		}
 
-		return buffer.toString();
+		return buffer.toString().replaceAll("\\r\\n", "\n");
 	}
 
 	public String toString() {
Index: mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java,v
retrieving revision 1.7
diff -u -r1.7 MIParser.java
--- mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java	23 Jun 2005 16:00:59 -0000	1.7
+++ mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java	29 Sep 2005 07:50:15 -0000
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     QNX Software Systems - Initial API and implementation
  *******************************************************************************/
@@ -131,7 +131,13 @@
 				if (token.charAt(0) == '^') {
 					token.deleteCharAt(0);
 					rr = processMIResultRecord(token, id);
-				} else if (startsWith(token, primaryPrompt)) {
+				} else if (!token.toString().startsWith(primaryPrompt)) {
+					/* we want to process the primary prompt as well to get it printed.. */
+	                MIOOBRecord band = processMIOOBRecord(token, id);
+                    if (band != null) {
+                        oobs.add(band);
+                    }
+                } else if (startsWith(token, primaryPrompt)) {
 					//break; // Do nothing.
 				} else {
 					MIOOBRecord band = processMIOOBRecord(token, id);
@@ -246,7 +252,7 @@
 		} else {
 			// Badly format MI line, just pass it to the user as target stream
 			MIStreamRecord stream = new MITargetStreamOutput();
-			stream.setCString(buffer.toString() + "\n"); //$NON-NLS-1$
+			stream.setCString(buffer.toString()); //$NON-NLS-1$
 			oob = stream;
 		}
 		return oob;
@@ -346,7 +352,7 @@
 	 * ']' consuming/delete chars from the StringBuffer.
 	 */
 	private MIValue processMIList(FSB buffer) {
-		MIList list = new MIList();
+		MIList list =  new MIList();
 		List valueList = new ArrayList();
 		List resultList = new ArrayList();
 		// catch closing ']'

Back to the top