diff --git a/src/mono/browser/debugger/DebuggerTestSuite/MiscTests.cs b/src/mono/browser/debugger/DebuggerTestSuite/MiscTests.cs index d82c2ecb22006f..3b0d795dfe5f4d 100644 --- a/src/mono/browser/debugger/DebuggerTestSuite/MiscTests.cs +++ b/src/mono/browser/debugger/DebuggerTestSuite/MiscTests.cs @@ -1200,5 +1200,24 @@ public async Task TestDebugUsingMultiThreadedRuntime(int _attempt) 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", 1684, 8, + "SpanByte.Run", + wait_for_event_fn: async (pause_location) => + { + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + await EvaluateOnCallFrameAndCheck(id, + ("span", TObject("System.Span", null)) + ); + } + ); + } } } diff --git a/src/mono/browser/debugger/tests/debugger-test/debugger-test.cs b/src/mono/browser/debugger/tests/debugger-test/debugger-test.cs index c06a12a60dd87f..f4132f82c4a820 100644 --- a/src/mono/browser/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/browser/debugger/tests/debugger-test/debugger-test.cs @@ -1675,4 +1675,13 @@ public static void Run() BreakpointTestsClass bpTest = new(); } } +} + +public class SpanByte +{ + public static void Run() + { + System.Span span = new (); + System.Diagnostics.Debugger.Break(); + } } \ No newline at end of file diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index a4c97afcff2cb3..7c0a93093e347a 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -5581,6 +5581,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) &&