Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-patch] Patch: ordering in C debugger tab

Applied.

(Would you like to "feature request" your last comment @ http://bugs.eclipse.org/ ? :-) .)

Thanks,
David.

Tom Tromey wrote:

When running the CDT compiled by gcj, the order of items on the C
debugger tab is different from the order we see when running under
the Sun JDK.  In particular, "GDB Server" ends up first -- but this
is not the best default.

It turns out the order comes from requesting values() from a HashMap,
which isn't defined.  So this patch "fixes" the problem by sorting
the result.

Maybe it would be preferable to add a property to tell which launcher
should be the first one...?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@xxxxxxxxxx>

	* src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
	(loadDebuggerComboBox): Sort entries by name.

Index: src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
===================================================================
RCS file: /usr/cygnus/eclipse-cvsroot/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java,v
retrieving revision 1.12
diff -u -r1.12 CDebuggerTab.java
--- src/org/eclipse/cdt/launch/ui/CDebuggerTab.java 16 Jun 2003 22:58:43 -0000 1.12
+++ src/org/eclipse/cdt/launch/ui/CDebuggerTab.java 28 Jul 2003 18:52:25 -0000
@@ -29,6 +29,9 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;

+import java.util.Arrays;
+import java.util.Comparator;
+
public class CDebuggerTab extends AbstractCDebuggerTab {
	protected Combo fDCombo;
	protected Button fStopInMain;
@@ -114,6 +117,13 @@
		}
		fDCombo.removeAll();
		debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
+		Arrays.sort(debugConfigs, new Comparator() {
+			public int compare(Object o1, Object o2) {
+				ICDebugConfiguration ic1 = (ICDebugConfiguration) o1;
+				ICDebugConfiguration ic2 = (ICDebugConfiguration) o2;
+				return ic1.getName().compareTo(ic2.getName());
+			}
+		});
		int x = 0;
		int selndx = -1;
		for (int i = 0; i < debugConfigs.length; i++) {
_______________________________________________
cdt-patch mailing list
cdt-patch@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-patch



Back to the top