Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PointerTests.cs « DebuggerTestSuite « wasm « sdks - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 932f02a0c802ab02258f29e042a71618cf283020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
using System;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Xunit;
using WebAssembly.Net.Debugging;

namespace DebuggerTests
{

	public class PointerTests : DebuggerTestBase {

		public static TheoryData<string, string, string, int, string, bool> PointersTestData =>
			new TheoryData<string, string, string, int, string, bool> {
				{$"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "LocalPointers", 32, "LocalPointers", false},
				{$"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "LocalPointers", 32, "LocalPointers", true},
				{$"invoke_static_method_async ('[debugger-test] DebuggerTests.PointerTests:LocalPointersAsync');", "DebuggerTests.PointerTests", "LocalPointersAsync", 32, "MoveNext", false},
				{$"invoke_static_method_async ('[debugger-test] DebuggerTests.PointerTests:LocalPointersAsync');", "DebuggerTests.PointerTests", "LocalPointersAsync", 32, "MoveNext", true}
			};

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointersToPrimitiveTypes (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						ip       = TPointer   ("int*"),
						ip_null  = TPointer   ("int*", is_null: true),
						ipp      = TPointer   ("int**"),
						ipp_null = TPointer   ("int**"),

						cvalue0  = TSymbol    ("113 'q'"),
						cp       = TPointer   ("char*"),

						vp       = TPointer   ("void*"),
						vp_null  = TPointer   ("void*", is_null: true),
					}, "locals", num_fields: 26);

					var props = await GetObjectOnLocals (locals, "ip");
					await CheckPointerValue (props, "*ip", TNumber (5), "locals");

					{
						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));
					}

					{
						var ipp_props = await GetObjectOnLocals (locals, "ipp_null");
						await CheckPointerValue (ipp_props, "*ipp_null", TPointer ("int*", is_null: true));
					}

					// *cp
					props = await GetObjectOnLocals (locals, "cp");
					await CheckPointerValue (props, "*cp", TSymbol ("113 'q'"));
				});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointerArrays (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						ipa = TArray ("int*[]", 3)
					}, "locals", num_fields: 26);

					var ipa_elems = await CompareObjectPropertiesFor (locals, "ipa", new [] {
						TPointer ("int*"),
						TPointer ("int*"),
						TPointer ("int*", is_null: true)
					});

					await CheckArrayElements (ipa_elems, new [] {
						TNumber (5),
						TNumber (10),
						null
					});
 				});

 		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalDoublePointerToPrimitiveTypeArrays (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						ippa = TArray ("int**[]", 5)
					}, "locals", num_fields: 26);

					var ippa_elems = await CompareObjectPropertiesFor (locals, "ippa", new [] {
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**", is_null: true)
					});

					{
						var actual_elems = await CheckArrayElements (ippa_elems, new [] {
							TPointer ("int*"),
							TPointer ("int*", is_null: true),
							TPointer ("int*"),
							TPointer ("int*", is_null: true),
							null
						});

						var val = await GetObjectOnLocals (actual_elems [0], "*[0]");
						await CheckPointerValue (val, "**[0]", TNumber (5));

						val = await GetObjectOnLocals (actual_elems [2], "*[2]");
						await CheckPointerValue (val, "**[2]", TNumber (5));
					}
 				});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointersToValueTypes (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						dt       = TValueType ("System.DateTime",  dt.ToString ()),
						dtp      = TPointer   ("System.DateTime*"),
						dtp_null = TPointer   ("System.DateTime*", is_null:    true),

						gsp      = TPointer   ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
						gsp_null = TPointer   ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*")
					}, "locals", num_fields: 26);

					await CheckDateTime (locals, "dt", dt);

					// *dtp
					var props = await GetObjectOnLocals (locals, "dtp");
					await CheckDateTime (props, "*dtp", dt);

					var gsp_props = await GetObjectOnLocals (locals, "gsp");
					await CheckPointerValue (gsp_props, "*gsp", TValueType ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"), "locals#gsp");

					{
						var gs_dt = new DateTime (1, 2, 3, 4, 5, 6);

						var gsp_deref_props = await GetObjectOnLocals (gsp_props, "*gsp");
						await CheckProps (gsp_deref_props, new {
							Value      = TValueType ("System.DateTime", gs_dt.ToString ()),
							IntField   = TNumber    (4),
							DTPP       = TPointer   ("System.DateTime**")
						}, "locals#gsp#deref");
						{
							var dtpp_props = await GetObjectOnLocals (gsp_deref_props, "DTPP");
							await CheckPointerValue (dtpp_props, "*DTPP", TPointer ("System.DateTime*"), "locals#*gsp");

							var dtpp_deref_props = await GetObjectOnLocals (dtpp_props, "*DTPP");
							await CheckDateTime (dtpp_deref_props, "**DTPP", dt);
						}
					}

					// 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");

					{
						var gs_dt = new DateTime (1, 2, 3, 4, 5, 6);

						var gsp_deref_props = await GetObjectOnLocals (gsp_w_n_props, "*gsp_null");
						await CheckProps (gsp_deref_props, new {
							Value      = TValueType ("System.DateTime", gs_dt.ToString ()),
							IntField   = TNumber    (4),
							DTPP       = TPointer   ("System.DateTime**")
						}, "locals#gsp#deref");
						{
							var dtpp_props = await GetObjectOnLocals (gsp_deref_props, "DTPP");
							await CheckPointerValue (dtpp_props, "*DTPP", TPointer ("System.DateTime*", is_null: true), "locals#*gsp");
						}
					}
			});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointersToValueTypeArrays (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						dtpa = TArray     ("System.DateTime*[]", 2)
					}, "locals", num_fields: 26);

					// dtpa
					var dtpa_elems = (await CompareObjectPropertiesFor (locals, "dtpa", new [] {
						TPointer ("System.DateTime*"),
						TPointer ("System.DateTime*", is_null: true)
					}));
					{
						var actual_elems = await CheckArrayElements (dtpa_elems, new [] {
							TValueType ("System.DateTime", dt.ToString ()),
							null
						});

						await CheckDateTime (actual_elems [0], "*[0]", dt);
					}
			});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointersToGenericValueTypeArrays (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						gspa = TArray ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*[]", 3),
					}, "locals", num_fields: 26);

					// 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>*"),
					});
					{
						var gs_dt = new DateTime (1, 2, 3, 4, 5, 6);
						var actual_elems = await CheckArrayElements (gspa_elems, new [] {
							null,
							TValueType ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"),
							TValueType ("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>")
						});

						// *[1]
						{
							var gsp_deref_props = await GetObjectOnLocals (actual_elems [1], "*[1]");
							await CheckProps (gsp_deref_props, new {
								Value      = TValueType ("System.DateTime", gs_dt.ToString ()),
								IntField   = TNumber    (4),
								DTPP       = TPointer   ("System.DateTime**")
							}, "locals#gsp#deref");
							{
								var dtpp_props = await GetObjectOnLocals (gsp_deref_props, "DTPP");
								await CheckPointerValue (dtpp_props, "*DTPP", TPointer ("System.DateTime*"), "locals#*gsp");

								dtpp_props = await GetObjectOnLocals (dtpp_props, "*DTPP");
								await CheckDateTime (dtpp_props, "**DTPP", dt);
							}
						}

						// *[2]
						{
							var gsp_deref_props = await GetObjectOnLocals (actual_elems [2], "*[2]");
							await CheckProps (gsp_deref_props, new {
								Value      = TValueType ("System.DateTime", gs_dt.ToString ()),
								IntField   = TNumber    (4),
								DTPP       = TPointer   ("System.DateTime**")
							}, "locals#gsp#deref");
							{
								var dtpp_props = await GetObjectOnLocals (gsp_deref_props, "DTPP");
								await CheckPointerValue (dtpp_props, "*DTPP", TPointer ("System.DateTime*", is_null: true), "locals#*gsp");
							}
						}
					}
			});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalDoublePointersToValueTypeArrays (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, 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 [] {
						TPointer ("System.DateTime**"),
						TPointer ("System.DateTime**"),
						TPointer ("System.DateTime**", is_null: true)
					}));

					var exp_elems = new [] {
						TPointer ("System.DateTime*"),
						TPointer ("System.DateTime*", is_null: true),
						null
					};

					var actual_elems = new JToken [exp_elems.Length];
					for (int i = 0; i < exp_elems.Length; i ++) {
						if (exp_elems [i] != null) {
							actual_elems [i] = await GetObjectOnLocals (dtppa_elems, i.ToString ());
							await CheckPointerValue (actual_elems [i], $"*[{i}]", exp_elems [i], $"dtppa->");
						}
					}
			});

		[Theory]
		[MemberDataAttribute (nameof (PointersTestData))]
		public async Task InspectLocalPointersInClasses (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						cwp            = TObject ("DebuggerTests.GenericClassWithPointers<System.DateTime>"),
						cwp_null  = TObject ("DebuggerTests.GenericClassWithPointers<System.DateTime>")
					}, "locals", num_fields: 26);

					var cwp_props = await GetObjectOnLocals (locals, "cwp");
					var ptr_props = await GetObjectOnLocals (cwp_props, "Ptr");
					await CheckDateTime (ptr_props, "*Ptr", dt);
			});

		public static TheoryData<string, string, string, int, string, bool> PointersAsMethodArgsTestData =>
			new TheoryData<string, string, string, int, string, bool> {
				{$"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "PointersAsArgsTest", 2, "PointersAsArgsTest", false},
				{$"invoke_static_method ('[debugger-test] DebuggerTests.PointerTests:LocalPointers');", "DebuggerTests.PointerTests", "PointersAsArgsTest", 2, "PointersAsArgsTest", true},
			};

		[Theory]
		[MemberDataAttribute (nameof (PointersAsMethodArgsTestData))]
		public async Task InspectPrimitiveTypePointersAsMethodArgs (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						ip   = TPointer   ("int*"),
						ipp  = TPointer   ("int**"),
						ipa  = TArray     ("int*[]",  3),
						ippa = TArray     ("int**[]", 5)
					}, "locals", num_fields: 8);

					// ip
					var props = await GetObjectOnLocals (locals, "ip");
					await CheckPointerValue (props, "*ip", TNumber (5), "locals");

					// 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 [] {
						TPointer ("int*"),
						TPointer ("int*"),
						TPointer ("int*", is_null: true)
					});

					await CheckArrayElements (ipa_elems, new [] {
						TNumber (5),
						TNumber (10),
						null
					});

					// ippa
					var ippa_elems = await CompareObjectPropertiesFor (locals, "ippa", new [] {
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**"),
						TPointer ("int**", is_null: true)
					});

					{
						var actual_elems = await CheckArrayElements (ippa_elems, new [] {
							TPointer ("int*"),
							TPointer ("int*", is_null: true),
							TPointer ("int*"),
							TPointer ("int*", is_null: true),
							null
						});

						var val = await GetObjectOnLocals (actual_elems [0], "*[0]");
						await CheckPointerValue (val, "**[0]", TNumber (5));

						val = await GetObjectOnLocals (actual_elems [2], "*[2]");
						await CheckPointerValue (val, "**[2]", TNumber (5));
					}
			});

		[Theory]
		[MemberDataAttribute (nameof (PointersAsMethodArgsTestData))]
		public async Task InspectValueTypePointersAsMethodArgs (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {
					var locals = await GetProperties (pause_location ["callFrames"][0]["callFrameId"].Value<string>());

					var dt = new DateTime (5, 6, 7, 8, 9, 10);
					await CheckProps (locals, new {
						dtp   = TPointer ("System.DateTime*"),
						dtpp  = TPointer ("System.DateTime**"),
						dtpa  = TArray   ("System.DateTime*[]", 2),
						dtppa = TArray   ("System.DateTime**[]", 3)
					}, "locals", num_fields: 8);

					// *dtp
					var dtp_props = await GetObjectOnLocals (locals, "dtp");
					await CheckDateTime (dtp_props, "*dtp", dt);

					// *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 [] {
						TPointer ("System.DateTime*"),
						TPointer ("System.DateTime*", is_null: true)
					}));
					{
						var actual_elems = await CheckArrayElements (dtpa_elems, new [] {
							TValueType ("System.DateTime", dt.ToString ()),
							null
						});

						await CheckDateTime (actual_elems [0], "*[0]", dt);
					}

					// 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)
					}));

					var exp_elems = new [] {
						TPointer ("System.DateTime*"),
						TPointer ("System.DateTime*", is_null: true),
						null
					};

					await CheckArrayElements (dtppa_elems, exp_elems);
				});

		[Theory]
		[InlineData ("invoke_static_method ('[debugger-test] Math:UseComplex', 0, 0);", "Math", "UseComplex", 3, "UseComplex", false)]
		[InlineData ("invoke_static_method ('[debugger-test] Math:UseComplex', 0, 0);", "Math", "UseComplex", 3, "UseComplex", true)]
		public async Task DerefNonPointerObject (string eval_fn, string type, string method, int line_offset, string bp_function_name, bool use_cfo)
			=> await CheckInspectLocalsAtBreakpointSite (
				type, method, line_offset, bp_function_name,
				"window.setTimeout(function() { " + eval_fn + " })",
				use_cfo: use_cfo,
				wait_for_event_fn: async (pause_location) => {

					// 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
					var props = await GetProperties (complex ["value"]["objectId"].Value<string> ().Replace (":object:", ":pointer:"));
					Assert.Empty (props.Values ());

					// try to deref an invalid pointer id
					props = await GetProperties ("dotnet:pointer:123897");
					Assert.Empty (props.Values ());
				});

		async Task<JToken[]> CheckArrayElements (JToken array, JToken[] exp_elems)
		{
			var actual_elems = new JToken [exp_elems.Length];
			for (int i = 0; i < exp_elems.Length; i ++) {
				if (exp_elems [i] != null) {
					actual_elems [i] = await GetObjectOnLocals (array, i.ToString ());
					await CheckPointerValue (actual_elems [i], $"*[{i}]", exp_elems [i], $"dtppa->");
				}
			}

			return actual_elems;
		}
	}
}