mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
Bug 233116: Cancelling an Attach or post-mortem launch should be graceful
This commit is contained in:
parent
18cae2a524
commit
60f2c4acc5
2 changed files with 16 additions and 2 deletions
|
@ -129,7 +129,9 @@ public class GdbConnectCommand implements IConnect {
|
||||||
try {
|
try {
|
||||||
PrompterInfo info = new PrompterInfo(fNewProcessSupported, fProcessList);
|
PrompterInfo info = new PrompterInfo(fNewProcessSupported, fProcessList);
|
||||||
Object result = prompter.handleStatus(processPromptStatus, info);
|
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);
|
fRequestMonitor.setData(result);
|
||||||
} else {
|
} else {
|
||||||
fRequestMonitor.setStatus(NO_PID_STATUS);
|
fRequestMonitor.setStatus(NO_PID_STATUS);
|
||||||
|
@ -185,6 +187,11 @@ public class GdbConnectCommand implements IConnect {
|
||||||
new PromptForPidJob(
|
new PromptForPidJob(
|
||||||
"Prompt for Process", newProcessSupported, procInfoList.toArray(new IProcessExtendedInfo[0]), //$NON-NLS-1$
|
"Prompt for Process", newProcessSupported, procInfoList.toArray(new IProcessExtendedInfo[0]), //$NON-NLS-1$
|
||||||
new DataRequestMonitor<Object>(fExecutor, rm) {
|
new DataRequestMonitor<Object>(fExecutor, rm) {
|
||||||
|
@Override
|
||||||
|
protected void handleCancel() {
|
||||||
|
rm.cancel();
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
// New cycle, look for service again
|
// New cycle, look for service again
|
||||||
|
|
|
@ -388,7 +388,9 @@ public class FinalLaunchSequence extends ReflectionSequence {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object result = prompter.handleStatus(filePrompt, null);
|
Object result = prompter.handleStatus(filePrompt, null);
|
||||||
if (result instanceof String) {
|
if (result == null) {
|
||||||
|
fRequestMonitor.cancel();
|
||||||
|
} else if (result instanceof String) {
|
||||||
fRequestMonitor.setData((String)result);
|
fRequestMonitor.setData((String)result);
|
||||||
} else {
|
} else {
|
||||||
fRequestMonitor.setStatus(NO_CORE_STATUS);
|
fRequestMonitor.setStatus(NO_CORE_STATUS);
|
||||||
|
@ -421,6 +423,11 @@ public class FinalLaunchSequence extends ReflectionSequence {
|
||||||
new PromptForCoreJob(
|
new PromptForCoreJob(
|
||||||
"Prompt for post mortem file", //$NON-NLS-1$
|
"Prompt for post mortem file", //$NON-NLS-1$
|
||||||
new DataRequestMonitor<String>(getExecutor(), requestMonitor) {
|
new DataRequestMonitor<String>(getExecutor(), requestMonitor) {
|
||||||
|
@Override
|
||||||
|
protected void handleCancel() {
|
||||||
|
requestMonitor.cancel();
|
||||||
|
requestMonitor.done();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
String newCoreFile = getData();
|
String newCoreFile = getData();
|
||||||
|
|
Loading…
Add table
Reference in a new issue