Browse Source

CurrentLineBookmark does not use whole line, 'Debug' layout used during debugging

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@244 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
021e7c4129
  1. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/NDebugger-Breakpoints.cs
  4. 23
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  5. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  6. 29
      src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs
  7. 6
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs
  8. 2
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Bookmark.cs

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

@ -343,7 +343,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -343,7 +343,7 @@ namespace ICSharpCode.SharpDevelop.Services
if (e.Reason == PausedReason.Exception) {
exceptionHistory.Add(debugger.CurrentThread.CurrentException);
OnExceptionHistoryModified();
if (debugger.CurrentThread.CurrentException.ExceptionType != ExceptionType.DEBUG_EXCEPTION_UNHANDLED && (debugger.CatchHandledExceptions == false)) {
if (debugger.CurrentThread.CurrentException.ExceptionType != ExceptionType.DEBUG_EXCEPTION_UNHANDLED) {
// Ignore the exception
e.ResumeDebuggingAfterEvent();
return;

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs

@ -102,7 +102,7 @@ namespace DebuggerLibrary @@ -102,7 +102,7 @@ namespace DebuggerLibrary
return base.GetHashCode();
}
internal unsafe void ResetBreakpoint() //TODO
internal unsafe void ResetBreakpoint()
{
hadBeenSet = false;
OnBreakpointStateChanged();

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/NDebugger-Breakpoints.cs

@ -99,7 +99,6 @@ namespace DebuggerLibrary @@ -99,7 +99,6 @@ namespace DebuggerLibrary
public void ResetBreakpoints()
{
foreach (Breakpoint b in breakpointCollection) {
b.HadBeenSet = false;
b.ResetBreakpoint();
}
}

23
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs

@ -92,9 +92,9 @@ namespace DebuggerLibrary @@ -92,9 +92,9 @@ namespace DebuggerLibrary
throw new DebuggerException("You are not allowed to pause since CurrentThread is not set");
}
debugger.CurrentThread.DeactivateAllSteppers();
if (reason != PausedReason.EvalComplete) {
debugger.OnDebuggingPaused(reason);
}
handlingCallback = false;
}
@ -155,11 +155,6 @@ namespace DebuggerLibrary @@ -155,11 +155,6 @@ namespace DebuggerLibrary
// Exception2 is used in .NET Framework 2.0
/*if (!debugger.CatchHandledExceptions && (unhandled == 0)) {
ExitCallback_Continue();
return;
}*/
ExitCallback_Paused(PausedReason.Exception);
}
@ -265,16 +260,21 @@ namespace DebuggerLibrary @@ -265,16 +260,21 @@ namespace DebuggerLibrary
public void NameChange(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
{
if (pAppDomain != null) {
EnterCallback("NameChange: pAppDomain", pAppDomain);
ExitCallback_Continue();
return;
}
if (pThread != null) {
EnterCallback("NameChange: pThread", pThread);
Thread thread = debugger.GetThread(pThread);
thread.HasBeenLoaded = true;
ExitCallback_Continue();
return;
}
}
@ -391,11 +391,6 @@ namespace DebuggerLibrary @@ -391,11 +391,6 @@ namespace DebuggerLibrary
{
EnterCallback("Exception2", pThread);
//if (!NDebugger.CatchHandledExceptions && dwEventType != CorDebugExceptionCallbackType.DEBUG_EXCEPTION_UNHANDLED) {
// ExitCallback_Continue();
// return;
//}
debugger.CurrentThread.CurrentExceptionType = (ExceptionType)dwEventType;
ExitCallback_Paused(PausedReason.Exception);

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -23,8 +23,6 @@ namespace DebuggerLibrary @@ -23,8 +23,6 @@ namespace DebuggerLibrary
ManagedCallback managedCallback;
ManagedCallbackProxy managedCallbackProxy;
public bool CatchHandledExceptions = false;
ApartmentState requiredApartmentState;
EvalQueue evalQueue;

29
src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs

@ -24,25 +24,33 @@ namespace ICSharpCode.Core @@ -24,25 +24,33 @@ namespace ICSharpCode.Core
{
static CurrentLineBookmark instance;
public static void SetPosition(IViewContent viewContent, int startLine, int startColumn, int endLine, int endColumn)
static int startLine;
static int startColumn;
static int endLine;
static int endColumn;
public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
{
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null)
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, startLine, startColumn, endLine, endColumn);
SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
else
Remove();
}
public static void SetPosition(string fileName, IDocument document, int startLine, int startColumn, int endLine, int endColumn)
public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
{
Remove();
startLine = makerStartLine;
startColumn = makerStartColumn;
endLine = makerEndLine;
endColumn = makerEndColumn;
LineSegment line = document.GetLineSegment(startLine - 1);
int offset = line.Offset + startColumn;
instance = new CurrentLineBookmark(fileName, document, startLine - 1);
document.BookmarkManager.AddMark(instance);
//currentLineMarker = new TextMarker(offset, endColumn - startColumn, TextMarkerType.SolidBlock, Color.Yellow, Color.Blue);
//currentLineMarkerParent = document;
//currentLineMarkerParent.MarkerStrategy.AddMarker(currentLineMarker);
document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, startLine - 1));
document.CommitUpdate();
}
@ -50,8 +58,8 @@ namespace ICSharpCode.Core @@ -50,8 +58,8 @@ namespace ICSharpCode.Core
public static void Remove()
{
if (instance != null) {
instance.RemoveMarker();
instance.Document.BookmarkManager.RemoveMark(instance);
instance.RemoveMarker();
instance = null;
}
}
@ -62,8 +70,9 @@ namespace ICSharpCode.Core @@ -62,8 +70,9 @@ namespace ICSharpCode.Core
}
}
public CurrentLineBookmark(string fileName, IDocument document, int lineNumber) : base(fileName, document, lineNumber)
public CurrentLineBookmark(string fileName, IDocument document, int startLine) : base(fileName, document, startLine)
{
}
public override void Draw(IconBarMargin margin, Graphics g, Point p)
@ -73,8 +82,8 @@ namespace ICSharpCode.Core @@ -73,8 +82,8 @@ namespace ICSharpCode.Core
protected override TextMarker CreateMarker()
{
LineSegment lineSeg = Document.GetLineSegment(LineNumber);
TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, Color.Yellow, Color.Blue);
LineSegment lineSeg = Document.GetLineSegment(startLine - 1);
TextMarker marker = new TextMarker(lineSeg.Offset + startColumn, endColumn - startColumn, TextMarkerType.SolidBlock, Color.Yellow, Color.Blue);
Document.MarkerStrategy.InsertMarker(0, marker);
return marker;
}

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

@ -84,8 +84,8 @@ namespace ICSharpCode.Core @@ -84,8 +84,8 @@ namespace ICSharpCode.Core
static void DebugStarted(object sender, EventArgs e)
{
//oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName;
//LayoutConfiguration.CurrentLayoutName = "Debug";
oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName;
LayoutConfiguration.CurrentLayoutName = "Debug";
ClearDebugMessages();
}
@ -93,7 +93,7 @@ namespace ICSharpCode.Core @@ -93,7 +93,7 @@ namespace ICSharpCode.Core
static void DebugStopped(object sender, EventArgs e)
{
CurrentLineBookmark.Remove();
//LayoutConfiguration.CurrentLayoutName = oldLayoutConfiguration;
LayoutConfiguration.CurrentLayoutName = oldLayoutConfiguration;
}

2
src/Main/Base/Project/Src/TextEditor/Bookmarks/Bookmark.cs

@ -78,6 +78,8 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -78,6 +78,8 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
{
if (oldDocument != null) {
oldDocument.MarkerStrategy.RemoveMarker(oldMarker);
oldDocument.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber));
oldDocument.CommitUpdate();
}
oldDocument = null;
oldMarker = null;

Loading…
Cancel
Save