mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
GDB has special "types"
int8_t int16_t etc ... parse them also.
This commit is contained in:
parent
f509d06f05
commit
97876ded77
5 changed files with 60 additions and 16 deletions
|
@ -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
|
2004-05-28 Alain Magloire
|
||||||
|
|
||||||
QuickFix for PR 58249
|
QuickFix for PR 58249
|
||||||
|
|
||||||
|
* cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
|
||||||
2004-05-28 Alain Magloire
|
2004-05-28 Alain Magloire
|
||||||
|
|
||||||
Error in looking for the CIdentifier.
|
Error in looking for the CIdentifier.
|
||||||
|
|
|
@ -307,6 +307,20 @@ public class SourceManager extends Manager implements ICDISourceManager {
|
||||||
return new StructType(target, typename);
|
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);
|
StringTokenizer st = new StringTokenizer(typename);
|
||||||
int count = st.countTokens();
|
int count = st.countTokens();
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,17 @@ public class Register extends Variable implements ICDIRegister {
|
||||||
super(obj, var);
|
super(obj, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName()
|
* @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject#getFullName()
|
||||||
*/
|
*/
|
||||||
public String getQualifiedName() throws CDIException {
|
public String getFullName() {
|
||||||
if (qualifiedName == null) {
|
if (fullName == null) {
|
||||||
qualifiedName = "$" + getFullName(); //$NON-NLS-1$
|
String n = getName();
|
||||||
|
if (!n.startsWith("$")) { //$NON-NLS-1$
|
||||||
|
fullName = "$" + n; //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return qualifiedName;
|
return fullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICDIVariable[] getChildren() throws CDIException {
|
public ICDIVariable[] getChildren() throws CDIException {
|
||||||
|
@ -52,8 +55,19 @@ public class Register extends Variable implements ICDIRegister {
|
||||||
MIVar[] vars = info.getMIVars();
|
MIVar[] vars = info.getMIVars();
|
||||||
children = new Register[vars.length];
|
children = new Register[vars.length];
|
||||||
for (int i = 0; i < vars.length; i++) {
|
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(),
|
RegisterObject regObj = new RegisterObject(getTarget(),
|
||||||
vars[i].getExp(), getPosition());
|
exp, fn, getPosition());
|
||||||
children[i] = mgr.createRegister(regObj, vars[i]);
|
children[i] = mgr.createRegister(regObj, vars[i]);
|
||||||
}
|
}
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.eclipse.cdt.debug.mi.core.cdi.model;
|
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.ICDIRegisterObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
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);
|
super(target, name, null, i, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public RegisterObject(ICDITarget target, String name, String fn, int i) {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName()
|
super(target, name, fn, null, i, 0);
|
||||||
*/
|
|
||||||
public String getQualifiedName() throws CDIException {
|
|
||||||
if (qualifiedName == null) {
|
|
||||||
qualifiedName = "$" + getFullName(); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
return qualifiedName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.ICDIVariableObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
|
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.Session;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
|
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");
|
// 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;
|
//String subarray = "*(" + variable.getName() + "+" + index + ")@" + length;
|
||||||
ICDITarget target = getTarget();
|
ICDITarget target = getTarget();
|
||||||
Session session = (Session) (target.getSession());
|
Session session = (Session) (target.getSession());
|
||||||
|
|
Loading…
Add table
Reference in a new issue