Controlling Program Execution
Knowing what is going on and where you program is executing is straight-forward in a serial debugging environment. Your program is either stopped or running. When it is running, an event such as arriving at a breakpoint can occur. This event tells the debugger to stop the program. Sometime later, you will tell the serial program to continue executing. Multiprocess and multithreaded programs are much complicated. Each thread and each process has its own execution state. When a thread (or set of threads) triggers a breakpoint, TotalView must decide what it should do about the other threads and processes. Some may stop; some may continue to run.
Advancing Program Execution
Debugging begins by entering a dload or dattach command. If you use the dload command, you must use the drun command to start the program executing. These three commands work at process level and cannot be used to start an individual threads. (This is also true for the dkill command.)
To advance program execution, you enter a command that causes one or more threads to execute instructions. The commands are applied to a P/T set. Because the set does not have to include all processes and threads, you can cause some processes to be executed while holding others back. You can also advance program execution by increments, stepping the program forward, and you can define the size of the increment.
Typically, debugging a program means that you have the program run, and then you stop it and examine its state. In this sense, a debugger can be thought of as tool that allows you to alter a program's state in a controlled way. And, debugging is the process of stopping the process to examine its state. However, the term "stop" has a slightly different meaning in a multiprocess, multithreaded program; in these programs, stopping means that the CLI holds one or more threads at a location until you enter a command that tells them to start executing again.