diff --git a/src/Debugger/Debugger/BreakpointProvider.cs b/src/Debugger/Debugger/BreakpointProvider.cs index d5f869f..476b6b9 100644 --- a/src/Debugger/Debugger/BreakpointProvider.cs +++ b/src/Debugger/Debugger/BreakpointProvider.cs @@ -38,7 +38,7 @@ namespace Debugger var breakPoint = GetBreakpointAt (file, line); if (breakPoint == null) - AddBreakpoint (new Breakpoint (new Location (line, file))); + AddBreakpoint (new Breakpoint (new Location (file, line))); else RemoveBreakpoint (breakPoint); } @@ -56,7 +56,7 @@ namespace Debugger file = typeProvider.MapFile (file); if (file == null) return null; - var bp = new Breakpoint (new Location (line, file)); + var bp = new Breakpoint (new Location (file, line)); if (AddBreakpoint (bp)) return bp; return null; diff --git a/src/Debugger/Debugger/ExecutionProvider.cs b/src/Debugger/Debugger/ExecutionProvider.cs index cf044f2..308aade 100644 --- a/src/Debugger/Debugger/ExecutionProvider.cs +++ b/src/Debugger/Debugger/ExecutionProvider.cs @@ -65,7 +65,7 @@ namespace Debugger currentThread = suspendingEvent.Thread; var frames = currentThread.GetFrames(); - currentLocation = frames.Count == 0 ? new Location (0, "") : frames[0].Location; + currentLocation = frames.Count == 0 ? new Location ("", 0) : frames[0].Location; } } diff --git a/src/Debugger/Debugger/Location.cs b/src/Debugger/Debugger/Location.cs index 26c4b3a..76ef7d2 100644 --- a/src/Debugger/Debugger/Location.cs +++ b/src/Debugger/Debugger/Location.cs @@ -10,12 +10,13 @@ namespace Debugger private readonly int _line; private readonly string _file; - static Location() + static Location () { - _default = new Location(0, ""); + _default = new Location ("", 0); } - public Location(int line,string file) : base(null) + public Location (string file, int line) + : base (null) { _line = line; _file = file; diff --git a/src/Debugger/Unity/Engine/SourcesWindow.cs b/src/Debugger/Unity/Engine/SourcesWindow.cs index 4035cd1..581e8cf 100644 --- a/src/Debugger/Unity/Engine/SourcesWindow.cs +++ b/src/Debugger/Unity/Engine/SourcesWindow.cs @@ -35,7 +35,7 @@ namespace Debugger.Unity.Engine foreach (var file in sourcesProvider.Sources) { if (GUILayout.Button (Path.GetFileName (file))) - sourceNavigator.ShowSourceLocation (new Location (1, file)); + sourceNavigator.ShowSourceLocation (new Location (file, 1)); } } diff --git a/src/Tests/Debugger.DummyProviders/mirror/Breakpoint.cs b/src/Tests/Debugger.DummyProviders/mirror/Breakpoint.cs index 8d624f0..6e24af2 100644 --- a/src/Tests/Debugger.DummyProviders/mirror/Breakpoint.cs +++ b/src/Tests/Debugger.DummyProviders/mirror/Breakpoint.cs @@ -5,6 +5,11 @@ namespace Debugger.DummyProviders class Breakpoint : EventRequest, IBreakpoint { + public Breakpoint (ILocation location) + { + Location = location; + } + public override void Enable () { Enabled = true; diff --git a/src/Tests/Debugger.DummyProviders/providers/BreakpointProvider.cs b/src/Tests/Debugger.DummyProviders/providers/BreakpointProvider.cs index bc67d3c..a1ecc3f 100644 --- a/src/Tests/Debugger.DummyProviders/providers/BreakpointProvider.cs +++ b/src/Tests/Debugger.DummyProviders/providers/BreakpointProvider.cs @@ -37,7 +37,7 @@ namespace Debugger.DummyProviders var breakPoint = GetBreakpointAt (file, line); if (breakPoint == null) - AddBreakpoint (new Mock(new Mock(file, line).Object).Object); + AddBreakpoint (new Breakpoint (new Location (file, line))); else RemoveBreakpoint (breakPoint); } @@ -55,7 +55,7 @@ namespace Debugger.DummyProviders file = typeProvider.MapFile (file); if (file == null) return null; - var bp = new Breakpoint (new Location (line, file)); + var bp = new Breakpoint (new Location (file, line)); if (AddBreakpoint (bp)) return bp; return null;