Debug any running process using VS.NET.
Post date: Aug 26, 2011 4:18:42 PM
Two day back one of colleague thought me to do debug the running process in vs.net.
Actaully we developed on apache proxy module, there we found one memory leak in between the code, so we decide to debug the code, but we never complied entire apache modules (It has more than 10 C project), we complied only one module where we suspect the memory leak.
First we put a break point at the code,
Execute Apache via Comman Prompt
we started the apache using command prompt
Then go to vs.net and do the following.
On the Debug menu, select Attach to Process. If no project is open, select Attach to Process on the Tools menu.
Attach Apache Process
In the Attach to Process dialog box, find the program that you want to attach to from the Available Processes list.
If the program that you want to debug is running on another computer, you must first select the remote computer. For more information, see How to: Select a Remote Machine.
If the process is running under a different user account, select the Show processes from all users check box.
If you are connected through Remote Desktop Connection, select the Show processes in all sessions check box.
Select Your Machine
In the Attach to box, make sure that the type of code you will debug is listed. The default Automatic setting tries to determine what type of code you want to debug. If the automatic setting is not appropriate:
Click Select.
In the Select Code Type dialog box, click Debug these code types and select the types to debug.
Click OK.
Click Attach.The Available Processes list is displayed automatically when you open the Processes dialog box. Processes can start and stop in the background while the dialog box is open. However, the contents are not always current. You can refresh the list at any time to see the current list of processes by clicking Refresh.You can be attached to multiple programs when you are debugging, but only one program is active in the debugger at any time. You can set the active program in the Debug Location toolbar or the Processes window. For more information, see How to: Set the Current Program.
-Courtesy Mukesh