mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug 345751: Inferior console does not get removed after a restart with GDB 7.0 and 7.1. Cleanup after the fix to bug 345749
This commit is contained in:
parent
fa56c9494a
commit
e1b18cad3e
1 changed files with 5 additions and 19 deletions
|
@ -68,7 +68,7 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
private DsfServicesTracker fTracker;
|
private DsfServicesTracker fTracker;
|
||||||
|
|
||||||
// This variable will be used to store the original container context,
|
// This variable will be used to store the original container context,
|
||||||
// but once the new process is start (restarted), it will contain the new
|
// but once the new process is started (restarted), it will contain the new
|
||||||
// container context. This new container context has for parent the process
|
// container context. This new container context has for parent the process
|
||||||
// context, which holds the new pid.
|
// context, which holds the new pid.
|
||||||
private IContainerDMContext fContainerDmc;
|
private IContainerDMContext fContainerDmc;
|
||||||
|
@ -305,10 +305,9 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
final Process inferior = inferiorProcess;
|
final Process inferior = inferiorProcess;
|
||||||
final ILaunch launch = (ILaunch)getContainerContext().getAdapter(ILaunch.class);
|
final ILaunch launch = (ILaunch)getContainerContext().getAdapter(ILaunch.class);
|
||||||
|
|
||||||
// This is the groupId of the current process.
|
// This is the groupId of the new process that will be started, even in the
|
||||||
// In the case of a restart for GDB 7.0 or 7.1, this groupId will _not_ be the one
|
// case of a restart.
|
||||||
// of the new process, since the pid is used for groupId.
|
final String groupId = ((IMIContainerDMContext)getContainerContext()).getGroupId();
|
||||||
final String currentGroupId = ((IMIContainerDMContext)getContainerContext()).getGroupId();
|
|
||||||
|
|
||||||
// For multi-process, we cannot simply use the name given by the backend service
|
// For multi-process, we cannot simply use the name given by the backend service
|
||||||
// because we may not be starting that process, but another one.
|
// because we may not be starting that process, but another one.
|
||||||
|
@ -331,7 +330,6 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
DebugPlugin.getDefault().asyncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
String label = pathLabel;
|
String label = pathLabel;
|
||||||
String groupId = currentGroupId;
|
|
||||||
|
|
||||||
if (fRestart) {
|
if (fRestart) {
|
||||||
// For a restart, remove the old inferior
|
// For a restart, remove the old inferior
|
||||||
|
@ -345,18 +343,6 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
||||||
// If the groupAttribute is set, then we must make sure it is the proper inferior
|
// If the groupAttribute is set, then we must make sure it is the proper inferior
|
||||||
if (groupAttribute == null || groupAttribute.equals(MIProcesses.UNIQUE_GROUP_ID) ||
|
if (groupAttribute == null || groupAttribute.equals(MIProcesses.UNIQUE_GROUP_ID) ||
|
||||||
groupAttribute.equals(groupId)) {
|
groupAttribute.equals(groupId)) {
|
||||||
|
|
||||||
// For GDB 7.0 and 7.1, the groupId of the new process will not be the same as
|
|
||||||
// the groupId of the old process, after the restart; we cannot know the new
|
|
||||||
// groupId yet since it will be the process pid, so we should use
|
|
||||||
// MIProcesses.UNIQUE_GROUP_ID. Starting with GDB 7.2, the groupId stays
|
|
||||||
// the same after a restart. We can use the groupId that was stored with
|
|
||||||
// the previous inferior to make sure we have the proper value.
|
|
||||||
// Note that in the case of an attach, where the groupId is already set
|
|
||||||
// even for GDB 7.0 and 7.1, but won't stay the same, we don't have an inferior
|
|
||||||
// at all, so we don't need to worry about that case.
|
|
||||||
groupId = groupAttribute;
|
|
||||||
|
|
||||||
launch.removeProcess(process);
|
launch.removeProcess(process);
|
||||||
// Use the exact same label as before
|
// Use the exact same label as before
|
||||||
label = process.getLabel();
|
label = process.getLabel();
|
||||||
|
|
Loading…
Add table
Reference in a new issue