From 34caecd0e1b95f1e98651412595872a6a2392d27 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 18 May 2010 15:25:45 +0000 Subject: [PATCH] Bug 313372: Re-create the CLIEventProcessor when we restart the program, so as to reset the internal threadId count. --- .../cdt/dsf/gdb/service/command/GDBControl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java index 1106648527a..65bad1729ba 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java @@ -103,12 +103,12 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { private IGDBBackend fMIBackend; - private boolean fConnected = false; + private boolean fConnected; private MIRunControlEventProcessor fMIEventProcessor; private CLIEventProcessor fCLICommandProcessor; private AbstractCLIProcess fCLIProcess; - private MIInferiorProcess fInferiorProcess = null; + private MIInferiorProcess fInferiorProcess; private PTY fPty; @@ -383,6 +383,14 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { } else { fInferiorProcess = new GDBInferiorProcess(GDBControl.this, fMIBackend, fPty); } + + // Create the CLI event processor each time this method is called + // to reset the internal thread id count + // Bug 313372 + if (fCLICommandProcessor != null) { + fCLICommandProcessor.dispose(); + } + fCLICommandProcessor = new CLIEventProcessor(GDBControl.this, fControlDmc); } public boolean isConnected() { @@ -537,7 +545,6 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { createInferiorProcess(); - fCLICommandProcessor = new CLIEventProcessor(GDBControl.this, fControlDmc); fMIEventProcessor = new MIRunControlEventProcessor(GDBControl.this, fControlDmc); requestMonitor.done();