1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +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 2003-12-09 Alain Magloire
Do not try to interrupt if the target was suspended. Do not try to interrupt if the target was suspended.

View file

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