Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThays Grazia <thaystg@gmail.com>2019-11-13 18:29:33 +0300
committerGitHub <noreply@github.com>2019-11-13 18:29:33 +0300
commitdd18ec40dd60e9cde7732436f843942cb51605af (patch)
tree05a8dedaa95b57a21adddc51449b8e7a969c637e /mcs/class/Mono.Debugger.Soft
parentfe0f824db5fa1f3021aad6dc4a6eb428133d8a4e (diff)
[debugger] Assert when async debug a generic method (#17727)
* When we try to call a method to get the async_id to do an async debug and we are trying to do this in a generic method like this: async Task<T> ExecuteAsync_Broken<T>() { await Task.Delay(2); return default; } We need to inflate the generic type before call the method or we will get the error: Could not execute the method because the containing type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[T_REF]’, is not fully instantiated. Fixes #17549 Fixes #17569
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs12
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest.cs10
2 files changed, 22 insertions, 0 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
index ae307971acc..be5e6c7f3c9 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
@@ -604,6 +604,7 @@ public class Tests : TestsBase, ITest2
if_property_stepping();
fixed_size_array();
test_new_exception_filter();
+ test_async_debug_generics();
return 3;
}
@@ -904,6 +905,17 @@ public class Tests : TestsBase, ITest2
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void test_async_debug_generics () {
+ ExecuteAsync_Broken<object>().Wait ();
+ }
+
+ async static Task<T> ExecuteAsync_Broken<T>()
+ {
+ await Task.Delay(2);
+ return default;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void inspect_enumerator_in_generic_struct() {
TestEnumeratorInsideGenericStruct<String, String> generic_struct = new TestEnumeratorInsideGenericStruct<String, String>(new KeyValuePair<string, string>("0", "f1"));
}
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
index c3893706fc5..52da50a45db 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
@@ -5152,6 +5152,16 @@ public class DebuggerTests
vm = null;
}
+ [Test]
+ public void TestAsyncDebugGenerics () {
+ Event e = run_until ("test_async_debug_generics");
+ e = step_in_await ("test_async_debug_generics", e);
+ e = step_in_await ("MoveNext", e);
+ e = step_in_await ("MoveNext", e);
+ e = step_in_await ("MoveNext", e);
+ e = step_in_await ("MoveNext", e);
+ }
+
#endif
} // class DebuggerTests
} // namespace