Debugging a Program With dbx

dbx Start-up Sequence

Upon invocation, dbx looks for and reads the installation startup file, dbxrc in the directory install-directory/lib, where the default install-directory is /opt.

Next, dbx searches for the startup file .dbxrc in the current directory, then in $HOME. If the file is not found, it searches for the startup file .dbxinit in the current directory, then in $HOME. Generally, the contents of .dbxrc and .dbxinit files are the same with one major exception. In the .dbxinit file, the alias command is defined to be dalias and not the normal default, which is kalias, the alias command for the Korn shell. A different startup file may be given explicitly with the -s command-line option.

A startup file may contain any dbx command, and commonly contains alias, dbxenv, pathmap, and Korn shell function definitions. However, certain commands require that a program has been loaded or a process has been attached to. All startup files are loaded in before the program or process is loaded. The startup file may also source other files using the source or .(period) command. The startup file is also used to set other dbx options.

As dbx loads program information, it prints a series of messages, such as Reading symbolic information...

Once the program is finished loading, dbx is in a ready state, visiting the "main" block of the program (For C, C++, or Fortran 90: main(); for FORTRAN 77: MAIN()). Typically, you want to set a breakpoint and then issue a run command, such as stop in main and run for a C program.


Note -

By default, the loading of debugging information for modules compiled with -xs is delayed in the same way as the debugging information stored in .o files. The dbx environment variable delay_xs lets you turn off the delayed loading of debugging information for modules compiled with -xs and have this information loaded at dbx startup (see "Debugging Without the Presence of .o Files").