diff options
author | James Blackburn | 2010-02-22 14:41:47 +0000 |
---|---|---|
committer | James Blackburn | 2010-02-22 14:41:47 +0000 |
commit | 0d3f70517e4ffca0d1353c409141f8cbdccac23a (patch) | |
tree | 668b010b1ca5d7df0158417768516242ceb5d17e | |
parent | f2530640603a5703f5df03ce9d4bc49050263421 (diff) | |
download | org.eclipse.cdt-0d3f70517e4ffca0d1353c409141f8cbdccac23a.tar.gz org.eclipse.cdt-0d3f70517e4ffca0d1353c409141f8cbdccac23a.tar.xz org.eclipse.cdt-0d3f70517e4ffca0d1353c409141f8cbdccac23a.zip |
Bug 302927 (again) ensure the oobList doesn't get too large, but keep it non-zero (<=20) so we handle unexpected stopping on shared lib load, for example.
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java index 98d858fbbca..8edffa637b1 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import org.eclipse.cdt.debug.mi.core.command.CLICommand; @@ -66,7 +67,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIValue; public class RxThread extends Thread { final MISession session; - List<MIStreamRecord> oobList; + LinkedList<MIStreamRecord> oobList; CLIProcessor cli; int prompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">" boolean fEnableConsole = true; @@ -75,7 +76,7 @@ public class RxThread extends Thread { super("MI RX Thread"); //$NON-NLS-1$ session = s; cli = new CLIProcessor(session); - oobList = new ArrayList<MIStreamRecord>(); + oobList = new LinkedList<MIStreamRecord>(); } /* @@ -259,10 +260,10 @@ public class RxThread extends Thread { for (int i = 0; i < oobs.length; i++) { processMIOOBRecord(oobs[i], list); } - // If not waiting for any command results, don't need the result in the oobList -// This breaks detecting shared library event handling. See bug 302927 -// if (rxQueue.isEmpty()) -// oobList.clear(); + // If not waiting for any command results, ensure the oobList doesn't + // get too large. See Bug 302927 for more + if (rxQueue.isEmpty() && oobList.size() > 20) + oobList.removeFirst(); } MIEvent[] events = list.toArray(new MIEvent[list.size()]); |