1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

deal with C++ references

This commit is contained in:
Alain Magloire 2004-08-15 03:35:30 +00:00
parent 6accf8fc2d
commit 9ee027d183

View file

@ -106,7 +106,7 @@ public class GDBTypeParser {
derived = (GDBDerivedType)gdbType;
gdbType = derived.getChild();
if (type == GDBType.FUNCTION) {
sb.append("()");
sb.append("()"); //$NON-NLS-1$
} else if (type == GDBType.ARRAY) {
sb.append('[').append(derived.getDimension()).append(']');
} else if (type == GDBType.POINTER) {
@ -116,10 +116,17 @@ public class GDBTypeParser {
} else if (childType == GDBType.GENERIC) {
sb.insert(0, '*');
} else {
sb.insert(0, "(*").append(")");
sb.insert(0, "(*").append(')'); //$NON-NLS-1$
}
} else if (type == GDBType.REFERENCE) {
sb.insert(0, "(&").append(")");
int childType = (gdbType != null) ? gdbType.getType() : GDBType.GENERIC;
if (childType == GDBType.POINTER || childType == GDBType.REFERENCE) {
sb.append("&"); //$NON-NLS-1$
} else if (childType == GDBType.GENERIC) {
sb.insert(0, '&');
} else {
sb.insert(0, "(&").append(')'); //$NON-NLS-1$
}
}
} else {
sb.insert(0, ' ');