-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/7.0-preview2][mono][hot reload] Fix sequence point logic for…
… compiler-generated methods in updates (#65867) * [tests] Pass PDB delta to ApplyUpdate * extra tracing output * Return 0 if a method has no sequence points -1 means there was some kind of problem 0 means 0 sequence points In particular for mono_ppdb_get_seq_points_enc a compiler-generated method might have 0 sequence points in the PDB delta, but we should consider that as ok, and not fall back to looking in the baseline image * pass MONO_DEBUG=getn-seq-points to hot reload tests For platforms where we use the remote executor, set the environment variable when starting the remote process. For WASM, pass --setenv when building the project. * fix whitespace * [debug] Handle gen-seq-points, and hot reload updates without PDBs When hot reload is used with dotnet watch, the baseline PDBs are available, and sequence points are enabled, but there are no PDB updates. * [hot_reload] Fix off by one error when counting added and modified rows * [hot_reload] Allow custom attribute deletions, even without ChangeCustomAttributes capability Roslyn seems to delete nullability annotations sometimes * Add regression test for adding static lambdas * param attributes for hot reload * don't run test where it isn't supported
- Loading branch information
1 parent
190a47e
commit e24f66d
Showing
12 changed files
with
201 additions
and
8 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...tem.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test; | ||
|
||
public class StaticLambdaRegression | ||
{ | ||
public int count; | ||
|
||
public string TestMethod() | ||
{ | ||
count++; | ||
#if false | ||
Message (static () => "hello"); | ||
#endif | ||
return count.ToString(); | ||
} | ||
|
||
#if false | ||
public void Message (Func<string> msg) => Console.WriteLine (msg()); | ||
#endif | ||
} |
24 changes: 24 additions & 0 deletions
24
....Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test; | ||
|
||
public class StaticLambdaRegression | ||
{ | ||
public int count; | ||
|
||
public string TestMethod() | ||
{ | ||
count++; | ||
#if true | ||
Message (static () => "hello2"); | ||
#endif | ||
return count.ToString(); | ||
} | ||
|
||
#if true | ||
public void Message (Func<string> msg) => Console.WriteLine (msg()); | ||
#endif | ||
} |
25 changes: 25 additions & 0 deletions
25
....Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/StaticLambdaRegression_v2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test; | ||
|
||
public class StaticLambdaRegression | ||
{ | ||
public int count; | ||
|
||
public string TestMethod() | ||
{ | ||
count++; | ||
#if true | ||
Message (static () => "hello2"); | ||
#endif | ||
Message (static () => "goodbye"); | ||
return count.ToString(); | ||
} | ||
|
||
#if true | ||
public void Message (Func<string> msg) => Console.WriteLine (msg()); | ||
#endif | ||
} |
11 changes: 11 additions & 0 deletions
11
...ambdaRegression/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<RootNamespace>System.Runtime.Loader.Tests</RootNamespace> | ||
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks> | ||
<TestRuntime>true</TestRuntime> | ||
<DeltaScript>deltascript.json</DeltaScript> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="StaticLambdaRegression.cs" /> | ||
</ItemGroup> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
...pdate/System.Reflection.Metadata.ApplyUpdate.Test.StaticLambdaRegression/deltascript.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"changes": [ | ||
{"document": "StaticLambdaRegression.cs", "update": "StaticLambdaRegression_v1.cs"}, | ||
{"document": "StaticLambdaRegression.cs", "update": "StaticLambdaRegression_v2.cs"}, | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters