Browse Source

Exposing InnerException data in the Debugger.Exception class via a new Debugger.DebuggerInnerException class. I am not exposing this to the user yet.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3044 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Justin Dearing 17 years ago
parent
commit
f300c7cc0b
  1. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  2. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Exception.cs
  3. 68
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/InnerException.cs
  4. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj

@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
<Compile Include="Src\Debugger\Exception.cs" />
<Compile Include="Src\Debugger\ExceptionType.cs" />
<Compile Include="Src\Debugger\IExpirable.cs" />
<Compile Include="Src\Debugger\InnerException.cs" />
<Compile Include="Src\Debugger\PausedReason.cs" />
<Compile Include="Src\Debugger\PauseSession.cs" />
<Compile Include="Src\Debugger\SourcecodeSegment.cs" />

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Exception.cs

@ -13,6 +13,13 @@ using Debugger.Wrappers.CorDebug; @@ -13,6 +13,13 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
/// <summary>
/// This class contains data from an Exception throw by an application
/// being debugged. Since the <c>System.Exception</c> object being thrown
/// lives in the debugged application and not in debugger, this class is
/// neccessary.
/// </summary>
/// <seealso cref="System.Exception" />
public class Exception: DebuggerObject
{
Thread thread;
@ -43,12 +50,32 @@ namespace Debugger @@ -43,12 +50,32 @@ namespace Debugger
}
}
/// <summary>
/// The <c>GetType().FullName</c> of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public string Type {
get {
return this.RuntimeValue.Type.FullName;
}
}
/// <summary>
/// The <c>InnerException</c> property of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public DebuggerInnerException InnerException {
get {
Debugger.Value exVal = this.RuntimeValue.GetMemberValue("_innerException");
return (exVal.IsNull) ? null : new DebuggerInnerException(exVal);
}
}
/// <summary>
/// The <c>Message</c> property of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public string Message {
get {
return this.RuntimeValue.GetMemberValue("_message").AsString;

68
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/InnerException.cs

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Justin Dearing" email="zippy1981@gmail.com"/>
// <version>$Revision: 2900 $</version>
// </file>
using System.Text;
using Debugger.Wrappers.CorDebug;
namespace Debugger
{
/// <summary>
/// This contains the nested InnerExceptions of a <c>Debugger.Exception</c> class
/// </summary>
/// <see cref="Debugger.Exception" />
/// <seealso cref="System.Exception" />
public class DebuggerInnerException
{
Debugger.Value exceptionValue;
internal DebuggerInnerException (Debugger.Value exception) {
this.exceptionValue = exception;
}
/// <summary>
/// The <c>InnerException</c> property of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public DebuggerInnerException InnerException {
get {
Debugger.Value exVal = this.exceptionValue.GetMemberValue("_innerException");
return (exVal.IsNull) ? null : new DebuggerInnerException(exVal);
}
}
/// <summary>
/// The <c>Message</c> property of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public string Message {
get {
return this.exceptionValue.GetMemberValue("_message").AsString;
}
}
/// <summary>
/// The <c>GetType().FullName</c> of the exception.
/// </summary>
/// <seealso cref="System.Exception" />
public string Type {
get {
return this.exceptionValue.Type.FullName;
}
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("Type: {0}", this.Type);
sb.AppendLine();
sb.AppendLine("Message:");
sb.Append(this.Message);
return sb.ToString();
}
}
}

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

@ -459,7 +459,7 @@ namespace Debugger @@ -459,7 +459,7 @@ namespace Debugger
EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);
// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
// Whatch out for the zeros and null!
// Watch out for the zeros and null!
// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
process.SelectedThread.CurrentException = new Exception(process.SelectedThread, (ExceptionType)exceptionType);

Loading…
Cancel
Save