Skip to content

Commit

Permalink
Backport of #99843 (#99844)
Browse files Browse the repository at this point in the history
  • Loading branch information
thaystg authored Apr 2, 2024
1 parent 3ea18f2 commit 9de64a2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -5589,6 +5589,7 @@ decode_value_compute_size (MonoType *t, int type, MonoDomain *domain, guint8 *bu
if (type != t->type && !MONO_TYPE_IS_REFERENCE (t) &&
!(t->type == MONO_TYPE_I && type == MONO_TYPE_VALUETYPE) &&
!(type == VALUE_TYPE_ID_FIXED_ARRAY) &&
!(type == MDBGPROT_VALUE_TYPE_ID_NULL) &&
!(t->type == MONO_TYPE_U && type == MONO_TYPE_VALUETYPE) &&
!(t->type == MONO_TYPE_PTR && type == MONO_TYPE_I8) &&
!(t->type == MONO_TYPE_FNPTR && type == MONO_TYPE_I8) &&
Expand Down
19 changes: 19 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,5 +1188,24 @@ public async Task TestDebugUsingMultiThreadedRuntime()
Assert.Equal(locals[1]["value"]["type"], "number");
Assert.Equal(locals[1]["name"], "currentThread");
}

[Fact]
public async Task InspectSpanByte()
{
var expression = $"{{ invoke_static_method('[debugger-test] SpanByte:Run'); }}";

await EvaluateAndCheck(
"window.setTimeout(function() {" + expression + "; }, 1);",
"dotnet://debugger-test.dll/debugger-test.cs", 1664, 8,
"SpanByte.Run",
wait_for_event_fn: async (pause_location) =>
{
var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();
await EvaluateOnCallFrameAndCheck(id,
("span", TObject("System.Span<byte>", null))
);
}
);
}
}
}
9 changes: 9 additions & 0 deletions src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,3 +1656,12 @@ public void CallMethod()

public int myField;
}

public class SpanByte
{
public static void Run()
{
System.Span<byte> span = new ();
System.Diagnostics.Debugger.Break();
}
}

0 comments on commit 9de64a2

Please sign in to comment.