示例#1
0
            /// <summary>
            /// Returns information for each method in a reference type. Inherited methods are not included. The list of methods will include constructors
            /// (identified with the name "&lt;init&gt;"), the initialization method (identified with the name "&lt;clinit&gt;") if present, and any synthetic methods
            /// created by the compiler. Methods are returned in the order they occur in the class file.
            /// </summary>
            public Task <List <MethodInfo> > MethodsAsync(ReferenceTypeId id)
            {
                var conn     = ConnectionOrError;
                var sizeInfo = conn.GetIdSizeInfo();
                var t        = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 15, sizeInfo.ReferenceTypeIdSize, x => id.WriteTo(x.Data)));

                return(t.ContinueWith(x => {
                    x.ForwardException();
                    var result = x.Result;
                    result.ThrowOnError();
                    var data = result.Data;
                    var count = data.GetInt();
                    var list = new List <MethodInfo>(count);
                    for (var i = 0; i < count; i++)
                    {
                        var methodId = new MethodId(data);
                        var name = data.GetString();
                        var signature = data.GetString();
                        var genericSignature = data.GetString();
                        var accessFlags = data.GetInt();
                        list.Add(new MethodInfo(methodId, name, signature, genericSignature, accessFlags));
                    }
                    return list;
                }));
            }
示例#2
0
            /// <summary>
            /// Returns variable information for the method, including generic signatures for the variables. The variable table includes arguments and
            /// locals declared within the method. For instance methods, the "this" reference is included in the table. Also, synthetic variables may be
            /// present. Generic signatures are described in the signature attribute section in the Java Virtual Machine Specification, 3rd Edition.
            /// Since JDWP version 1.5.
            /// </summary>
            public Task <List <VariableInfo> > VariableTableWithGenericAsync(ReferenceTypeId typeId, MethodId methodId)
            {
                var conn = ConnectionOrError;
                var t    = conn.SendAsync(JdwpPacket.CreateCommand(conn, Nr, 5, typeId.Size + methodId.Size,
                                                                   x => {
                    var data = x.Data;
                    typeId.WriteTo(data);
                    methodId.WriteTo(data);
                }));

                return(t.ContinueWith(x => {
                    x.ForwardException();
                    var result = x.Result;
                    result.ThrowOnError();
                    var data = result.Data;
                    var argCnt = data.GetInt();
                    var count = data.GetInt();
                    var list = new List <VariableInfo>(count);
                    for (var i = 0; i < count; i++)
                    {
                        var codeIndex = data.GetLong();
                        var name = data.GetString();
                        var signature = data.GetString();
                        var genericSignature = data.GetString();
                        var length = data.GetInt();
                        var slot = data.GetInt();
                        list.Add(new VariableInfo(codeIndex, name, signature, genericSignature, length, slot));
                    }
                    return list;
                }));
            }
示例#3
0
 /// <summary>
 /// Read an value.
 /// </summary>
 public Location(JdwpPacket.DataReaderWriter readerWriter)
 {
     Class  = ReferenceTypeId.Read(readerWriter);
     Method = new MethodId(readerWriter);
     Index  = readerWriter.GetULong();
 }
示例#4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public Location(ReferenceTypeId classId, MethodId methodId, ulong index)
 {
     Class  = classId;
     Method = methodId;
     Index  = index;
 }