1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 20:35:38 +02:00

Fix for PR 48870: Terminate gdb if attach to process fails.

This commit is contained in:
Mikhail Khodjaiants 2003-12-16 17:44:43 +00:00
parent c8b4fb4ce5
commit c35087d93c
2 changed files with 24 additions and 15 deletions

View file

@ -1,3 +1,9 @@
2003-12-16 Mikhail Khodjaiants
Fix for PR 48870: Terminate gdb if attach to process fails.
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java
2003-12-09 Alain Magloire
Do not try to interrupt if the target was suspended.

View file

@ -258,23 +258,26 @@ public class MIPlugin extends Plugin {
throw e;
}
CommandFactory factory = session.getCommandFactory();
if (targetParams != null && targetParams.length > 0) {
MITargetSelect target = factory.createMITargetSelect(targetParams);
session.postCommand(target);
MIInfo info = target.getMIInfo();
if (info == null) {
pgdb.destroy();
throw new MIException("No answer");
try {
if (targetParams != null && targetParams.length > 0) {
MITargetSelect target = factory.createMITargetSelect(targetParams);
session.postCommand(target);
MIInfo info = target.getMIInfo();
if (info == null) {
throw new MIException("No answer");
}
}
}
if (pid > 0) {
MITargetAttach attach = factory.createMITargetAttach(pid);
session.postCommand(attach);
MIInfo info = attach.getMIInfo();
if (info == null) {
pgdb.destroy();
throw new MIException("No answer");
if (pid > 0) {
MITargetAttach attach = factory.createMITargetAttach(pid);
session.postCommand(attach);
MIInfo info = attach.getMIInfo();
if (info == null) {
throw new MIException("No answer");
}
}
} catch (MIException e) {
pgdb.destroy();
throw e;
}
//@@@ We have to manually set the suspended state when we attach
session.getMIInferior().setSuspended();