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
// //
// ExceptionForm // ExceptionForm
// //
this.AutoScaleBaseSize = new System.Drawing.Size(7, 19);
this.ClientSize = new System.Drawing.Size(638, 203); this.ClientSize = new System.Drawing.Size(638, 203);
this.Controls.Add(this.label); this.Controls.Add(this.label);
this.Controls.Add(this.pictureBox); 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
isProcessRunningCache = false; isProcessRunningCache = false;
OnIsProcessRunningChanged(EventArgs.Empty); OnIsProcessRunningChanged(EventArgs.Empty);
JumpToCurrentLine();
if (e.Reason == PausedReason.Exception) { if (e.Reason == PausedReason.Exception) {
exceptionHistory.Add(debugger.CurrentThread.CurrentException); exceptionHistory.Add(debugger.CurrentThread.CurrentException);
OnExceptionHistoryModified(); OnExceptionHistoryModified();
@ -348,6 +346,8 @@ namespace ICSharpCode.SharpDevelop.Services
e.ResumeDebuggingAfterEvent(); e.ResumeDebuggingAfterEvent();
return; return;
} }
JumpToCurrentLine();
ExceptionForm form = new ExceptionForm(); ExceptionForm form = new ExceptionForm();
form.label.Text = "Exception " + form.label.Text = "Exception " +
@ -365,6 +365,8 @@ namespace ICSharpCode.SharpDevelop.Services
case ExceptionForm.Result.Ignore: case ExceptionForm.Result.Ignore:
throw new NotImplementedException(); throw new NotImplementedException();
} }
} else {
JumpToCurrentLine();
} }
} }

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

@ -93,9 +93,9 @@ namespace DebuggerLibrary
} }
debugger.CurrentThread.DeactivateAllSteppers(); debugger.CurrentThread.DeactivateAllSteppers();
debugger.OnDebuggingPaused(reason);
handlingCallback = false; handlingCallback = false;
debugger.OnDebuggingPaused(reason);
} }
@ -155,7 +155,7 @@ namespace DebuggerLibrary
// Exception2 is used in .NET Framework 2.0 // Exception2 is used in .NET Framework 2.0
ExitCallback_Paused(PausedReason.Exception); ExitCallback_Continue();
} }
#endregion #endregion
@ -392,8 +392,18 @@ namespace DebuggerLibrary
EnterCallback("Exception2", pThread); EnterCallback("Exception2", pThread);
debugger.CurrentThread.CurrentExceptionType = (ExceptionType)dwEventType; 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) public void ExceptionUnwind(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags)
@ -419,7 +429,13 @@ namespace DebuggerLibrary
public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda) 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(); ExitCallback_Continue();
} }

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

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

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

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

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

@ -108,7 +108,15 @@ namespace DebuggerLibrary
internal ISymbolMethod symMethod { internal ISymbolMethod symMethod {
get { 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