Debugging Multiple Targets

Debugging Multiple Targets

You can debug multiple dump files or live user-mode applications at the same time. Each target contains one or more processes, and each process contains one or more threads.

These targets are also grouped into systems. Systems are sets of targets that are grouped together for easy identification and manipulation. Systems are defined as follows:

  • Each kernel-mode or user-mode dump file is a separate system.

  • When you are debugging live user-mode applications on different computers (by using a process server, such as Dbgsrv), each application is a separate system.

  • When you are debugging live user-mode applications on the local computer, the applications are combined into a single system.

The current or active system is the system that you are currently debugging.

Acquiring Multiple Targets

The first target is acquired in the usual manner.

You can debug additional live user-mode applications by using the .attach (Attach to Process) or .create (Create Process) command, followed by the g (Go) command.

You can debug additional dump files by using the .opendump (Open Dump File) command, followed by the g (Go) command. You can also open multiple dump files when the debugger is started. To open multiple dump files, include multiple -z switches in the command, each followed by a different file name.

You can use the preceding commands even if the processes are on different systems. You must start a process server on each system and then use the -premote parameter with .attach or .create to identify the proper process server. If you use the .attach or .create command again without specifying the -premote parameter, the debugger attaches to, or creates, a process on the current system.

Manipulating Systems and Targets

When debugging begins, the current system is the one that the debugger most recently attached to. If an exception occurs, the current system switches to the system that this exception occurred on.

To close one target and continue to debug the other targets, use the .kill (Kill Process) command. On Microsoft Windows XP and later versions of Windows, you can use the .detach (Detach from Process) command or WinDbg's Debug | Detach Debuggee menu command instead. These commands detach the debugger from the target but leave the target running.

To control the debugging of multiple systems, you can use the following methods:

By using these commands to select the current system, and by using the standard commands to select the current process and thread, you can determine the context of commands that display memory and registers.

However, you cannot separate execution of these processes. The g (Go) command always causes all targets to execute together.

Note   We recommend that you do not debug live targets and dump targets together, because commands behave differently for each type of debugging. For example, if you use the g (Go) command when the current system is a dump file, the debugger begins executing, but you cannot break back into the debugger, because the break command is not recognized as valid for dump file debugging.



Send comments about this topic to Microsoft

© 2016 Microsoft