diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java index c8925b009df..dff989fc745 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java @@ -34,4 +34,10 @@ public class Argument extends Variable implements ICDIArgument { return new Argument(target, thread, frame, name, fullName, pos, depth, miVar); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createDescriptor(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int) + */ + protected VariableDescriptor createDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth) { + return new ArgumentDescriptor(target, thread, frame, n, fn, pos, depth); + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/GlobalVariable.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/GlobalVariable.java index eac4e223f6b..05a102bb4e4 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/GlobalVariable.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/GlobalVariable.java @@ -49,4 +49,11 @@ public class GlobalVariable extends Variable implements ICDIGlobalVariable { protected Variable createVariable(Target target, Thread thread, StackFrame frame, String name, String fullName, int pos, int depth, MIVar miVar) { return new GlobalVariable(target, thread, frame, name, fullName, pos, depth, miVar); } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createDescriptor(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int) + */ + protected VariableDescriptor createDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth) { + return new GlobalVariableDescriptor(target, thread, frame, n, fn, pos, depth); + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/LocalVariable.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/LocalVariable.java index 016d67edc60..52ad4261355 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/LocalVariable.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/LocalVariable.java @@ -41,4 +41,10 @@ public class LocalVariable extends Variable implements ICDILocalVariable { return new LocalVariable(target, thread, frame, name, fullName, pos, depth, miVar); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createDescriptor(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int) + */ + protected VariableDescriptor createDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth) { + return new LocalVariableDescriptor(target, thread, frame, n, fn, pos, depth); + } } 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 bbeb3caedbd..7356b59b1e1 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 @@ -107,4 +107,10 @@ public class Register extends Variable implements ICDIRegister { return super.equals(register); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createDescriptor(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int) + */ + protected VariableDescriptor createDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth) { + return new RegisterDescriptor(target, thread, frame, n, fn, pos, depth); + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/ThreadStorage.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/ThreadStorage.java index 793ee549554..0c14d8dcc36 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/ThreadStorage.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/ThreadStorage.java @@ -52,4 +52,10 @@ public class ThreadStorage extends Variable implements ICDIThreadStorage { return new Register(target, thread, frame, name, fullName, pos, depth, miVar); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createDescriptor(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int) + */ + protected VariableDescriptor createDescriptor( Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth ) { + return new ThreadStorageDescriptor(target, thread, frame, n, fn, pos, depth); + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java index a5cd2a69b8b..9504222a809 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java @@ -161,7 +161,7 @@ public abstract class Variable extends VariableDescriptor implements ICDIVariabl } VariableManager vm = ((Session)((Target)getTarget()).getSession()).getVariableManager(); String qualName = "&(" + getQualifiedName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - LocalVariableDescriptor desc = new LocalVariableDescriptor((Target)getTarget(), (Thread)getThread(), (StackFrame)getStackFrame(), getName(), qualName, getPosition(), getStackDepth()); + VariableDescriptor desc = createDescriptor((Target)getTarget(), (Thread)getThread(), (StackFrame)getStackFrame(), getName(), qualName, getPosition(), getStackDepth()); Variable v = vm.createVariable( desc ); v.setFormat(ICDIFormat.HEXADECIMAL); hexAddress = v.getValue().getValueString(); @@ -560,4 +560,6 @@ public abstract class Variable extends VariableDescriptor implements ICDIVariabl public void setMIVarCreate(MIVarCreate miVar) { fVarCreateCMD = miVar; } + + abstract protected VariableDescriptor createDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth); }