abkareem
May 20th, 1999, 06:10 AM
Dear All,
How I can debug a Service Application ?... Is it possible?
Thanks In advance.
Kareem.
How I can debug a Service Application ?... Is it possible?
Thanks In advance.
Kareem.
|
Click to See Complete Forum and Search --> : How Can Debug a Service Application ??? abkareem May 20th, 1999, 06:10 AM Dear All, How I can debug a Service Application ?... Is it possible? Thanks In advance. Kareem. leolin@ May 20th, 1999, 08:05 AM 4. Use PView to get the process ID (PID) for the Simple service. For instance, if PView shows the process as simple(0xD5), then the PID is 0xD5. 5. Convert the PID from hexadecimal to decimal. For example, 0xD5 is 213 in decimal. 6. At a command prompt, go to the directory containing the sample and type start windbg to start WinDbg in its own command shell. 7. In WinDbg, choose Open from the File menu and open the source file 8. Set breakpoints at lines you want. The lines will not change color at this point, but the breakpoints are successfully set. 9. Open a command window in WinDbg and type .attach <PID> where <PID> is a decimal number obtained in steps 4 and 5. The .attach command does not accept hexadecimal numbers. Note that the lines where breakpoints are set will have changed colors. 10 . Type "g" (a go command) in the WinDbg command window to restart after the thread that WinDbg uses to do the .attach terminates. 11. At the command prompt, start the client 12. Press F5 (a go command) to debug the service. The breakpoint hit will be on line you set. Press F5 again to go to the next breakpoint. Keep pressing F5 until line you set waits again for a client to connect. Try connecting another client and repeat the same steps. Exiting WinDbg will kill the service, which must be restarted manually with the Control Panel. Services must log on as LocalSystem for this to work correctly; otherwise, you will not have permission to debug the service. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |