Attaching to a Running Process
Go Up to Debugging Applications Index
You can attach to a process that is running on your PC or on a remote PC or supported cross-platform target. For example, doing this is useful for debugging a program that was not created with RAD Studio.
To attach to a running process
- Choose Run > Attach to Process to display the Attach to Process dialog box.
- By default, the Attach to Process dialog displays the processes running locally, for which the default debugger is the Embarcadero Win32 Debugger.
- Select the appropriate debugger from the Debugger drop-down list:
- Embarcadero Win32 Debugger if the process you want is either a local 32-bit application or is running on a remote 32-bit PC.
- If the process is running on a cross-platform machine, select the appropriate cross-platform debugger:
- Embarcadero Mac OS X Debugger if the process is running on a Mac under OS X.
- Embarcadero Win64 Debugger if the process is a 64-bit Windows process, running either locally on your 64-bit Windows development system or on a remote 64-bit Windows system.
- Embarcadero iOS Device Debugger if the process is running on an iOS device.
- Specify the Remote Machine where the process is running (either host name or IP address):
- If you are using the new remote and cross-platform debugging solution that utilizes the Platform Assistant and a connection profile, click the ellipsis in the Remote Machine field, and select an existing connection profile or add a new connection profile on the Select Connection Profile dialog box. The Platform Assistant must be running on the remote machine. These steps are required in order for you to use the integrated debugger in the IDE for debugging.
- If you are using the old-style remote debugging solution, enter the name of the computer in the Remote Machine field. The remote debug server (file name
rmtdbgnnn.exefor Win32) must be running on the remote computer. For more information, see Installing, Starting, and Stopping the Remote Debug Server.
- The list of Running Processes is refreshed to display the processes running either locally or on the remote machine.
- For cross-platform processes, the selected debugger attempts to connect to the specified remote cross-platform machine. If a connection profile does not exist for the specified remote machine (or if the Platform Assistant server is not running on the target platform or an intermediate platform that supports the target platform), an error is displayed, "Unable to connect to remote host." To Create a Connection Profile or to select from existing connection profiles, click the ellipsis button [...].
- Select a process from the list of Running Processes.
- To include system processes in the list, check Show System Processes.
- If you do not want the process to pause after you have attached to it, uncheck Pause After Attach.
- Click Attach. The CPU Windows open.