From c7c666408a35817864e208627dae4c917160a2e8 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Tue, 3 Jun 2003 19:46:07 +0000 Subject: [PATCH] Save the head of the type for the return value. --- .../org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java index c649eab1727..aef21ba2754 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java @@ -232,6 +232,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager { // Parse the string. GDBType gdbType = gdbTypeParser.parse(typename); + Type headType = null; Type type = null; for (Type aType = null; gdbType != null; type = aType) { @@ -259,10 +260,14 @@ public class SourceManager extends SessionObject implements ICDISourceManager { if (type instanceof DerivedType) { ((DerivedType)type).setComponentType(aType); } + // Save the head to returning it. + if (headType == null) { + headType = aType; + } } - if (type != null) { - return type; + if (headType != null) { + return headType; } throw new CDIException("Unknown type"); }