Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
2003-02-27 Martin Baulig <martin@ximian.com>
Browse files Browse the repository at this point in the history
	* frontends/gui/SourceManager.cs (GetSourceView): Use the
	SourceFile / ISourceBuffer as hash key, not the IMethodSource.

svn path=/trunk/debugger/; revision=12030
  • Loading branch information
Martin Baulig committed Feb 27, 2003
1 parent ed8ebd2 commit 487b506
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2003-02-27 Martin Baulig <martin@ximian.com>

* frontends/gui/SourceManager.cs (GetSourceView): Use the
SourceFile / ISourceBuffer as hash key, not the IMethodSource.

2003-02-27 Martin Baulig <martin@ximian.com>

* backends/server/server.h (CommandError): Cleaned this up.
Expand Down
13 changes: 11 additions & 2 deletions frontends/gui/SourceManager.cs
Expand Up @@ -201,12 +201,21 @@ string[] GetSource (IMethodSource source)
return buffer.Contents;
}

object GetSourceKey (IMethodSource source)
{
if (source.IsDynamic)
return source.SourceBuffer;
else
return source.SourceFile;
}

SourceView GetSourceView (IMethod method, IMethodSource source)
{
if (source == null)
return disassembler_view;

SourceList view = (SourceList) sources [source];
object source_key = GetSourceKey (source);
SourceList view = (SourceList) sources [source_key];
if (view != null)
return view;

Expand All @@ -217,7 +226,7 @@ SourceView GetSourceView (IMethod method, IMethodSource source)
view = CreateSourceView (source.Name, String.Join ("\n", contents));
view.Widget.ShowAll ();

sources [source] = view;
sources [source_key] = view;
notebook.InsertPage (view.Widget, view.TabWidget, -1);
notebook.SetMenuLabelText (view.Widget, source.Name);
view.TabWidget.ButtonClicked += new EventHandler (close_tab);
Expand Down

0 comments on commit 487b506

Please sign in to comment.