Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorAlain Magloire2004-05-31 23:51:45 +0000
committerAlain Magloire2004-05-31 23:51:45 +0000
commit97876ded779277ec852d36a36cde07c30fc3a442 (patch)
tree53d9540865bd9871edda7419be21e7cd42dc05a7 /debug
parentf509d06f05f176c07edc5edd9abc89d42669de18 (diff)
downloadorg.eclipse.cdt-97876ded779277ec852d36a36cde07c30fc3a442.tar.gz
org.eclipse.cdt-97876ded779277ec852d36a36cde07c30fc3a442.tar.xz
org.eclipse.cdt-97876ded779277ec852d36a36cde07c30fc3a442.zip
GDB has special "types"
int8_t int16_t etc ... parse them also.
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/ChangeLog11
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java14
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java28
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java11
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java12
5 files changed, 60 insertions, 16 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
index 94dea9e3d3..c60870aece 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog
@@ -1,7 +1,18 @@
2004-05-28 Alain Magloire
+ GDB has special "types"
+ int8_t int16_t etc ... parse them also.
+
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java
+
+2004-05-28 Alain Magloire
+
QuickFix for PR 58249
+ * cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
2004-05-28 Alain Magloire
Error in looking for the CIdentifier.
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
index de4a0fe113..0383c2dd79 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
@@ -307,6 +307,20 @@ public class SourceManager extends Manager implements ICDISourceManager {
return new StructType(target, typename);
}
+ // GDB has some special types for int
+ if (typename.equals("int8_t")) { //$NON-NLS-1$
+ return new CharType(target, typename);
+ } else if (typename.equals("int16_t")) { //$NON-NLS-$1
+ return new ShortType(target, typename);
+ } else if (typename.equals("int32_t")) { //$NON-NLS-$1
+ return new LongType(target, typename);
+ } else if (typename.equals("int64_t")) { //$NON-NLS-$1
+ return new IntType(target, typename);
+ } else if (typename.equals("int128_t")) { //$NON-NLS-$1
+ return new IntType(target, typename);
+ }
+
+
StringTokenizer st = new StringTokenizer(typename);
int count = st.countTokens();
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java
index 62010ab6bc..6c84674845 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java
@@ -26,14 +26,17 @@ public class Register extends Variable implements ICDIRegister {
super(obj, var);
}
- /**
- * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName()
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject#getFullName()
*/
- public String getQualifiedName() throws CDIException {
- if (qualifiedName == null) {
- qualifiedName = "$" + getFullName(); //$NON-NLS-1$
+ public String getFullName() {
+ if (fullName == null) {
+ String n = getName();
+ if (!n.startsWith("$")) { //$NON-NLS-1$
+ fullName = "$" + n; //$NON-NLS-1$
+ }
}
- return qualifiedName;
+ return fullName;
}
public ICDIVariable[] getChildren() throws CDIException {
@@ -52,8 +55,19 @@ public class Register extends Variable implements ICDIRegister {
MIVar[] vars = info.getMIVars();
children = new Register[vars.length];
for (int i = 0; i < vars.length; i++) {
+ String fn;
+ String exp = vars[i].getExp();
+ if (isCPPLanguage()) {
+ if ((exp.equals("private") || exp.equals("public") || exp.equals("protected"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ fn = getFullName();
+ } else {
+ fn = getFullName() + "." + exp;
+ }
+ } else {
+ fn = getFullName() + "." + exp;
+ }
RegisterObject regObj = new RegisterObject(getTarget(),
- vars[i].getExp(), getPosition());
+ exp, fn, getPosition());
children[i] = mgr.createRegister(regObj, vars[i]);
}
} catch (MIException e) {
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java
index 459368280a..79fc331287 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java
@@ -1,6 +1,5 @@
package org.eclipse.cdt.debug.mi.core.cdi.model;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
@@ -12,14 +11,8 @@ public class RegisterObject extends VariableObject implements ICDIRegisterObject
super(target, name, null, i, 0);
}
- /**
- * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName()
- */
- public String getQualifiedName() throws CDIException {
- if (qualifiedName == null) {
- qualifiedName = "$" + getFullName(); //$NON-NLS-1$
- }
- return qualifiedName;
+ public RegisterObject(ICDITarget target, String name, String fn, int i) {
+ super(target, name, fn, null, i, 0);
}
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java
index e6382e1e08..2a5013c8ec 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java
@@ -13,6 +13,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
+import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
/**
@@ -52,6 +53,17 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue {
// throw new CDIException("Index out of bound");
//}
+ // Overload for registers.
+ if (variable instanceof Register) {
+ ICDIVariable[] vars = getVariables();
+
+ if (index < vars.length && (index + length) <= vars.length) {
+ ICDIVariable[] newVars = new ICDIVariable[length];
+ System.arraycopy(vars, index, newVars, 0, length);
+ return newVars;
+ }
+ return new ICDIVariable[0];
+ }
//String subarray = "*(" + variable.getName() + "+" + index + ")@" + length;
ICDITarget target = getTarget();
Session session = (Session) (target.getSession());

Back to the top