Debugging a Program With dbx

Basic Concepts

Event management is based on the concept of a handler. The name comes from an analogy with hardware interrupt handlers. Each event management command typically creates a handler, which consists of an event specification and a series of side-effect actions.

An example of the association of a program event with a dbx action is setting a breakpoint on a particular line.

The most generic form of creating a handler is through the when command:


when event-specification
 {action;
... }

Although all event management can be performed through when, dbx has historically had many other commands, which are still retained, either for backward compatibility, or because they are simpler and easier to use.

In many places examples are given on how a command (like stop, step, or ignore) can be written in terms of when. These examples are meant to illustrate the flexibility of when and the underlying handler mechanism, but they are not always exact replacements.