none
How to get full stack trace from exception object, when debugging in windbg? RRS feed

  • Question

  • Hi all,

    I have a dump file, which was dumped from a crash context.

    The first thread contains a System.NullReferenceException:

     1: 0:000> ~0s
     2: ...
     3: 0:000> !pe
     4: Exception object: 2308de80
     5: Exception type: System.NullReferenceException
     6: Message:   Object reference not set to an instance of an object.
     7: InnerException: <none>
     8: StackTrace (generated):
     9:  SP  IP  Function
     10:  0023F408 554228CB WindowsBase_ni!System.Windows.Threading.DispatcherOperation.Invoke()+0xeb
     11:  0023F448 5541E57E WindowsBase_ni!System.Windows.Threading.Dispatcher.ProcessQueue()+0x15e
     12:  0023F48C 5541E810 WindowsBase_ni!System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+0x164
     13:  0023F4DC 5541FDB6 WindowsBase_ni!MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+0xbe
     14:  0023F528 5541FCE5 WindowsBase_ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)+0x7d
     15:  0023F538 5541FB93 WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+0x53
     16:  0023F558 5541FAC2 WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+0x42
     17:  0023F5A0 5541E050 WindowsBase_ni!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)+0xb4
     18:  0023F5E8 5541F5E0 WindowsBase_ni!MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)+0x104
     19: 
     20: StackTraceString: <none>
     21: HResult: 80004003

    Then I checked the NullReferenceException object:

     1: 0:000> !do 2308de80
     2: Name:  System.NullReferenceException
     3: MethodTable: 6b05470c
     4: EEClass:  6ad91cb4
     5: Size:  84(0x54) bytes
     6: File:  C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
     7: Fields:
     8:  MT Field Offset     Type VT  Attr Value Name
     9: 6b05f9ac 400004a  4  System.String 0 instance 00000000 _className
     10: 6b0601f4 400004b  8 ...ection.MethodBase 0 instance 00000000 _exceptionMethod
     11: 6b05f9ac 400004c  c  System.String 0 instance 00000000 _exceptionMethodString
     12: 6b05f9ac 400004d  10  System.String 0 instance 2308dfd4 _message
     13: 6b054004 400004e  14 ...tions.IDictionary 0 instance 2308e1c4 _data
     14: 6b05fc0c 400004f  18  System.Exception 0 instance 00000000 _innerException
     15: 6b05f9ac 4000050  1c  System.String 0 instance 00000000 _helpURL
     16: 6b05f5e8 4000051  20  System.Object 0 instance 2308e118 _stackTrace
     17: 6b05f5e8 4000052  24  System.Object 0 instance 00000000 _watsonBuckets
     18: 6b05f9ac 4000053  28  System.String 0 instance 00000000 _stackTraceString
     19: 6b05f9ac 4000054  2c  System.String 0 instance 00000000 _remoteStackTraceString
     20: 6b062978 4000055  3c   System.Int32 1 instance  0 _remoteStackIndex
     21: 6b05f5e8 4000056  30  System.Object 0 instance 00000000 _dynamicMethods
     22: 6b062978 4000057  40   System.Int32 1 instance -2147467261 _HResult
     23: 6b05f9ac 4000058  34  System.String 0 instance 00000000 _source
     24: 6b05aa2c 4000059  44  System.IntPtr 1 instance 23ef70 _xptrs
     25: 6b062978 400005a  48   System.Int32 1 instance -1073741819 _xcode
     26: 6b01a29c 400005b  4c  System.UIntPtr 1 instance 554228cb _ipForWatsonBuckets
     27: 6b019888 400005c  38 ...ializationManager 0 instance 2308e04c _safeSerializationManager

    Finally I want to know the call stack in exception context, but the _stackTrace is only a array of SByte:
     1: 0:000> !do 2308e118 
     2: Name:  System.SByte[]
     3: MethodTable: 6b016024
     4: EEClass:  6ad9c7bc
     5: Size:  172(0xac) bytes
     6: Array:  Rank 1, Number of elements 160, Type SByte
     7: Element Type:System.SByte
     8: Content:  ....x....(BU..#..f8U}.AUH.#..B8U..AU..#..C8U..AU..#...:U..AU(.#...:U..AU8.#..c8U..AUX.#..c8UO.AU..#..@8U..AU..#...:U............
     9: Fields:
     10: None

    Question: How could I get the full stack in string from the _stackTrace?
    Thanks.

    Feel free
    Wednesday, April 20, 2011 3:28 AM

Answers