mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Bug 550165: Debugging is stuck when "command aborts" on step return
Command abort can occur for commands that are run not just in context of thread, instead stack frame is also present, e.g., step return in case of this bug. Updated the implementation to get IExecutionDMContext from the command context if it is not IExecutionDMContext itself. Change-Id: Ia6cccffba8bde28e22eca46211747de31084f25a Signed-off-by: Umair Sair <umair_sair@hotmail.com>
This commit is contained in:
parent
15b00032ce
commit
810f329774
1 changed files with 5 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Mentor Graphics - Initial API and implementation
|
* Mentor Graphics - Initial API and implementation
|
||||||
|
* Umair Sair (Mentor Graphics) - Debugging is stuck when "command aborted" occurs on step return (bug 550165)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.dsf.mi.service.command;
|
package org.eclipse.cdt.dsf.mi.service.command;
|
||||||
|
@ -18,6 +19,7 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
|
||||||
|
@ -90,10 +92,11 @@ public class MIAsyncErrorProcessor implements IEventProcessor {
|
||||||
public void commandDone(ICommandToken token, ICommandResult result) {
|
public void commandDone(ICommandToken token, ICommandResult result) {
|
||||||
if (token.getCommand() instanceof MICommand<?> && result instanceof MIInfo && ((MIInfo) result).isRunning()) {
|
if (token.getCommand() instanceof MICommand<?> && result instanceof MIInfo && ((MIInfo) result).isRunning()) {
|
||||||
IDMContext ctx = ((MICommand<MIInfo>) token.getCommand()).getContext();
|
IDMContext ctx = ((MICommand<MIInfo>) token.getCommand()).getContext();
|
||||||
if (ctx instanceof IExecutionDMContext) {
|
IExecutionDMContext execDMCtx = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
|
||||||
|
if (execDMCtx != null) {
|
||||||
MIResultRecord rr = ((MIInfo) result).getMIOutput().getMIResultRecord();
|
MIResultRecord rr = ((MIInfo) result).getMIOutput().getMIResultRecord();
|
||||||
if (rr != null) {
|
if (rr != null) {
|
||||||
fRunCommands.put((IExecutionDMContext) ctx, Integer.valueOf(rr.getToken()));
|
fRunCommands.put(execDMCtx, Integer.valueOf(rr.getToken()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue