From: Thays Grazia Date: Tue, 7 Feb 2023 19:48:36 +0000 (-0300) Subject: [wasm][debugger] Skip generated wrappers when trying to step into/out with JustMyCode... X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~4182 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a1e99e24fa12d8387a31459d39230cb1a37ebb1;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [wasm][debugger] Skip generated wrappers when trying to step into/out with JustMyCode enabled (#81715) * Skip generated wrappers when trying to step. * Changing to use System.Diagnostics.DebuggerNonUserCode --- diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/Constants.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/Constants.cs index 5a90431..aab379d 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/Constants.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/Constants.cs @@ -10,6 +10,7 @@ namespace Microsoft.Interop.JavaScript public const string JSImportAttribute = "System.Runtime.InteropServices.JavaScript.JSImportAttribute"; public const string JSExportAttribute = "System.Runtime.InteropServices.JavaScript.JSExportAttribute"; public const string JavaScriptMarshal = "System.Runtime.InteropServices.JavaScript.JavaScriptMarshal"; + public const string DebuggerNonUserCodeAttribute = "System.Diagnostics.DebuggerNonUserCode"; public const string JSFunctionSignatureGlobal = "global::System.Runtime.InteropServices.JavaScript.JSFunctionBinding"; public const string JSMarshalerArgumentGlobal = "global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument"; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs index 47c79a6..229400e 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs @@ -145,6 +145,8 @@ namespace Microsoft.Interop.JavaScript MemberDeclarationSyntax wrappperMethod = MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier(wrapperName)) .WithModifiers(TokenList(new[] { Token(SyntaxKind.InternalKeyword), Token(SyntaxKind.StaticKeyword), Token(SyntaxKind.UnsafeKeyword) })) + .WithAttributeLists(SingletonList(AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(Constants.DebuggerNonUserCodeAttribute)))))) .WithParameterList(ParameterList(SingletonSeparatedList( Parameter(Identifier("__arguments_buffer")).WithType(PointerType(ParseTypeName(Constants.JSMarshalerArgumentGlobal)))))) .WithBody(wrapperStatements); diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs index 34b9c0b..f4519ac 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.cs @@ -120,6 +120,8 @@ namespace Microsoft.Interop.JavaScript // Create stub function MethodDeclarationSyntax stubMethod = MethodDeclaration(stub.SignatureContext.StubReturnType, userDeclaredMethod.Identifier) .AddAttributeLists(stub.SignatureContext.AdditionalAttributes.ToArray()) + .WithAttributeLists(SingletonList(AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(Constants.DebuggerNonUserCodeAttribute)))))) .WithModifiers(StripTriviaFromModifiers(userDeclaredMethod.Modifiers)) .WithParameterList(ParameterList(SeparatedList(stub.SignatureContext.StubParameters))) .WithBody(stubCode);