Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test for Debugger.Break().
  • Loading branch information
ilonatommy committed Nov 22, 2021
commit 064b4e257e2380c1f64ecf95fb9834cfd4c74294
23 changes: 23 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -658,5 +658,28 @@ await EvaluateAndCheck(
"VisibleMethod"
);
}

[Fact]
public async Task DebuggerAttributeStopOnDebuggerHiddenCallWithDebuggerBreakCall()
{
var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunDebuggerBreak", 1);
await EvaluateAndCheck(
"window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:RunDebuggerBreak'); }, 1);",
"dotnet://debugger-test.dll/debugger-test.cs",
bp_init.Value["locations"][0]["lineNumber"].Value<int>(),
bp_init.Value["locations"][0]["columnNumber"].Value<int>(),
"RunDebuggerBreak"
);
await SendCommandAndCheck(null, "Debugger.resume",
null,
bp_init.Value["locations"][0]["lineNumber"].Value<int>() + 1,
bp_init.Value["locations"][0]["lineNumber"].Value<int>() + 1,
"RunDebuggerBreak");
await SendCommandAndCheck(null, "Debugger.resume",
null,
835,
8,
"VisibleMethodDebuggerBreak");
}
}
}
19 changes: 19 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 @@ -818,14 +818,33 @@ public static void HiddenMethod()
currentCount++;
}

[System.Diagnostics.DebuggerHidden]
public static void HiddenMethodDebuggerBreak()
{
System.Diagnostics.Debugger.Break();
currentCount++;
}

public static void VisibleMethod()
{
currentCount++;
}

public static void VisibleMethodDebuggerBreak()
{
System.Diagnostics.Debugger.Break();
currentCount++;
}

public static void Run()
{
HiddenMethod();
VisibleMethod();
}

public static void RunDebuggerBreak()
{
HiddenMethodDebuggerBreak();
VisibleMethodDebuggerBreak();
}
}