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. 25
      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
if (e.Reason == PausedReason.Exception) { if (e.Reason == PausedReason.Exception) {
exceptionHistory.Add(debugger.CurrentThread.CurrentException); exceptionHistory.Add(debugger.CurrentThread.CurrentException);
OnExceptionHistoryModified(); 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 // Ignore the exception
e.ResumeDebuggingAfterEvent(); e.ResumeDebuggingAfterEvent();
return; return;

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

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

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

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

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

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

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

@ -22,8 +22,6 @@ namespace DebuggerLibrary
ICorDebug corDebug; ICorDebug corDebug;
ManagedCallback managedCallback; ManagedCallback managedCallback;
ManagedCallbackProxy managedCallbackProxy; ManagedCallbackProxy managedCallbackProxy;
public bool CatchHandledExceptions = false;
ApartmentState requiredApartmentState; ApartmentState requiredApartmentState;

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

@ -23,26 +23,34 @@ namespace ICSharpCode.Core
public class CurrentLineBookmark: SDMarkerBookmark public class CurrentLineBookmark: SDMarkerBookmark
{ {
static CurrentLineBookmark instance; static CurrentLineBookmark instance;
static int startLine;
static int startColumn;
static int endLine;
static int endColumn;
public static void SetPosition(IViewContent viewContent, int startLine, int startColumn, int endLine, int endColumn) public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
{ {
ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider; ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
if (tecp != null) 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 else
Remove(); 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(); Remove();
startLine = makerStartLine;
startColumn = makerStartColumn;
endLine = makerEndLine;
endColumn = makerEndColumn;
LineSegment line = document.GetLineSegment(startLine - 1); LineSegment line = document.GetLineSegment(startLine - 1);
int offset = line.Offset + startColumn; int offset = line.Offset + startColumn;
instance = new CurrentLineBookmark(fileName, document, startLine - 1); instance = new CurrentLineBookmark(fileName, document, startLine - 1);
document.BookmarkManager.AddMark(instance); 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.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, startLine - 1));
document.CommitUpdate(); document.CommitUpdate();
} }
@ -50,8 +58,8 @@ namespace ICSharpCode.Core
public static void Remove() public static void Remove()
{ {
if (instance != null) { if (instance != null) {
instance.RemoveMarker();
instance.Document.BookmarkManager.RemoveMark(instance); instance.Document.BookmarkManager.RemoveMark(instance);
instance.RemoveMarker();
instance = null; instance = null;
} }
} }
@ -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) public override void Draw(IconBarMargin margin, Graphics g, Point p)
@ -73,8 +82,8 @@ namespace ICSharpCode.Core
protected override TextMarker CreateMarker() protected override TextMarker CreateMarker()
{ {
LineSegment lineSeg = Document.GetLineSegment(LineNumber); LineSegment lineSeg = Document.GetLineSegment(startLine - 1);
TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); TextMarker marker = new TextMarker(lineSeg.Offset + startColumn, endColumn - startColumn, TextMarkerType.SolidBlock, Color.Yellow, Color.Blue);
Document.MarkerStrategy.InsertMarker(0, marker); Document.MarkerStrategy.InsertMarker(0, marker);
return marker; return marker;
} }

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

@ -84,8 +84,8 @@ namespace ICSharpCode.Core
static void DebugStarted(object sender, EventArgs e) static void DebugStarted(object sender, EventArgs e)
{ {
//oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName; oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName;
//LayoutConfiguration.CurrentLayoutName = "Debug"; LayoutConfiguration.CurrentLayoutName = "Debug";
ClearDebugMessages(); ClearDebugMessages();
} }
@ -93,7 +93,7 @@ namespace ICSharpCode.Core
static void DebugStopped(object sender, EventArgs e) static void DebugStopped(object sender, EventArgs e)
{ {
CurrentLineBookmark.Remove(); 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
{ {
if (oldDocument != null) { if (oldDocument != null) {
oldDocument.MarkerStrategy.RemoveMarker(oldMarker); oldDocument.MarkerStrategy.RemoveMarker(oldMarker);
oldDocument.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber));
oldDocument.CommitUpdate();
} }
oldDocument = null; oldDocument = null;
oldMarker = null; oldMarker = null;

Loading…
Cancel
Save