.Net异常-跟踪异常在代码中发生的位置
大多数情况下,方法都很短,只需知道你在哪个函数中出现了异常,就足以让你找出原因,但我们都知道,我们并不是生活在这样一个完美的世界里:我们编写的是完全模块化的应用程序,所有的东西都排列得很整齐:)
假设你在堆上发现了这个异常。。。
0:025> !dumpobj 02b7191c
Name: System.NullReferenceException
MethodTable: 7915ec4c
EEClass: 791ea18c
Size:72(0x48) bytes (C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
Fields:
MT Field Offset Type VT Attr Value Name
790fa3e0 40000b54 System.String 0 instance 00000000_className79109208 40000b6 8 ...ection.MethodBase 0 instance 00000000_exceptionMethod
790fa3e0 40000b7 c System.String0 instance 00000000_exceptionMethodString
790fa3e0 40000b810 System.String 0instance 02b719bc _message
79113dfc 40000b914 ...tions.IDictionary 0 instance 00000000_data
790fa9e8 40000ba18 System.Exception 0 instance 00000000_innerException
790fa3e0 40000bb 1c System.String0 instance 00000000_helpURL
790f9c18 40000bc20 System.Object 0instance 02b71a38 _stackTrace
790fa3e0 40000bd24 System.String 0 instance 00000000_stackTraceString
790fa3e0 40000be28 System.String 0 instance 00000000_remoteStackTraceString
790fed1c 40000bf34 System.Int32 0 instance 0_remoteStackIndex
790f9c18 40000c0 2c System.Object0 instance 00000000_dynamicMethods
790fed1c 40000c138 System.Int32 0 instance -2147467261_HResult
790fa3e0 40000c230 System.String 0 instance 00000000_source
790fe160 40000c3 3c System.IntPtr0 instance 34270984_xptrs
790fed1c 40000c440 System.Int32 0 instance -1073741819_xcode0:025> !printexception 02b7191c
Exceptionobject: 02b7191c
Exception type: System.NullReferenceException
Message: Object reference not set to an instance of anobject.
InnerException:<none>StackTrace (generated):
SP IP Function
020AF378 029C3269 DisplayUserInfo.Page_Load(System.Object, System.EventArgs)
StackTraceString:<none>
- 上一篇: 仅通过转储来排除内存泄漏
- 下一篇: 使用Java中的InputStream读取文件数据