The following read-only predefined variables represent the current state of dbx. They are always valid. They follow the current LWP or thread.
$pc | Current program counter accress in hexadecimal |
$ins | Disassembly of the current instruction |
$lineno | Current line number in decimal |
$vlineno | Current `visiting' line number in decimal |
$line | Contents of the current line |
$func | Name of the current function |
$vfunc | Name of the current `visiting' function |
$class | Name of the class to which $func belongs |
$vclass | Name of the class to which $vfunc belongs |
$file | Name of the current file |
$vfile | Name of the current file being visited |
$loadobj | Name of the loadable object being visited |
$vloadob | ... |
$scope | The scope of the current PC in back-quote notation |
$vscope | ... |
$funcaddr | Address of $func in hexadecimal |
$caller | Name of the function calling $func |
$newhandlerid | Event ID of the handler most recently created |
$firedhandlers | List of handler ids that caused the most recent stoppage. The handlers on this list are marked with a `*' in the output of the status command. |
$proc | The process ID of the current process being debugged |
$lwp | LWP ID of the current LWP (multithreaded programs only) |
$thread | Thread ID of the current thread (multithread programs only) |
$prog | Full path name of the loaded program |
$oprog | Previous value of $prog. Very useful after follow-exec, when $prog reverts to "-". |
$dllist | List of all load objects last opened with dlopen () or closed with dlclose (). |
$exception | Pointer to the current C++ exception, or 0 if none |
$exitcode | Exit status from the last run of the program. This value is an empty string if the process hasn't actually exited. |
$machtype | If a program is loaded, $machtype returns its machine type: sparcv8 sparcv8+ sparcv9 intel. Otherwise it returns 'unknown' |
$datamodel | If a program is loaded, $datamodel returns its data model: ilp32 lp64. Otherwise it returns `unknown.' To find the model of the program you've just loaded, use the following in your .dbxrc file: when prog_new -perm { echo machine: $machtype $datamodel; } |
The following are valid only within the body of a when Command:
$handlerid | During the execution of the body $handlerid is the ID of the when command to which the body belongs. |
$booting | Is set to `true' if the event occurs during the "boot" process. Whenever a new program is debugged, it is first booted so that the list and location of shared libraries can be ascertained. The process is then killed. While booting happens "behind the users back", contributing to the "Reading symbolic information for libc.so.1" messages, all events are still available. Use this variable to distinguish, for example, the sync and the syncrtld events occuring during execution started with a debug command and the ones occurring during exeuction started with a run Command. |
The following are only valid within the body of a when Command and are event specific.
For event signals:
$sig | Signal number that caused the event |
$sigstr | Name of $sig |
$sigcode | Subcode of $sig if applicable |
$sigcodestr | Name of $sigcode |
$sigsender | Pid of sender of the signal if relevant, 0 otherwise |
For event exit:
$exitcode | Argument passed to exit(). This value is also valid outside the body of a when Command. See above. |
For event access:
$watchaddr | The address being written to, read from or executed. |
$watchmode | One of "rwx" for read, write or execute followed by one of "ab" for after or before. |
For events sysin and sysout:
syscode | $system call code |
$sysname | system call name as defined in <sys/syscall.h> |
For events dlopen and dlclose (only if a param was provided):
$dlobj | loadobject that cause the event |
For event proc_gone:
$reason | Reason the process went away. Can be signal, exit Command, kill Command, or detach Command |