Browse Source

Add "Set current statement" command to text editor context menu.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@723 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
70810828fd
  1. 10
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
  2. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
  3. 31
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/SetCurrentStatementCommand.cs
  4. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  5. 21
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

10
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin

@ -10,6 +10,16 @@ @@ -10,6 +10,16 @@
class="ICSharpCode.SharpDevelop.Services.WindowsDebugger"/>
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">
<Condition name = "IsProcessRunning" isdebugging="True" isprocessrunning="False">
<MenuItem id = "DebuggerSetCurrentStatement"
insertbefore = "Refactoring"
label = "Set current statement"
icon = "Icons.16x16.Debug.StepInto"
class = "ICSharpCode.SharpDevelop.Services.SetCurrentStatementCommand"/>
</Condition>
</Path>
<!--<Path name = "/SharpDevelop/Workbench/MainMenu/Debug">
<MenuItem id = "CatchHandledExceptionsSeparator"
type = "Separator"

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj

@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
<Compile Include="Src\Pads\VariableListItems\VariableItem.cs" />
<Compile Include="Src\Pads\VariableListItems\VariableListItem.cs" />
<Compile Include="Src\Service\DynamicTreeDebuggerRow.cs" />
<Compile Include="Src\Service\SetCurrentStatementCommand.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">

31
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/SetCurrentStatementCommand.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 11.11.2005
* Time: 23:48
*/
using System;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.TextEditor;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
namespace ICSharpCode.SharpDevelop.Services
{
public class SetCurrentStatementCommand : AbstractMenuCommand
{
public override void Run()
{
SharpDevelopTextAreaControl textEditor = this.Owner as SharpDevelopTextAreaControl;
if (textEditor == null) return;
WindowsDebugger debugger = (WindowsDebugger)DebuggerService.CurrentDebugger;
string fileName = textEditor.FileName;
int line = textEditor.ActiveTextAreaControl.Caret.Line + 1;
int column = textEditor.ActiveTextAreaControl.Caret.Column;
debugger.DebuggerCore.CurrentThread.CurrentFunction.SetIP(fileName, line, column);
}
}
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -298,10 +298,6 @@ namespace ICSharpCode.SharpDevelop.Services @@ -298,10 +298,6 @@ namespace ICSharpCode.SharpDevelop.Services
RemoveBreakpoint(e.BreakpointBookmark);
AddBreakpoint(e.BreakpointBookmark);
};
DebuggerService.SetIPRequest += delegate (object sender, DebuggerService.SetIPArgs args) {
SourcecodeSegment seg = debugger.CurrentThread.CurrentFunction.SetIP(args.filename, args.line + 1, args.column);
};
RestoreNDebuggerBreakpoints();

21
src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

@ -281,15 +281,6 @@ namespace ICSharpCode.Core @@ -281,15 +281,6 @@ namespace ICSharpCode.Core
static DebuggerGridControl oldToolTipControl;
static int oldLine;
public class SetIPArgs: EventArgs
{
public string filename;
public int line;
public int column;
}
public static event EventHandler<SetIPArgs> SetIPRequest;
/// <summary>
/// This function shows variable values as tooltips
/// </summary>
@ -312,18 +303,6 @@ namespace ICSharpCode.Core @@ -312,18 +303,6 @@ namespace ICSharpCode.Core
Point logicPos = textArea.TextView.GetLogicalPosition(mousepos.X - viewRect.Left,
mousepos.Y - viewRect.Top);
if (logicPos.Y >= 0 && logicPos.Y < textArea.Document.TotalNumberOfLines) {
// This is for testing olny - it must be reworked properly
if (Control.ModifierKeys == (Keys.Control | Keys.Shift) && currentDebugger != null && currentDebugger.IsDebugging) {
SetIPArgs a = new SetIPArgs();
a.filename = textArea.MotherTextEditorControl.FileName;
a.line = logicPos.Y;
a.column = logicPos.X;
if (SetIPRequest != null) {
SetIPRequest(null, a);
}
return;
}
IDocument doc = textArea.Document;
IExpressionFinder expressionFinder = ParserService.GetExpressionFinder(textArea.MotherTextEditorControl.FileName);
if (expressionFinder == null)

Loading…
Cancel
Save