From 5b0f17bcfc65fa21eab994f85f4f96bdfeecbdbf Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 30 Sep 2008 20:19:06 +0000 Subject: [PATCH] [249209] With the new GDB, asynchronous events do not have tokens. So, *running, *stopped, etc will not have a token. However, in our traces, we somehow print the token as -1. This is the fix. --- .../eclipse/dd/mi/service/command/output/MIAsyncRecord.java | 4 ++-- .../eclipse/dd/mi/service/command/output/MIResultRecord.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIAsyncRecord.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIAsyncRecord.java index 61d7c235ec6..c6270f116bb 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIAsyncRecord.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIAsyncRecord.java @@ -21,7 +21,7 @@ public abstract class MIAsyncRecord extends MIOOBRecord { MIResult[] results = null; String asynClass = ""; //$NON-NLS-1$ - int token = 0; + int token = -1; public int getToken() { return token; @@ -53,7 +53,7 @@ public abstract class MIAsyncRecord extends MIOOBRecord { @Override public String toString() { StringBuffer buffer = new StringBuffer(); - if (token != 0) { + if (token > 0) { buffer.append(token); } if (this instanceof MIExecAsyncOutput) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIResultRecord.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIResultRecord.java index c29e1a6ce2d..7e809681955 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIResultRecord.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIResultRecord.java @@ -57,7 +57,10 @@ public class MIResultRecord { @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(token).append('^').append(resultClass); + if (token > 0) { + buffer.append(token); + } + buffer.append('^').append(resultClass); for (int i = 0; i < results.length; i++) { buffer.append(',').append(results[i].toString()); }