大多数情况下,方法都很短,只需知道你在哪个函数中出现了异常,就足以让你找出原因,但我们都知道,我们并不是生活在这样一个完美的世界里:我们编写的是完全模块化的应用程序,所有的东西都排列得很整齐:)
假设你在堆上发现了这个异常。。。

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 40000b5
4 System.String 0 instance 00000000_className79109208 40000b6 8 ...ection.MethodBase 0 instance 00000000_exceptionMethod
790fa3e0 40000b7 c System.String
0 instance 00000000_exceptionMethodString
790fa3e0 40000b8
10 System.String 0instance 02b719bc _message
79113dfc 40000b9
14 ...tions.IDictionary 0 instance 00000000_data
790fa9e8 40000ba
18 System.Exception 0 instance 00000000_innerException
790fa3e0 40000bb 1c System.String
0 instance 00000000_helpURL
790f9c18 40000bc
20 System.Object 0instance 02b71a38 _stackTrace
790fa3e0 40000bd
24 System.String 0 instance 00000000_stackTraceString
790fa3e0 40000be
28 System.String 0 instance 00000000_remoteStackTraceString
790fed1c 40000bf
34 System.Int32 0 instance 0_remoteStackIndex
790f9c18 40000c0 2c System.Object
0 instance 00000000_dynamicMethods
790fed1c 40000c1
38 System.Int32 0 instance -2147467261_HResult
790fa3e0 40000c2
30 System.String 0 instance 00000000_source
790fe160 40000c3 3c System.IntPtr
0 instance 34270984_xptrs
790fed1c 40000c4
40 System.Int32 0 instance -1073741819_xcode0:025> !printexception 02b7191c
Exception
object: 02b7191c
Exception type: System.NullReferenceException
Message: Object reference not set to an instance of an
object.
InnerException:
<none>StackTrace (generated):
SP IP Function
020AF378 029C3269 DisplayUserInfo.Page_Load(System.Object, System.EventArgs)

StackTraceString:
<none>

标签: none

添加新评论