Browse Source

Bugfixing, handled exceptions handled faster

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@246 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
026b3f41b5
  1. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  3. 28
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  4. 15
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  5. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/RemotingSinks/PrivateEventHandlersSink/MyProxy.cs
  6. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs

@ -96,7 +96,6 @@ namespace ICSharpCode.SharpDevelop.Services @@ -96,7 +96,6 @@ namespace ICSharpCode.SharpDevelop.Services
//
// ExceptionForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(7, 19);
this.ClientSize = new System.Drawing.Size(638, 203);
this.Controls.Add(this.label);
this.Controls.Add(this.pictureBox);

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

@ -338,8 +338,6 @@ namespace ICSharpCode.SharpDevelop.Services @@ -338,8 +338,6 @@ namespace ICSharpCode.SharpDevelop.Services
isProcessRunningCache = false;
OnIsProcessRunningChanged(EventArgs.Empty);
JumpToCurrentLine();
if (e.Reason == PausedReason.Exception) {
exceptionHistory.Add(debugger.CurrentThread.CurrentException);
OnExceptionHistoryModified();
@ -348,6 +346,8 @@ namespace ICSharpCode.SharpDevelop.Services @@ -348,6 +346,8 @@ namespace ICSharpCode.SharpDevelop.Services
e.ResumeDebuggingAfterEvent();
return;
}
JumpToCurrentLine();
ExceptionForm form = new ExceptionForm();
form.label.Text = "Exception " +
@ -365,6 +365,8 @@ namespace ICSharpCode.SharpDevelop.Services @@ -365,6 +365,8 @@ namespace ICSharpCode.SharpDevelop.Services
case ExceptionForm.Result.Ignore:
throw new NotImplementedException();
}
} else {
JumpToCurrentLine();
}
}

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

@ -93,9 +93,9 @@ namespace DebuggerLibrary @@ -93,9 +93,9 @@ namespace DebuggerLibrary
}
debugger.CurrentThread.DeactivateAllSteppers();
debugger.OnDebuggingPaused(reason);
handlingCallback = false;
debugger.OnDebuggingPaused(reason);
}
@ -155,7 +155,7 @@ namespace DebuggerLibrary @@ -155,7 +155,7 @@ namespace DebuggerLibrary
// Exception2 is used in .NET Framework 2.0
ExitCallback_Paused(PausedReason.Exception);
ExitCallback_Continue();
}
#endregion
@ -392,8 +392,18 @@ namespace DebuggerLibrary @@ -392,8 +392,18 @@ namespace DebuggerLibrary
EnterCallback("Exception2", pThread);
debugger.CurrentThread.CurrentExceptionType = (ExceptionType)dwEventType;
ExitCallback_Paused(PausedReason.Exception);
if (ExceptionType.DEBUG_EXCEPTION_UNHANDLED != (ExceptionType)dwEventType) {
// Handled exception
if (debugger.PauseOnHandledException) {
ExitCallback_Paused(PausedReason.Exception);
} else {
ExitCallback_Continue();
}
} else {
// Unhandled exception
ExitCallback_Paused(PausedReason.Exception);
}
}
public void ExceptionUnwind(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags)
@ -419,7 +429,13 @@ namespace DebuggerLibrary @@ -419,7 +429,13 @@ namespace DebuggerLibrary
public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
{
EnterCallback("MDANotification");
if (c is ICorDebugAppDomain) {
EnterCallback("MDANotification", (ICorDebugAppDomain)c);
} else if (c is ICorDebugProcess){
EnterCallback("MDANotification", (ICorDebugProcess)c);
} else {
throw new System.Exception("Unknown callback argument");
}
ExitCallback_Continue();
}

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

@ -26,6 +26,8 @@ namespace DebuggerLibrary @@ -26,6 +26,8 @@ namespace DebuggerLibrary
ApartmentState requiredApartmentState;
EvalQueue evalQueue;
bool pauseOnHandledException = false;
internal EvalQueue EvalQueue {
get {
@ -44,7 +46,16 @@ namespace DebuggerLibrary @@ -44,7 +46,16 @@ namespace DebuggerLibrary
return corDebug;
}
}
public bool PauseOnHandledException {
get {
return pauseOnHandledException;
}
set {
pauseOnHandledException = value;
}
}
internal ManagedCallback ManagedCallback {
get {
return managedCallback;
@ -153,7 +164,7 @@ namespace DebuggerLibrary @@ -153,7 +164,7 @@ namespace DebuggerLibrary
internal void TraceMessage(string message)
{
Console.WriteLine("Trace:" + message);
System.Diagnostics.Debug.WriteLine("Debugger:" + message);
OnDebuggerTraceMessage(message);
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/RemotingSinks/PrivateEventHandlersSink/MyProxy.cs

@ -45,7 +45,7 @@ namespace CustomSinks @@ -45,7 +45,7 @@ namespace CustomSinks
try {
RemotingServices.GetRealProxy(realObject).InitializeServerObject(ctorMsg);
} catch (Exception e) {
} catch {
}
ObjRef objRef = RemotingServices.Marshal(realObject);

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -108,7 +108,15 @@ namespace DebuggerLibrary @@ -108,7 +108,15 @@ namespace DebuggerLibrary
internal ISymbolMethod symMethod {
get {
return symReader.GetMethod(new SymbolToken((int)methodProps.Token));
if (symReader == null) {
return null;
} else {
try {
return symReader.GetMethod(new SymbolToken((int)methodProps.Token));
} catch {
return null;
}
}
}
}

Loading…
Cancel
Save