C H A P T E R 3 |
Customizing dbx |
This chapter describes the dbx environment variables you can use to customize certain attributes of your debugging environment, and how to use the initialization file, .dbxrc, to preserve your changes and adjustments from session to session.
This chapter is organized into the following sections:
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. If you customize dbx from the command line while you are debugging, those settings apply only to the current debugging session.
Note - A .dbxrc file should not contain commands that execute your code. However, you can put such commands in a file, and then use the dbx source command to execute the commands in that file. |
During startup, the search order is:
1. Installation directory (unless you specify the -S option to the dbx command) install-directory/SUNWspro/lib/dbxrc. The default install-directory is /opt. If your Sun Studio 8 software is not installed in /opt, dbx derives the path to the .dbxrc file from the path to the dbx executable.
3. Home directory $HOME/.dbxrc
To create a .dbxrc file that contains common customizations and aliases, type in the command pane:
You can then customize the resulting file by using your text editor to uncomment the entries you want to have executed.
The first line changes the default setting for the case sensitivity control:
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.
You can use the dbxenv command to set the dbx environment variables that customize your dbx sessions.
To display the value of a specific variable, type:
To show all variables and their values, type:
To set the value of a variable, type:
TABLE 3-1 shows all of the dbx environment variables that you can set:
Lets you specify to dbx a path for Java class files that are loaded by custom class loaders |
|
Controls whether dbx uses pathmap settings to locate the correct libraries for a "mismatched" core file. Default: off. |
|
SPARC platform: Sets the version of dbx's built-in disassembler for SPARC V8, V9, or V9 with the Visual Instruction set. Default is autodetect, which sets the mode dynamically depending on the type of the machine a.out is running on. |
|
Governs the printing of compilation line during a fix. Default: off |
|
When following a child, inherits or does not inherit breakpoints. Default: off |
|
Determines which process is followed after a fork; that is, when the current process executes a fork, vfork, or fork1. If set to parent, the process follows the parent. If set to child, it follows the child. If set to both, it follows the child, but the parent process remains active. If set to ask, you are asked which process to follow whenever a fork is detected. Default: parent. |
|
Of relevance after a fork has been detected if follow_fork_mode was set to ask, and you chose stop. By setting this variable, you need not use cont -follow. |
|
If set to autodetect, dbx automatically selects case sensitivity based on the language of the file: false for Fortran files, otherwise true. If true, case matters in variable and function names; otherwise, case is not significant. |
|
Specifies the directories in which dbx should look for Java source files. |
|
Stores the current dbx mode. It can have the following settings: java, jni, or native. |
|
The jvm_invocation environment variable lets you customize the way the JVM software is started. (The terms "Java virtual machine" and "JVM" mean a virtual machine for the Java platform.) For more information, see Customizing Startup of the JVM Software. |
|
Governs the language used for parsing and evaluating expressions.
|
|
When enabled, dbx will be more conservative in its resource usage and will be able to debug processes with upwards of 300 LWPs. The down side is significant slowdown. Default: off. |
|
Default base for printing integer constants. Default: automatic (pointers in hexadecimal characters, all else in decimal). |
|
Used to cause a class member to be prefixed with classname(s) when its value or declaration is printed. If set to on, it causes the class member to be prefixed. Default: on. |
|
When set to on, -d is the default for printing, displaying, and inspecting. Default: off. |
|
When set to on, -r is the default for printing, displaying, and inspecting. Default: off. |
|
Governs the default number of lines to print in the list command. Default: 10. |
|
Sets number of characters printed for char *s. Default: 512. |
|
Sets -p as the default for printing, displaying, and inspecting. Default: off. |
|
For C++, if set to on, does automatic function overload resolution. Default: on. |
|
For C++, if set to on, does automatic operator overload resolution. Default: on. |
|
If set to on, automatically calls appropriate destructors for locals when popping a frame. Default: on. |
|
If set to on, keeps dbx from attaching to a process if another tool is already attached. Warning: be aware that if more than one tool attaches to a process and tries to control it chaos ensues. Default: on. |
|
Logs errors to rtc_error_log_file_name and continue. Default: off. |
|
If set to on, an RTC error at a given location is reported only once. Default: off. |
|
Used when memory use checking is on explicitly or via check -all. If the value is on, a non-verbose memory use (blocks in use) report is produced at program exit. If the value is verbose, a verbose memory use report is produced at program exit. The value off causes no output. Default: on. |
|
Name of file to which RTC errors are logged if rtc_auto_continue is set. Default: |
|
If set to on, stack traces show frames corresponding to RTC internal mechanisms. Default: off. |
|
If set to on, enables runtime checking on child processes that are executed from the debugged program and causes LD_PRELOAD to be inherited. Default: off. |
|
Used when memory leak checking is on. If the value is on, a non-verbose memory leak report is produced at program exit. If the value is verbose, a verbose memory leak report is produced at program exit. The value off causes no output. Default: on. |
|
If set to on with no active program, step, next, stepi, and nexti implicitly run the program and stop at the language-dependent main routine. If set to on, cont implies run when necessary. |
|
Governs whether the user program's input/output is redirected to dbx's stdio or a specific pty. The pty is provided by run_pty. Default: stdio. |
|
Sets the name of the pty to use when run_io is set to pty. Ptys are used by graphical user interface wrappers. |
|
If set to on, no symbolic information is loaded. The symbolic information can be loaded on demand using prog -readsysms. Until then, dbx behaves as if the program being debugged is stripped. Default: off. |
|
Multiplexes tty settings, process group, and keyboard settings (if -kbd was used on the command line) between dbx and the program being debugged. Useful when debugging editors and shells. Set to on if dbx gets SIGTTIN or SIGTTOU and pops back into the shell. Set to off to gain a slight speed advantage. The setting is irrelevant if dbx is attached to the program being debugged or is running under the dbx Debugger. Default: on. |
|
If set to on, when a program is run, setpgrp(2)is called right after the fork. Default: off. |
|
If set to on, enumerators are put in global scope and not in file scope. Set before debugging information is processed (~/.dbxrc). Default: off. |
|
If set to on, finds file static symbols, in scopes other than the current scope. Default: on. |
|
Name of the file where dbx logs all commands and their output. Output is appended to the file. Default: "" (no session logging). |
|
When set to on, dbx attempts to find and automatically make active the first stack frame with source when the program being debugged comes to a stop in a function that is not compiled with -g. |
|
Governs the printing of arguments and line information in where. Default: on. |
|
When set to on, allows breakpoints while using step and next commands to step through code. Default: off. |
|
Controls granularity of source line stepping. When set to statement the following code: takes the two next commands to execute. When set to line a single next command executes the code. The granularity of line is particularly useful when dealing with multiline macros. Default: statement. |
|
Sets the release level below which the startup message is not printed. Default: 3.01. |
|
When set to on, reads debugging information for each include file only once. Default: on. |
|
Sets the speed of tracing execution. Value is the number of seconds to pause between steps. |
Each dbx environment variable is also accessible as a ksh variable. The name of the ksh variable is derived from the dbx environment variable by prefixing it with DBX_. For example dbxenv stack_verbose and echo $DBX_stack_verbose yield the same output. You can assign the value of the variable directly or with the dbxenv command.
Copyright © 2004, Sun Microsystems, Inc. All rights reserved.