(12dc.3570): Unknown exception - code c0000029 (!!! second chance !!!) eax=00c1f9c0 ebx=00c1fe70 ecx=00c20000 edx=00c1d000 esi=00b0107d edi=00c1fd5c eip=774d341f esp=00c1f9a0 ebp=00c1fd3c iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246 ntdll!RtlUnwind+0x3c52f: 774d341f 8b4c240c mov ecx,dword ptr [esp+0Ch] ss:002b:00c1f9ac=00c20000
0:000> g WARNING: Continuing a non-continuable exception (12dc.3570): Unknown exception - code c0000029 (first chance) (12dc.3570): Unknown exception - code c0000029 (!!! second chance !!!) eax=00c1f9c0 ebx=00c1fedc ecx=00c20000 edx=00c1d000 esi=00b0107d edi=00c1fd5c eip=774d341f esp=00c1f9a0 ebp=00c1fd3c iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246 ntdll!RtlUnwind+0x3c52f: 774d341f 8b4c240c mov ecx,dword ptr [esp+0Ch] ss:002b:00c1f9ac=00c20000
0:000> g WARNING: Continuing a non-continuable exception (12dc.3570): Unknown exception - code c0000029 (first chance) (12dc.3570): Unknown exception - code c0000029 (!!! second chance !!!) eax=00c1f9c0 ebx=00c1fef4 ecx=00c20000 edx=00c1d000 esi=00b0107d edi=00c1fd5c eip=774d341f esp=00c1f9a0 ebp=00c1fd3c iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246 ntdll!RtlUnwind+0x3c52f: 774d341f 8b4c240c mov ecx,dword ptr [esp+0Ch] ss:002b:00c1f9ac=00c20000
0:000> g WARNING: Continuing a non-continuable exception (12dc.3570): Unknown exception - code 80000026 (!!! second chance !!!) eax=00000000 ebx=00000000 ecx=00000000 edx=00000000 esi=00000000 edi=00000000 eip=00b01ffe esp=00c1fd54 ebp=00c1fdec iopl=0 nv up ei pl nz na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206 Test!___longjmp_internal+0x4e: 00b01ffe 5e pop esi
0:000> g (12dc.3570): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=00b0107d ebx=c483ffff ecx=1b2b3725 edx=00000000 esi=e8a2110c edi=00000000 eip=00b0263e esp=00c1fd2c ebp=00c1fdec iopl=0 nv up ei pl nz ac pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010216 Test!__local_unwind2+0x48: 00b0263e 8b0cb3 mov ecx,dword ptr [ebx+esi*4] ds:002b:670c442f=????????
如果给 foo 函数下断点,只会命中一次,而如果给 bar 函数下断点,则会命中多次,这很好理解。如果在 foo 函数中给局部变量 value 下内存读写断点,该断点只会命中一次(在变量被初始化为 0 的时候)。理论上来说,进入函数 bar 时,传入的参数 value 的值应该总是 0 ,但是实际上并非如此,而且我们在 foo 函数中下的内存断点也无法监控到 value 的值的改变,在 WinDbg 中可以进行验证: