1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 539455: Report debug command errors via status handler

Change-Id: I4c3abbb660e426580ce8f836e6e19a897fbaeefe
Signed-off-by: John Dallaway <john@dallaway.org.uk>
This commit is contained in:
John Dallaway 2018-09-27 12:28:14 +01:00
parent 70a03a862e
commit 87cd426861
5 changed files with 48 additions and 11 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 Wind River Systems and others.
* Copyright (c) 2006, 2018 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
@ -13,6 +13,7 @@
* Marc Khouzam (Ericsson) - New method to properly created ErrorThread (Bug 350837)
* Jason Litton (Sage Electronic Engineering, LLC) - Use Dynamic Tracing option (Bug 379169)
* Jonah Graham (Kichwa Coders) - Bug 317173 - cleanup warnings
* John Dallaway - Decode line breaks in status message (Bug 539455)
*******************************************************************************/
package org.eclipse.cdt.dsf.mi.service.command;
@ -833,6 +834,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
clientMsg.append("Failed to execute MI command:\n"); //$NON-NLS-1$
clientMsg.append(origCommand.toString());
if (message != null) {
message = message.replaceAll("\\\\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
clientMsg.append("Error message from debugger back end:\n"); //$NON-NLS-1$
if (parameters != null) {
try {

View file

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.ui;singleton:=true
Bundle-Version: 2.5.0.qualifier
Bundle-Version: 2.5.1.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2012 Wind River Systems and others.
* Copyright (c) 2006, 2018 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
@ -8,14 +8,15 @@
* Contributors:
* Wind River Systems - initial API and implementation
* Marc Khouzam (Ericsson) - Added support for multi-selection (Bug 330974)
* John Dallaway - Report command execution error (Bug 539455)
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.ui.actions;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.concurrent.ImmediateDataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.Immutable;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.debug.service.IMultiRunControl;
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
@ -108,7 +109,13 @@ public class DsfResumeCommand implements IResumeHandler {
return;
}
multiRun.resume(getContexts(), new ImmediateRequestMonitor());
multiRun.resume(getContexts(), new ImmediateRequestMonitor() {
@Override
protected void handleError() {
super.handleError();
CDebugUtils.error(getStatus(), DsfResumeCommand.this);
}
});
}
});
return false;
@ -117,7 +124,13 @@ public class DsfResumeCommand implements IResumeHandler {
private void executeSingle(IDebugCommandRequest request) {
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
@Override public void doExecute() {
getRunControl().resume(getContext(), new RequestMonitor(fExecutor, null));
getRunControl().resume(getContext(), new ImmediateRequestMonitor() {
@Override
protected void handleError() {
super.handleError();
CDebugUtils.error(getStatus(), DsfResumeCommand.this);
}
});
}
});
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2012 Wind River Systems and others.
* Copyright (c) 2006, 2018 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
@ -8,14 +8,15 @@
* Contributors:
* Wind River Systems - initial API and implementation
* Marc Khouzam (Ericsson) - Added support for multi-selection (Bug 330974)
* John Dallaway - Report command execution error (Bug 539455)
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.ui.actions;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.concurrent.ImmediateDataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.Immutable;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.debug.service.IMultiRunControl;
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
@ -107,7 +108,13 @@ public class DsfSuspendCommand implements ISuspendHandler {
return;
}
multiRun.suspend(getContexts(), new ImmediateRequestMonitor());
multiRun.suspend(getContexts(), new ImmediateRequestMonitor() {
@Override
protected void handleError() {
super.handleError();
CDebugUtils.error(getStatus(), DsfSuspendCommand.this);
}
});
}
});
return false;
@ -116,7 +123,13 @@ public class DsfSuspendCommand implements ISuspendHandler {
private void executeSingle(IDebugCommandRequest request) {
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
@Override public void doExecute() {
getRunControl().suspend(getContext(), new RequestMonitor(fExecutor, null));
getRunControl().suspend(getContext(), new ImmediateRequestMonitor() {
@Override
protected void handleError() {
super.handleError();
CDebugUtils.error(getStatus(), DsfSuspendCommand.this);
}
});
}
});
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2016 Wind River Systems and others.
* Copyright (c) 2006, 2018 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
@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
* John Dallaway - Report command execution error (Bug 539455)
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.ui.viewmodel;
@ -20,6 +21,8 @@ import java.util.Map;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
@ -453,6 +456,12 @@ public final class SteppingController {
}
super.handleFailure();
}
@Override
protected void handleError() {
super.handleError();
CDebugUtils.error(getStatus(), SteppingController.this);
}
});
}