diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index c8145d0c77..408fa69e4a 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -5950,7 +5950,13 @@ Shows the full callstack of the error. Object Graph - Parallel Stack + Parallel Stacks + + + Toggle Method View + + + Show/Hide Zoom Control Run to cursor diff --git a/data/resources/image/BitmapResources/BitmapResources-data/Icons.48x48.CurrentFrame.png b/data/resources/image/BitmapResources/BitmapResources-data/Icons.48x48.CurrentFrame.png new file mode 100644 index 0000000000..db6c9772b9 Binary files /dev/null and b/data/resources/image/BitmapResources/BitmapResources-data/Icons.48x48.CurrentFrame.png differ diff --git a/data/resources/image/BitmapResources/BitmapResources.res b/data/resources/image/BitmapResources/BitmapResources.res index 6b1df909cd..1cb487ede6 100644 --- a/data/resources/image/BitmapResources/BitmapResources.res +++ b/data/resources/image/BitmapResources/BitmapResources.res @@ -37,6 +37,10 @@ ProjectBrowser.WebReferenceFolder.Closed = ProjectBrowserIcons\WebReferenceFolde ProjectBrowser.WebReferenceFolder.Open = ProjectBrowserIcons\WebReferenceFolder.Open.png ProjectBrowser.WebReference = ProjectBrowserIcons\WebReference.png +#Parallel Stacks pad +ParallelStacks.MethodView = PadIcons\MethodView.png +ParallelStacks.ZoomControl = PadIcons\ZoomControl.png + #Output pad OutputPad.Toolbar.ClearOutputWindow = OutputPadIcons\ClearOutputWindow.png @@ -226,6 +230,7 @@ Icons.16x16.OpenFileIcon = BitmapResources-data\Icons.1 Icons.16x16.HtmlElements.FieldSetElement = BitmapResources-data\Icons.16x16.HtmlElements.FieldSetElement.png Icons.16x16.SplitWindow = BitmapResources-data\Icons.16x16.SplitWindow.png Icons.16x16.DeleteHistory = BitmapResources-data\Icons.16x16.DeleteHistory.png +Icons.48x48.CurrentFrame = BitmapResources-data\Icons.48x48.CurrentFrame.png Icons.16x16.Refresh = BitmapResources-data\Icons.16x16.Refresh.png Icons.Magnifier = BitmapResources-data\magnifier.png @@ -249,6 +254,7 @@ PadIcons.LocalVariables = PadIcons\LocalVariables.png PadIcons.Threads = PadIcons\Threads.png PadIcons.Exceptions = PadIcons\Exceptions.png PadIcons.XPathQuery = PadIcons\XPathQuery.png +PadIcons.Parallel = PadIcons\Parallel.png #SharpQuery icons Icons.16x16.SharpQuery.DataBaseRoot = SharpQueryIcons\Icons.16x16.SharpQuery.Database.png diff --git a/data/resources/image/BitmapResources/PadIcons/MethodView.png b/data/resources/image/BitmapResources/PadIcons/MethodView.png new file mode 100644 index 0000000000..a830304afa Binary files /dev/null and b/data/resources/image/BitmapResources/PadIcons/MethodView.png differ diff --git a/data/resources/image/BitmapResources/PadIcons/Parallel.png b/data/resources/image/BitmapResources/PadIcons/Parallel.png new file mode 100644 index 0000000000..eeac4da65a Binary files /dev/null and b/data/resources/image/BitmapResources/PadIcons/Parallel.png differ diff --git a/data/resources/image/BitmapResources/PadIcons/ZoomControl.png b/data/resources/image/BitmapResources/PadIcons/ZoomControl.png new file mode 100644 index 0000000000..5d73c69855 Binary files /dev/null and b/data/resources/image/BitmapResources/PadIcons/ZoomControl.png differ diff --git a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin index 89209b2151..210f63b594 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin +++ b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin @@ -130,6 +130,13 @@ icon = "PadIcons.LocalVariables" class = "ICSharpCode.SharpDevelop.Gui.Pads.ObjectGraphPad" defaultPosition = "Bottom, Hidden" /> + + @@ -166,6 +173,24 @@ type="ComboBox" id="SelectLanguageCommand" /> + + + + + + /> + + diff --git a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj index a84df33228..67d344518c 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj +++ b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj @@ -58,6 +58,15 @@ ..\..\..\..\bin\SharpDevelop.exe + + ..\..\..\Libraries\GraphSharp\GraphSharp.dll + + + ..\..\..\Libraries\GraphSharp\GraphSharp.Controls.dll + + + ..\..\..\Libraries\GraphSharp\Microsoft.Contracts.dll + 3.0 @@ -68,6 +77,9 @@ 3.0 + + ..\..\..\Libraries\GraphSharp\QuickGraph.dll + 3.5 @@ -89,6 +101,9 @@ CallStackPad.xaml Code + + + ConditionCell.xaml @@ -101,6 +116,17 @@ WatchList.xaml + + DrawSurface.xaml + Code + + + + + + ThreadStack.xaml + Code + WatchInputBox.xaml Code @@ -125,8 +151,6 @@ DebuggingSymbolsPanel.cs - - UserControl @@ -367,6 +391,8 @@ + + @@ -394,7 +420,9 @@ ICSharpCode.Core.WinForms False + + diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs index 6da43185b1..39e0e41589 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs @@ -216,7 +216,6 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads bool showModuleNames = DebuggingOptions.Instance.ShowModuleNames; StringBuilder name = new StringBuilder(); - name.Append(frame.MethodInfo.DeclaringType.FullName); name.Append('.'); name.Append(frame.MethodInfo.Name); diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/ParallelStacksViewCommands.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/ParallelStacksViewCommands.cs new file mode 100644 index 0000000000..84192784bf --- /dev/null +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/ParallelStacksViewCommands.cs @@ -0,0 +1,92 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Windows.Controls; +using ICSharpCode.Core; + +namespace ICSharpCode.SharpDevelop.Gui.Pads +{ + public sealed class ShowZoomControlCommand : AbstractCheckableMenuCommand + { + ParallelStackPad pad; + + public override object Owner { + get { return base.Owner; } + set { + if (!(value is ParallelStackPad)) + throw new Exception("Owner has to be a ParallelStackPad"); + pad = value as ParallelStackPad; + base.Owner = value; + } + } + + public override bool IsChecked { + get { return pad.IsZoomControlVisible; } + set { pad.IsZoomControlVisible = value; } + } + + public override void Run() + { + IsChecked = !IsChecked; + } + } + + public sealed class ToggleMethodViewCommand : AbstractCheckableMenuCommand + { + ParallelStackPad pad; + + public override object Owner { + get { return base.Owner; } + set { + if (!(value is ParallelStackPad)) + throw new Exception("Owner has to be a AbstractConsolePad"); + pad = value as ParallelStackPad; + base.Owner = value; + } + } + + public override bool IsChecked { + get { return pad.IsMethodView; } + set { pad.IsMethodView = value; } + } + + public override void Run() + { + IsChecked = !IsChecked; + } + } + + public sealed class ParallelStacksViewCommand : AbstractComboBoxCommand + { + ParallelStackPad pad; + ComboBox box; + + protected override void OnOwnerChanged(EventArgs e) + { + this.pad = this.Owner as ParallelStackPad; + if (this.pad == null) + return; + + box = this.ComboBox as ComboBox; + + if (this.box == null) + return; + + foreach (var name in Enum.GetNames(typeof(ParallelStacksView))) + box.Items.Add(name); + + box.SelectedIndex = 0; + + base.OnOwnerChanged(e); + } + + public override void Run() + { + if (this.pad != null && this.box != null) { + pad.ParallelStacksView = (ParallelStacksView)Enum.Parse(typeof(ParallelStacksView), box.SelectedValue.ToString()); + } + base.Run(); + } + } +} \ No newline at end of file diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/SelectLanguageCommand.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/SelectLanguageCommand.cs similarity index 96% rename from src/AddIns/Debugger/Debugger.AddIn/Pads/SelectLanguageCommand.cs rename to src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/SelectLanguageCommand.cs index 8cddba8ae9..b117571b31 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/SelectLanguageCommand.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/SelectLanguageCommand.cs @@ -1,47 +1,47 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) - -using System; -using Debugger; -using Debugger.AddIn; -using ICSharpCode.Core; -using ICSharpCode.NRefactory; -using ICSharpCode.SharpDevelop.Debugging; -using ICSharpCode.SharpDevelop.Services; -using System.Windows.Controls; - -namespace ICSharpCode.SharpDevelop.Gui.Pads -{ - class SelectLanguageCommand : AbstractComboBoxCommand - { - ConsolePad pad; - ComboBox box; - - protected override void OnOwnerChanged(EventArgs e) - { - this.pad = this.Owner as ConsolePad; - if (this.pad == null) - return; - - box = this.ComboBox as ComboBox; - - if (this.box == null) - return; - - foreach (var name in Enum.GetNames(typeof(SupportedLanguage))) - box.Items.Add(name); - - box.SelectedIndex = 0; - - base.OnOwnerChanged(e); - } - - public override void Run() - { - if (this.pad != null && this.box != null) { - pad.SelectedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), box.SelectedValue.ToString()); - } - base.Run(); - } - } -} +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) + +using System; +using Debugger; +using Debugger.AddIn; +using ICSharpCode.Core; +using ICSharpCode.NRefactory; +using ICSharpCode.SharpDevelop.Debugging; +using ICSharpCode.SharpDevelop.Services; +using System.Windows.Controls; + +namespace ICSharpCode.SharpDevelop.Gui.Pads +{ + class SelectLanguageCommand : AbstractComboBoxCommand + { + ConsolePad pad; + ComboBox box; + + protected override void OnOwnerChanged(EventArgs e) + { + this.pad = this.Owner as ConsolePad; + if (this.pad == null) + return; + + box = this.ComboBox as ComboBox; + + if (this.box == null) + return; + + foreach (var name in Enum.GetNames(typeof(SupportedLanguage))) + box.Items.Add(name); + + box.SelectedIndex = 0; + + base.OnOwnerChanged(e); + } + + public override void Run() + { + if (this.pad != null && this.box != null) { + pad.SelectedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), box.SelectedValue.ToString()); + } + base.Run(); + } + } +} diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPadCommands.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs similarity index 100% rename from src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPadCommands.cs rename to src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerPad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerPad.cs index 54afe42de7..1076c8e141 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerPad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/DebuggerPad.cs @@ -1,41 +1,66 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) - -using Debugger; -using ICSharpCode.SharpDevelop.Debugging; -using ICSharpCode.SharpDevelop.Services; - -namespace ICSharpCode.SharpDevelop.Gui.Pads -{ - public abstract class DebuggerPad: AbstractPadContent - { - protected WindowsDebugger debugger; - - public DebuggerPad() - { - debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; - - InitializeComponents(); - - debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { - SelectProcess(e.Process); - }; - SelectProcess(debugger.DebuggedProcess); - } - - protected virtual void InitializeComponents() - { - - } - - protected virtual void SelectProcess(Process process) - { - - } - - public virtual void RefreshPad() - { - - } - } -} +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) + +using System.Windows.Controls; +using Debugger; +using ICSharpCode.SharpDevelop.Debugging; +using ICSharpCode.SharpDevelop.Services; + +namespace ICSharpCode.SharpDevelop.Gui.Pads +{ + public abstract class DebuggerPad : AbstractPadContent + { + protected DockPanel panel; + ToolBar toolbar; + protected WindowsDebugger debugger; + + public override object Control { + get { + return panel; + } + } + + public DebuggerPad() + { + // UI + this.panel = new DockPanel(); + this.toolbar = BuildToolBar(); + + if (this.toolbar != null) { + this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); + + this.panel.Children.Add(toolbar); + } + + // logic + debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; + + InitializeComponents(); + + debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { + SelectProcess(e.Process); + }; + SelectProcess(debugger.DebuggedProcess); + } + + protected virtual void InitializeComponents() + { + + } + + protected virtual void SelectProcess(Process process) + { + + } + + public virtual void RefreshPad() + { + + } + + protected virtual ToolBar BuildToolBar() + { + return null; + } + } +} diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/LoadedModulesPad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/LoadedModulesPad.cs index 0ccfc5c182..b93cf95ed0 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/LoadedModulesPad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/LoadedModulesPad.cs @@ -17,15 +17,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads SimpleListViewControl loadedModulesList; Process debuggedProcess; - public override object Control { - get { - return loadedModulesList; - } - } - protected override void InitializeComponents() { loadedModulesList = new SimpleListViewControl(); + panel.Children.Add(loadedModulesList); RedrawContent(); ResourceService.LanguageChanged += delegate { RedrawContent(); }; } diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs index c2669f3ce7..61a6c0b550 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs @@ -27,15 +27,6 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads get { return instance; } } - /// - /// This is not used anywhere, but it is neccessary to be overridden in children of AbstractPadContent. - /// - public override object Control { - get { - return localVarList; - } - } - public Process Process { get { return debuggedProcess; } } @@ -43,6 +34,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads protected override void InitializeComponents() { localVarList = new WatchList(); + panel.Children.Add(localVarList); } protected override void SelectProcess(Process process) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/ObjectGraphPad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/ObjectGraphPad.cs index 5a11ca25e7..06384cdebb 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/ObjectGraphPad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/ObjectGraphPad.cs @@ -1,76 +1,72 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) - -using ICSharpCode.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using Debugger; -using Debugger.AddIn.Visualizers.Graph; - -namespace ICSharpCode.SharpDevelop.Gui.Pads -{ - /// - /// Description of ObjectGraphPad. - /// - public class ObjectGraphPad : DebuggerPad - { - Process debuggedProcess; - ObjectGraphControl objectGraphControl; - static ObjectGraphPad instance; - - public ObjectGraphPad() - { - instance = this; - } - - /// Always check if Instance is null, might be null if pad is not opened! - public static ObjectGraphPad Instance { - get { return instance; } - } - - protected override void InitializeComponents() - { - objectGraphControl = new ObjectGraphControl(); - } - - public override object Control { - get { - return objectGraphControl; - } - } - - public override void RefreshPad() - { - // BUG: if pad window is undocked and floats standalone, IsVisible == false (so pad won't refresh) - // REQUEST: need to refresh when pad becomes visible -> VisibleChanged event? - if (!objectGraphControl.IsVisible) - { - return; - } - if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { - this.objectGraphControl.Clear(); - return; - } - this.objectGraphControl.Refresh(); - } - - protected override void SelectProcess(Process process) - { - if (debuggedProcess != null) { - debuggedProcess.Paused -= debuggedProcess_Paused; - } - debuggedProcess = process; - if (debuggedProcess != null) { - debuggedProcess.Paused += debuggedProcess_Paused; - } - RefreshPad(); - } - - void debuggedProcess_Paused(object sender, ProcessEventArgs e) - { - RefreshPad(); - } - } -} +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) + +using ICSharpCode.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using Debugger; +using Debugger.AddIn.Visualizers.Graph; + +namespace ICSharpCode.SharpDevelop.Gui.Pads +{ + /// + /// Description of ObjectGraphPad. + /// + public class ObjectGraphPad : DebuggerPad + { + Process debuggedProcess; + ObjectGraphControl objectGraphControl; + static ObjectGraphPad instance; + + public ObjectGraphPad() + { + instance = this; + } + + /// Always check if Instance is null, might be null if pad is not opened! + public static ObjectGraphPad Instance { + get { return instance; } + } + + protected override void InitializeComponents() + { + objectGraphControl = new ObjectGraphControl(); + panel.Children.Add(objectGraphControl); + } + + + public override void RefreshPad() + { + // BUG: if pad window is undocked and floats standalone, IsVisible == false (so pad won't refresh) + // REQUEST: need to refresh when pad becomes visible -> VisibleChanged event? + if (!objectGraphControl.IsVisible) + { + return; + } + if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { + this.objectGraphControl.Clear(); + return; + } + this.objectGraphControl.Refresh(); + } + + protected override void SelectProcess(Process process) + { + if (debuggedProcess != null) { + debuggedProcess.Paused -= debuggedProcess_Paused; + } + debuggedProcess = process; + if (debuggedProcess != null) { + debuggedProcess.Paused += debuggedProcess_Paused; + } + RefreshPad(); + } + + void debuggedProcess_Paused(object sender, ProcessEventArgs e) + { + RefreshPad(); + } + } +} diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/ParallelPad/DrawSurface.xaml b/src/AddIns/Debugger/Debugger.AddIn/Pads/ParallelPad/DrawSurface.xaml new file mode 100644 index 0000000000..9d574e64d0 --- /dev/null +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/ParallelPad/DrawSurface.xaml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100% + + + +