From 0034b230e838db24bb41bb6e19814f65bc88faff Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 3 Oct 2016 16:09:59 +0200 Subject: [Mono.Debugger.Soft] Tweak ClassLocalReflection test --- mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs | 36 ++++++++++++++------------ mcs/class/Mono.Debugger.Soft/Test/dtest.cs | 12 +++++++-- 2 files changed, 29 insertions(+), 19 deletions(-) (limited to 'mcs/class/Mono.Debugger.Soft') diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs index cc2ab66960f..42a02d6f16f 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -1620,6 +1620,25 @@ public class Foo public ProcessStartInfo info; } +class LocalReflectClass +{ + public static void RunMe () + { + var reflectMe = new someClass (); + var temp = reflectMe; // Breakpoint location + reflectMe.someMethod (); + } + + class someClass : ContextBoundObject + { + public object someField; + + public void someMethod () + { + } + } +} + // Class used for line number info testing, don't change its layout public class LineNumbers { @@ -1643,22 +1662,5 @@ public class LineNumbers } } -class LocalReflectClass -{ - public static void RunMe () - { - var reflectMe = new someClass (); - reflectMe.someMethod (); - } - - class someClass : ContextBoundObject - { - public object someField; - - public void someMethod () - { - } - } -} diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 505ab2abdbe..0eea592e2cf 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -558,7 +558,11 @@ public class DebuggerTests MethodMirror m = entry_point.DeclaringType.Assembly.GetType ("LocalReflectClass").GetMethod ("RunMe"); Assert.IsNotNull (m); - //Console.WriteLine ("X: " + name + " " + m.ILOffsets.Count + " " + m.Locations.Count); + +// foreach (var x in m.Locations) { +// Console.WriteLine (x); +// } + var offset = -1; int method_base_linum = m.Locations [0].LineNumber; foreach (var location in m.Locations) @@ -586,7 +590,11 @@ public class DebuggerTests e = single_step (e.Thread); var frame = e.Thread.GetFrames ()[0]; - Value variable = frame.GetValue (frame.Method.GetLocal ("reflectMe")); + + Assert.IsNotNull (frame); + var field = frame.Method.GetLocal ("reflectMe"); + Assert.IsNotNull (field); + Value variable = frame.GetValue (field); ObjectMirror thisObj = (ObjectMirror)variable; TypeMirror thisType = thisObj.Type; -- cgit v1.2.3