mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 12:25:35 +02:00
Bug 339379 : Instruction pointer is not always removed when terminating launch. Fix for GDB >= 7.0
This commit is contained in:
parent
6c08d0dc7d
commit
587d3cee4c
2 changed files with 22 additions and 17 deletions
|
@ -442,23 +442,10 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend {
|
|||
}
|
||||
|
||||
public void destroy() {
|
||||
// We are responsible for closing the streams we have used or else
|
||||
// we will leak pipes.
|
||||
// Bug 345164
|
||||
try {
|
||||
getMIOutputStream().close();
|
||||
} catch (IOException e) {}
|
||||
try {
|
||||
getMIInputStream().close();
|
||||
} catch (IOException e) {}
|
||||
// Don't close the streams ourselves as it may be too early.
|
||||
// Wait for the actual user of the streams to close it.
|
||||
// Bug 339379
|
||||
|
||||
// We do access GDB's error stream and must
|
||||
// close it.
|
||||
// Bug 327617
|
||||
try {
|
||||
fProcess.getErrorStream().close();
|
||||
} catch (IOException e) {}
|
||||
|
||||
// destroy() should be supported even if it's not spawner.
|
||||
if (getState() == State.STARTED) {
|
||||
fProcess.destroy();
|
||||
|
|
|
@ -654,6 +654,12 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
|||
break;
|
||||
}
|
||||
}
|
||||
// Must close the stream here to avoid leaking
|
||||
// Bug 345164 and Bug 339379
|
||||
try {
|
||||
if (fOutputStream != null) fOutputStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -715,6 +721,13 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
|||
} catch (RejectedExecutionException e) {
|
||||
// Dispatch thread is down.
|
||||
}
|
||||
// Must close the stream here to avoid leaking and
|
||||
// to give enough time to read all the data
|
||||
// Bug 345164 and Bug 339379
|
||||
try {
|
||||
fInputStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
private MIResult findResultRecord(MIResult[] results, String variable) {
|
||||
|
@ -1031,7 +1044,12 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
|||
} catch (RejectedExecutionException e) {
|
||||
// Dispatch thread is down.
|
||||
}
|
||||
// The backend service will close the stream
|
||||
// Must close the stream here to avoid leaking
|
||||
// Bug 345164 and Bug 339379
|
||||
try {
|
||||
fErrorStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue