/// <summary> /// Resolve the given dalvik location to a source location. /// </summary> private DocumentLocation DoResolve(Location location) { var refType = ReferenceTypeManager[location.Class]; DalvikMethod method = null; if (refType != null) { method = refType.GetMethodsAsync().Select(t => { DalvikMethod m; return(t.TryGetMember(location.Method, out m) ? m : null); }).Await(VmTimeout); } var typeName = (refType != null) ? refType.GetNameAsync().Await(VmTimeout) : null; var typeEntry = (typeName != null) ? mapFile.GetTypeByNewName(typeName) : null; var methodDexName = (method != null) ? method.Name : null; var methodDexSignature = (method != null) ? method.Signature : null; var methodEntry = ((typeEntry != null) && (method != null)) ? typeEntry.FindDexMethod(methodDexName, methodDexSignature) : null; Document document = null; DocumentPosition position = null; if (methodEntry != null) { mapFile.TryFindLocation(typeEntry, methodEntry, (int)location.Index, out document, out position); } return(new DocumentLocation(location, document, position, refType, method, typeEntry, methodEntry)); }
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, SourceCodePosition sourceCode, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) throw new ArgumentNullException("location"); Location = location; SourceCode = sourceCode; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, Document document, DocumentPosition position, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) throw new ArgumentNullException("location"); Location = location; Document = document; Position = position; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, SourceCodePosition sourceCode, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) { throw new ArgumentNullException("location"); } Location = location; SourceCode = sourceCode; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, Document document, DocumentPosition position, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) { throw new ArgumentNullException("location"); } Location = location; Document = document; Position = position; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
/// <summary> /// Load the method that this frame refers to. /// </summary> public Task <DalvikMethod> GetMethodAsync() { if (method != null) { return(method.AsTask()); } var refType = GetReferenceType(); return(refType.GetMethodsAsync().Select(x => x.FirstOrDefault(m => m.Id.Equals(Location.Method))).SaveAndReturn(x => method = x)); }
/// <summary> /// Load the method that this frame refers to. /// </summary> public Task<DalvikMethod> GetMethodAsync() { if (method != null) return method.AsTask(); var refType = GetReferenceType(); return refType.GetMethodsAsync().Select(x => x.FirstOrDefault(m => m.Id.Equals(Location.Method))).SaveAndReturn(x => method = x); }