From 810f329774b386cb0df5f1f454db8f69b9bb21ac Mon Sep 17 00:00:00 2001 From: Umair Sair Date: Sun, 18 Aug 2019 00:16:58 +0500 Subject: 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 --- .../eclipse/cdt/dsf/mi/service/command/MIAsyncErrorProcessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIAsyncErrorProcessor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIAsyncErrorProcessor.java index 83023202e0f..b2ab447b5fe 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIAsyncErrorProcessor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIAsyncErrorProcessor.java @@ -10,6 +10,7 @@ * * Contributors: * 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; @@ -18,6 +19,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +import org.eclipse.cdt.dsf.datamodel.DMContexts; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; 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) { if (token.getCommand() instanceof MICommand && result instanceof MIInfo && ((MIInfo) result).isRunning()) { IDMContext ctx = ((MICommand) token.getCommand()).getContext(); - if (ctx instanceof IExecutionDMContext) { + IExecutionDMContext execDMCtx = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class); + if (execDMCtx != null) { MIResultRecord rr = ((MIInfo) result).getMIOutput().getMIResultRecord(); if (rr != null) { - fRunCommands.put((IExecutionDMContext) ctx, Integer.valueOf(rr.getToken())); + fRunCommands.put(execDMCtx, Integer.valueOf(rr.getToken())); } } } -- cgit v1.2.3