var c_obj_id = c_obj["value"]?["objectId"]?.Value<string>();
Assert.NotNull(c_obj_id);
- // Invalid format
- await GetProperties("dotnet:array:4123", expect_ok: false);
+ // Invalid format
+ await GetProperties("dotnet:array:4123", expect_ok: false);
- // Invalid object id
- await GetProperties("dotnet:array:{ \"arrayId\": 234980 }", expect_ok: false);
+ // Invalid object id
+ await GetProperties("dotnet:array:{ \"arrayId\": 234980 }", expect_ok: false);
- // Trying to access object as an array
- if (!DotnetObjectId.TryParse(c_obj_id, out var id) || id.Scheme != "object")
+ // Trying to access object as an array
+ if (!DotnetObjectId.TryParse(c_obj_id, out var id) || id.Scheme != "object")
Assert.True(false, "Unexpected object id format. Maybe this test is out of sync with the object id format in library_mono.js?");
if (!int.TryParse(id.Value, out var idNum))
Assert.True(id_args["arrayId"] != null, "ObjectId format for array seems to have changed. Expected to find 'arrayId' in the value. Update this test");
Assert.True(id_args != null, "Expected to get a json as the value part of {id}");
- // Try one valid query, to confirm that the id format hasn't changed!
- id_args["arrayIdx"] = 0;
+ // Try one valid query, to confirm that the id format hasn't changed!
+ id_args["arrayIdx"] = 0;
await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: true);
id_args["arrayIdx"] = 12399;
var invalid_accessors = new object[] { "NonExistant", "10000", "-2", 10000, -2, null, String.Empty };
foreach (var invalid_accessor in invalid_accessors)
{
- // var res = await InvokeGetter (JObject.FromObject (new { value = new { objectId = obj_id } }), invalid_accessor, expect_ok: true);
- var res = await InvokeGetter(pf_arr, invalid_accessor, expect_ok: true);
+ // var res = await InvokeGetter (JObject.FromObject (new { value = new { objectId = obj_id } }), invalid_accessor, expect_ok: true);
+ var res = await InvokeGetter(pf_arr, invalid_accessor, expect_ok: true);
AssertEqual("undefined", res.Value["result"]?["type"]?.ToString(), "Expected to get undefined result for non-existant accessor");
}
});
else
AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
- // Check for a __proto__ object
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // Check for a __proto__ object
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
await CheckProps(obj_own.Value["result"], new
{
length = TNumber(len),
- // __proto__ = TArray (type, 0) // Is this one really required?
- }, $"obj_own", num_fields: is_js ? 2 : 1);
+ // __proto__ = TArray (type, 0) // Is this one really required?
+ }, $"obj_own", num_fields: is_js ? 2 : 1);
});
}
var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
- // isOwn = false, accessorPropertiesOnly = true
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // isOwn = false, accessorPropertiesOnly = true
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
else
AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
- // Ignoring the __proto__ property
+ // Ignoring the __proto__ property
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
{
var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
- // getProperties (isOwn = false, accessorPropertiesOnly = true)
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (isOwn = false, accessorPropertiesOnly = true)
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
else
AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
- // getProperties (isOwn = true, accessorPropertiesOnly = false)
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (isOwn = true, accessorPropertiesOnly = false)
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
await CheckProps(obj_own.Value["result"], new
{
length = TNumber(ret_len),
- // __proto__ returned by js
- }, $"obj_own", num_fields: is_js ? 2 : 1);
+ // __proto__ returned by js
+ }, $"obj_own", num_fields: is_js ? 2 : 1);
});
}
{
var is_js = bp_loc.EndsWith(".js");
- // getProperties (own=false)
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=false)
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
else
AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
- // getProperties (own=true)
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=true)
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
ownProperties = true
}), ctx.token);
- // AssertEqual (2, obj_own.Value ["result"].Count (), $"{label}-obj_own.count");
+ // AssertEqual (2, obj_own.Value ["result"].Count (), $"{label}-obj_own.count");
- var obj_own_val = obj_own.Value["result"];
+ var obj_own_val = obj_own.Value["result"];
await CheckProps(obj_own_val, new
{
length = TNumber(ret_len),
- // __proto__ returned by JS
- }, $"obj_own", num_fields: (is_js ? ret_len + 2 : ret_len + 1));
+ // __proto__ returned by JS
+ }, $"obj_own", num_fields: (is_js ? ret_len + 2 : ret_len + 1));
for (int i = 0; i < ret_len; i++)
CheckNumber(obj_own_val, i.ToString(), i * 2 + 1000);
{
var ret_len = 5;
- // getProperties (own=false)
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=false)
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
- // getProperties (own=true)
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=true)
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
await CheckProps(obj_own_val, new
{
length = TNumber(ret_len),
- // __proto__ returned by JS
- }, "obj_own", num_fields: ret_len + 1);
+ // __proto__ returned by JS
+ }, "obj_own", num_fields: ret_len + 1);
for (int i = 0; i < ret_len; i++)
{
var act_i = CheckValueType(obj_own_val, i.ToString(), "Math.SimpleStruct");
- // Valuetypes can get sent as part of the container's getProperties, so ensure that we can access it
- var act_i_props = await GetProperties(act_i["value"]["objectId"]?.Value<string>());
+ // Valuetypes can get sent as part of the container's getProperties, so ensure that we can access it
+ var act_i_props = await GetProperties(act_i["value"]["objectId"]?.Value<string>());
await CheckProps(act_i_props, new
{
dt = TValueType("System.DateTime", new DateTime(2020 + (i * 2), 1, 2, 3, 4, 5).ToString()),
test_fn: async (result) =>
{
- // getProperties (own=false)
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=false)
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
}), ctx.token);
AssertEqual(0, obj_accessors.Value["result"].Count(), "obj_accessors-count");
- // getProperties (own=true)
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=true)
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
test_fn: async (result) =>
{
- // getProperties (own=false)
- var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=false)
+ var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = true,
await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
- // getProperties (own=true)
- // isOwn = true, accessorPropertiesOnly = false
- var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+ // getProperties (own=true)
+ // isOwn = true, accessorPropertiesOnly = false
+ var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
{
objectId = result.Value["result"]["objectId"].Value<string>(),
accessorPropertiesOnly = false,
"big", bp_loc, line, col, returnByValue: true, roundtrip: roundtrip,
test_fn: async (result) =>
{
- // Check cfo result
- AssertEqual(JTokenType.Object, result.Value["result"].Type, "cfo-result-jsontype");
+ // Check cfo result
+ AssertEqual(JTokenType.Object, result.Value["result"].Type, "cfo-result-jsontype");
AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
AssertEqual(JTokenType.Array, result.Value["result"]["value"].Type, "cfo-res-value-jsontype");
roundtrip: roundtrip,
test_fn: async (result) =>
{
- // Check cfo result
- AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
+ // Check cfo result
+ AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
var exp = new JArray();
for (int i = 0; i < 10; i++)
DTArray = TGetter("DTArray"),
StringField = TString(null),
- // Auto properties show w/o getters, because they have
- // a backing field
- DTAutoProperty = TValueType("System.DateTime", dt.ToString())
+ // Auto properties show w/o getters, because they have
+ // a backing field
+ DTAutoProperty = TValueType("System.DateTime", dt.ToString())
}, local_name);
- // Automatic properties don't have invokable getters, because we can get their
- // value from the backing field directly
- {
+ // Automatic properties don't have invokable getters, because we can get their
+ // value from the backing field directly
+ {
var dt_auto_props = await GetObjectOnLocals(obj_props, "DTAutoProperty");
await CheckDateTime(obj_props, "DTAutoProperty", dt);
}
- // Invoke getters, and check values
+ // Invoke getters, and check values
- dt = new DateTime(3, 4, 5, 6, 7, 8);
+ dt = new DateTime(3, 4, 5, 6, 7, 8);
var res = await InvokeGetter(obj, get_args_fn(new[] { "Int" }), cfo_fn);
await CheckValue(res.Value["result"], JObject.FromObject(new { type = "number", value = (0xDEADBEEF + (uint)dt.Month) }), $"{local_name}.Int");
await CheckValue(res.Value["result"], TValueType("System.DateTime", dt.ToString()), $"{local_name}.DT");
await CheckDateTimeValue(res.Value["result"], dt);
- // Check arrays through getters
+ // Check arrays through getters
- res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn);
+ res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn);
await CheckValue(res.Value["result"], TArray("int[]", 2), $"{local_name}.IntArray");
{
var arr_elems = await GetProperties(res.Value["result"]?["objectId"]?.Value<string>());
var is_js = bp_loc.EndsWith(".js");
- // Check with `accessorPropertiesOnly=true`
+ // Check with `accessorPropertiesOnly=true`
- var id = result.Value?["result"]?["objectId"]?.Value<string>();
+ var id = result.Value?["result"]?["objectId"]?.Value<string>();
var get_prop_req = JObject.FromObject(new
{
objectId = id,
});
var res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 6 : 5); // js returns extra `__proto__` member also
- Assert.False(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField shouldn't be returned for `accessorPropertiesOnly`");
+ Assert.False(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField shouldn't be returned for `accessorPropertiesOnly`");
- // Check with `accessorPropertiesOnly` unset, == false
- get_prop_req = JObject.FromObject(new
+ // Check with `accessorPropertiesOnly` unset, == false
+ get_prop_req = JObject.FromObject(new
{
objectId = id,
});
res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 8 : 7); // js returns a `__proto__` member also
- Assert.True(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField should be returned for `accessorPropertiesOnly=false`");
+ Assert.True(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField should be returned for `accessorPropertiesOnly=false`");
});
async Task<Result> GetPropertiesAndCheckAccessors(JObject get_prop_req, int num_fields)
var res = await InvokeGetter(ptd, "StringField", returnByValue: returnByValue);
if (is_js)
{
- // In js case, it doesn't know the className, so the result looks slightly different
- Assert.True(
- JObject.DeepEquals(res.Value["result"], null_value_json),
- $"[StringField#returnByValue = {returnByValue}] Json didn't match. Actual: {res.Value["result"]} vs {null_value_json}");
+ // In js case, it doesn't know the className, so the result looks slightly different
+ Assert.True(
+ JObject.DeepEquals(res.Value["result"], null_value_json),
+ $"[StringField#returnByValue = {returnByValue}] Json didn't match. Actual: {res.Value["result"]} vs {null_value_json}");
}
else
{
fn_del_null = TObject("Math.IsMathNull", is_null: true),
fn_del_arr = TArray("Math.IsMathNull[]", 1),
- // Unused locals
- fn_func_unused = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
+ // Unused locals
+ fn_func_unused = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
fn_func_null_unused = TObject("System.Func<Math, bool>", is_null: true),
fn_func_arr_unused = TArray("System.Func<Math, bool>[]", 1),
{
var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
- // sc_arg
- {
+ // sc_arg
+ {
var sc_arg = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "sc_arg");
await CheckValue(sc_arg, TObject("DebuggerTests.SimpleClass"), "sc_arg#1");
}, "sc_arg_props#1");
}
- // local_gs
- {
+ // local_gs
+ {
var local_gs = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "local_gs");
await CheckValue(local_gs, TValueType("DebuggerTests.SimpleGenericStruct<int>"), "local_gs#1");
}, "local_gs_props#1");
}
- // step, check local_gs
- pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 1, col, function_name);
+ // step, check local_gs
+ pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 1, col, function_name);
{
var local_gs = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "local_gs");
await CheckValue(local_gs, TValueType("DebuggerTests.SimpleGenericStruct<int>"), "local_gs#2");
}, "local_gs_props#2");
}
- // step check sc_arg.Id
- pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 2, col, function_name);
+ // step check sc_arg.Id
+ pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 2, col, function_name);
{
var sc_arg = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "sc_arg");
await CheckValue(sc_arg, TObject("DebuggerTests.SimpleClass"), "sc_arg#2");
X = TNumber(10),
Y = TNumber(45),
Id = TString("sc_arg#Id"), // <------- This changed
- Color = TEnum("DebuggerTests.RGB", "Blue"),
+ Color = TEnum("DebuggerTests.RGB", "Blue"),
PointWithCustomGetter = TGetter("PointWithCustomGetter")
}, "sc_arg_props#2");
}
evaluate = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "this.c");
CheckContentValue(evaluate, "3");
- // FIXME: not supported yet
- // evaluate = await EvaluateOnCallFrame (pause_location ["callFrames"][0] ["callFrameId"].Value<string> (), "this.dt");
- // await CheckDateTimeValue (evaluate, new DateTime (2000, 5, 4, 3, 2, 1));
- });
+ // FIXME: not supported yet
+ // evaluate = await EvaluateOnCallFrame (pause_location ["callFrames"][0] ["callFrameId"].Value<string> (), "this.dt");
+ // await CheckDateTimeValue (evaluate, new DateTime (2000, 5, 4, 3, 2, 1));
+ });
}
}
await CheckPointerValue(ipp_props, "*ipp_null", TPointer("int*", is_null: true));
}
- // *cp
- props = await GetObjectOnLocals(locals, "cp");
+ // *cp
+ props = await GetObjectOnLocals(locals, "cp");
await CheckPointerValue(props, "*cp", TSymbol("113 'q'"));
});
await CheckDateTime(locals, "dt", dt);
- // *dtp
- var props = await GetObjectOnLocals(locals, "dtp");
+ // *dtp
+ var props = await GetObjectOnLocals(locals, "dtp");
await CheckDateTime(props, "*dtp", dt);
var gsp_props = await GetObjectOnLocals(locals, "gsp");
}
}
- // gsp_null
- var gsp_w_n_props = await GetObjectOnLocals(locals, "gsp_null");
+ // gsp_null
+ var gsp_w_n_props = await GetObjectOnLocals(locals, "gsp_null");
await CheckPointerValue(gsp_w_n_props, "*gsp_null", TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"), "locals#gsp");
{
dtpa = TArray("System.DateTime*[]", 2)
}, "locals", num_fields: 26);
- // dtpa
- var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
- {
+ // dtpa
+ var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
+ {
TPointer("System.DateTime*"),
TPointer("System.DateTime*", is_null : true)
}));
gspa = TArray("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*[]", 3),
}, "locals", num_fields: 26);
- // dtpa
- var gspa_elems = await CompareObjectPropertiesFor(locals, "gspa", new[]
- {
+ // dtpa
+ var gspa_elems = await CompareObjectPropertiesFor(locals, "gspa", new[]
+ {
TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*", is_null : true),
TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>")
});
- // *[1]
- {
+ // *[1]
+ {
var gsp_deref_props = await GetObjectOnLocals(actual_elems[1], "*[1]");
await CheckProps(gsp_deref_props, new
{
}
}
- // *[2]
- {
+ // *[2]
+ {
var gsp_deref_props = await GetObjectOnLocals(actual_elems[2], "*[2]");
await CheckProps(gsp_deref_props, new
{
dtppa = TArray("System.DateTime**[]", 3),
}, "locals", num_fields: 26);
- // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null };
- var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
- {
+ // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null };
+ var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
+ {
TPointer("System.DateTime**"),
TPointer("System.DateTime**"),
TPointer("System.DateTime**", is_null : true)
ippa = TArray("int**[]", 5)
}, "locals", num_fields: 8);
- // ip
- var props = await GetObjectOnLocals(locals, "ip");
+ // ip
+ var props = await GetObjectOnLocals(locals, "ip");
await CheckPointerValue(props, "*ip", TNumber(5), "locals");
- // ipp
- var ipp_props = await GetObjectOnLocals(locals, "ipp");
+ // ipp
+ var ipp_props = await GetObjectOnLocals(locals, "ipp");
await CheckPointerValue(ipp_props, "*ipp", TPointer("int*"));
ipp_props = await GetObjectOnLocals(ipp_props, "*ipp");
await CheckPointerValue(ipp_props, "**ipp", TNumber(5));
- // ipa
- var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
- {
+ // ipa
+ var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
+ {
TPointer("int*"),
TPointer("int*"),
TPointer("int*", is_null : true)
null
});
- // ippa
- var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
- {
+ // ippa
+ var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
+ {
TPointer("int**"),
TPointer("int**"),
TPointer("int**"),
dtppa = TArray("System.DateTime**[]", 3)
}, "locals", num_fields: 8);
- // *dtp
- var dtp_props = await GetObjectOnLocals(locals, "dtp");
+ // *dtp
+ var dtp_props = await GetObjectOnLocals(locals, "dtp");
await CheckDateTime(dtp_props, "*dtp", dt);
- // *dtpp
- var dtpp_props = await GetObjectOnLocals(locals, "dtpp");
+ // *dtpp
+ var dtpp_props = await GetObjectOnLocals(locals, "dtpp");
await CheckPointerValue(dtpp_props, "*dtpp", TPointer("System.DateTime*"), "locals");
dtpp_props = await GetObjectOnLocals(dtpp_props, "*dtpp");
await CheckDateTime(dtpp_props, "**dtpp", dt);
- // dtpa
- var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
- {
+ // dtpa
+ var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
+ {
TPointer("System.DateTime*"),
TPointer("System.DateTime*", is_null : true)
}));
await CheckDateTime(actual_elems[0], "*[0]", dt);
}
- // dtppa = new DateTime**[] { &dtp, &dtp_null, null };
- var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
- {
+ // dtppa = new DateTime**[] { &dtp, &dtp_null, null };
+ var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
+ {
TPointer("System.DateTime**"),
TPointer("System.DateTime**"),
TPointer("System.DateTime**", is_null : true)
wait_for_event_fn: async (pause_location) =>
{
- // this will generate the object ids
- var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
+ // this will generate the object ids
+ var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
var complex = GetAndAssertObjectWithName(locals, "complex");
- // try to deref the non-pointer object, as a pointer
- await GetProperties(complex["value"]["objectId"].Value<string>().Replace(":object:", ":pointer:"), expect_ok: false);
+ // try to deref the non-pointer object, as a pointer
+ await GetProperties(complex["value"]["objectId"].Value<string>().Replace(":object:", ":pointer:"), expect_ok: false);
- // try to deref an invalid pointer id
- await GetProperties("dotnet:pointer:123897", expect_ok: false);
+ // try to deref an invalid pointer id
+ await GetProperties("dotnet:pointer:123897", expect_ok: false);
});
async Task<JToken[]> CheckArrayElements(JToken array, JToken[] exp_elems)
function_name,
wait_for_event_fn: async (pause_location) =>
{
- //make sure we're on the right bp
+ //make sure we're on the right bp
- Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
+ Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
var top_frame = pause_location["callFrames"][0];
"DelegatesTest",
wait_for_event_fn: async (pause_location) =>
{
- //make sure we're on the right bp
- Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
+ //make sure we're on the right bp
+ Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
var top_frame = pause_location["callFrames"][0];
var scope = top_frame["scopeChain"][0];
Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
- // Try to get an invalid scope!
- var get_prop_req = JObject.FromObject(new
+ // Try to get an invalid scope!
+ var get_prop_req = JObject.FromObject(new
{
objectId = "dotnet:scope:23490871",
});
ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
- await SetBreakpoint(debugger_test_loc, 22, 8);
+ await SetBreakpoint(debugger_test_loc, 24, 8);
var pause_location = await EvaluateAndCheck(
"window.setTimeout(function() { invoke_method_with_structs(); }, 1);",
- debugger_test_loc, 22, 8, "MethodWithLocalStructs");
+ debugger_test_loc, 24, 8, "MethodWithLocalStructs");
var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
await CheckProps(locals, new
ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
- await SetBreakpoint(debugger_test_loc, 34, 12);
+ await SetBreakpoint(debugger_test_loc, 36, 12);
var pause_location = await EvaluateAndCheck(
"window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:TestStructsAsMethodArgs'); }, 1);",
- debugger_test_loc, 34, 12, "MethodWithStructArgs");
+ debugger_test_loc, 36, 12, "MethodWithStructArgs");
var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
{
Assert.Equal(3, locals.Count());
await CompareObjectPropertiesFor(ss_arg_props, "gs", ss_local_gs);
}
- pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 38, 8, "MethodWithStructArgs", times: 4,
+ pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 40, 8, "MethodWithStructArgs", times: 4,
locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
{
// ----------- Step back to the caller ---------
- pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 28, 12, "TestStructsAsMethodArgs",
+ pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 30, 12, "TestStructsAsMethodArgs",
times: 2, locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
await CheckProps(locals, new
ctx = new DebugTestContext(cli, insp, token, scripts);
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
- var lines = new[] { 203, 206 };
+ var lines = new[] { 205, 208 };
await SetBreakpoint(debugger_test_loc, lines[0], 12);
await SetBreakpoint(debugger_test_loc, lines[1], 12);
ctx = new DebugTestContext(cli, insp, token, scripts);
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
- var lines = new[] { 212, 214 };
+ var lines = new[] { 214, 216 };
await SetBreakpoint(debugger_test_loc, lines[0], 12);
await SetBreakpoint(debugger_test_loc, lines[1], 12);
ctx = new DebugTestContext(cli, insp, token, scripts);
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
- var lines = new[] { 223, 225 };
+ var lines = new[] { 225, 227 };
await SetBreakpoint(debugger_test_loc, lines[0], 12);
await SetBreakpoint(debugger_test_loc, lines[1], 12);
}
[Theory]
- [InlineData(135, 12, "MethodWithLocalsForToStringTest", false, false)]
- [InlineData(145, 12, "MethodWithArgumentsForToStringTest", true, false)]
- [InlineData(190, 12, "MethodWithArgumentsForToStringTestAsync", true, true)]
- [InlineData(180, 12, "MethodWithArgumentsForToStringTestAsync", false, true)]
+ [InlineData(137, 12, "MethodWithLocalsForToStringTest", false, false)]
+ [InlineData(147, 12, "MethodWithArgumentsForToStringTest", true, false)]
+ [InlineData(192, 12, "MethodWithArgumentsForToStringTestAsync", true, true)]
+ [InlineData(182, 12, "MethodWithArgumentsForToStringTestAsync", false, true)]
public async Task InspectLocalsForToStringDescriptions(int line, int col, string method_name, bool call_other, bool invoke_async)
{
var insp = new Inspector();
return true;
}
- public async Task < (T, Point[]) > InstanceMethodValueTypeLocalsAsync<T>(T t1)
+ public async Task<(T, Point[])> InstanceMethodValueTypeLocalsAsync<T>(T t1)
{
var point_arr = new Point[]
{
new Point { X = 90, Y = -4, Id = "point#Id", Color = RGB.Green }.GenericInstanceMethod(sc);
}
}
-}
\ No newline at end of file
+}
public static async System.Threading.Tasks.Task PropertyGettersTestAsync()
{
- var ptd = new ClassWithProperties { DTAutoProperty = new DateTime (4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
- var swp = new StructWithProperties { DTAutoProperty = new DateTime (4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
+ var ptd = new ClassWithProperties { DTAutoProperty = new DateTime(4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
+ var swp = new StructWithProperties { DTAutoProperty = new DateTime(4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
System.Console.WriteLine("break here");
await System.Threading.Tasks.Task.CompletedTask;
}
- public static void MethodForNegativeTests (string value = null)
+ public static void MethodForNegativeTests(string value = null)
{
var ptd = new ClassWithProperties { StringField = value };
var swp = new StructWithProperties { StringField = value };
public DateTime DTAutoProperty { get; set; }
public string StringField;
}
-}
\ No newline at end of file
+}
return dt_str;
}
}
-}
\ No newline at end of file
+}
c = c + 3;
}
}
-}
\ No newline at end of file
+}
{
public class TestCaughtException
{
- public void run()
+ public void run()
{
try
{
- throw new CustomException ("not implemented caught");
+ throw new CustomException("not implemented caught");
}
catch
{
{
public void run()
{
- throw new CustomException ("not implemented uncaught");
+ throw new CustomException("not implemented uncaught");
}
}
// Using this name to match with what js has.
// helps with the tests
public string message;
- public CustomException (string message)
- : base (message)
+ public CustomException(string message)
+ : base(message)
{
this.message = message;
}
}
-}
\ No newline at end of file
+}
PointersAsArgsTest(ip, ipp, ipa, ippa, &dt, &dtp, dtpa, dtppa);
}
- static unsafe void PointersAsArgsTest(int* ip, int** ipp, int*[] ipa, int**[] ippa,
+ static unsafe void PointersAsArgsTest(int* ip, int** ipp, int*[] ipa, int**[] ippa,
DateTime* dtp, DateTime** dtpp, DateTime*[] dtpa, DateTime**[] dtppa)
{
Console.WriteLine($"break here!");
{
public unsafe T* Ptr;
}
-}
\ No newline at end of file
+}
Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func = (m, gs) => new GenericStruct<bool[]>();
Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func_del = GenericStruct<int>.DelegateTargetForSignatureTest;
Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func_null = null;
- Func<bool> fn_func_only_ret = () => { Console.WriteLine ($"hello"); return true; };
+ Func<bool> fn_func_only_ret = () => { Console.WriteLine($"hello"); return true; };
var fn_func_arr = new Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>>[] {
(m, gs) => new GenericStruct<bool[]> () };
}
static void locals_inner() { }
-}
\ No newline at end of file
+}
public static void Types()
{
double dPI = System.Math.PI;
- float fPI = (float) System.Math.PI;
+ float fPI = (float)System.Math.PI;
int iMax = int.MaxValue;
int iMin = int.MinValue;
uint uiMax = uint.MaxValue;
uint uiMin = uint.MinValue;
- long l = uiMax * (long) 2;
+ long l = uiMax * (long)2;
long lMax = long.MaxValue; // cannot be represented as double
long lMin = long.MinValue; // cannot be represented as double
var d = usMin + usMax;
}
-}
\ No newline at end of file
+}
{
StringField = "string#0",
SimpleStructField = new SimpleStruct("SimpleStructField#string#0", 5, DateTimeKind.Local),
- SimpleStructProperty = new SimpleStruct("SimpleStructProperty#string#0", 2, DateTimeKind.Utc), DT = new DateTime(2020, 1, 2, 3, 4, 5), RGB = RGB.Blue
+ SimpleStructProperty = new SimpleStruct("SimpleStructProperty#string#0", 2, DateTimeKind.Utc),
+ DT = new DateTime(2020, 1, 2, 3, 4, 5),
+ RGB = RGB.Blue
};
Console.WriteLine($"Using the struct: {ss_local.gs.StringField}, gs: {gs_local.StringField}, {vt_local.StringField}");
}
public static void MethodUpdatingVTArrayMembers()
{
- var ssta = new []
+ var ssta = new[]
{
new StructForToStringTests { DT = new DateTime(1, 2, 3, 4, 5, 6) }
};
All = Option1 | Option3
}
-}
\ No newline at end of file
+}
return x;
}
}
-}
\ No newline at end of file
+}