Update Mono debug proxy code (#13053)

This is now equivalent to Mono's commit 612e064 and to the Mono binaries that we'll include in Preview 9
This commit is contained in:
Steve Sanderson 2019-08-12 17:10:30 +01:00 committed by GitHub
parent eb564a8862
commit c6f043cb98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 5 deletions

View File

@ -322,8 +322,7 @@ namespace WsProxy {
name = method.Name,
startLocation = method.StartLocation.ToJObject (),
endLocation = method.EndLocation.ToJObject (),
}},
@this = new { }
}}
}));
++frame_id;
@ -485,11 +484,11 @@ namespace WsProxy {
var values = res.Value? ["result"]? ["value"]?.Values<JObject> ().ToArray ();
var var_list = new List<JObject> ();
int i = 0;
// Trying to inspect the stack frame for DotNetDispatcher::InvokeSynchronously
// results in a "Memory access out of bounds", causing 'values' to be null,
// so skip returning variable values in that case.
for (int i = 0; values != null && i < vars.Length; ++i) {
while (values != null && i < var_ids.Length && i < values.Length) {
var value = values [i] ["value"];
if (((string)value ["description"]) == null)
value ["description"] = value ["value"]?.ToString();
@ -498,12 +497,24 @@ namespace WsProxy {
name = vars [i].Name,
value = values [i] ["value"]
}));
i++;
}
//Async methods are special in the way that local variables can be lifted to generated class fields
//value of "this" comes here either
while (i < values.Length) {
String name = values [i] ["name"].ToString ();
if (name.IndexOf (">", StringComparison.Ordinal) > 0)
name = name.Substring (1, name.IndexOf (">", StringComparison.Ordinal) - 1);
var_list.Add (JObject.FromObject (new {
name = name,
value = values [i+1] ["value"]
}));
i = i + 2;
}
o = JObject.FromObject (new {
result = var_list
});
SendResponse (msg_id, Result.Ok (o), token);
}