mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 00:35:49 +02:00
Bug 197162: NPE thrown viewing Global Variables (VariableManager.createLocalVariables).
This commit is contained in:
parent
3c4483ffea
commit
8563df14dc
6 changed files with 34 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue