mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
do not call "info program" for attach session
This commit is contained in:
parent
7c38ceb5da
commit
1821764512
1 changed files with 18 additions and 11 deletions
|
@ -191,7 +191,7 @@ public class MIInferior extends Process {
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isRunning() && inferiorPid != 0) {
|
if (isRunning() && inferiorPid > 0) {
|
||||||
// lets try something else.
|
// lets try something else.
|
||||||
gdbSpawner.raise(inferiorPid, gdbSpawner.INT);
|
gdbSpawner.raise(inferiorPid, gdbSpawner.INT);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ public class MIInferior extends Process {
|
||||||
if (pty != null) {
|
if (pty != null) {
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//e.printStackTrace();
|
//e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -310,15 +310,22 @@ public class MIInferior extends Process {
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if (inferiorPid == 0) {
|
if (inferiorPid == 0) {
|
||||||
// Try to discover the pid
|
// Do not try this on attach session.
|
||||||
CommandFactory factory = session.getCommandFactory();
|
if (!isConnected()) {
|
||||||
MIInfoProgram prog = factory.createMIInfoProgram();
|
// Try to discover the pid
|
||||||
try {
|
CommandFactory factory = session.getCommandFactory();
|
||||||
session.postCommand(prog);
|
MIInfoProgram prog = factory.createMIInfoProgram();
|
||||||
MIInfoProgramInfo info = prog.getMIInfoProgramInfo();
|
try {
|
||||||
inferiorPid = info.getPID();
|
session.postCommand(prog);
|
||||||
} catch (MIException e) {
|
MIInfoProgramInfo info = prog.getMIInfoProgramInfo();
|
||||||
// no rethrown.
|
inferiorPid = info.getPID();
|
||||||
|
} catch (MIException e) {
|
||||||
|
// no rethrown.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// We fail permantely.
|
||||||
|
if (inferiorPid == 0) {
|
||||||
|
inferiorPid = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue