/// <summary> /// Returns reference types for all classes currently loaded by the target VM. /// </summary> public Task <List <ClassInfo> > AllClassesWithGenericAsync() { var conn = ConnectionOrError; var sizeInfo = conn.GetIdSizeInfo(); var t = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 20, 0)); return(t.ContinueWith(x => { x.ForwardException(); var result = x.Result; result.ThrowOnError(); var data = result.Data; var count = data.GetInt(); var list = new List <ClassInfo>(); while (count > 0) { count--; var typeId = ReferenceTypeId.Read(data); var signature = data.GetString(); var genericSignature = data.GetString(); var status = data.GetInt(); list.Add(new ClassInfo(typeId, signature, genericSignature, (Jdwp.ClassStatus)status)); } return list; })); }
/// <summary> /// Returns the runtime type of the object. The runtime type will be a class or an array. /// </summary> public Task <ReferenceTypeId> ReferenceTypeAsync(ObjectId objectId) { var conn = ConnectionOrError; var t = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 1, objectId.Size, x => { var data = x.Data; objectId.WriteTo(data); })); return(t.ContinueWith(x => { x.ForwardException(); var result = x.Result; result.ThrowOnError(); return ReferenceTypeId.Read(result.Data); })); }
/// <summary> /// Returns reference types that match the given signature. /// </summary> public Task <List <ClassInfo> > ClassBySignatureAsync(string signature) { var conn = ConnectionOrError; var sizeInfo = conn.GetIdSizeInfo(); var t = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 2, JdwpPacket.DataReaderWriter.GetStringSize(signature), x => x.Data.SetString(signature))); return(t.ContinueWith(x => { x.ForwardException(); var result = x.Result; result.ThrowOnError(); var data = result.Data; var count = data.GetInt(); var list = new List <ClassInfo>(); while (count > 0) { count--; var typeId = ReferenceTypeId.Read(data); var status = data.GetInt(); list.Add(new ClassInfo(typeId, signature, signature, (Jdwp.ClassStatus)status)); } return list; })); }
/// <summary> /// Read an value. /// </summary> public Location(JdwpPacket.DataReaderWriter readerWriter) { Class = ReferenceTypeId.Read(readerWriter); Method = new MethodId(readerWriter); Index = readerWriter.GetULong(); }