diff options
author | Marc Khouzam | 2010-04-30 17:07:00 +0000 |
---|---|---|
committer | Marc Khouzam | 2010-04-30 17:07:00 +0000 |
commit | ea18f6f726b5e0046747253ef1e02e236c27e8f2 (patch) | |
tree | 18bf1c0259e6e3a82b6621e4e86838d703e505af /dsf | |
parent | 1e87c2c634bf733a6fcb7146a57eda0dfce8c459 (diff) | |
download | org.eclipse.cdt-ea18f6f726b5e0046747253ef1e02e236c27e8f2.tar.gz org.eclipse.cdt-ea18f6f726b5e0046747253ef1e02e236c27e8f2.tar.xz org.eclipse.cdt-ea18f6f726b5e0046747253ef1e02e236c27e8f2.zip |
Bug 309309: CommandCache could prevent RMs from being completed if the ICommandControl.queueCommand() returned right away.
Diffstat (limited to 'dsf')
-rw-r--r-- | dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java index 08bd677026a..20851ae8086 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 Wind River Systems and others. + * Copyright (c) 2007, 2010 Wind River Systems and others. * 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 @@ -418,13 +418,17 @@ public class CommandCache implements ICommandListener * Match this up with a command set we know about. */ if ( ! fPendingQCommandsSent.remove(finalCachedCmd) ) { - /* - * It should not be the case that this is possible. It would mean we - * have mismanaged the queues or completions are lost at the lower - * levels. When the removal and cancellation is completed this code - * will probably not be here. But for now just return. - */ - return ; + /* + * This can happen if the call to queueCommand() completes without + * actually having to send the command. In that case, we should find + * our command in the fPendingQCommandsNotYetSent queue. + * For example, upon termination some queueCommand() implementation + * may complete immediately with an error status. Bug 309309 + */ + if ( ! fPendingQCommandsNotYetSent.remove(finalCachedCmd) ) { + assert false : "Missing command"; //$NON-NLS-1$ + return; + } } ICommandResult result = getData(); |