From 0d3f70517e4ffca0d1353c409141f8cbdccac23a Mon Sep 17 00:00:00 2001 From: James Blackburn Date: Mon, 22 Feb 2010 14:41:47 +0000 Subject: 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. --- .../mi/org/eclipse/cdt/debug/mi/core/RxThread.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'debug/org.eclipse.cdt.debug.mi.core') 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 oobList; + LinkedList 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(); + oobList = new LinkedList(); } /* @@ -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()]); -- cgit v1.2.3