[Monodevelop-patches-list] r1992 - in trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn: . Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Oct 22 02:38:55 EDT 2004
Author: toshok
Date: 2004-10-22 02:38:55 -0400 (Fri, 22 Oct 2004)
New Revision: 1992
Added:
trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Gui/DebuggerStackTracePad.cs
Modified:
trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Makefile.am
trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/MonoDevelopDebugger.addin.xml
Log:
2004-10-22 Chris Toshok <toshok at ximian.com>
* MonoDevelopDebugger.addin.xml: add DebuggerStackTracePad to
* the
views.
* Gui/DebuggerStackTracePad.cs: new file.
* Makefile.am (FILES): add DebuggerStackTracePad.cs
Modified: trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/ChangeLog 2004-10-22 05:27:40 UTC (rev 1991)
+++ trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/ChangeLog 2004-10-22 06:38:55 UTC (rev 1992)
@@ -1,3 +1,12 @@
+2004-10-22 Chris Toshok <toshok at ximian.com>
+
+ * MonoDevelopDebugger.addin.xml: add DebuggerStackTracePad to the
+ views.
+
+ * Gui/DebuggerStackTracePad.cs: new file.
+
+ * Makefile.am (FILES): add DebuggerStackTracePad.cs
+
2004-10-21 Chris Toshok <toshok at ximian.com>
* DebuggingService.cs: return String.Empty from CurrentFilename if
Added: trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Gui/DebuggerStackTracePad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Gui/DebuggerStackTracePad.cs 2004-10-22 05:27:40 UTC (rev 1991)
+++ trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Gui/DebuggerStackTracePad.cs 2004-10-22 06:38:55 UTC (rev 1992)
@@ -0,0 +1,144 @@
+using GLib;
+using Gtk;
+using GtkSharp;
+using System;
+using System.IO;
+using System.Collections;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using Mono.Debugger;
+using Mono.Debugger.Languages;
+
+using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.SourceEditor.Gui
+{
+ public class DebuggerStackTracePad : Gtk.ScrolledWindow, IPadContent
+ {
+ StackFrame current_frame;
+
+ Gtk.TreeView tree;
+ Gtk.TreeStore store;
+
+ public DebuggerStackTracePad ()
+ {
+ this.ShadowType = ShadowType.In;
+
+ store = new TreeStore (typeof (string));
+
+ tree = new TreeView (store);
+ tree.RulesHint = true;
+ tree.HeadersVisible = true;
+
+ TreeViewColumn FrameCol = new TreeViewColumn ();
+ CellRenderer FrameRenderer = new CellRendererText ();
+ FrameCol.Title = "Frame";
+ FrameCol.PackStart (FrameRenderer, true);
+ FrameCol.AddAttribute (FrameRenderer, "text", 0);
+ FrameCol.Resizable = true;
+ FrameCol.Alignment = 0.0f;
+ tree.AppendColumn (FrameCol);
+
+ Add (tree);
+ ShowAll ();
+
+ DebuggingService dbgr = (DebuggingService)ServiceManager.GetService (typeof (DebuggingService));
+ dbgr.PausedEvent += new EventHandler (OnPausedEvent);
+ dbgr.ResumedEvent += new EventHandler (OnResumedEvent);
+ dbgr.StoppedEvent += new EventHandler (OnStoppedEvent);
+ }
+
+ void add_frame (string frame)
+ {
+ TreeIter iter;
+ store.Append (out iter);
+ store.SetValue (iter, 0, new GLib.Value (frame));
+ }
+
+ Hashtable iters = null;
+
+ public void CleanDisplay ()
+ {
+ store.Clear ();
+ iters = new Hashtable ();
+ }
+
+ public void UpdateDisplay ()
+ {
+ CleanDisplay ();
+
+ if ((current_frame == null) || (current_frame.Method == null))
+ return;
+
+ DebuggingService dbgr = (DebuggingService)ServiceManager.GetService (typeof (DebuggingService));
+ string[] trace = dbgr.Backtrace;
+
+ foreach (string frame in trace)
+ add_frame (frame);
+ }
+
+ protected void OnStoppedEvent (object o, EventArgs args)
+ {
+ CleanDisplay ();
+ }
+
+ protected void OnResumedEvent (object o, EventArgs args)
+ {
+ CleanDisplay ();
+ }
+
+ protected void OnPausedEvent (object o, EventArgs args)
+ {
+ DebuggingService dbgr = (DebuggingService)ServiceManager.GetService (typeof (DebuggingService));
+ current_frame = (StackFrame)dbgr.CurrentFrame;
+ UpdateDisplay ();
+ }
+
+
+
+ public Gtk.Widget Control {
+ get {
+ return this;
+ }
+ }
+
+ public string Title {
+ get {
+ return "Call Stack";
+ }
+ }
+
+ public string Icon {
+ get {
+ return MonoDevelop.Gui.Stock.OutputIcon;
+ }
+ }
+
+ public void RedrawContent ()
+ {
+ UpdateDisplay ();
+ }
+
+ public void BringToFront ()
+ {
+ }
+
+ protected virtual void OnTitleChanged(EventArgs e)
+ {
+ if (TitleChanged != null) {
+ TitleChanged(this, e);
+ }
+ }
+ protected virtual void OnIconChanged(EventArgs e)
+ {
+ if (IconChanged != null) {
+ IconChanged(this, e);
+ }
+ }
+ public event EventHandler TitleChanged;
+ public event EventHandler IconChanged;
+
+ }
+}
Modified: trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Makefile.am 2004-10-22 05:27:40 UTC (rev 1991)
+++ trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/Makefile.am 2004-10-22 06:38:55 UTC (rev 1992)
@@ -11,8 +11,10 @@
DebuggerCommands.cs \
DebuggingService.cs \
Gui/DebuggerLocalsPad.cs \
-Gui/DebuggerVariablePad.cs
+Gui/DebuggerVariablePad.cs \
+Gui/DebuggerStackTracePad.cs
+
EXTRA_DIST = $(FILES) $(ADDIN)
if ENABLE_DEBUGGER
Modified: trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/MonoDevelopDebugger.addin.xml
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/MonoDevelopDebugger.addin.xml 2004-10-22 05:27:40 UTC (rev 1991)
+++ trunk/MonoDevelop/Core/src/AddIns/DebuggerAddIn/MonoDevelopDebugger.addin.xml 2004-10-22 06:38:55 UTC (rev 1992)
@@ -17,6 +17,8 @@
<Extension path="/SharpDevelop/Workbench/Views">
<Class id = "DebuggerLocalsPad"
class = "MonoDevelop.SourceEditor.Gui.DebuggerLocalsPad"/>
+ <Class id = "DebuggerStackTracePad"
+ class = "MonoDevelop.SourceEditor.Gui.DebuggerStackTracePad"/>
</Extension>
<Extension path="/SharpDevelop/Workbench/MainMenu/Run">
More information about the Monodevelop-patches-list
mailing list