Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2011-03-15 05:57:16 -0400
committerMarc Khouzam2011-03-15 05:57:16 -0400
commit60f2c4acc5ff7b99bf1a6a96e31860bbd8fea2ae (patch)
tree84cc3639c867dd2a8a52e5539938ba10dace778d
parent18cae2a5248775d772cf820716027e851e4d5d15 (diff)
downloadorg.eclipse.cdt-60f2c4acc5ff7b99bf1a6a96e31860bbd8fea2ae.tar.gz
org.eclipse.cdt-60f2c4acc5ff7b99bf1a6a96e31860bbd8fea2ae.tar.xz
org.eclipse.cdt-60f2c4acc5ff7b99bf1a6a96e31860bbd8fea2ae.zip
Bug 233116: Cancelling an Attach or post-mortem launch should be graceful
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java9
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java9
2 files changed, 16 insertions, 2 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java
index 5d36b7d44b..f25797c023 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java
@@ -129,7 +129,9 @@ public class GdbConnectCommand implements IConnect {
try {
PrompterInfo info = new PrompterInfo(fNewProcessSupported, fProcessList);
Object result = prompter.handleStatus(processPromptStatus, info);
- if (result instanceof Integer || result instanceof String) {
+ if (result == null) {
+ fRequestMonitor.cancel();
+ } else if (result instanceof Integer || result instanceof String) {
fRequestMonitor.setData(result);
} else {
fRequestMonitor.setStatus(NO_PID_STATUS);
@@ -186,6 +188,11 @@ public class GdbConnectCommand implements IConnect {
"Prompt for Process", newProcessSupported, procInfoList.toArray(new IProcessExtendedInfo[0]), //$NON-NLS-1$
new DataRequestMonitor<Object>(fExecutor, rm) {
@Override
+ protected void handleCancel() {
+ rm.cancel();
+ rm.done();
+ }
+ @Override
protected void handleSuccess() {
// New cycle, look for service again
final IGDBProcesses procService = fTracker.getService(IGDBProcesses.class);
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java
index 8277708204..0c0f44316f 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java
@@ -388,7 +388,9 @@ public class FinalLaunchSequence extends ReflectionSequence {
try {
Object result = prompter.handleStatus(filePrompt, null);
- if (result instanceof String) {
+ if (result == null) {
+ fRequestMonitor.cancel();
+ } else if (result instanceof String) {
fRequestMonitor.setData((String)result);
} else {
fRequestMonitor.setStatus(NO_CORE_STATUS);
@@ -422,6 +424,11 @@ public class FinalLaunchSequence extends ReflectionSequence {
"Prompt for post mortem file", //$NON-NLS-1$
new DataRequestMonitor<String>(getExecutor(), requestMonitor) {
@Override
+ protected void handleCancel() {
+ requestMonitor.cancel();
+ requestMonitor.done();
+ }
+ @Override
protected void handleSuccess() {
String newCoreFile = getData();
if (newCoreFile == null || newCoreFile.length()== 0) {

Back to the top