public string[] names;
public int[] live_range_start;
public int[] live_range_end;
+ public int[] scopes_start;
+ public int[] scopes_end;
}
struct PropInfo {
ERR_UNLOADED = 103,
ERR_NO_INVOCATION = 104,
ABSENT_INFORMATION = 105,
- NO_SEQ_POINT_AT_IL_OFFSET = 106
+ NO_SEQ_POINT_AT_IL_OFFSET = 106,
+ INVOKE_ABORTED = 107
}
public class ErrorHandlerEventArgs : EventArgs {
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
- internal const int MINOR_VERSION = 40;
+ internal const int MINOR_VERSION = 44;
enum WPSuspendPolicy {
NONE = 0,
GET_THIS = 2,
SET_VALUES = 3,
GET_DOMAIN = 4,
+ SET_THIS = 5,
}
enum CmdArrayRef {
return res;
}
+ public string ReadUTF16String () {
+ int len = decode_int (packet, ref offset);
+ string res = new String (Encoding.Unicode.GetChars (packet, offset, len));
+ offset += len;
+ return res;
+ }
+
public ValueImpl ReadValue () {
ElementType etype = (ElementType)ReadByte ();
var res = SendReceive (CommandSet.METHOD, (int)CmdMethod.GET_LOCALS_INFO, new PacketWriter ().WriteId (id));
LocalsInfo info = new LocalsInfo ();
+
+ if (Version.AtLeast (2, 43)) {
+ int nscopes = res.ReadInt ();
+ info.scopes_start = new int [nscopes];
+ info.scopes_end = new int [nscopes];
+ int last_start = 0;
+ for (int i = 0; i < nscopes; ++i) {
+ info.scopes_start [i] = last_start + res.ReadInt ();
+ info.scopes_end [i] = info.scopes_start [i] + res.ReadInt ();
+ last_start = info.scopes_start [i];
+ }
+ }
+
int nlocals = res.ReadInt ();
info.types = new long [nlocals];
for (int i = 0; i < nlocals; ++i)
return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
}
+ internal void StackFrame_SetThis (long thread_id, long id, ValueImpl value) {
+ SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_THIS, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteValue (value));
+ }
+
/*
* ARRAYS
*/
* STRINGS
*/
internal string String_GetValue (long id) {
- return SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id)).ReadString ();
+ var r = SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id));
+
+ bool is_utf16 = false;
+ if (Version.AtLeast (2, 41))
+ is_utf16 = r.ReadByte () == 1;
+
+ if (is_utf16)
+ return r.ReadUTF16String ();
+ else
+ return r.ReadString ();
}
internal int String_GetLength (long id) {