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:
parent
c8b4fb4ce5
commit
c35087d93c
2 changed files with 24 additions and 15 deletions
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue