Author: martin
Date: 2008-02-08 08:28:20 -0500 (Fri, 08 Feb 2008)
New Revision: 95238
Modified:
branches/martin/debugger-terrania/debugger/ChangeLog
branches/martin/debugger-terrania/debugger/backend/SingleSteppingEngine.cs
branches/martin/debugger-terrania/debugger/languages/TargetStructType.cs
branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
branches/martin/debugger-terrania/debugger/languages/mono/MonoGenericInstanceType.cs
branches/martin/debugger-terrania/debugger/languages/mono/MonoLanguageBackend.cs
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
branches/martin/debugger-terrania/debugger/test/B.cs
branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
Log:
2008-02-08 Martin Baulig <[EMAIL PROTECTED]>
* languages/TargetStructType.cs
(TargetStructType.BaseName): New public abstract property. This
is the full name (including namespace and generic arity) without
the type arguments.
* languages/mono/MonoLanguageBackend.cs
(MonoLanguageBackend.RegisterMethodLoadHandler): Use
`TargetStructType.BaseName' to insert the breakpoint.
* test/{testsuite|src}/TestAnonymous.cs: Added new tests here.
Modified: branches/martin/debugger-terrania/debugger/ChangeLog
===================================================================
--- branches/martin/debugger-terrania/debugger/ChangeLog 2008-02-08
12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/ChangeLog 2008-02-08
13:28:20 UTC (rev 95238)
@@ -1,3 +1,16 @@
+2008-02-08 Martin Baulig <[EMAIL PROTECTED]>
+
+ * languages/TargetStructType.cs
+ (TargetStructType.BaseName): New public abstract property. This
+ is the full name (including namespace and generic arity) without
+ the type arguments.
+
+ * languages/mono/MonoLanguageBackend.cs
+ (MonoLanguageBackend.RegisterMethodLoadHandler): Use
+ `TargetStructType.BaseName' to insert the breakpoint.
+
+ * test/{testsuite|src}/TestAnonymous.cs: Added new tests here.
+
2008-02-06 Martin Baulig <[EMAIL PROTECTED]>
* test/testsuite/NUnit.cs: Also scan for `// @MDB BREAKPOINT: name'
Modified:
branches/martin/debugger-terrania/debugger/backend/SingleSteppingEngine.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/backend/SingleSteppingEngine.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/backend/SingleSteppingEngine.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -2287,7 +2287,7 @@
inferior.CallMethod (
info.InsertSourceBreakpoint, image.Address,
- func.Token, index, func.DeclaringType.Name, ID);
+ func.Token, index, func.DeclaringType.BaseName,
ID);
}
protected override EventResult CallbackCompleted (long data1,
long data2)
Modified:
branches/martin/debugger-terrania/debugger/languages/TargetStructType.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/languages/TargetStructType.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/languages/TargetStructType.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -6,6 +6,10 @@
: base (language, kind)
{ }
+ public abstract string BaseName {
+ get;
+ }
+
public abstract Module Module {
get;
}
Modified:
branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -73,6 +73,10 @@
this.class_info = class_info;
}
+ public override string BaseName {
+ get { return type.FullName; }
+ }
+
TargetStructType IMonoStructType.Type {
get { return this; }
}
Modified:
branches/martin/debugger-terrania/debugger/languages/mono/MonoGenericInstanceType.cs
===================================================================
---
branches/martin/debugger-terrania/debugger/languages/mono/MonoGenericInstanceType.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++
branches/martin/debugger-terrania/debugger/languages/mono/MonoGenericInstanceType.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -22,7 +22,7 @@
this.type_args = type_args;
this.class_ptr = class_ptr;
- StringBuilder sb = new StringBuilder
(container.Type.FullName);
+ StringBuilder sb = new StringBuilder
(container.BaseName);
sb.Append ('<');
for (int i = 0; i < type_args.Length; i++) {
if (i > 0)
@@ -37,6 +37,10 @@
get { return this; }
}
+ public override string BaseName {
+ get { return Container.BaseName; }
+ }
+
public override string Name {
get { return full_name; }
}
Modified:
branches/martin/debugger-terrania/debugger/languages/mono/MonoLanguageBackend.cs
===================================================================
---
branches/martin/debugger-terrania/debugger/languages/mono/MonoLanguageBackend.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++
branches/martin/debugger-terrania/debugger/languages/mono/MonoLanguageBackend.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -962,7 +962,7 @@
TargetAddress retval = thread.CallMethod (
info.InsertSourceBreakpoint,
func.SymbolFile.MonoImage,
- func.Token, index, func.DeclaringType.Name);
+ func.Token, index, func.DeclaringType.BaseName);
MethodLoadedHandler handler = handle.MethodLoaded;
Modified:
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
===================================================================
---
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -115,6 +115,10 @@
this.fields = fields;
}
+ public override string BaseName {
+ get { return name; }
+ }
+
public override string Name {
get { return name; }
}
Modified: branches/martin/debugger-terrania/debugger/test/B.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/B.cs 2008-02-08
12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/test/B.cs 2008-02-08
13:28:20 UTC (rev 95238)
@@ -1,10 +1,14 @@
using System;
-public class Foo
+namespace Test
{
- public static void Hello<T> (T t)
+ public class Foo<T>
{
- Console.WriteLine (t);
+ public static void Hello<S> (S s, T t)
+ {
+ Console.WriteLine (s);
+ Console.WriteLine (t);
+ }
}
}
@@ -12,7 +16,6 @@
{
static void Main ()
{
- Foo.Hello (8);
- Foo.Hello ("World");
+ Test.Foo<int>.Hello ("Hello World", 8);
}
}
Modified: branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -8,9 +8,11 @@
Test1.X.Run (); // @MDB
LINE: main
Test2.X.Run ();
Test3.X.Run ();
+ Test4.X.Run ();
}
}
+// gtest-anon-8.cs
namespace Test1
{
delegate int Foo ();
@@ -40,6 +42,7 @@
}
}
+// gtest-anon-1.cs
namespace Test2
{
delegate void Foo ();
@@ -70,6 +73,7 @@
}
}
+// gtest-anon-3.cs
namespace Test3
{
delegate void Foo<S> (S s);
@@ -97,3 +101,37 @@
}
}
}
+
+// gtest-anon-15.cs
+namespace Test4
+{
+ public delegate void Foo<V> (V v);
+
+ public delegate void Bar<W> (W w);
+
+ public class Test<T>
+ {
+ public static void Hello<S> (T t, S s)
+ {
+ Foo<long> foo = delegate (long r) {
+ Console.WriteLine (r); // @MDB
LINE: test4 foo
+ Bar<T> bar = delegate (T x) {
+ Console.WriteLine (r);
+ Console.WriteLine (t);
+ Console.WriteLine (s);
+ Console.WriteLine (x);
+ };
+ bar (t);
+ };
+ foo (5); // @MDB
BREAKPOINT: test4
+ }
+ }
+
+ public class X
+ {
+ public static void Run ()
+ {
+ Test<string>.Hello ("Kahalo", Math.PI);
+ }
+ }
+}
Modified:
branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
2008-02-08 12:36:15 UTC (rev 95237)
+++ branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
2008-02-08 13:28:20 UTC (rev 95238)
@@ -44,7 +44,7 @@
AssertExecute ("step");
// FIXME: Print a better method name
- AssertStopped (thread,
"Test1.X/<>c__CompilerGenerated4`1<R>.<Test1>c__5()",
+ AssertStopped (thread,
"Test1.X/<>c__CompilerGenerated5`1<R>.<Test1>c__6()",
GetLine ("test1 foo"));
AssertPrint (thread, "a", "(int) 2");
@@ -91,7 +91,7 @@
AssertExecute ("step");
AssertStopped (thread,
-
"Test2.X/<>c__CompilerGenerated1`1<T>.<Test>c__6()",
+
"Test2.X/<>c__CompilerGenerated1`1<T>.<Test>c__7()",
GetLine ("test2 foo"));
// FIXME
@@ -130,7 +130,7 @@
AssertExecute ("step");
AssertStopped (thread,
-
"Test3.X/<>c__CompilerGenerated2`1<T>.<Test>c__7(S)",
+
"Test3.X/<>c__CompilerGenerated2`1<T>.<Test>c__8(S)",
GetLine ("test3 foo"));
// FIXME
@@ -146,6 +146,27 @@
AssertExecute ("continue");
+ //
+ // Test4
+ //
+
+ AssertHitBreakpoint (thread, "test4",
"Test4.Test`1<T>.Hello(T,S)");
+ AssertPrint (thread, "t", "(string) \"Kahalo\"");
+ AssertType (thread, "t", "string");
+ AssertPrint (thread, "s", String.Format ("(double)
{0}", System.Math.PI));
+ AssertType (thread, "s", "double");
+
+ AssertExecute ("continue");
+ AssertTargetOutput ("5");
+ AssertTargetOutput ("5");
+ AssertTargetOutput ("Kahalo");
+ AssertTargetOutput (System.Math.PI.ToString ());
+ AssertTargetOutput ("Kahalo");
+
+ //
+ // Done
+ //
+
AssertTargetExited (thread.Process);
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches