Multiprocess Debugging

The debugger can find and control more than one process at a time. The debugger can find and control a process for one of the following reasons:

At any one time, you can examine or execute only one of the processes that the debugger controls. The rest are stalled. You must explicitly switch the debugger to the process you want to work with, stalling the one it was controlling:

multiprocess_command

        : show_process_command

        | switch_process_command

 

You can show the processes the debugger controls:

show_process_command

        : show process [ all ]

        | process

all

        : all

        | *

 

For example:

(idb) show process

>localhost:20986 (/home/user/examples/x_list) loaded.

 

You can explicitly command the debugger to control a different process:

switch_process_command

        : process pid

        | process filename

 

The process you are switching away from remains stalled until either the debugger exits or until you switch to it and continue it.

The following example creates two processes and switches from one to the other:

(idb) process

There is no current process.

You may start one by using the `load' or `attach' commands.

(idb) load x_list

Reading symbolic information from /home/user/examples/x.x_processes/x_list...done

(idb) process

>localhost:20988 (/home/user/examples/x.x_processes/x_list) loaded.

(idb) set $old_process = $curprocess

(idb) printf "$old_process=%d", $old_process

$old_process=20988

(idb) load x_segv

Reading symbolic information from /home/user/examples/x.x_processes/x_segv...done

(idb) process

 localhost:20988 (/home/user/examples/x.x_processes/x_list) loaded.

>localhost:20990 (/home/user/examples/x.x_processes/x_segv) loaded.

(idb) process 20988

(idb) process

>localhost:20988 (/home/user/examples/x.x_processes/x_list) loaded.

 localhost:20990 (/home/user/examples/x.x_processes/x_segv) loaded.

 

Both the load (dbx) command and the attach (dbx) command switch the debugger to the process on which they operate.