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
Added test for DebuggerHidden decorator.
  • Loading branch information
ilonatommy committed Nov 3, 2021
commit 5302e15803e0831662649c7ceefdb2e7efb22ae4
8 changes: 8 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,5 +642,13 @@ await EvaluateAndCheck(
}
);
}


[Fact]
public async Task DebuggerAttributeNoStopInDebuggerHidden()
{
var bp_hidden = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "HiddenMethod", 1);
Assert.Empty(bp_hidden.Value["locations"]);
}
}
}
17 changes: 17 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 @@ -3,6 +3,7 @@

using System;
using System.Linq;
using System.Diagnostics;
public partial class Math
{ //Only append content to this class as the test suite depends on line info
public static int IntAdd(int a, int b)
Expand Down Expand Up @@ -807,3 +808,19 @@ public int Increment(int count)
return count + 1;
}
}

public class DebuggerAttribute
{
static int currentCount = 0;

[DebuggerHidden]
public static void HiddenMethod()
{
currentCount++;
}

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