attach

Connect to a running process.

Syntax

GDB Mode:

attach processid

IDB Mode:

attach processid [filename]

Parameters

processid

The ID of the process to which you want to connect.

filename

IDB mode only.

The name of the executable file of the process. You may omit filename only if the debugger has already loaded the file. If a file name is not specified, the debugger uses the current executable. If the executable contains symbolic debug information, the debugger reads it while attaching.

Description

This command attaches the debugger to a process that is already running. You may find this necessary when you are debugging your application from outside of the debugger and find a bug.

Once you attach the debugger to a process, the process continues execution until it raises a signal that the debugger intercepts, such as SEGV. If you have set the $stoponattach debugger variable, the process stops immediately.

Examples

The following example loads the symbol file a.out and then attaches it to the process with process ID 8492.

GDB Mode:

(idb) file a.out
(idb) attach 8492

IDB Mode:

(idb) attach 8492 a.out

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.