Debugging a Program With dbx

Using the .dbxrc File

The dbx initialization file, .dbxrc, stores dbx commands that are executed each time you start dbx. Typically, the file contains commands that customize your debugging environment, but you can place any dbx commands in the file. Remember, if you customize dbx from the command line while you are debugging, those settings apply only to the current debugging session.

During startup, dbx searches for .dbxrc first. The search order is:

  1. Current directory ./.dbxrc

  2. Home directory $HOME/.dbxrc

If .dbxrc is not found, dbx prints a warning message and searches for .dbxinit (dbx mode).

The search order is:

  1. Current directory ./.dbxinit

  2. Home directory $HOME/.dbxinit

Creating a .dbxrc File

To suppress the warning message and create a .dbxrc file that contains common customizations and aliases, type in the command pane:

 help .dbxrc>$HOME/.dbxrc

You can then customize the resulting file by using your text editor to uncomment the entries you wish to have executed.

A Sample Initialization File

Here is a sample .dbxrc file:


dbxenv case input_case_sensitive false
catch FPE

The first line changes the default setting for the case sensitivity control. dbxenv refers to the set of debugging environment attributes. input_case_sensitive refers to the matching control. false is the control setting.

The next line is a debugging command, catch, which adds a system signal, FPE to the default list of signals to which dbx responds, stopping the program.