遇到了一个问题:想看看静态构造函数中私有变量的初始化值,请大虾传授下调试的经验,代码如下:
Code
是这个意思不?:
class A
{
static private string s;
static private int i;
static private bool b;
public static void B() { }
}
class test
{
static void Main()
{
A.B();
Console.Read();
}
}
.load sos
已加载扩展 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll
!name2ee ph.exe A
PDB symbol for mscorwks.dll not loaded
Module: 00982c5c (ph.exe)
Token: 0x02000002
MethodTable: 009830b0
EEClass: 00981348
Name: A
!dumpclass 00981348
Class Name: A
mdToken: 02000002 (C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ph\ph\bin\Debug\ph.exe)
Parent Class: 790c3ef0
Module: 00982c5c
Method Table: 009830b0
Vtable Slots: 4
Total Method Slots: 5
Class Attributes: 100000
NumInstanceFields: 0
NumStaticFields: 3
MT Field Offset Type VT Attr Value Name
793308ec 4000001 4 System.String 0 static 00000000 s
79332b38 4000002 1c System.Int32 1 static 0 i
793043b8 4000003 20 System.Boolean 1 static 0 b
下断点调试,还能怎么样