Exemple #1
0
 /// <summary>
 /// Load the value of all instance fields of this class
 /// </summary>
 public Task <List <DalvikFieldValue> > GetInstanceFieldValuesAsync(DalvikObjectReference objectReference)
 {
     return(GetFieldsAsync().Select(list => {
         var process = manager.Process;
         var instanceFields = list.Where(x => !x.IsStatic).ToList();
         var instanceFieldIds = instanceFields.Select(x => x.Id).ToArray();
         var values = Debugger.ObjectReference.GetValuesAsync(objectReference.Id, instanceFieldIds).Await(DalvikProcess.VmTimeout);
         var result = new List <DalvikFieldValue>();
         for (var i = 0; i < instanceFields.Count; i++)
         {
             result.Add(new DalvikFieldValue(values[i], instanceFields[i], process));
         }
         return result;
     }));
 }
 /// <summary>
 /// Load the value of all instance fields of this class
 /// </summary>
 public Task<List<DalvikFieldValue>> GetInstanceFieldValuesAsync(DalvikObjectReference objectReference)
 {
     return GetFieldsAsync().Select(list => {
         var process = manager.Process;
         var instanceFields = list.Where(x => !x.IsStatic).ToList();
         var instanceFieldIds = instanceFields.Select(x => x.Id).ToArray();
         var values = Debugger.ObjectReference.GetValuesAsync(objectReference.Id, instanceFieldIds).Await(DalvikProcess.VmTimeout);
         var result = new List<DalvikFieldValue>();
         for (var i = 0; i < instanceFields.Count; i++)
         {
             result.Add(new DalvikFieldValue(values[i], instanceFields[i], process));
         }
         return result;
     });
 }
Exemple #3
0
        /// <summary>
        /// Gets the value of this field in the given object reference.
        /// If this field is static, the object reference is ignored.
        /// </summary>
        public Task <DalvikFieldValue> GetValueAsync(DalvikObjectReference objectReference)
        {
            var process = declaringType.Manager.Process;

            if (IsStatic)
            {
                // Get static field value
                return(process.Debugger.ReferenceType.GetValuesAsync(declaringType.Id, new[] { Id }).Select(x => new DalvikFieldValue(x[0], this, process)));
            }

            // Get instance field value
            if (objectReference == null)
            {
                throw new ArgumentNullException("objectReference");
            }
            return(process.Debugger.ObjectReference.GetValuesAsync(objectReference.Id, new[] { Id }).Select(x => new DalvikFieldValue(x[0], this, process)));
        }
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugBaseClassProperty(DalvikObjectReference objectReference, DalvikReferenceType superClass, DebugProperty parent)
     : base(parent)
 {
     this.objectReference = objectReference;
     this.superClass = superClass;
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugBaseClassProperty(DalvikObjectReference objectReference, DalvikReferenceType superClass)
 {
     this.objectReference = objectReference;
     this.superClass = superClass;
     LazyLoading = true;
 }
Exemple #6
0
        /// <summary>
        /// Gets the value of this field in the given object reference.
        /// If this field is static, the object reference is ignored.
        /// </summary>
        public Task<DalvikFieldValue> GetValueAsync(DalvikObjectReference objectReference)
        {
            var process = declaringType.Manager.Process;
            if (IsStatic)
            {
                // Get static field value
                return process.Debugger.ReferenceType.GetValuesAsync(declaringType.Id, new[] { Id }).Select(x => new DalvikFieldValue(x[0], this, process));
            }

            // Get instance field value
            if (objectReference == null)
                throw new ArgumentNullException("objectReference");
            return process.Debugger.ObjectReference.GetValuesAsync(objectReference.Id, new[] { Id }).Select(x => new DalvikFieldValue(x[0], this, process));
        }