0
Answer

why my program breaks?

George George

George George

16y
2.4k
1

Hello everyone,


My operation is like this, I am using WinDbg to set a breakpoint to method foo. Here is what I did.

[Code]
0:000> !bpmd TestDebug.exe TestDebug.Program.foo
Adding pending breakpoints...
0:000> lm
start             end                 module name
00000000`00400000 00000000`00408000   TestDebug C (private pdb symbols)  D:\Visual Studio 2008\Projects\TestDebug\TestDebug\bin\Debug\TestDebug.pdb

0:000> g
(1b0.5c4): CLR exception - code e0434f4d (first chance)
(1b0.5c4): CLR exception - code e0434f4d (!!! second chance !!!)
KERNEL32!RaiseException+0x5c:
00000000`77d4dd10 4881c4c8000000  add     rsp,0C8h
 
But when pressing g, and the program stops, then I pressed k to display the current stack. I found there is no my code in the stack. The seems the stop execution is not because of breakpoint (because no break point  hit information)? I am so confused. Any ideas?
 
namespace TestDebug
{
    class Program
    {
        static void foo()
        {
            int a = 100;
            throw new Exception ("Hello Exception Debug");
        }
       
        static void Main(string[] args)
        {
            foo();
        }
    }
}
[/Code]


thanks in advance,
George