Browse Source

fix SD-1843 - 'Pause on handled exceptions' won't let me continue program execution after a handled exception is caught by the debugger

pull/18/head
Siegfried Pammer 14 years ago
parent
commit
69800ced7c
  1. 8
      data/resources/StringResources.nl.resx
  2. 5
      data/resources/StringResources.resx
  3. 9
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  4. 15
      src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs
  5. 114
      src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.Designer.cs
  6. 72
      src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.cs
  7. 120
      src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.resx
  8. 40
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  9. 17
      src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs

8
data/resources/StringResources.nl.resx

@ -261,6 +261,9 @@ @@ -261,6 +261,9 @@
<data name="AddIns.HelpViewer.HelpModeLabel" xml:space="preserve">
<value>Help modus</value>
</data>
<data name="AddIns.HelpViewer.HLMNoActiveCatalogError" xml:space="preserve">
<value>Help Library Manager kan niet starten omdat geen help catalogus is geïnstalleerd/geselecteerd. Controleer aub de help instellingen (Zie Extra &gt; Opties &gt; Extra's &gt; Microsoft Help Viewer)</value>
</data>
<data name="AddIns.HelpViewer.HLMNotFound" xml:space="preserve">
<value>De Help-bibliotheek Manager werd niet gevonden. Ga alst7ublieft na of deze wel korrekt geïnstalleerd werd.</value>
</data>
@ -5670,6 +5673,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -5670,6 +5673,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<data name="MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException" xml:space="preserve">
<value>Uitzondering kan niet onderschept worden. Foutopsporing kan programma niet voortzetten en evaluatie van eigenschappen is niet mogelijk.</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptHandledException" xml:space="preserve">
<value>Kan afgehandelde uitzonderingen niet onderscheppen. Foutzoek symbolen kunnen mogelijk ontbreken voor de bron van de uitzondering.</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.HideExceptionDetails" xml:space="preserve">
<value>Uitzondering details verbergen</value>
</data>
@ -5683,7 +5689,7 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -5683,7 +5689,7 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<value>op {0} in {1}:regel {2}</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.Message" xml:space="preserve">
<value>Een uitzondering van type {0} werd verworpen:\{1}</value>
<value>Een uitzondering van type {0} werd verworpen:</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.ShowExceptionDetails" xml:space="preserve">
<value>Uitzondering details tonen</value>

5
data/resources/StringResources.resx

@ -5962,9 +5962,12 @@ Continues the execution of debuggee. @@ -5962,9 +5962,12 @@ Continues the execution of debuggee.
Button is enabled only for handled exceptions.</comment>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException" xml:space="preserve">
<value>Can not intercept exception. Debugged program can not be continued and properties can not be evaluated.</value>
<value>Cannot intercept exception. Debugged program can not be continued and properties can not be evaluated.</value>
<comment>eg. Happens on StackOverflow exception.</comment>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptHandledException" xml:space="preserve">
<value>Cannot intercept handled exception. Debug symbols might not be available for the source of the exception.</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.HideExceptionDetails" xml:space="preserve">
<value>Hide Exception Details</value>
</data>

9
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -174,12 +174,6 @@ @@ -174,12 +174,6 @@
<Compile Include="Service\DebuggeeExceptionForm.Designer.cs">
<DependentUpon>DebuggeeExceptionForm.cs</DependentUpon>
</Compile>
<Compile Include="Service\DebuggerEventForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Service\DebuggerEventForm.Designer.cs">
<DependentUpon>DebuggerEventForm.cs</DependentUpon>
</Compile>
<Compile Include="Service\EditBreakpointScriptWindow.xaml.cs">
<DependentUpon>EditBreakpointScriptWindow.xaml</DependentUpon>
<SubType>Code</SubType>
@ -289,9 +283,6 @@ @@ -289,9 +283,6 @@
<EmbeddedResource Include="Options\DebuggingSymbolsPanel.resx">
<DependentUpon>DebuggingSymbolsPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Service\DebuggerEventForm.resx">
<DependentUpon>DebuggerEventForm.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="Service\SetCurrentStatementCommand.cs" />
<Compile Include="..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>

15
src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs

@ -4,10 +4,10 @@ @@ -4,10 +4,10 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using Debugger;
using ICSharpCode.Core;
using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Services
@ -15,6 +15,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -15,6 +15,7 @@ namespace ICSharpCode.SharpDevelop.Services
internal sealed partial class DebuggeeExceptionForm
{
Process process;
bool isUnhandled;
DebuggeeExceptionForm(Process process)
{
@ -56,14 +57,15 @@ namespace ICSharpCode.SharpDevelop.Services @@ -56,14 +57,15 @@ namespace ICSharpCode.SharpDevelop.Services
this.process.Resumed -= ProcessHandler;
}
public static void Show(Process process, string title, string message, string stacktrace, Bitmap icon, bool canContinue)
public static void Show(Process process, string title, string message, string stacktrace, Bitmap icon, bool isUnhandled)
{
DebuggeeExceptionForm form = new DebuggeeExceptionForm(process);
form.Text = title;
form.pictureBox.Image = icon;
form.lblExceptionText.Text = message;
form.exceptionView.Text = stacktrace;
form.btnContinue.Enabled = canContinue;
form.isUnhandled = isUnhandled;
form.btnContinue.Enabled = !isUnhandled;
form.Show(WorkbenchSingleton.MainWin32Window);
}
@ -100,7 +102,10 @@ namespace ICSharpCode.SharpDevelop.Services @@ -100,7 +102,10 @@ namespace ICSharpCode.SharpDevelop.Services
void BtnBreakClick(object sender, EventArgs e)
{
Close();
if (this.process.SelectedThread.CurrentExceptionIsUnhandled)
Close();
else if (((WindowsDebugger)DebuggerService.CurrentDebugger).BreakAndInterceptHandledException())
Close();
}
void BtnStopClick(object sender, EventArgs e)
@ -111,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -111,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Services
void BtnContinueClick(object sender, EventArgs e)
{
this.process.Continue();
this.process.AsyncContinue();
Close();
}
}

114
src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.Designer.cs generated

@ -1,114 +0,0 @@ @@ -1,114 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
using System;
using System.Windows.Forms;
namespace ICSharpCode.SharpDevelop.Services
{
partial class DebuggerEventForm : System.Windows.Forms.Form
{
#region Windows Forms Designer generated code
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent() {
this.buttonBreak = new System.Windows.Forms.Button();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.buttonTerminate = new System.Windows.Forms.Button();
this.buttonContinue = new System.Windows.Forms.Button();
this.textBox = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
// buttonBreak
//
this.buttonBreak.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonBreak.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonBreak.Location = new System.Drawing.Point(176, 160);
this.buttonBreak.MaximumSize = new System.Drawing.Size(91, 32);
this.buttonBreak.MinimumSize = new System.Drawing.Size(91, 32);
this.buttonBreak.Name = "buttonBreak";
this.buttonBreak.Size = new System.Drawing.Size(91, 32);
this.buttonBreak.TabIndex = 0;
this.buttonBreak.Text = "${res:MainWindow.Windows.Debug.ExceptionForm.Break}";
this.buttonBreak.Click += new System.EventHandler(this.buttonBreak_Click);
//
// pictureBox
//
this.pictureBox.Location = new System.Drawing.Point(14, 16);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(56, 64);
this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox.TabIndex = 3;
this.pictureBox.TabStop = false;
//
// buttonTerminate
//
this.buttonTerminate.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonTerminate.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonTerminate.Location = new System.Drawing.Point(372, 160);
this.buttonTerminate.MaximumSize = new System.Drawing.Size(91, 32);
this.buttonTerminate.MinimumSize = new System.Drawing.Size(91, 32);
this.buttonTerminate.Name = "buttonTerminate";
this.buttonTerminate.Size = new System.Drawing.Size(91, 32);
this.buttonTerminate.TabIndex = 2;
this.buttonTerminate.Text = "${res:MainWindow.Windows.Debug.ExceptionForm.Terminate}";
this.buttonTerminate.Click += new System.EventHandler(this.buttonTerminate_Click);
//
// buttonContinue
//
this.buttonContinue.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonContinue.Location = new System.Drawing.Point(274, 160);
this.buttonContinue.MaximumSize = new System.Drawing.Size(91, 32);
this.buttonContinue.MinimumSize = new System.Drawing.Size(91, 32);
this.buttonContinue.Name = "buttonContinue";
this.buttonContinue.Size = new System.Drawing.Size(91, 32);
this.buttonContinue.TabIndex = 1;
this.buttonContinue.Text = "${res:MainWindow.Windows.Debug.ExceptionForm.Continue}";
this.buttonContinue.Click += new System.EventHandler(this.buttonContinue_Click);
//
// textBox
//
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox.Location = new System.Drawing.Point(76, 16);
this.textBox.Multiline = true;
this.textBox.Name = "textBox";
this.textBox.ReadOnly = true;
this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox.Size = new System.Drawing.Size(543, 138);
this.textBox.TabIndex = 4;
this.textBox.WordWrap = false;
//
// DebuggerEventForm
//
this.CancelButton = this.buttonBreak;
this.ClientSize = new System.Drawing.Size(638, 203);
this.Controls.Add(this.buttonTerminate);
this.Controls.Add(this.buttonContinue);
this.Controls.Add(this.buttonBreak);
this.Controls.Add(this.textBox);
this.Controls.Add(this.pictureBox);
this.MinimizeBox = false;
this.Name = "DebuggerEventForm";
this.ShowInTaskbar = false;
this.TopMost = true;
this.Resize += new System.EventHandler(this.debuggerEventFormResize);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
protected System.Windows.Forms.PictureBox pictureBox;
protected System.Windows.Forms.TextBox textBox;
protected System.Windows.Forms.Button buttonBreak;
protected System.Windows.Forms.Button buttonContinue;
protected System.Windows.Forms.Button buttonTerminate;
}
}

72
src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.cs

@ -1,72 +0,0 @@ @@ -1,72 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
using System;
using System.Drawing;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Services
{
internal partial class DebuggerEventForm
{
public enum Result {Break, Continue, Terminate};
protected Result result = Result.Break; // Default
protected DebuggerEventForm()
{
InitializeComponent();
this.Text = StringParser.Parse(this.Text);
buttonBreak.Text = StringParser.Parse(buttonBreak.Text);
buttonContinue.Text = StringParser.Parse(buttonContinue.Text);
buttonTerminate.Text = StringParser.Parse(buttonTerminate.Text);
WindowState = DebuggingOptions.Instance.DebuggerEventWindowState;
FormLocationHelper.Apply(this, "DebuggerEventForm", true);
}
/// <summary>
/// Displays a DebuggerEvent form with the given message.
/// </summary>
/// <param name="title">Title of the dialog box.</param>
/// <param name="message">The message to display in the TextArea of the dialog box.</param>
/// <param name="icon">Icon to display i nthe dialog box.</param>
/// <param name="canContinue">Set to true to enable the continue button on the form.</param>
/// <returns></returns>
public static Result Show(string title, string message, Bitmap icon, bool canContinue)
{
using (DebuggerEventForm form = new DebuggerEventForm()) {
form.Text = title;
form.textBox.Text = message;
form.pictureBox.Image = icon;
form.buttonContinue.Enabled = canContinue;
form.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
return form.result;
}
}
private void buttonBreak_Click(object sender, EventArgs e)
{
result = Result.Break;
Close();
}
private void buttonContinue_Click(object sender, EventArgs e)
{
result = Result.Continue;
Close();
}
private void buttonTerminate_Click(object sender, EventArgs e)
{
result = Result.Terminate;
Close();
}
void debuggerEventFormResize(object sender, EventArgs e)
{
DebuggingOptions.Instance.DebuggerEventWindowState = WindowState;
}
}
}

120
src/AddIns/Debugger/Debugger.AddIn/Service/DebuggerEventForm.resx

@ -1,120 +0,0 @@ @@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

40
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -857,19 +857,24 @@ namespace ICSharpCode.SharpDevelop.Services @@ -857,19 +857,24 @@ namespace ICSharpCode.SharpDevelop.Services
StringBuilder stacktraceBuilder = new StringBuilder();
// Need to intercept now so that we can evaluate properties
if (e.Process.SelectedThread.InterceptCurrentException()) {
stacktraceBuilder.AppendLine(e.Exception.ToString());
string stackTrace;
try {
stackTrace = e.Exception.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.EndOfInnerException}"));
} catch (GetValueException) {
stackTrace = e.Process.SelectedThread.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.Symbols}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.NoSymbols}"));
if (e.IsUnhandled) {
// Need to intercept now so that we can evaluate properties
if (e.Process.SelectedThread.InterceptCurrentException()) {
stacktraceBuilder.AppendLine(e.Exception.ToString());
string stackTrace;
try {
stackTrace = e.Exception.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.EndOfInnerException}"));
} catch (GetValueException) {
stackTrace = e.Process.SelectedThread.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.Symbols}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.NoSymbols}"));
}
stacktraceBuilder.Append(stackTrace);
} else {
// For example, happens on stack overflow
stacktraceBuilder.AppendLine(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException}"));
stacktraceBuilder.AppendLine(e.Exception.ToString());
stacktraceBuilder.Append(e.Process.SelectedThread.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.Symbols}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.NoSymbols}")));
}
stacktraceBuilder.Append(stackTrace);
} else {
// For example, happens on stack overflow
stacktraceBuilder.AppendLine(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException}"));
stacktraceBuilder.AppendLine(e.Exception.ToString());
stacktraceBuilder.Append(e.Process.SelectedThread.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.Symbols}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.NoSymbols}")));
}
@ -878,7 +883,17 @@ namespace ICSharpCode.SharpDevelop.Services @@ -878,7 +883,17 @@ namespace ICSharpCode.SharpDevelop.Services
string message = string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Message}"), e.Exception.Type);
Bitmap icon = WinFormsResourceService.GetBitmap(e.IsUnhandled ? "Icons.32x32.Error" : "Icons.32x32.Warning");
DebuggeeExceptionForm.Show(debuggedProcess, title, message, stacktraceBuilder.ToString(), icon, !e.IsUnhandled);
DebuggeeExceptionForm.Show(debuggedProcess, title, message, stacktraceBuilder.ToString(), icon, e.IsUnhandled);
}
public bool BreakAndInterceptHandledException()
{
if (!debuggedProcess.SelectedThread.InterceptCurrentException()) {
MessageService.ShowError("${res:MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptHandledException}");
return false;
}
JumpToCurrentLine();
return true;
}
public void JumpToCurrentLine()
@ -888,7 +903,6 @@ namespace ICSharpCode.SharpDevelop.Services @@ -888,7 +903,6 @@ namespace ICSharpCode.SharpDevelop.Services
WorkbenchSingleton.MainWindow.Activate();
if (debuggedProcess.IsSelectedFrameForced()) {
if (debuggedProcess.SelectedStackFrame != null && debuggedProcess.SelectedStackFrame.HasSymbols) {
JumpToSourceCode();

17
src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs

@ -501,23 +501,26 @@ namespace Debugger @@ -501,23 +501,26 @@ namespace Debugger
ExitCallback();
}
public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags)
public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType _exceptionType, uint dwFlags)
{
EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);
EnterCallback(PausedReason.Exception, "Exception2 (type=" + _exceptionType.ToString() + ")", pThread);
// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
// Watch out for the zeros and null!
// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
if ((ExceptionType)exceptionType == ExceptionType.Unhandled ||
(process.Options != null && process.Options.PauseOnHandledExceptions)) {
ExceptionType exceptionType = (ExceptionType)_exceptionType;
bool pauseOnHandled = process.Options != null && process.Options.PauseOnHandledExceptions;
if (exceptionType == ExceptionType.Unhandled || (pauseOnHandled && exceptionType == ExceptionType.CatchHandlerFound)) {
process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType;
process.SelectedThread.CurrentExceptionIsUnhandled = (ExceptionType)exceptionType == ExceptionType.Unhandled;
process.SelectedThread.CurrentExceptionType = exceptionType;
process.SelectedThread.CurrentExceptionIsUnhandled = exceptionType == ExceptionType.Unhandled;
pauseOnNextExit = true;
}
ExitCallback();
}

Loading…
Cancel
Save