From 7cfecd1a5e116a90c2d9cb922f5a4d9b0c94914d Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 20 Aug 2003 01:22:46 +0000 Subject: [PATCH] Fix to deal with gdb ptype for class/structure --- .../org/eclipse/cdt/debug/mi/core/GDBTypeParser.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java index dfa192dc125..5589e746ea9 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java @@ -68,6 +68,13 @@ public class GDBTypeParser { dataType += " " + token; } + // Hack for GDB, the typename can be something like + // class A : public B, C { ... } * + // We are only interreste in "class A" + int column = dataType.indexOf(':'); + if (column > 0) { + dataType = dataType.substring(0, column); + } genericType = new GDBType(dataType); // Start the recursive parser. @@ -173,7 +180,7 @@ public class GDBTypeParser { // check if the character is an alphabet boolean isCIdentifierStart(int c) { - if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') { + if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == ':' || c == ',') { return true; } return false; @@ -181,6 +188,8 @@ public class GDBTypeParser { // check is the character is alpha numeric // [a-zA-Z0-9] + // GDB hack accept ':' ',' part of the GDB hacks + // when doing ptype gdb returns "class A : public C { ..}" boolean isCIdentifierPart(int c) { if ((c >= '0' && c <= 9) || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') { return true;