public static void SetFieldValue(Thread evalThread, Value objectInstance, IField fieldInfo, Value newValue) { Value val = GetFieldValue(evalThread, objectInstance, fieldInfo); if (!newValue.Type.GetDefinition().IsDerivedFrom(fieldInfo.Type.GetDefinition())) { throw new GetValueException("Cannot assign {0} to {1}", newValue.Type.FullName, fieldInfo.Type.FullName); } val.SetValue(evalThread, newValue); }
public static void SetFieldValue(Value objectInstance, FieldInfo fieldInfo, Value newValue) { Value val = GetFieldValue(objectInstance, fieldInfo); if (!fieldInfo.FieldType.IsAssignableFrom(newValue.Type)) { throw new GetValueException("Can not assign {0} to {1}", newValue.Type.FullName, fieldInfo.FieldType.FullName); } val.SetValue(newValue); }
void BeforeGetValue(string name) { NamedValue localVar; try { localVar = process.LocalVariables[name]; } catch (DebuggerException) { return; } PrintLine("Getting local variable " + name); // First, get out of GC unsafe point Stepper stepOut = new Stepper(process.SelectedThread.LastFunction, "Boo interperter"); stepOut.StepComplete += delegate { process.Debugger.MTA2STA.AsyncCall(delegate { if (!interpreter_localVariable.SetValue(localVar)) { PrintLine("Getting of local variable " + name + " failed"); } process.Continue(); }); }; stepOut.StepOut(); }
public void SetArrayElement(Thread evalThread, uint[] elementIndices, Value newVal) { Value elem = GetArrayElement(elementIndices); elem.SetValue(evalThread, newVal); }
public void SetArrayElement(int[] elementIndices, Value newVal) { Value elem = GetArrayElement(elementIndices); elem.SetValue(newVal); }