Attaching to a Running Process

From RAD Studio
Jump to: navigation, search

Go Up to How To Use the Debugger

You can attach to a process that is running on your local PC, on a remote PC, an macOS machine, or an iOS simulator running on a Mac. For example, attaching to a process can be useful for debugging a program that was not created with RAD Studio.

To attach to a running process

  1. 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.
  2. Select the appropriate debugger from the Debugger drop-down list:
    Select this debugger If the process is ...

    Embarcadero Win32 Debugger


    • A local 32-bit application
    • An app running on a remote 32-bit PC

    Embarcadero macOS Debugger


    • A macOS app
    • An iOS app running on an iOS simulator on a Mac
    • Embarcadero Windows 64-bit Debugger for Delphi
    • Embarcadero Windows 64-bit LLDB Debugger for C++

    A Delphi or C++ variant based on the language used to compile the application,

    or the debug information format that comes with it.

    Embarcadero Linux 64-bit Debugger

    A 64-bit Linux process.

    You cannot select the following debuggers
    • Embarcadero iOS32 Device Debugger
    • Embarcadero iOS64 Device Debugger

    Does not support Attach to Process

    • Embarcadero Android Device Debugger

    Does not support Attach to Process

  3. Specify the Remote Machine where the process is running (either host name or IP address):
    For macOS and iOS:
    1. 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.
    2. The Platform Assistant must be running on the Mac. These steps are required in order for you to use the integrated debugger in the IDE for debugging.
  4. The list of Running Processes is refreshed to display the processes running either locally or on the remote machine.
    • For multi-device processes, the selected debugger attempts to connect to the specified remote machine.
    • For macOS and iOS, if a connection profile does not exist for the specified remote machine, or if the Platform Assistant server is not running on the Mac, 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 [...].
  5. Select a process from the list of Running Processes.
  6. To include system processes in the list, check Show System Processes.
  7. If you do not want the process to pause after you have attached to it, uncheck Pause After Attach.
  8. Click Attach. The CPU Windows open.

Note: 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 rmtdbg270.exe for Win32) must be running on the remote computer. For more information, see Installing, Starting, and Stopping the Remote Debug Server.

See Also