From 9387b687f52baa4de0d298a19135ffe0e89837e7 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 27 Jan 2003 19:01:53 +0000 Subject: [PATCH] Fallback on the first thread when no selection is specified. --- .../src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index b971f78ec95..a78935f0084 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java @@ -244,6 +244,11 @@ public class Target implements ICDITarget { cthreads = new Thread[]{new Thread(this, 0)}; } currentThreadId = info.getCurrentThread(); + //FIX: When attaching there is no thread selected + // We will choose the first one as a workaround. + if (currentThreadId == 0 && cthreads.length > 0) { + currentThreadId = cthreads[0].getId(); + } } catch (MIException e) { // Do not throw anything in this case. //throw new CDIException(e.getMessage());