Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] MI fix for C++ classes variables

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.163
diff -u -r1.163 ChangeLog
--- ChangeLog	19 Aug 2003 02:38:52 -0000	1.163
+++ ChangeLog	19 Aug 2003 20:53:52 -0000
@@ -1,3 +1,10 @@
+2003-08-19 Alain Magloire
+
+	GDB, uses false category for C++ class/struct.
+	Fix to return the correct name.
+	
+	* src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
+
 2003-08-18 Alain Magloire
 
 	Patch from Chris Songer, excerpt from the email.
Index: src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java,v
retrieving revision 1.18
diff -u -r1.18 Variable.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java	7 Aug 2003 03:28:44 -0000	1.18
+++ src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java	19 Aug 2003 20:53:52 -0000
@@ -189,22 +189,20 @@
 						//    - public
 						//       - y
 						// So we choose to ignore the first set of children
-						// but carry over to those "fake" variable the typename and the qualified name
-						if (isFake()) {
-							qName = "(" + getQualifiedName() + ")." + vars[i].getExp();
-						} else {
-							// So if the child is something like "public", "private" ...
-							// carrry over the parent qualified name and the typename
-							// also flag it as a fake variable.
-							qName = getQualifiedName();
-							childTypename = typename;
+						// but carry over to those "fake" variables the typename and the qualified name
+						if (!isFake()
+							|| (isFake() && !(name.equals("private") || name.equals("public") || name.equals("protected")))) {
 							childFake = true;
+							childTypename = getTypeName();
+						} else {
+							qName = "(" + getQualifiedName() + ")." + vars[i].getExp();
 						}
-					} else {
+					} else { // If not C++ language
 						qName = "(" + getQualifiedName() + ")." + vars[i].getExp();
 					}
 				}
-				Variable v = new Variable(getTarget(), vars[i].getExp(), qName, getStackFrame(), getPosition(), getStackDepth(), vars[i]);
+				Variable v =
+					new Variable(getTarget(), vars[i].getExp(), qName, getStackFrame(), getPosition(), getStackDepth(), vars[i]);
 				if (childTypename != null) {
 					// Hack to reset the typename to a known value
 					v.typename = childTypename;



Back to the top