From a00f0ded40737be55e0c54d6aee369d2f3f7bbce Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 28 Aug 2007 20:38:03 +0000 Subject: [PATCH] Bug 196002 - Set up the mapping from the gdb/mi debugger to the gnu toolchain. Also map the cygwin debugger to the cygwin toolchain. Fix up the launch shortcut so that the longest matching pattern wins the day since both cygwin and mingw would get trumped by the main gnu one. With this single click debug works on Linux. --- .../org.eclipse.cdt.debug.mi.core/plugin.xml | 22 +++++++++++++------ .../internal/CApplicationLaunchShortcut.java | 7 +++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/plugin.xml b/debug/org.eclipse.cdt.debug.mi.core/plugin.xml index 5f38212bddc..118ec607ac7 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/plugin.xml +++ b/debug/org.eclipse.cdt.debug.mi.core/plugin.xml @@ -11,14 +11,22 @@ id="org.eclipse.cdt.debug.mi.core.CDebuggerNew" modes="run,core,attach" name="%GDBMIDebugger.name" - platform="*"/> + platform="*"> + + + + cpu="native" + id="org.eclipse.cdt.debug.mi.core.CygwinCDebugger" + modes="run,core,attach" + name="%CygwinGDBDebugger.name" + platform="win32"> + + + + pattern="cdt\.managedbuild\.config\.gnu\.mingw\..*"> diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java index 3c719764a28..41ff47547d8 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java @@ -120,14 +120,15 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut { ICConfigurationDescription configDesc = projDesc.getActiveConfiguration(); String configId = configDesc.getId(); ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); - outer: for (int i = 0; i < debugConfigs.length; ++i) { + int matchLength = 0; + for (int i = 0; i < debugConfigs.length; ++i) { ICDebugConfiguration dc = debugConfigs[i]; String[] patterns = dc.getSupportedBuildConfigPatterns(); if (patterns != null) { for (int j = 0; j < patterns.length; ++j) { - if (configId.matches(patterns[j])) { + if (patterns[j].length() > matchLength && configId.matches(patterns[j])) { debugConfig = dc; - break outer; + matchLength = patterns[j].length(); } } }