Example #1
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;
                }));
            }
Example #2
0
 /// <summary>
 /// Write this location into the given packet writer.
 /// </summary>
 public void WriteTo(JdwpPacket.DataReaderWriter writer)
 {
     writer.SetByte((byte)GetType(Class));
     Class.WriteTo(writer);
     Method.WriteTo(writer);
     writer.SetULong(Index);
 }