Attaching to a remote running process

ngaix.gif (1051 bytes)ngwin.gif (1069 bytes)Restriction: Attaching to a running process is only supported on AIX and Windows.

ngjava.gif (225 bytes)Important: You can only attach to a running process when debugging a High Performance Compiled (HPC) Java program. For interpreted Java programs, you must attach to a running Java Virtual Machine (JVM). See the related topic below on how to attach to a running JVM.

You can attach the debugger to a process running on a remote system either by using the Process List dialog or from a command line by using the -a option of the idebug command. See the related topic below on when to attach to a running process.

To attach the debugger to a running process on a remote system with the Process List dialog:

  1. On the remote system, start the debug engine using the irmtdbgc command. If you specify the -qport option, take note of it. You will need it later.
  2. On the local system with the debugger user interface running, select File > Attach Process to invoke the Process List dialog.
  3. In the Process List dialog, select TCP/IP Connection, then fill in the host name and port number for the remote system. If you specified the -qport option of the irmtdbgc command, the port number used in the -qport option must match the port number in Process List dialog.
  4. Click Refresh.
  5. Select the remote process you want to attach from the Select Process list.
  6. If the Process Path field is enabled, enter the full path name to the executable associated with the process you want to attach.
  7. Click Attach.

To attach the debugger to a running process from a command line:

  1. On the remote system, start the debug engine using the irmtdbgc command. If you specify the -qport option, take note of it. You will need it later.
  2. On the local system, enter the following command:
    ngaix.gif (1051 bytes)idebug -qhost=<remote_host> [-qport=<host_port>] -a<process_id>
    ngwin.gif (1069 bytes)idebug -qhost=<remote_host> [-qport=<host_port>] -a<process_id> <full_path_to_executable>

where <remote_host> is the the TCP/IP name or address of the remote system, <full_path_to_executable> is the full path name to the executable associated with process id you want to attach, and <process_id> is a valid process id on the remote system.

Important: Do not attach to operating system processes or to the debugger's own process. Attaching to such processes can cause unpredictable results.

If you are currently debugging a process, that process is terminated when the new process is attached. When you exit the debugger, any attached process is also terminated.

You cannot restart a program that you have attached to.

ngrelc.gif (533 bytes)
ngaix.gif (1051 bytes)ngwin.gif (1069 bytes)When to attach

ngrelt.gif (466 bytes)
ngaix.gif (1051 bytes)ngwin.gif (1069 bytes)Attaching to a local running process
ngjava.gif (225 bytes) Attaching to a running Java Virtual Machine

ngrelr.gif (548 bytes)
idebug command
ngaix.gif (1051 bytes)ngwin.gif (1069 bytes)irmtdbgc command