1. Start the service which is built in debug version and start Visual Studio, and tools->attach process, select your service process.
2. This can't debug service startup code. In order to debug startup code, in your main function, put _asm { int 3 } as the first line. Run this service and a dialog will pop up,
3. Press Cancel to debug and select a debugger. The program will break at the line following int 3.
4. Call DebugBreak is similar with int 3. It seems DebugBreak is implemented as int 3 in X86 platform. So call DebugBreak if you want to break in both x86 and x64 platform.
5. Of course, DebugBreak should only be used in your debugging process and should not be left in your release code.
posted on 2008-10-27 10:01
Sean 阅读(232)
评论(0) 编辑 收藏 引用