Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Command Reference

This appendix provides detailed syntax and functional descriptions of all of the dbx commands.

assign Command

In native mode, the assign command assigns a new value to a program variable. In Java mode, the assign command assigns a new value to a local variable or parameter.

Native Mode Syntax

assign variable = expression

where:

expression is the value to be assigned to variable.

Java Mode Syntax

assign identifier = expression

where:

expression is a valid Java expression, which can include any of the following:

  • class-name is the name of a Java class. You can use either of the following:

    • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

    • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

  • field-name is the name of a field in the class.

  • identifier is a local variable or parameter, including this, the current class instance variable (object-name.field-name) or a class (static) variable (class-name.field-name).

  • object-name is the name of a Java object.

attach Command

The attach command attaches dbx to a running process, stopping execution and putting the program under debugging control. It has identical syntax and identical functionality in native mode and Java mode.

Syntax

attach process-ID

Begin debugging the program with process ID process-ID. dbx finds the program using /proc.

attach -p process-ID program-name

Begin debugging program-name with process ID process-ID.

attach program-name process-ID

Begin debugging program-name with process ID process-ID. program-name can be ‐. dbx finds it using /proc.

attach -r ...

The -r option causes dbx to retain all watch commands, display commands, when commands, and stop commands. With no -r option, an implicit delete all command and undisplay 0 command are performed.

where:

process-ID is the process ID of a running process.

program-name is the path name of the running program.

For information on how to attach dbx to a running Java process, see Attaching dbx to a Running Java Application.

bsearch Command

The bsearch command searches backward in the current source file. It is valid only in native mode.

Syntax

bsearch string

Search backward for string in the current file.

bsearch

Repeat search, using the last search string.

where:

string is a character string.

call Command

In native mode, the call command calls a procedure. In Java mode, the call command calls a method.

You can also use the call command to call a function. To display the return value use the print command.

Occasionally the called function hits a breakpoint. You can choose to continue using the cont command or abort the call by using pop -c. The latter method is useful also if the called function causes a segmentation fault.

Native Mode Syntax

call procedure ([parameters]) [–lang language] [–resumeone] [–m] [+m]

where:

language is the language of the called procedure.

procedure is the name of the procedure.

parameters are the procedure’s parameters.

–lang specifies the language of the called procedure and tells dbx to use the calling conventions of the specified language. This option is useful when the procedure being called was compiled without debugging information and dbx does not know how to pass parameters.

–resumeone resumes only one thread when the procedure is called. For more information, see Resuming Execution.

–m specifies that macro expansion be applied to the procedure and parameters when the dbxenv variable macro_expand is set to off.

+m specifies that macro expansion be skipped when the dbxenv variable macro_expand is set to on.

Java Mode Syntax

call [class-name.|object-name.] method-name ([parameters])

where:

class-name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

object-name is the name of a Java object.

method-name is the name of a Java method.

parameters are the method’s parameters.

cancel Command

The cancel command cancels the current signal. It is primarily used within the body of a when command (see when Command). It is valid only in native mode.

Signals are normally cancelled when dbx stops because of a signal. If a when command is attached to a signal event, the signal is not automatically cancelled. The cancel command can be used to explicitly cancel the signal.

catch Command

The catch command catches the given signals. It is valid only in native mode.

Catching a given signal causes dbx to stop the program when the process receives that signal. If you continue the program at that point, the signal is not processed by the program.

Syntax

catch

Print a list of the caught signals.

catch number number ...

Catch signals numbered number.

catch signal signal ...

Catch signals named by signal. SIGKILL cannot be caught or ignored.

catch $(ignore)

Catch all signals.

where:

number is the number of a signal.

signal is the name of a signal.

check Command

The check command enables checking of memory access, leaks, or usage and prints the current status of runtime checking (RTC). It is valid only in native mode.

The features of runtime checking that are enabled by this command are reset to their initial state by the debug command.

Syntax

This section provides information about the options for the check command.

check [functions] [files] [loadobjects]

Equivalent to check –all; suppress all; unsuppress all in functions, files, and loadobjects

where:

functions is one or more function names.

files is one or more file names.

loadobjects is one or more load object names.

You can use this to focus runtime checking on places of interest.


Note -  To detect all errors, RTC does not require the program be compiled with –g. However, symbolic ( –g) information is sometimes needed to guarantee the correctness of certain errors (mostly read from uninitialized memory). For this reason certain errors (rui for a.out and rui + aib + air for shared libraries) are suppressed if no symbolic information is available. This behavior can be changed by using suppress and unsuppress.

–access Option

The –access option enables checking. RTC reports the following errors:

baf

Bad free

duf

Duplicate free

maf

Misaligned free

mar

Misaligned read

maw

Misaligned write

oom

Out of memory

rob

Read from array out-of-bounds memory

rua

Read from unallocated memory

rui

Read from uninitialized memory

wob

Write to array out-of-bounds memory

wro

Write to read-only memory

wua

Write to unallocated memory

The default behavior is to stop the process after detecting each access error, which can be changed using the rtc_auto_continue dbxenv variable. When set to on, access errors are logged to a file. The log file name is controlled by the dbxenv variable rtc_error_log_file_name.

By default, each unique access error is only reported the first time it happens. You can change this behavior using the dbxenv variable rtc_auto_suppress. The default setting of this variable is on.

–leaks Option

The syntax for the leaks option is:

check –leaks [–frames n] [–match m]

Enable leak checking. RTC reports the following errors:

aib

Possible memory leak – The only pointer points in the middle of the block

air

Possible memory leak – Pointer to the block exists only in register

mel

Memory leak – No pointers to the block

With leak checking enabled, an automatic leak report is generated when the program exits. All leaks including possible leaks are reported at that time. By default, a non-verbose report is generated, which can be changed through the dbxenv variable rtc_mel_at_exit. However, you can ask for a leak report at any time (see showleaks Command).

–frames n implies that up to n distinct stack frames are displayed when reporting leaks. –match m is used for combining leaks; if the call stack at the time of allocation for two or more leaks matches n frames, then these leaks are reported in a single combined leak report.

The default value of n is 8 or the value of m (whichever is larger). Maximum value of n is 16. The default value of m is 8.

–memuse Option

The syntax for the –memuse option is:

check –memuse [–frames n] [–match m]

The –memuse option behaves similarly to the –leaks option and also enables a blocks-in-use report (biu) when the program exits. By default, a non-verbose blocks in use report is generated, which can be changed through the dbxenv variable rtc_biu_at_exit. At any time during program execution you can see where the memory in your program has been allocated (see showmemuse Command).

–frames n implies that up to n distinct stack frames will be displayed while reporting memory use and leaks. Use –match m to combine these reports. If the call stack at the time of allocation for two or more leaks matches m frames, then these leaks are reported in a single combined memory leak report.

The default value of n is 8 or the value of m, whichever is larger. The maximum value of n is 16. The default value of m is 8.

–all Option

The syntax for the –all option is:

check –all [–frames n] [–match m]

Equivalent to:

check –access and check –memuse [–frames n] [–match m]

The value of the dbxenv variable rtc_biu_at_exit is not changed with check –all, so by default no memory use report is generated at exit. See dbx Command for the description of the rtc_biu_at_exit environment variable.

clear Command

The clear command clears breakpoints. It is valid only in native mode.

Event handlers created using the stop command, trace command, or when command with the inclass argument, inmethod argument, infile argument, or infunction argument create sets of breakpoints. If the line you specify in the clear command matches one of these breakpoints, only that breakpoint is cleared. Once cleared in this manner, an individual breakpoint belonging to a set cannot be enabled again. However, disabling and then enabling the relevant event handler re-establishes all the breakpoints.

Syntax

clear [filename: line]

where:

line is the number of a source code line, such that all breakpoints are cleared at the specified line

filename is the name of a source code file, such that all breakpoints at line line are cleared in the specified file.

If no file or line is specified, all breakpoints are cleared at the current stopping point.

collector Command

The collector command collects performance data for analysis by the Performance Analyzer. It is valid only in native mode.

This section lists the collector commands and provides details about them.

Syntax

collector archive options

Specify the mode for archiving an experiment when it terminates.

collector dbxsample options

Control the collection of samples when dbx stops the target process.

collector disable

Stop data collection and close the current experiment.

collector enable

Enable the collector and open a new experiment .

collector heaptrace options

Enable or disable collection of heap tracing data.

collector hwprofile options

Specify hardware counter profiling settings.

collector limit options

Limit the amount of profiling data recorded.

collector pause

Stop collecting performance data but leave experiment open.

collector profile options

Specify settings for collecting callstack profiling data.

collector resume

Start performance data collection after pause.

collector sample options

Specify sampling settings.

collector show options

Show current collector settings.

collector status

Inquire status about current experiment.

collector store options

Experiment file control and settings.

collector synctrace options

Specify settings for collecting thread synchronization wait tracing data.

collector tha options

Specify settings for collecting thread analyzer data.

collector version

Report the version of libcollector.so that would be used to collect data.

where:

To start collecting data, type collector enable.

To stop data collection, type collector disable.

collector archive Command

The collector archive command specifies the archiving mode to be used when the experiment terminates.

Syntax

collector archive on|off|copy

By default, normal archiving is used. For no archiving, specify off. To copy load objects into the experiment for portability, specify copy.

collector dbxsample Command

The collector dbxsample command specifies whether to record a sample when the process is stopped by dbx.

Syntax

collector dbxsample on|off

By default, a sample is collected when the process is stopped by dbx. To indicate not to collect a sample at this time, specify off.

collector disable Command

The collector disable command causes the data collection to stop and the current experiment to be closed.

collector enable Command

The collector enable command enables the collector and opens a new experiment.

collector heaptrace Command

The collector heaptrace command specifies options for collecting heap tracing (memory allocation) data.

Syntax

collector heaptrace on|off

By default, heap tracing data is not collected. To collect this data, specify on.

collector hwprofile Command

The collector hwprofile command specifies options for collecting hardware-counter overflow profiling data.

Syntax

collector hwprofile on|off

By default, hardware-counter overflow profile data is not collected. To collect this data, specify on.

collector hwprofile list

Print out the list of available counters.

collector hwprofile counter on|hi|high|lo|low|off

By default, hardware-counter overflow profile data is not collected. To collect this data, specify on. You can set the resolution of the counters to high or low. If you do not specify a resolution, it is set to normal. These options are similar to the collect command options. See the collect(1) man page for more information.

collector hwprofile addcounter on|off

Add additional counters for hardware counter overflow profiles.

collector hwprofile counter name interval [name2 interval2]

Specify hardware counter names and intervals.

where:

name is the name of a hardware counter.

interval is the collection interval in milliseconds.

name2 is the name of a second hardware counter.

interval2 is the collection interval in milliseconds.

Hardware counters are system-specific, so the choice of counters available depends on the system you are using. Many systems do not support hardware-counter overflow profiling. On these machines, the feature is disabled.

collector limit Command

The collector limit command specifies the experiment file size limit.

Syntax

collector limit value | unlimited | none

where:

value, in megabytes, limits the amount of profiling data recorded and must be a positive number. When the limit is reached, no more profiling data is recorded but the experiment remains open and sample points continue to be recorded. By default, there is no limit on the amount of data recorded.

If you have set a limit, specify unlimited or none to remove the limit.

collector pause Command

The collector pause command causes the data collection to stop but leaves the current experiment open. Sample points are not recorded while the Collector is paused. A sample is generated prior to a pause, and another sample is generated immediately following a resume. Data collection can be resumed with the collector resume command.

collector profile Command

The collector profile command specifies options for collecting profile data.

Syntax

collector profile on|off

Specify the profile data collection mode.

collector profile timer interval

Specify profile timer period, fixed or floating point, with an optional trailing m for milliseconds or u for microseconds.

collector resume Command

The collector resume command causes the data collection to resume after a pause created by the collector pause command (see collector pause Command).

collector sample Command

The collector sample command specifies the sampling mode and the sampling interval.

Syntax

collector sample periodic|manual

Specify sampling mode.

collector sample period seconds

Specify sampling interval in seconds.

collector sample record [name]

Record a sample with an optional name.

where:

seconds is the length of the sampling interval.

name is the name of the sample.

collector show Command

The collector show command shows the settings of one or more categories of options.

Syntax

collector show

Show all settings

collector show all

Show all settings

collector show archive

Show archive setting

collector show profile

Show call stack profiling settings

collector show synctrace

Show thread synchronization wait tracing settings

collector show hwprofile

Show hardware counter data settings

collector show heaptrace

Show heap tracing data settings

collector show limit

Show experiment size limits

collector show sample

Show sample settings

collector show store

Show store settings

collector show tha

Show thread analyzer data settings

collector status Command

The collector status command inquires about the status of the current experiment. It returns the working directory and the experiment name.

collector store Command

The collector store command specifies the directory and file name where an experiment is stored.

Syntax

collector store {–directory pathname | –filename filename | –group string}

where:

pathname is the pathname of the directory where an experiment is to be stored.

filename is the name of the experiment file.

string is the name of an experiment group.

collector synctrace Command

The collector synctrace command specifies options for collecting synchronization wait tracing data.

Syntax

collector synctrace on|off

By default, thread synchronization wait tracing data is not collected. To collect this data, specify on.

collector synctrace threshold {microseconds| calibrate}

Specify threshold in microseconds. The default value is 1000. If calibrate is specified, the threshold value will be calculated automatically.

where:

microseconds is the threshold below which synchronization wait events are discarded.

collector tha Command

The collector tha command specifies options for collecting thread analyzer data.

Syntax

collector tha on|off

By default, thread analyzer data is not collected. To collect this data, specify on.

collector version Command

The collector version command reports the version of libcollector.so that would be used to collect data.

Syntax

collector version

cont Command

The cont command causes the process to continue execution. It has identical syntax and identical functionality in native mode and Java mode.

Syntax

cont

Continue execution. In a multithreaded process, all threads are resumed. Use Control-C to stop executing the program.

cont ... –sig signal

Continue execution with signal signal.

cont ... ID

The id specifies which thread or LWP to continue.

cont at line [ID]

Continue execution at line line. ID is required if the application is multithreaded.

cont ... –follow parent|child|both

If the dbx follow_fork_mode environment variable is set to ask and you have chosen stop, use this option to choose which process to follow. both is only applicable in the Oracle Solaris Studio DE.

dalias Command

The dalias command defines a dbx-style (csh-style) alias. It is valid only in native mode.

Syntax

dalias [name [definition]]

(dbx alias) List all currently defined aliases.

If a name is specified, list the definition, if any, of alias name.

If a definition is also specified, define name to be an alias for definition. definition can contain white space. A semicolon or newline terminates the definition.

where:

name is the name of an alias

definition is the definition of an alias.

dbx accepts the following csh history substitution meta-syntax, which is commonly used in aliases:

!:<n>

!-<n>

!^

!$

!*

The ! usually needs to be preceded by a backslash. For example:

dalias goto "stop at \!:1; cont; clear"

For more information, see the csh(1) man page.

dbx Command

The dbx command starts dbx.

Native Mode Syntax

dbx options program-name [core | process-ID]

Debug program-name.

If core is specified, debug program-name with corefile core.

If process-ID is specified, debug program-name with process ID process-ID.

dbx options - {process-ID|core}

If process ID is specified, debug process ID process-ID; dbx finds the program using /proc.

If core is specified, debug with corefile core.

dbx options - core

Debug using corefile core.

dbx options –r program-name arguments

Run program-name with arguments arguments. If abnormal termination, start debugging program-name, else just exit.

where:

program-name is the name of the program to be debugged.

process-ID is the process ID of a running process.

arguments are the arguments to be passed to the program.

options are the options listed in Options.

Java Mode Syntax

dbx options program-name{.class | .jar}

Debug program-name.

dbx options program-name{.class | .jar} process-ID

Debug program-name with process ID process ID.

dbx options - process-ID

Debug process ID process ID; dbx finds the program using /proc.

dbx options { –r | –a} program-name{.class | .jar} arguments

Run program-name with arguments arguments. If abnormal termination, start debugging program-name, else, just exit.

where:

program-name is the name of the program to be debugged.

process-id is the process ID of a running process.

arguments are the arguments to be passed to the program (not to the JVM software).

options are the options listed in Options.

Options

The following table lists the options of the dbx command for both native mode and Java mode :

–-a arguments
Load program with program arguments arguments.
–-B
Suppress all messages; return with exit code of program being debugged.
-c commands
Execute commands before prompting for input.
-C
Preload the Runtime Checking library (see check Command).
-d
Used with -s, removes file after reading.
-e
Echo input commands.
-f
Force loading of core file, even if it does not match.
-h
Print the usage help on dbx.
-I dir
Add dir to pathmap set (see pathmap Command).
-k
Save and restore keyboard translation state.
-q
Suppress messages about reading stabs.
-r
Run program; if program exits normally, exit.
-R
Print the README file on dbx.
-s file
Use file instead of /current-dir/.dbxrc or $HOME/.dbxrc as the startup file
-S
Suppress reading of initialization file /install-dir/lib/dbxrc.
-V
Print the version of dbx.
-w n
Skip n frames on where command.
-x exec32
Run the 32-bit dbx binary instead of the 64-bit dbx binary that runs by default on systems running a 64-bit OS.
--
Marks the end of the option list; use this if the program name starts with a dash.

dbxenv Command

The dbxenv command is used to list or set dbxenv variables. It has the same syntax and functionality in native mode and Java mode.

Syntax

dbxenv [environment-variable setting]

Display the current settings of the dbxenv variables. If a dbxenv variable is specified, set the dbxenv variable to setting.

where:

environment-variable is a dbxenv variable.

setting is a valid setting for that variable.

debug Command

The debug command lists or changes the program being debugged. In native mode, it loads the specified application and begins debugging the application. In Java mode, it loads the specified Java application, checks for the existence of the class file, and begins debugging the application.

Native Mode Syntax

debug

Print the name and arguments of the program being debugged.

debug program-name

Begin debugging program-name with no process or core.

debug -c core program-name

Begin debugging program-name with core file core.

debug -p process-ID program-name

Begin debugging program-name with process ID process-ID.

debug program-name core

Begin debugging program with core file core. program-name can be -. dbx will attempt to extract the name of the executable from the core file. For details, see Debugging a Core File.

debug program-name process-ID

Begin debugging program-name with process ID process-ID. program-name can be -; dbx finds it using /proc.

debug -f ...

Force loading of a core file, even if it does not match.

debug -r ...

The –r option causes dbx to retain all display, trace, when, and stop commands. With no –r option, an implicit delete all and undisplay O are performed.

debug -clone ...

The –clone option causes another dbx process to begin execution, permitting debugging of more than one process at a time. Valid only if running in the Oracle Solaris Studio IDE.

debug -clone

Starts another dbx process debugging nothing. Valid only if running in the Oracle Solaris Studio IDE.

debug [options] -- program-name

Start debugging program-name even if program-name begins with a dash.

where:

core is the name of a core file.

options are the options listed inOptions.

process-ID is the process ID of a running process.

program-name is the path name of the program.

Leaks checking and access checking are disabled when a program is loaded with the debug command. You can enable them with the check command.

Java Mode Syntax

debug

Print the name and arguments of the program being debugged.

debug program-name [.class | .jar]

Begin debugging program-name with no process.

debug -p process-ID program-name [.class | .jar]

Begin debugging program-name with process ID process-ID.

debug program-name [.class | .jar] process-ID

Begin debugging program-name with process ID process-ID. program-name can be -; dbx finds it using /proc.

debug -r

The -r option causes dbx to retain all watch commands, display commands, trace commands, when commands, and stop commands. With no -r option, an implicit delete all command and undisplay 0 command are performed.

debug -clone ...

The -clone option causes another dbx process to begin execution, permitting debugging of more than one process at a time. Valid only if running in the Oracle Solaris Studio IDE.

debug -clone

Starts another dbx process debugging nothing. Valid only if running in the Oracle Solaris Studio DE.

debug [options] -- program-name{.class | .jar}

Start debugging program-name even if program-name begins with a dash.

where:

options are the options listed inOptions.

process-ID is the process ID of a running process.

program-name is the path name of the program.

Options

–c commands

Execute commands before prompting for input.

–d

Used with –s, removes

–e

Echo input commands.

–I directory_name

Add directory_name to pathmap set (see pathmap Command.

–k

Save and restore keyboard translation state.

–q

Suppress messages about reading stabs.

–r

Run program; if program exits normally, then exit.

–R

Print the readme file for dbx.

–s file

Use file instead of current_directory/.dbxrc or $HOME/.dbxrc as the startup file

–S

Suppress reading of initialization file /install-dir/lib/dbxrc.

–V

Print the version of dbx.

–w n

Skip n frames on where command.

–-

Marks the end of the option list; use this if the program name starts with a dash.

delete Command

The delete command deletes breakpoints and other events. It has the same syntax and functionality in native mode and Java mode.

Syntax

delete [-h] handler-ID ...

Remove trace commands, when commands, or stop commands of given handler-IDs. To remove hidden handlers, you must include the –h option.

delete [-h] O | all | -all

Remove all trace commands, when commands, and stop commands excluding permanent and hidden handlers. Specifying –h removes hidden handlers as well.

delete -temp

Remove all temporary handlers.

delete $firedhandlers

Delete all the handlers that caused the latest stoppage.

where:

handler-ID is the identifier of a handler.

detach Command

The detach command releases the target process from dbx’s control.

Native Mode Syntax

detach [–sig signal | –stop]

Detach dbx from the target, and cancel any pending signals.

If the –sig option is specified, detach while forwarding the given signal.

If the –stop option is specified, detach dbx from the target and leave the process in a stopped state. This option allows temporary application of other/proc-based debugging tools that might be blocked due to exclusive access. For an example, Detaching dbx From a Process.

where:

signal is the name of a signal.

Java Mode Syntax

detach

Detach dbx from the target, and cancel any pending signals.

dis Command

The dis command disassembles machine instructions. It is valid only in native mode.

Syntax

dis [ –a ] address [/count]

Disassemble count instructions (default is 10), starting at address address.

dis address1, address2

Disassemble instructions from address1 through address2.

dis

Disassemble 10 instructions, starting at the value of +.

where:

address is the address at which to start disassembling. The default value of address is the address after the last address previously assembled. This value is shared by the examine command.

address1 is the address at which to start disassembling.

address2 is the address at which to stop disassembling.

count is the number of instructions to disassemble. The default value of count is 10.

Options

–a

When used with a function address, disassembles the entire function. When used without parameters, disassembles the remains of the current visiting function, if any.

display Command

In native mode, the display command re-evaluates and prints expressions at every stopping point. In Java mode, the display command evaluates and prints expressions, local variables, or parameters at every stopping point. Object references are expanded to one level and arrays are printed itemwise.

The expression is parsed for the current scope at the time you type the command and reevaluated at every stopping point. Because the expression is parsed at entry time, the correctness of the expression can be immediately verified.

If you are running dbx in the IDE or dbxtool in the Sun Studio 12 release, the Sun Studio 12 Update 1 release, the Oracle Solaris Studio 12.2 release, or later updated releases, the display expression command effectively behaves like a watch $(which expression) command.

Native Mode Syntax

display

Print the list of expressions being displayed.

display expression, ...

Display the value of expressions expression, ... at every stopping point. Because expression is parsed at entry time, the correctness of the expression is immediately verified.

display [-r|+r|-d|+d|-S|+S|-p|+p|-L|-fformat|-Fformat|-m|+m|--] expression, ...

See print Command for the meaning of these flags.

where:

expression is a valid expression.

format is the output format you want used to print the expression. For information on valid formats, see print Command.

Java Mode Syntax

display

Print the list of variables and parameters being displayed.

display expression|identifier, ...

Display the value of variables and parameters of identifier, ... at every stopping point.

display [-r|+r|-d|+d|-p|+p|-fformat|-Fformat|-Fformat|--] expression|identifier, ...

See print Command for the meaning of these flags.

where:

class-name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

expression is a valid Java expression.

field-name is the name of a field in the class.

format is the output format you want used to print the expression. For information about valid formats, see print Command.

identifier is a local variable or parameter, including this, the current class instance variable (object-name.field-name) or a class (static) variable (class-name.field-name).

object-name is the name of a Java object.

down Command

The down command moves down the call stack (away from main). It has the same syntax and functionality in native mode and Java mode.

Syntax

down

Move down the call stack one level.

down number

Move down the call stack number levels.

down -h [number]

Move down the call stack, but do not skip hidden frames.

where:

number is a number of call stack levels.

dump Command

The dump command prints all variables local to a procedure. It has the same syntax and functionality in native mode and Java mode.

Syntax

dump [procedure]

Print all variables local to the current procedure.

If a procedure is specified, print all variables local to procedure.

where:

procedure is the name of a procedure.

edit Command

The edit command invokes $EDITOR on a source file. It is valid only in native mode.

The edit command uses $EDITOR if dbx is not running in the Oracle Solaris Studio IDE. Otherwise, it sends a message to the IDE to display the appropriate file.

Syntax

edit [filename | procedure]

Edit the current file.

If a file name is specified, edit the specified file filename.

If a procedure is specified, edit the file containing function or procedure procedure.

where:

filename is the name of a file.

procedure is the name of a function or procedure.

examine Command

The examine command shows memory contents. It is valid only in native mode.

The x command is an alias for the examine command.

Syntax

examine [address] [ / [count] [format]]

Display the contents of memory starting at address for count items in format format.

examine address1, address2 [ / [format]]

Display the contents of memory from address1 through address2 inclusive, in format format.

examine address= [format]

Display the address (instead of the contents of the address) in the given format.

The address can be +, which indicates the address just after the last one previously displayed (the same as omitting it).

x is a predefined alias for examine.

where:

address is the address at which to start displaying memory contents. The default value of address is the address after the address whose contents were last displayed. This value is shared by the dis command.

address1 is the address at which to start displaying memory contents.

address2 is the address at which to stop displaying memory contents.

count is the number of addresses from which to display memory contents. The default value of count is 1.

format is the format in which to display the contents of memory addresses. The default format is X (hexadecimal) for the first examine command, and the format specified in the previous examine command for subsequent examine commands. The following values are valid for format:

o,O

octal (2 or 4 bytes)

x,X

hexadecimal (2 or 4 bytes)

b

octal (1 byte)

c

character

w

wide character

s

string

W

wide character string

f

hexadecimal and floating point (4 bytes, 6-digit precision)

F

hexadecimal and floating point (8 bytes, 14-digit precision )

g

same as F

E

hexadecimal and floating point (16 bytes, 14-digit precision)

ld,lD

decimal (4 bytes, same as D)

lo,lO

octal 94 bytes, same as O

lx,lX

hexadecimal (4 bytes, same as X)

Ld,LD

decimal (8 bytes)

Lo,LO

octal (8 bytes)

Lx,LX

hexadecimal (8 bytes)

exception Command

The exception command prints the value of the current C++ exception. It is valid only in native mode.

Syntax

exception [-d | +d]

Prints the value of the current C++ exception, if any.

where:

-d enables showing dynamic exceptions.

+d disables showing dynamic exceptions.

exists Command

The exists command checks for the existence of a symbol name. It is valid only in native mode.

Syntax

exists name

Returns 0 if name is found in the current program, 1 if name is not found.

where:

name is the name of a symbol.

file Command

The file command lists or changes the current file. It has the same syntax and functionality in native mode and in Java mode.

Syntax

filefilename

Print the name of the current file.

If a file name is specified, change the current file.

where:

filename is the name of a file.

files Command

In native mode, the files command lists file names that match a regular expression. In Java mode, the files command lists all of the Java source files known to dbx. If your Java source files are not in the same directory as the .class or .jar files, dbx might not find them unless you have set the $JAVASRCPATH environment variable. For more information, see Specifying the Location of Your Java Source Files.

Native Mode Syntax

files

List the names of all files that contributed debugging information to the current program (those that were compiled with –g).

files regular-expression

List the names of all files compiled with–g that match the given regular expression.

where:

regular-expression is a regular expression.

For example:

(dbx) files ^r
myprog:
retregs.cc
reg_sorts.cc
reg_errmsgs.cc
rhosts.cc

Java Mode Syntax

files

List the names of all of the Java source files known to dbx.

fix Command

The fix command recompiles modified source files and dynamically links the modified functions into the application. It is valid only in native mode. It is not valid on Linux platforms.

Syntax

fix [file-name file-name ...] [–options]

Fix the current file.

If file names are listed, fix files in list.

where:

–options are the following valid options.

–f

Force fixing the file, even if source has not been modified.

–a

Fix all modified files.

–g

Strip –O flags and add –g flag.

–c

Print compilation line (can include some options added internally for use by dbx).

–n

Do not execute compile/link commands (use with -v).

v

Verbose mode (overrides dbx fix_verbose environment variable setting).

+v

Non-verbose mode (overrides dbx fix_verbose environment variable setting).

fixed Command

The fixed command lists the names of all fixed files. It is valid only in native mode.

fortran_modules Command

The fortran_modules command lists the Fortran modules in the current program, or the functions or variables in one of the modules.

Syntax

fortran_modules [–f module-name | –v module-name]

Lists all Fortran modules in the current program.

If the –f option is specified, list all functions in the specified module.

If the –v option is specified, lists all variables in the specified module.

frame Command

The frame command lists or changes the current stack frame number. It has identical syntax and identical functionality in native mode and in Java mode.

Syntax

frame

Display the frame number of the current frame.

frame [-h] number

Set the current frame to frame number.

frame [-h] +[number]

Go number frames up the stack; default is 1.

frame [-h] -[number]

Go number frames down the stack; default is 1.

-h

Go to frame, even if frame is hidden.

where:

number is the number of a frame in the call stack.

func Command

In native mode, the func command lists or changes the current function. In Java mode, the func command lists or changes the current method.

Native Mode Syntax

func [procedure]

Print the name of the current function.

If a procedure is specified, change the current function to the function or procedure procedure.

where:

procedure is the name of a function or procedure.

Java Mode Syntax

func

Print the name of the current method.

func [class-name.]method-name [(parameters)]

Change the current function to the method method-name.

where:

class-name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

method-name is the name of a Java method.

parameters are the method’s parameters.

funcs Command

The funcs command lists all function names that match a regular expression. It is valid only in native mode.

Syntax

funcs [-f filename] [-g] [regular-expression]

List all functions in the current program,

If -f filename is specified, list all functions in the file. If -g is specified, list all functions with debugging information. If filename ends in .o, then all functions, including those created automatically by the compiler, are listed. Otherwise, only functions appearing in the source code are listed.

If regular-expression is specified, list all functions that match the regular expression.

where:

filename is the name of the file for which you wish to list all the functions.

regular-expression is the regular expression for which you wish to list all the matching functions.

For example:

(dbx) funcs [vs]print
”libc.so.1”isprint
”libc.so.1”wsprintf
”libc.so.1”sprintf
”libc.so.1”vprintf
”libc.so.1”vsprintf

gdb Command

The gdb command supports the GDB command set. It is valid only in native mode.

Syntax

gdb on | off

Use gbd on to enter the GDB command mode under which dbx understands and accepts GDB commands. To exit the GDB command mode and return to the dbx command mode, type gdb off. dbx commands are not accepted while in GDB command mode and GDB commands are not accepted while in dbx mode. All debugging settings such as breakpoints are preserved across different command modes.

    The following GDB commands are not supported in this release:

  • commands

  • define

  • handle

  • hbreak

  • interrupt

  • maintenance

  • printf

  • rbreak

  • return

  • signal

  • tcatch

  • until

handler Command

The handler command modifies event handlers (enable, disable, and such). It has identical syntax and identical functionality in native mode and in Java mode.

A handler is created for each event that needs to be managed in a debugging session. The commands trace, stop, and when create handlers. Each of these commands returns a number known as the handler ID (handler-ID). The handler, status, and delete commands manipulate or provide information about handlers in a generic fashion.

Syntax

handler [-enable | -disable] handler-ID ...

Either enable or disable given handlers, specify handler-ID as all for all handlers. Use $firedhandlers instead of handler-ID to disable the handlers that caused the most recent stoppage.

handler -count handler-ID new-limit

Print value of trip counter for given handler.

If a new limit parameter is specified, set new count limit for given event.

handler -reset handler-ID

Reset trip counter for given handler.

where:

handler-ID is the identifier of a handler.

hide Command

The hide command hides stack frames that match a regular expression. It is valid only in native mode.

Syntax

hide regular-expression

List the stack frame filters currently in effect.

If regular-expression is specified, hide stack frames matching regular-expression. The regular expression matches either the function name, or the name of the load object, and is a sh or ksh file matching style regular expression.

where:

regular-expression is a regular expression.

ignore Command

The ignore command tells the dbx process not to catch the given signals. It is valid only in native mode.

Ignoring a signal causes dbx not to stop when the process receives that kind of signal.

Syntax

ignore [number ... | signal ...]

Print a list of the ignored signals.

If a signal number is specified, ignore signal numbered number.

If a signal is specified, ignore signals named by signal. SIGKILL cannot be caught or ignored.

where:

number is the number of a signal.

signal is the name of a signal.

import Command

The import command imports commands from a dbx command library. It has the same syntax and functionality in native mode and in Java mode.

Syntax

import path-name

Import commands from the dbx command library path-name.

where:

path-name is the path name of a dbx command library.

intercept Command

The intercept command throws (C++ exceptions) of the given type (C++ only). It is valid only in native mode.

dbx stops when the type of a thrown exception matches a type on the intercept list unless the type of the exception also matches a type on the excluded list. A thrown exception for which there is no matching catch is called an “unhandled” throw. A thrown exception that does not match the exception specification of the function it is thrown from is called an “unexpected” throw.

Unhandled and unexpected throws are intercepted by default.

Syntax

intercept -x excluded-typename [, excluded-typename ...]

Add throws of excluded-typename to the excluded list.

intercept -a[ll] -x excluded-typename [, excluded-typename...]

Add all types except excluded-typename to the intercept list.

intercept -s[et] [intercepted-typename [, intercepted-typename ...]] [-x excluded-typename [, excluded-typename]]

Clear both the intercept list and the excluded list, and set the lists to intercept or exclude only throws of the specified types.

intercept

List intercepted types.

where:

included-typename and excluded-typename are exception type specifications such as List <int> or unsigned short.

java Command

The java command is used when dbx is in JNI mode to indicate that the Java version of a specified command is to be executed. It causes the specified command to use the Java expression evaluator, and when relevant, to display Java threads and stack frames.

Syntax

java command

where:

command is the command name and arguments of the command to be executed.

jclasses Command

The jclasses command prints the names of all Java classes known to dbx at the time you issue the command. It is valid only in Java mode.

Classes in your program that have not yet been loaded are not printed.

Syntax

jclasses [–a]

Print the names of all Java classes known to dbx.

If the –a option is specified, print system classes as well as other known Java classes.

joff Command

The joffcommand switches dbx from Java mode or JNI mode to native mode.

jon Command

The jon command switches dbx from native mode to Java mode.

jpkgs Command

The jpkgs command prints the names of all Java packages known to dbx at the time you issue the command. It is valid only in Java mode.

Packages in your program that have not yet been loaded are not printed.

kill Command

The kill command sends a signal to a process. It is valid only in native mode.

Syntax

kill -l

List all known signal numbers, names, and descriptions.

kill

Kill the controlled process.

kill [signal]job ...

Send the SIGTERM signal to the listed jobs.

If the –signal option is specified, send the given signal to the listed jobs.

where:

job can be a process ID or can be specified in any of the following ways:

%+

Kill the current job.

%-

Kill the previous job.

%number

Kill job number number.

%string

Kill the job that begins with string.

%?string

Kill the job that contains string.

where:

signal is the name of a signal.

language Command

The language command lists or changes the current source language. It is valid only in native mode.

Syntax

language

Print the current language mode set by the dbx language_mode environment variable. If the language mode is set to autodetect or main, the command also prints the name of the current language used for parsing and evaluating expressions.

where:

language is c, c++, fortran, or fortran90.


Note -  c is an alias for ansic.

line Command

The line command lists or changes the current line number. It has the same syntax and functionality in native mode and in Java mode.

Syntax

line [["file-name":][number]]

Display the current line number.

If a number is specified, set the current line number to number.

If a file name is specified, set current line number to line 1 in filename.

If both are specified, set current line number to line number in file-name.

where:

filename is the name of the file in which to change the line number. The ““ quotation marks around the file name are optional. They are useful when your file name contains spaces.

number is the number of a line in the file.

Examples

line 100
line "/root/test/test.cc":100

list Command

The list command displays lines of a source file. It has the same syntax and functionality in native mode and in Java mode.

The default number of lines listed, N, is controlled by the dbx output_list_size environment variable.

Syntax

list

List N lines.

list number

List line number number.

list +

List next N lines.

list +n

List next n lines.

list -

List previous N lines.

list -n

List previous n lines.

list n1, n2

List lines from n1 to n2.

list n1, +

List from n1 to n1 + N.

list n1, +n2

List from n1 to n1 + n2.

list n1, -

List from n1-N to n1.

list n1, -n2

List from n1-n2 to n1.

list function

List the start of the source for function. list function changes the current scope. See Program Scope for more information.

list filename

List the start of the file filename.

list filename:n

List file filename from line n.

where:

filename is the file name of a source code file.

function is the name of a function to display.

number is the number of a line in the source file.

n is a number of lines to display.

n1 is the number of the first line to display.

n2 is the number of the last line to display. Where appropriate, the line number can be ”$” which denotes the last line of the file. Comma is optional.

Options

–i or –instr

Intermix source lines and assembly code.

–w or –wn

List N (or n) lines (window) around line or function. This option is not allowed in combination with the plus sign (+) or minus sign (-) syntax or when two line numbers are specified.

–a

When used with a function name, lists the entire function. When used without parameters, lists the remains of the current visiting function, if any.

Examples

list                      // list N lines starting at current line
list +5                      // list next 5 lines starting at current line
list -                    // list previous N lines
list -20                  // list previous 20 lines
list 1000                 // list line 1000
list 1000,$               // list from line 1000 to last line
list 2737 +24             // list line 2737 and next 24 lines
list 1000 -20             // list line 980 to 1000
list test.cc:33           // list source line 33 in file test.cc
list -w                   // list N lines around current line
list -w8 ”test.cc”func1   // list 8 lines around function func1
list -i 500 +10                // list source and assembly code for line
                500 to line 510

listi Command

The listi command displays source and disassembled instructions. It is valid only in native mode. This command is the same as using list –i.

See list Command for details.

loadobject Command

The loadobject command lists and manages symbolic information from load objects. It is valid only in native mode.

This section lists the loadobject options and provides details about them.

Syntax

loadobject -list [regexp] [-a]

Show currently loaded load objects.

loadobject -load loadobject

Load symbols for specified load object.

loadobject -unload [regexp]

Unload specified load objects.

loadobject -hide [regexp]

Remove load object from dbx's search algorithm.

loadobject -use [regexp]

Add load object to dbx's search algorithm.

loadobject -dumpelf [regexp]

Show various ELF details of the load object.

loadobject -exclude ex-regexp

Don't automatically load loadobjects matching ex-regexp.

loadobject exclude -clear

Clear the exclude list of patterns.

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

ex-regexp is not optional, it must be specified.

This command has a default alias lo.

loadobject -dumpelf Command

The loadobject -dumpelf command shows various ELF details of the load object. It is valid only in native mode.

Syntax

loadobject -dumpelf [regexp]

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

This command dumps out information related to the ELF structure of the load object file on disk. The details of this output are highly subject to change. If you want to parse this output, use the Oracle Solaris OS commands dump or elfdump.

loadobject -exclude Command

The loadobject -exclude command tells dbx not to automatically load loadobjects matching the specified regular expression.

Syntax

loadobject -exclude ex-regexp [-clear]

where:

ex-regexp is a regular expression.

This command prevents dbx from automatically loading symbols for load objects that match the specified regular expression. Unlike regexp in other loadobject subcommands, if ex-regexp is not specified, it does not default to all. If you do not specify ex-regexp, the command lists the excluded patterns that have been specified by previous loadobject -exclude commands.

If you specify -clear, the list of excluded patterns is deleted.

Currently this functionality cannot be used to prevent loading of the main program or the runtime linker. Also, using it to prevent loading of C++ runtime libraries could cause the failure of some C++ functionality.

This option should not be used with runtime checking (RTC).

loadobject -hide Command

The loadobject -hide command removes load objects from dbx’s search algorithm.

Syntax

loadobject -hide [regexp]

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

This command removes a load object from the program scope, and hides its functions and symbols from dbx. This command also resets the “preload” bit. For more information, refer to the dbx help file by typing the following into the dbx prompt.

(dbx) help loadobject preloading

loadobject -list Command

The loadobject -list command shows currently loaded loadobjects. It is valid only in native mode.

Syntax

loadobject -list [regexp] [-a]

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

The full path name for each load object is shown along with letters in the margin to show status. Load objects that are hidden are listed only if you specify the -a option.

h

This letter means “hidden” (the symbols are not found by symbolic queries like whatis or stop in).

u

If there is an active process, u means “unmapped.”

p

This letter indicates a load object that is preloaded, that is, the result of a loadobject -load command or a dlopen event in the program.

For example:

(dbx) lo -list libm
/usr/lib/64/libm.so.1
/usr/lib/64/libmp.so.2
(dbx) lo -list ld.so
h  /usr/lib/sparcv9/ld.so.1 (rtld)

This last example shows that the symbols for the runtime linker are hidden by default. To use those symbols in dbxcommands, see loadobject -use Command.

loadobject -load Command

The loadobject -load command loads symbols for specified load objects. It is valid only in native mode.

Syntax

loadobject -load load-object

where:

load-object can be a full path name or a library in /usr/lib, /usr/lib/sparcv9 or /usr/lib/amd64. If a program is being debugged, then only the proper ABI library directory will be searched.

loadobject -unload Command

The loadobject -unload command unloads specified load objects. It is valid only in native mode.

Syntax

loadobject -unload [regexp]

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

This command unloads the symbols for any load objects matching the regexp supplied on the command line. The main program loaded with the debug command cannot be unloaded. dbx might also refuse to unload other load objects that might be currently in use or critical to the proper functioning of dbx.

loadobject -use Command

The loadobject -use command adds load objects from dbx’s search algorithm. It is valid only in native mode.

Syntax

loadobject -use [regexp]

where:

regexp is a regular expression. If it is not specified, the command applies to all load objects.

lwp Command

The lwp command lists or changes the current LWP (lightweight process). It is valid only in native mode.


Note -  The lwp command is available only on Oracle Solaris platforms.

Syntax

lwp

Display current LWP.

lwp lwp-ID

Switch to LWP lwp-ID.

lwp –info

Displays the name, home, and masked signals of the current LWP.

lwp [lwp-ID] –setfp address-expression

Tells dbx that the fp register has the value address-expression. The state of the program being debugged is not changed. A frame pointer set with the –setfp option is reset to its original value upon resuming execution.

lwp [lwp-ID] –resetfp

Sets the frame pointer logical value from the register value in the current process or core file, undoing the effect of a previous lwp –setfp command.

where:

lwp-ID is the identifier of a lightweight process.

If the command is used with both an LWP ID and an option, the corresponding action is applied to LWP specified by the lwp-ID, but the current LWP is not changed.

The –setfp and –resetfp options are useful when the frame pointer (fp) of the LWP is corrupted. In this event, dbx cannot reconstruct the call stack properly and evaluate local variables. These options work when debugging a core file, where assign $fp=... is unavailable.

To make changes to the fp register visible to the application being debugged, use the assign $fp=address-expression command.

lwps Command

The lwps command lists all LWPs (lightweight processes) in the process. It is valid only in native mode.


Note -  The lwps command is available only on Oracle Solaris platforms.

macro Command

The macro command prints the macro expansion of an expression.

Syntax

macro expression, ...

mmapfile Command

The mmapfile command views the contents of memory mapped files that are missing from a core dump. It is valid only in native mode.

Oracle Solaris core files do not contain any memory segments that are read-only. Executable read-only segments (that is, text) are dealt with automatically and dbx resolves memory accesses against these by looking into the executable and the relevant shared objects.

Syntax

mmapfile mmapped-file address offset length

View contents of memory mapped files missing from core dump.

where:

mmapped-file is the file name of a file that was memory mapped during a core dump.

address is the starting address of the address space of the process.

length is length in bytes of the address space to be viewed.

offset is the offset in bytes to the starting address in mmapped-file.

Example

Read-only data segments typically occur when an application memory maps a database. For example:

caddr_t vaddr = NULL;
off_t offset = 0;
size_t = 10 * 1024;
int fd;
fd = open("../DATABASE", ...)
vaddr = mmap(vaddr, size, PROT_READ, MAP_SHARED, fd, offset);
index = (DBIndex *) vaddr;

The following command enables access to the database through the debugger as memory:

mmapfile ../DATABASE $[vaddr] $[offset] $[size]

Then, to look at your database contents in a structured way:

print *index

module Command

The module command reads debugging information for one or more modules. It is valid only in native mode.

Syntax

module [-v]

Print the name of the current module.

module [-f] [-v] [-q] {name | -a}

If name is specified, read in debugging information for the module called name. If –a is specified, read in debugging information for all modules.

where:

name is the name of a module for which to read debugging information.

-a specifies all modules.

-f forces reading of debugging information, even if the file is newer than the executable. Use this option with caution!

-v specifies verbose mode, which prints language, file names, and such.

-q specifies quiet mode.

modules Command

The modules command lists module names. It is valid only in native mode.

Syntax

modules [-v] [–debug |–read]

List all modules.

If –debug is specified, list all modules containing debugging information.

If –read is specified, list names of modules containing debugging information that have been read in already.

where:

-v specifies verbose mode, which prints language, file names, and such.

native Command

The native command is used when dbx is in Java mode to indicate that the native version of a specified command is to be executed. Preceding a command with native results in dbx executing the command in native mode. This means that expressions are interpreted and displayed as C expressions or C++ expressions, and certain other commands produce different output than they do in Java mode.

This command is useful when you are debugging Java code but you want to examine the native environment.

Syntax

native command

where:

command is the command name and arguments of the command to be executed.

next Command

The next command steps one source line (stepping over calls).

The dbx step_events environment variable (see Setting dbxenv Variables) controls whether breakpoints are enabled during a step.

Native Mode Syntax

next

Step one line (step over calls). With multithreaded programs when a function call is stepped over, all LWPs (lightweight processes) are implicitly resumed for the duration of that function call in order to avoid deadlock. Non-active threads cannot be stepped.

next n

Step n lines (step over calls).

next ... -sig signal

Deliver the specified signal while stepping.

next ... thread-ID

Step the specified thread.

next ... lwp-ID

Step the given LWP. Will not implicitly resume all LWPs when stepping over a function.

where:

n is the number of lines to step.

signal is the name of a signal.

thread-ID is a thread ID.

lwp-ID is an LWP ID.

When an explicit thread-id or lwp-ID is included, the deadlock avoidance measure of the generic next command is defeated.

See also nexti Command for machine-level stepping over calls.


Note -  For information about lightweight processes (LWPs), see the Oracle Solaris Multithreaded Programming Guide.

Java Mode Syntax

next

Step one line (step over calls). With multithreaded programs when a function call is stepped over, all LWPs (lightweight processes) are implicitly resumed for the duration of that function call in order to avoid deadlock. Non-active threads cannot be stepped.

next n

Step n lines (step over calls).

next ... thread-ID

Step the given thread.

next ... lwp-ID

Step the given LWP. Will not implicitly resume all LWPs when stepping over a function.

where:

n is the number of lines to step.

thread-ID is a thread identifier.

lwp-ID is an LWP identifier.

When an explicit thread-ID or lwp-ID is included, the deadlock avoidance measure of the generic next command is defeated.


Note -  For information on lightweight processes (LWPs), see the Oracle Solaris Multithreaded Programming Guide.

nexti Command

The nexti command steps one machine instruction (stepping over calls). It is valid only in native mode.

Syntax

nexti

Step one machine instruction (step over calls).

nexti n

Step n machine instructions (step over calls).

nexti -sig signal

Deliver the given signal while stepping.

nexti ... lwp-ID

Step the given LWP.

nexti ... thread-ID

Step the LWP on which the given thread is active. Will not implicitly resume all LWPs when stepping over a function.

where:

n is the number of instructions to step.

signal is the name of a signal.

thread-ID is a thread ID.

lwp-ID is an LWP ID.

omp_loop Command

The omp_loop command prints a description of the current loop, including scheduling (static, dynamic, guided, auto, or runtime), ordered or not, bounds, steps or strides, and number of iterations. You can issue the command only from the thread that is currently executing a loop.

omp_pr Command

The omp_pr command prints a description of the current or specified parallel region, including the parent region, parallel region id, team size (number of threads), and program location (program counter address).

Syntax

omp_pr

Print a description of the current parallel region.

omp_pr parallel-region-ID

Print a description of the specified parallel region. This command does not cause dbx to switch the current parallel region to the specified region.

omp_pr –ancestors

Print descriptions of all the parallel regions along the path from the current parallel region to the root of the current parallel region tree.

omp_pr parallel-region-ID –ancestors

Print descriptions of all the parallel regions along the path from the specified parallel region to its root.

omp_pr –tree

Print a description of the whole parallel region tree.

omp_pr –v

Print a description of the current parallel region with team member information.

omp_serialize Command

The omp_serialize command serializes the execution of the next encountered parallel region for the current thread or for all threads in the current team. The serialization applies only to that one trip into the parallel region and does not persist.

Be sure you are in the right place in the program when you use this command. A logical place is just before a parallel directive.

Syntax

omp_serialize [–team]

Serialize the execution of the next encountered parallel region for the current thread.

If –team is specified, do this for all threads in the current team.

omp_team Command

The omp_team command prints all the threads in the current team.

Syntax

omp_team [parallel-region-ID]

Print all the threads in the current team.

If a parallel region ID is specified, print all the threads in the team for the specified parallel region.

omp_tr Command

The omp_tr command prints a description of the current task region, including the task region ID, type (implicit or explicit), state (spawned, executing, or waiting), executing thread, program location (program counter address), unfinished children, and parent.

Syntax

omp_tr

Print a description of the current task region.

omp_tr task-region-ID

Print a description of the specified task region. This command does not cause dbx to switch the current task region to the specified task region.

omp_tr –ancestors

Print descriptions of all the task regions along the path from the current task region to the root of the current task region tree.

omp_tr task-region-ID –ancestors

Print descriptions of all the task regions along the path from the specified task region to its root.

omp_tr –tree

Print a description of the whole task region tree.

pathmap Command

The pathmap command maps one path name to another for finding source files and such. The mapping is applied to source paths, object file paths, and the current working directory (if you specify -c). During macro skimming, it is also applied to include directory paths. The pathmap command has the same syntax and functionality in native mode and in Java mode.

The pathmap command is useful for dealing with automounted and explicit NFS mounted filesystems with different paths on differing hosts. Current working directories are inaccurate on automounted filesystems. Specify -c when you are trying to correct problems arising due to the automounter. The pathmap command is also useful if source or build trees are moved.

pathmap /tmp_mnt / exists by default.

The pathmap command is used to find load objects for core files when the dbxenv variable core_lo_pathmap is set to on. Other than this case, the pathmap command has no effect on finding load objects (shared libraries). For more information, see Debugging a Mismatched Core File.

Syntax

pathmap [ -c ] [ -index ] from to

Establish a new mapping from from to to.

pathmap [ -c ] [ -index ] to

Map all paths to to.

pathmap

List all existing path mappings (by index).

pathmap -s

The same, but the output can be read by dbx.

pathmap -d from1 from2 ...

Delete the given mappings by path.

pathmap -d index1 index2 ...

Delete the given mappings by index.

where:

from and to are path prefixes. from refers to the path compiled into the executable or object file and to refers to the path at debug time.

from1 is the path of the first mapping to be deleted.

from2 is the path of the last mapping to be deleted.

index specifies the index with which the mapping is to be inserted in the list. If you do not specify an index, the mapping is added to the end of the list.

index1 is the index of the first mapping to be deleted.

index2 is the index of the last mapping to be deleted.

If you specify -c, the mapping is applied to the current working directory as well.

If you specify -s, the existing mappings are listed in an output format that dbx can read.

If you specify -d, the specified mappings are deleted.

Examples

(dbx) pathmap /export/home/work1 /net/mmm/export/home/work2
  # maps /export/home/work1/abc/test.c to /net/mmm/export/home/work2/abc/test.c
(dbx) pathmap /export/home/newproject
  # maps /export/home/work1/abc/test.c to /export/home/newproject/test.c
(dbx) pathmap
(1) -c /tmp_mnt /
(2) /export/home/work1 /net/mmm/export/home/work2
(3) /export/home/newproject

pop Command

The pop command removes one or more frames from the call stack. It is valid only in native mode.

You can pop only to a frame for a function that was compiled with -g. The program counter is reset to the beginning of the source line at the call site. You cannot pop past a function call made by the debugger; but must use pop -c.

Normally, a pop command calls all the C++ destructors associated with the popped frames. You can override this behavior by setting the dbx pop_auto_destruct environment variable to off.

Syntax

pop

Pop the current top frame from stack.

pop number

Pop number frames from stack.

pop -f number

Pop frames from stack until specified frame number.

pop -c

Pop the last call made from the debugger.

where:

number is the number of frames to pop from the stack.

print Command

In native mode, the print command prints the value of an expression. In Java mode, the print command prints the value of an expression, local variable, or parameter.

Native Mode Syntax

print expression, ...

Print the value of the expression expression, ... .

print -r expression

Print the value of the expression expression including its inherited members.

print +r expression

Do not print inherited members when the dbx output_inherited_members environment variable is set to on.

print -d [-r] expression

Show dynamic type of expression expression instead of static type.

print +d [-r] expression

Don’t use dynamic type of expression expression when the dbx output_dynamic_type environment variable is set to on.

print -s expression

Print the value of expression expression for each thread in the current OpenMP parallel region if the expression contains private or thread-private variables.

print -S [-r] [-d] expression

Print the value of expression expression including its static members (C++ only)

print +S [-r] [-d] expression

Don't print static members when the dbxenv variable show_static_members is set to on (C++ only).

print -p expression

Call the prettyprint function.

print +p expression

Do not call the prettyprint function when the dbx output_pretty_print environment variable is on.

print -L expression

If the printing object expression is larger than 4K, enforce the printing.

print +l expression

If the expression is a string (char *), print the address only, do not print the literal.

print -l expression

('Literal’) Do not print the left side. If the expression is a string (char *), do not print the address, just print the raw characters of the string, without quotes.

print -fformat expression

Use format as the format for integers, strings, or floating-point expressions.

print -Fformat expression

Use the given format but do not print the left hand side (the variable name or expression).

print -o expression

Print the value of expression, which must be an enumeration as an ordinal value. You can also use a format string here (-fformat). This option is ignored for non-enumeration expressions.

print —m expression

Apply macro expansion to expression when the dbxenv variable macro_expand is set to off.

print +m expression

Skip macro expansion of expression when the dbxenv variable macro_expand is set to on.

print -- expression

“--” signals the end of flag arguments. This is useful if expression can start with a plus or minus. SeeProgram Scope for scope resolution rules.

where:

expression is the expression whose value you want to print.

format is the output format you want used to print the expression. If the format does not apply to the given type, the format string is silently ignored and dbx uses its built-in printing mechanism.

The allowed formats are a subset of those used by the printf(3S) command. The following restrictions apply:

  • No n conversion.

  • No * for field width or precision.

  • No %<digits>$ argument selection.

  • Only one conversion specification per format string.

    The allowed forms are defined by the following simple grammar:

    FORMAT ::= CHARS % FLAGS WIDTH PREC MOD SPEC CHARS

    CHARS ::= <any character sequence not containing a %>

    | %%

    | <empty>

    | CHARS CHARS

    FLAGS ::= + | - | <space> | # | 0 | <empty>

    WIDTH ::= <decimal_number> | <empty>

    PREC ::= . | . <decimal_number> | <empty>

    MOD ::= h | l | L | ll | <empty>

    SPEC ::= d | i | o | u | x | X | f | e | E | g | G |

    c | wc | s | ws | p

    If the given format string does not contain a %, dbx automatically prepends one. If the format string contains spaces, semicolons, or tabs, the entire format string must be surrounded by double quotes.

Java Mode Syntax

print expression, ... | ...

Print the values of the expressions expression, ... or identifier identifier, ....

print -r expression | identifier

Print the value of expression or identifier including its inherited members.

print +r expression | identifier

Do not print inherited members when the dbx output_inherited_members environment variable is set to on.

print -d [-r] expression | identifier

Show dynamic type of expression or identifier instead of static type.

print +d [-r] expression | identifier

Do not use dynamic type of expression or identifier when the dbx output_dynamic_type environment variable is set to on.

print -- expression | identifier

”--’ signals the end of flag arguments. This is useful if expression can start with a plus or minus. See Program Scope for scope resolution rules.

where:

class-name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

expression is the Java expression whose value you want to print.

field-name is the name of a field in the class.

identifier is a local variable or parameter, including this, the current class instance variable (object-name.field-name) or a class (static) variable (class-name.field-name).

object-name is the name of a Java object.

proc Command

The proc command displays the status of the current process. It has identical syntax and identical functionality in native mode and in Java mode.

Syntax

proc {–cwd | –map | –pid}

If –cwd is specified, show the current working directory of the current process.

If –map is specified, show the list of load objects with addresses.

If –process-ID is specified, show current process ID (process-ID).

prog Command

The prog command manages programs being debugged and their attributes. It has the same syntax and functionality in native mode and Java mode.

Syntax

prog -readsyms

Read symbolic information which was postponed by having set the dbx run_quick environment variable to on.

prog -executable

Prints the full path of the executable, - if the program was attached to using -.

prog -argv

Prints the whole argv, including argv[0].

prog -args

Prints the argv, excluding argv[0].

prog -stdin

Prints < filename or empty if stdin is used.

prog -stdout

Prints > filename or >> filename or empty if stdout is used. The outputs of -args, -stdin, -stdout are designed so that the strings can be combined and reused with the run command.

quit Command

The quit command exits dbx. It has the same syntax and functionality in native mode and Java mode.

If dbx is attached to a process, the process is detached from before exiting. If there are pending signals, they are cancelled. Use the detach command for fine control.

Syntax

quit

Exit dbx with return code 0. Same as exit.

quit n

Exit with return code n. Same as exit n.

where:

n is a return code.

regs Command

The regs command prints the current value of registers. It is valid only in native mode.

Syntax

regs [-f] [-F]

where:

-f includes floating-point registers (single precision) (SPARC platform only)

-F includes floating-point registers (double precision) (SPARC platform only)

Example (SPARC platform)

dbx[13] regs -F
current thread: t@1
current frame:  [1]
g0-g3              0x00000000 0x0011d000 0x00000000 0x00000000
g4-g7              0x00000000 0x00000000 0x00000000 0x00020c38
o0-o3              0x00000003 0x00000014 0xef7562b4 0xeffff420
o4-o7              0xef752f80 0x00000003 0xeffff3d8 0x000109b8
l0-l3              0x00000014 0x0000000a 0x0000000a 0x00010a88
l4-l7              0xeffff438 0x00000001 0x00000007 0xef74df54
i0-i3              0x00000001 0xeffff4a4 0xeffff4ac 0x00020c00
i4-i7              0x00000001 0x00000000 0xeffff440 0x000108c4
y                  0x00000000
psr                0x40400086
pc                 0x000109c0:main+0x4    mov     0x5, %l0
npc                0x000109c4:main+0x8    st      %l0, [%fp - 0x8]
f0f1               +0.00000000000000e+00
f2f3               +0.00000000000000e+00
f4f5               +0.00000000000000e+00
f6f7               +0.00000000000000e+00

replay Command

The replay command replays debugging commands since the last run, rerun, or debug command. It is valid only in native mode.

Syntax

replay [-number]

Replay all or all minus number commands since last run command, rerun command, or debug command.

where:

number is the number of commands not to replay.

rerun Command

The rerun command runs the program with no arguments. It has the same syntax and functionality in native mode and Java mode.

Syntax

rerun

Begin executing the program with no arguments.

rerun arguments

Begin executing the program with new arguments by the save command (see save Command).

restore Command

The restore command restores dbx to a previously saved state. It is valid only in native mode.

Syntax

restore [filename ]

where:

filename is the name of the file to which the dbx commands executed since the last run, rerun, or debug command were saved.

rprint Command

The rprint command prints an expression using shell quoting rules. It is valid only in native mode.

Syntax

rprint [-r|+r|-d|+d|-S|+S|-p|+p|-L|-l|-f format | -Fformat | -- ] expression

Print the value of the expression. No special quoting rules apply, so rprint a > b puts the value of a (if it exists) into file b. See print Command for the meanings of the flags.

where:

expression is the expression whose value you want to print.

format is the output format you want used to print the expression. For information about valid formats, see print Command.

rtc showmap Command

The rtc showmap command reports the address range of program text categorized by instrumentation type (branches and traps). It is valid only in native mode.

This command is intended for expert users. Runtime checking instruments program text for access checking. The instrumentation type can be a branch or a trap instruction based on available resources. The rtc showmap command reports the address range of program text categorized by instrumentation type. This map can be used to find an optimal location for adding patch area object files and to avoid the automatic use of traps. SeeRuntime Checking Limitations for details.

rtc skippatch Command

The rtc skippatch command excludes load objects, object files, and functions from being instrumented by runtime checking. The effect of the command is permanent to each dbx session unless the load object is unloaded explicitly.

Because dbx does not track memory access in load objects, object files, and functions affected by this command, incorrect rui errors might be reported for functions that were not skipped. dbx cannot determine whether an rui error was introduced by this command, so this type error was not suppressed automatically.

Syntax

rtc skippatch load-object [–o object-file ...] [–f function ...]

Exclude the specified object files and functions in the specified load object from being instrumented.

where:

load-object is the name of a load object or the path to the name of a load object.

object-file is the name of an object file.

function is the name of a function.

run Command

The run command runs the program with arguments.

Use Control-C to stop executing the program.

Native Mode Syntax

run

Begin executing the program with the current arguments.

run arguments

Begin executing the program with new arguments.

run ... >|>> output-file

Set the output redirection.

run ... < input-file

Set the input redirection.

where:

arguments are the arguments to be used in running the target process.

input-file is the file name of the file from which input is to be redirected.

output-file is the file name of the file to which output is to be redirected.


Note -  There is currently no way to redirect stderr using the run or runargs command.

Java Mode Syntax

run

Begin executing the program with the current arguments.

run arguments

Begin executing the program with new arguments.

where:

arguments are the arguments to be used in running the target process. They are passed to the Java application, not to the JVM software. Do not include the main class name as an argument.

You cannot redirect the input or output of a Java application with the run command.

Breakpoints you set in one run persist in subsequent runs.

runargs Command

The runargs command changes the arguments of the target process. It has identical syntax and identical functionality in native mode and Java mode.

Use the debug command with no arguments to inspect the current arguments of the target process.

Syntax

runargs arguments

Set the current arguments, to be used by the run command (see run Command).

runargs ... >|>>file

Set the output redirection to be used by the run command.

runargs ... <file

Set the input redirection to be used by the run command.

runargs

Clear the current arguments.

where:

arguments are the arguments to be used in running the target process.

file is the file to which output from the target process or input to the target process is to be redirected.

save Command

The save command saves commands to a file. It is valid only in native mode.

Syntax

save [ -number ] [ filename ]

Save all or all minus number commands since last run command, rerun command, or debug command to the default file or filename.

where:

number is the number of commands not to save.

filename is the name of the file to save the dbx commands executed since the last run, rerun, or debug command.

scopes Command

The scopes command prints a list of active scopes. It is valid only in native mode.

search Command

The search command searches forward in the current source file. It is valid only in native mode.

Syntax

search string

Search forward for string in the current file.

search

Repeat search, using last search string.

where:

string is the character string for which you wish to search.

showblock Command

The showblock command shows where the particular heap block was allocated from runtime checking. It is valid only in native mode.

When runtime checking is turned on, the showblock command shows the details about the heap block at the specified address. The details include the location of the blocks’ allocation and its size.

Syntax

showblock -a address

where:

address is the address of a heap block.

showleaks Command


Note -  The showleaks command is available only on Oracle Solaris platforms.

In the default non-verbose case, a one-line report per leak record is printed. Actual leaks are reported followed by the possible leaks. Reports are sorted according to the combined size of the leaks.

Syntax

showleaks [-a] [-m m] [-n number] [-v]

where:

-a shows all the leaks generated so far, not just the leaks since the last showleaks command.

-m m combines leaks; if the call stack at the time of allocation for two or more leaks matches m frames, then these leaks are reported in a single combined leak report. If the -m option is given, it overrides the global value of m specified with the check command.

-n number shows up to number records in the report. The default is to show all records.

-v Generate verbose output. The default is to show non-verbose output.

showmemuse Command

A one-line report per block-in-use record is printed. The commands sorts the reports according to the combined size of the blocks. Any leaked blocks since the last showleaks command are also included in the report.

Syntax

showmemuse [-a] [-m m] [-n number] [-v]

where:

-a shows all the blocks in use (not just the blocks since the last showmemuse command).

-m m combines the blocks-in-use reports. The default value of m is 8 or the global value last given with the check command. If the call stack at the time of allocation for two or more blocks matches m frames, then these blocks are reported in a single combined report. If the -m option is given, it overrides the global value of m.

-n number shows up to number records in the report. The default is 20.

-v generates verbose output. The default is to show non-verbose output.

source Command

The source command executes commands from a given file. It is valid only in native mode.

Syntax

source filename

Execute commands from file filename. $PATH is not searched.

status Command

The status command lists event handlers (breakpoints and such). It has identical syntax and identical functionality in native mode and Java mode.

Syntax

status

Print trace, when, and stop breakpoints in effect.

status handler-ID

Print status for handler handler-ID.

status -h

Print trace, when, and stop breakpoints in effect including the hidden ones.

status -s

The same, but the output can be read by dbx.

where:

handler-ID is the identifier of an event handler.

Example

(dbx) status -s > bpts
...
(dbx) source bpts

step Command

The step command steps one source line or statement, stepping into calls that were compiled with the -g option.

The dbx step_events environment variable controls whether breakpoints are enabled during a step.

The dbx step_granularity environment variable controls granularity of source line stepping.

The dbx step_abflow environment variable controls whether dbx stops when it detects that abnormal control flow change is about to occur. This type of control flow change can be caused by a call to siglongjmp() or longjmp() or an exception throw.

Native Mode Syntax

step

Single-step one line (step into calls). With multithreaded programs when a function call is stepped over, all threads are implicitly resumed for the duration of that function call in order to avoid deadlock. Non-active threads cannot be stepped.

step n

Single-step n lines (step into calls).

step up

Step up and out of the current function.

step ... -sig signal

Deliver the specified signal while stepping. If a signal handler exists for the signal, step into it if the signal handler was compiled with the -g option.

step ...thread-ID

Step the specified thread. Does not apply to step up.

step ...lwp-ID

Step the specified LWP. Does not implicitly resume all LWPs when stepping over a function.

step to [ function ]

Attempts to step into function called from the current source code line. If function is not specified, steps into the last function called, helping to avoid long sequences of step commands and step up commands. Examples of the last function are:

f()->s()-t()->last();

last(a() + b(c()->d()));

where:

n is the number of lines to step.

signal is the name of a signal.

thread-ID is a thread ID.

lip-ID is an LWP ID.

function is a function name.

When an explicit lwpID is specified, the deadlock avoidance measure of the generic step command is defeated.

When executing the step to command, while an attempt is made to step into the last assembly call instruction or step into a function (if specified) in the current source code line, the call might not be taken due to a conditional branch. In a case where the call is not taken or no function call is in the current source code line, the step to command steps over the current source code line. Take special consideration on user-defined operators when using the step to command.

See also stepi Command for machine-level stepping.

Java Mode Syntax

step

Single-step one line (step into calls). With multithreaded programs when a method call is stepped over, all threads are implicitly resumed for the duration of that method call in order to avoid deadlock. Non-active threads cannot be stepped.

step n

Single-step n lines (step into calls).

step up

Step up and out of the current method.

step ...thread-ID

Step the specified thread. Does not apply to step up.

step ...lwp-ID

Step the specified LWP. Does not implicitly resume all LWPs when stepping over a method.

stepi Command

The stepi command steps one machine instruction (stepping into calls). It is valid only in native mode.

Syntax

stepi

Single-step one machine instruction (step into calls).

stepi n

Single step n machine instructions (step into calls).

stepi -sig signal

Step and deliver the specified signal.

stepi ...lwp-ID

Step the given LWP.

stepi ...thread-ID

Step the LWP on which the specified thread is active.

where:

n is the number of instructions to step.

signal is the name of a signal.

lwp-ID is an LWP ID.

thread-ID is a thread ID.

stop Command

The stop command sets a source-level breakpoint.

Syntax

The stop command has the following general syntax:

stop event-specification [modifier]

When the specified event occurs, the process is stopped.

Native Mode Syntax

This section describes some of the more important syntaxes that are valid in native mode. For information about additional events, see Setting Event Specifications.

stop [ -update ]

Stop execution now. Only valid within the body of a when command.

stop -noupdate

Stop execution now but do not update the Oracle Solaris Studio IDE Debugger windows.

stop access mode address-expression [,byte-size-expression ]

Stop execution when the memory specified by address-expression has been accessed. See also Stopping Execution When an Address Is Accessed.

stop at line-number

Stop execution at line-number. See Setting a Breakpoint at a Line of Source Code.

stop change variable

Stop execution when the value of variable has changed.

stop cond condition-expression

Stop execution when the condition denoted by condition-expression evaluates to true.

stop in function

Stop execution when function is called. See Setting a Breakpoint in a Function.

stop inclass class-name [ -recurse | -norecurse ]

C++ only: Set breakpoints on all member functions of a class, struct, union, or template class. -norecurse is the default. If -recurse is specified, the base classes are included. See also Setting Breakpoints in All Member Functions of a Class.

stop infile file-name

Stop execution when any function in filename is called.

stop infunction name

C++ only: Set breakpoints on all non-member functions name.

stop inmember name

C++ only: set breakpoints on all member functions name. See Setting Breakpoints in Member Functions of Different Classes.

stop inobject object-expression [ -recurse | -norecurse ]

C++ only: set breakpoint on entry into any non-static method of the class and all its base classes when called from the object object-expression. -recurse is the default. If -norecurse is specified, the base classes are not included. See Setting Breakpoints in Objects.

line-number is the number of a source code line.

function is the name of a function.

class-name is the name of a C++ class, struct, union, or template class.

mode specifies how the memory was accessed. It can be composed of one or all of the letters:

r

The memory at the specified address has been read.

w

The memory has been written to.

x

The memory has been executed.

mode can also contain the following:

a

Stops the process after the access (default).

b

Stops the process before the access.

name is the name of a C++ function.

object-expression identifies a C++ object.

variable is the name of a variable.

The following modifiers are valid in native mode.

–if condition-expression

The specified event occurs only when condition-expression evaluates to true.

–in function

Execution stops only if the specified event occurs during the extent of function.

–count number

Starting at 0, each time the event occurs, the counter is incremented. When number is reached, execution stops and the counter is reset to 0.

–count infinity

Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.

–temp

Create a temporary breakpoint that is deleted when the event occurs.

–disable

Create the breakpoint in a disabled state.

–instr

Do instruction-level variation. For example, step becomes instruction level stepping, and at takes a text address for an argument instead of a line number.

–perm

Make this event permanent across debug. Certain events (like breakpoints) are not appropriate to be made permanent. delete all will not delete permanent handlers. To delete permanent handlers, use delete hid.

–hidden

Hide the event from the status command. Some import modules might choose to use this. Use status -h to see them.

–lwp lwp-ID

Execution stops only if the specified event occurs in the specified LWP.

–thread thread-ID

Execution stops only if the specified event occurs in the specified thread.

Java Mode Syntax

The following specific syntaxes are valid in Java mode.

stop access mode class-name.field-name

Stop execution when the memory specified by class-name.field-name has been accessed.

stop at line-number

Stop execution at line-number.

stop at filename:line-number

Stop execution at line-number in filename.

stop change class-name.field-name

Stop execution when the value of field-name in class-name has changed.

stop classload

Stop execution when any class is loaded.

stop classload class-name

Stop execution when class-name is loaded.

stop classunload

Stop execution when any class is unloaded.

stop classunload class-name

Stop execution when class-name is unloaded.

stop cond condition-expression

Stop execution when the condition denoted by condition-expression evaluates to true.

stop in class-name.method-name

Stop execution when class-name.method-name has been entered, and the first line is about to be executed. If no parameters are specified and the method is overloaded, a list of methods is displayed.

stop in class-name.method-name([parameters])

Stop execution when class-name.method-name has been entered, and the first line is about to be executed.

stop inmethod class-name.method-name

Set breakpoints on all non-member methods class-name.method-name.

stop inmethod class-name.method-name ([parameters])

Set breakpoints on all non-member methods class-name.method-name.

stop throw

Stop execution when a Java exception has been thrown.

stop throw type

Stop execution when a Java exception of type has been thrown.

where:

class-name is the name of a Java class.. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

condition-expression can be any expression, but it must evaluate to an integral type.

field-name is the name of a field in the class.

filename is the name of a file.

line-number is the number of a source code line.

method-name is the name of a Java method.

mode specifies how the memory was accessed. It can be composed of one or all of the letters:

r

The memory at the specified address has been read.

w

The memory has been written to.

mode can also contain the following:

b

Stops the process before the access.

The program counter will point at the offending instruction.

parameters are the method’s parameters.

type is a type of Java exception. -unhandled or -unexpected are valid values for type.

The following modifiers are valid in Java mode:

–if condition-expression

The specified event occurs only when condition-expression evaluates to true.

–count number

Starting at 0, each time the event occurs, the counter is incremented. When number is reached, execution stops and the counter is reset to 0.

–count infinity

Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.

–temp

Create a temporary breakpoint that is deleted when the event occurs.

–disable

Create the breakpoint in a disabled state.

See stopi Command for information about setting a machine-level breakpoint.

For a list and the syntax of all events, see Setting Event Specifications.

stopi Command

The stopi command sets a machine-level breakpoint. It is valid only in native mode.

Syntax

The stopi command has the following general syntax:

stopi event-specification [modifier]

When the specified event occurs, the process is stopped.

The following specific syntaxes are valid:

stopi at address-expression

Stop execution at location address-expression.

stopi in function

Stop execution when function is called.

where:

address-expression is any expression resulting in or usable as an address.

function is the name of a function.

For a list and the syntax of all events, see Setting Event Specifications.

suppress Command

The suppress command suppresses reporting of memory errors during runtime checking. It is valid only in native mode.

If the dbx rtc_auto_suppress environment variable is set to on, the memory error at a given location is reported only once.

Syntax

suppress

History of suppress and unsuppress commands, not including those specifying the -d and -reset options.

suppress -d

List of errors being suppressed in functions not compiled for debugging (default suppression). This list is per load object. These errors can be unsuppressed only by using the unsuppress command with the -d option.

suppress -d errors

Modify the default suppressions for all load objects by further suppressing errors.

suppress -d errors in load-objects

Modify the default suppressions in the load-objects by further suppressing errors.

suppress -last

At error location suppress present error.

suppress -reset

Set the default suppression to the original value (startup time).

suppress -r ID...

Remove the unsuppress events as specified by the IDs, which can be obtained with the unsuppress command.

suppress -r 0 | all | -all

Remove all the unsuppress events as specified by the unsuppress command.

suppress errors

Suppress errors everywhere.

suppress errors in [ functions ] [ files ] [ load-objects ]

Suppress errors in list of functions, list of files, and list of load-objects.

suppress errors at line

Suppress errors at line.

suppress errors at "file":line

Suppress errors at line in file.

suppress errors addr address

Suppress errors at location address.

where:

address is a memory address.

errors are blank separated and can be any combination of the following:

all

All errors

aib

Possible memory leak - address in block

air

Possible memory leak - address in register

baf

Bad free

duf

Duplicate free

mel

Memory leak

maf

Misaligned free

mar

Misaligned read

maw

Misaligned write

oom

Out of memory

rob

Read from array out-of-bounds memory

rua

Read from unallocated memory

rui

Read from uninitialized memory

wob

Write to array out-of-bounds memory

wro

Write to read-only memory

wua

Write to unallocated memory

biu

Block in use (allocated memory). Though not an error, you can use biu just like errors in the suppress commands.

file is the name of a file.

files is the names of one or more files.

functions is one or more function names.

line is the number of a source code line.

load-objects is one or more load object names.

See Suppressing Errors for more information about suppressing errors.

See unsuppress Command for information about unsuppressing errors.

sync Command

The sync command shows information about a specified synchronization object. It is valid only in native mode.


Note -  The sync command is available only on Oracle Solaris platforms.

Syntax

sync -info address

Show information about the synchronization object at address.

where:

address is the address of the synchronization object.

syncs Command

The syncs command lists all synchronization objects (locks). It is valid only in native mode.


Note -  The syncs command is available only on Oracle Solaris platforms.

thread Command

The thread command lists or changes the current thread.

Native Mode Syntax

thread

Display current thread.

thread thread-ID

Switch to thread thread-ID.

In the following variations, the current thread is assumed if a thread ID is not specified.

thread -info [thread-ID]

Print everything known about the specified thread. For OpenMP threads, the information includes the OpenMP thread ID, parallel region ID, task region ID, and thread state.

thread -hide [thread-ID]

Hide the specified (or current) thread. It will not show up in the generic threads listing.

thread -unhide [thread-ID]

Unhide the specified (or current) thread.

thread -unhide all

Unhide all threads.

thread -suspend thread-ID

Keep the specified thread from ever running. A suspended thread shows up with an “S” in the threads list.

thread -resume thread-ID

Undo the effect of -suspend.

thread -blocks [thread-ID]

List all locks held by the specified thread blocking other threads.

thread -blockedby [thread-ID]

Show which synchronization object the specified thread is blocked by, if any.

where:

thread-ID is a thread ID.

Java Mode Syntax

thread

Display current thread.

thread thread-ID

Switch to thread thread-ID.

In the following variations, the current thread is assumed if a thread ID is not specified.

thread -info [thread-ID]

Print everything known about the specified thread.

thread -hide [thread-ID]

Hide the specified (or current) thread. It will not show up in the generic threads listing.

thread -unhide [thread-ID]

Unhide the specified (or current) thread.

thread -unhide all

Unhide all threads.

thread -suspend thread-ID

Keep the specified thread from ever running. A suspended thread shows up with an “S” in the threads list.

thread -resume thread-ID

Undo the effect of -suspend.

thread -blocks [thread-ID]

Lists the Java monitor owned by thread-ID.

thread -blockedby [thread-id]

Lists the Java monitor on which thread-ID is blocked.

where:

thread-ID is a dbx-style thread ID of the form t@number or the Java thread name specified for the thread.

threads Command

The threads command lists all threads.

Native Mode Syntax

threads

Print the list of all known threads.

threads -all

Print threads normally not printed (zombies).

threads -mode all|filter

Controls whether all threads are printed or threads are filtered. The default is to filter threads. When filtering is on, threads that have been hidden by the thread -hide command are not listed.

threads -mode auto|manual

Under the IDE, enables automatic updating of the thread listing.

threads -mode

Echo the current modes.

    Each line of information is composed of the following:

  • An * (asterisk) indicating that an event requiring user attention has occurred in this thread. Usually this is a breakpoint.

    An 'o’ instead of an asterisk indicates that a dbx internal event has occurred.

  • An > (arrow) denoting the current thread.

  • t@num, the thread ID, referring to a particular thread. The number is the thread_t value passed back by thr_create.

  • b l@num meaning the thread is bound (currently assigned to the designated LWP), or a l@num meaning the thread is active (currently scheduled to run).

  • The “Start function” of the thread as passed to thr_create. A ?() means that the start function is not known.

  • The thread state, which is one of the following:

    • monitor

    • running

    • sleeping

    • unknown

    • wait

    • zombie

    The function that the thread is currently executing.

Java Mode Syntax

threads

Print the list of all known threads.

threads -all

Print threads normally not printed (zombies).

threads -mode all|filter

Controls whether all threads are printed or threads are filtered. The default is to filter threads.

threads -mode auto|manual

Under the IDE, enables automatic updating of the thread listing.

threads -mode

Echo the current modes.

    Each line of information in the listing is composed of the following:

  • An > (arrow) denoting the current thread

  • t@number, a dbx-style thread ID

  • The thread state, which is one of the following:

    • monitor

    • running

    • sleeping

    • unknown

    • wait

    • zombie

  • The thread name in single quotation marks

  • A number indicating the thread priority

trace Command

The trace command shows executed source lines, function calls, or variable changes.

The speed of a trace is set using the dbx trace_speed environment variable.

If dbx is in Java mode and you want to set a trace breakpoint in native code, switch to Native mode using the joff command or prefix the trace command with native.

If dbx is in JNI mode and you want to set a trace breakpoint in Java code, prefix the trace command with java.

Syntax

The trace command has the following general syntax:

trace event-specification [modifier]

When the specified event occurs, a trace is printed.

Native Mode Syntax

The following specific syntaxes are valid in native mode:

trace -file filename

Direct all trace output to the specified file name. To revert trace output to standard output use - for filename. Trace output is always appended to filename. It is flushed whenever dbx prompts and when the application has exited. The file is always re-opened on a new run or resumption after an attach.

trace step

Trace each source line, function call, and return.

trace next -in function

Trace each source line while in the specified function.

trace at line-number

Trace given source line.

trace in function

Trace calls to and returns from the specified function.

trace infile filename

Trace calls to and returns from any function in filename.

trace inmember function

Trace calls to any member function named function.

trace infunction function

Trace when any function named function is called.

trace inclass class

Trace calls to any member function of class.

trace change variable

Trace changes to the variable.

where:

filename is the name of the file to which you want trace output sent.

function is the name of a function.

line-number is the number of a source code line.

class is the name of a class.

variable is the name of a variable.

The following modifiers are valid in native mode.

–if condition-expression

The specified event occurs only when condition-expression evaluates to true.

–in function

Execution stops only if the specified event occurs in function.

–count number

Starting at 0, each time the event occurs, the counter is incremented. When number is reached, execution stops and the counter is reset to 0.

–count infinity

Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.

–temp

Create a temporary breakpoint that is deleted when the event occurs.

–disable

Create the breakpoint in a disabled state.

–instr

Do instruction-level variation. For example, step becomes instruction-level stepping, and at takes a text address for an argument instead of a line number.

–perm

Make this event permanent across debug. Certain events like breakpoints are not appropriate to be made permanent. delete all will not delete permanent handlers. To delete permanent handlers, use delete hid.

–hidden

Hide the event from the status command. Some import modules might choose to use this. Use status -h to see them.

–lwp lwp-ID

Execution stops only if the specified event occurs in the given LWP.

–thread thread-ID

Execution stops only if the specified event occurs in the given thread.

Java Mode Syntax

The following specific syntaxes are valid in Java mode.

trace -file filename

Direct all trace output to the specified filename. To revert trace output to standard output use - for filename. Trace output is always appended to filename. It is flushed whenever dbxprompts and when the application has exited. The file is always re-opened on a new run or resumption after an attach.

trace at line-number

Trace line-number.

trace at filename.line-number

Trace specified source filename.line-number.

trace in class-name.method-name

Trace calls to and returns from class-name. method-name.

trace in class-name.method-name([parameters]).

Trace calls to and returns from class-name.method-name([parameters]).

trace inmethod class-name.method-name

Trace when any method named class-name.method-name is called.

trace inmethod class-name.method-name[(parameters)]

Trace when any method named class-name.method-name [(parameters)] is called.

where:

class_name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

filename is the name of a file.

line-number is the number of a source code line.

method-name is the name of a Java method.

parameters are the method’s parameters

The following modifiers are valid in Java mode.

–if condition-expression

The specified event occurs and the trace is printed only when condition-expression evaluates to true.

–count number

Starting at 0, each time the event occurs, the counter is incremented. When number is reached, the trace is printed and the counter is reset to 0.

–count infinity

Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.

–temp

Create a temporary breakpoint that is deleted when the event occurs and the trace is printed. If -temp is used with -count, the breakpoint is deleted only when the counter is reset to 0.

–disable

Create the breakpoint in a disabled state.

For a list and the syntax of all events see Setting Event Specifications.

tracei Command

The tracei command shows machine instructions, function calls, or variable changes. It is valid only in native mode.

tracei is really a shorthand for trace event-specification -instr where the -instr modifier causes tracing to happen at instruction granularity instead of source-line granularity. When the event occurs, the printed information is in disassembly format instead of source-line format.

Syntax

tracei step

Trace each machine instruction.

tracei next -in function

Trace each instruction while in the specified function.

tracei at address

Trace the instruction at address.

tracei in function

Trace calls to and returns from the specified function.

tracei inmember function

Trace calls to any member function named function.

tracei infunction function

Trace when any function named function is called.

tracei inclass class

Trace calls to any member function of class.

tracei change variable

Trace changes to the variable.

where:

address is any expression resulting in or usable as an address.

filename is the name of the file to which you want trace output sent.

function is the name of a function.

line is the number of a source code line.

class is the name of a class.

variable is the name of a variable.

See trace Command for more information.

uncheck Command

The uncheck command disables checking of memory access, leaks, or usage. It is valid only in native mode.

Syntax

uncheck

Print the current status of checking.

uncheck -access

Disable access checking.

uncheck -leaks

Disable leak checking.

uncheck -memuse

Disable memory use checking (leak checking is disabled as well).

uncheck -all

Equivalent to uncheck -access; uncheck -memuse.

uncheck [functions] [files] [load-objects]

Equivalent to suppress all in functions files load-objects.

where:

functions is one or more function names.

files is one or more file names.

load-objects is one or more load object names

See check Command for information about enabling checking.

See suppress Command for information about suppressing errors.

See Capabilities of Runtime Checking for an introduction to runtime checking.

undisplay Command

The undisplay command undoes display commands.

Native Mode Syntax

undisplay {expression,... | n ...}

Undo a display expression command or all the display commands numbered n, ...

If n is set to zero (0), then undo all display commands.

where:

expression is a valid expression.

Java Mode Syntax

undisplay expression, ... | identifier, ...

Undo a display expression, ... or display identifier, ... command.

undisplay n, ...

Undo the display commands numbered n, ...

undisplay 0
do all display commands.

Undo all display commands.

where:

expression is a valid Java expression.

field-name is the name of a field in the class.

identifier is a local variable or parameter, including this, the current class instance variable (object-name.field-name), or a class (static) variable (class-name.field-name).

unhide Command

The unhide command undoes hide commands. It is valid only in native mode.

Syntax

unhide {regular-expression | number}

Delete stack frame filter regular-expression or delete stack frame filter number number

If number is set to zero (0), delete all stack frame filters.

where:

regular-expression is a regular expression.

number is the number of a stack frame filter.

The hide command lists the filters with numbers.

unintercept Command

The unintercept command undoes intercept commands (C++ only). It is valid only in native mode.

Syntax

unintercept intercepted-typename [, intercepted-typename ... ]

Delete throws of type intercepted-typename from the intercept list.

unintercept -a[ll]

Delete all throws of all types from intercept list.

unintercept -x excluded-typename [, excluded-typename ... ]

Delete excluded-typename from excluded list.

unintercept -x -a[ll]

Delete all throws of all types from the excluded list.

unintercept

List intercepted types.

where:

included-typename and excluded-typename are exception type specifications such as List <int> or unsigned short.

unsuppress Command

The unsuppress command undoes suppress commands. It is valid only in native mode.

Syntax

unsuppress

History of suppress and unsuppress commands (not those specifying the -d and -reset options).

unsuppress -d

List of errors being unsuppressed in functions that are not compiled for debugging. This list is per load object. Any other errors can be suppressed only by using the suppress command with the -d option.

unsuppress -d errors

Modify the default suppressions for all load objects by further unsuppressing errors.

unsuppress -d errors in load-objects

Modify the default suppressions in the load-objects by further unsuppressing errors.

unsuppress -last

At error location unsuppress present error.

unsuppress -reset

Set the default suppression mask to the original value (startup time).

unsuppress errors

Unsuppress errors everywhere.

unsuppress errors in [functions] [filename ...] [load-objects]

Suppress errors in a list of functions, a list of files, and a list of load objects.

unsuppress errors at line

Unsuppress errors at line.

unsuppress errors at "filenames" line

Unsuppress errors at line in filenames.

unsuppress errors addr address

Unsuppress errors at location address.

where:

errors is one or more error names.

functions is one or more function names.

filenames is one or more file names.

line is a line number.

load-objects is one or more load object names

unwatch Command

The unwatch command undoes a watch command. It is valid only in native mode.

Syntax

unwatch {expression | n}

Undo a watch expression command or the watch commands numbered n

If n is set to zero (0), then undo all watch commands.

where:

expression is a valid expression.

up Command

The up command moves up the call stack toward main. It has the same syntax and functionality in native mode and in Java mode.

Syntax

up [-h [number]]

Move up the call stack one level.

If number is specified, move up the call stack number levels.

If –h is specified, move up the call stack, but do not skip hidden frames.

where:

number is a number of call stack levels.

use Command

The use command lists or changes the directory search path. It is valid only in native mode.

This command is an anachronism and usage of this command is mapped to the following pathmap commands:

use is equivalent to pathmap -s

use directory is equivalent to pathmap directory.

watch Command

The watch command evaluates and prints expressions at every stopping point in the scope current at that stop point. Because the expression is not parsed at entry time, the correctness of the expression cannot be immediately verified. The watch command is valid only in native mode.

Syntax

watch

Print the list of expressions being displayed.

watch [-r|+r|-d|+d|-S|+S|-p|+p|-L|-fformat|-Fformat|-m|+m|--] expression

Watch the value of expression expression at every stopping point. See print Command for the meaning of these flags.

where:

expression is a valid expression.

format is the output format you want used to print the expression. For information about valid formats, see print Command.

whatis Command

In native mode, the whatis command prints the type of expression or declaration of type, or the definition of a macro. It also prints OpenMP data-sharing attribute information when applicable.

In Java mode, the whatis command prints the declaration of an identifier. If the identifier is a class, it prints method information for the class, including all inherited methods.

Native Mode Syntax

whatis [-n] [-r] [–m] [+m] name

Print the declaration of the non-type name, or the definition if name is a macro.

whatis -t [-r] [-u] type

Print the declaration of the type type.

whatis -e [-r] [-u] [-d] expression

Print the type of the expression expression.

where:

name is the name of a non-type or macro.

type is the name of a type.

expression is a valid expression.

macro is the name of a macro.

–d shows dynamic type instead of static type.

–e displays the type of an expression.

–n displays the declaration of a non-type. It is not necessary to specify -n; this is the default if you type the whatis command with no options.

–r prints information about base classes and types.

–t displays the declaration of a type.

–u displays the root definition of a type.

–m forces macro expansion even if the dbxenv variable macro_expand is set to off.

+m defeats macro lookup so that any symbols that might have been shadowed by macros are found instead.

The whatis command, when run on a C++ class or structure, provides you with a list of all the defined member functions, the static data members, the class friends, and the data members that are defined explicitly within that class. Undefined member functions are not listed.

Specifying the –r (recursive) option adds information from the inherited classes.

The–d flag, when used with the –e flag, uses the dynamic type of the expression.

    For C++, template-related identifiers are displayed as follows:

  • All template definitions are listed with whatis -t.

  • Function template instantiations are listed with whatis.

  • Class template instantiations are listed with whatis -t.

Java Mode Syntax

whatis identifier

Print the declaration of identifier.

where:

identifier is a class, a method in the current class, a local variable in the current frame, or a field in the current class.

when Command

The when command executes commands when a specified event occurs.

If dbx is in Java mode and you want to set a when breakpoint in native code, switch to Native mode using the joff command or prefix the when command with native.

If dbx is in JNI mode and you want to set a when breakpoint in Java code, prefix the when command with java.

Syntax

The when command has the following general syntax:

when event-specification [modifier]{command; ... }

    When the specified event occurs, the commands are executed. The following commands are forbidden in the when command:

  • attach

  • debug

  • next

  • replay

  • rerun

  • restore

  • run

  • save

  • step

A cont command with no options is ignored.

Native Mode Syntax

The following specific syntaxes are valid in native mode:

when at line-number { command; }

Execute command when line-number is reached.

when in procedure { command; }

Execute command when procedure is called.

where:

line-number is the number of a source code line.

command is the name of a command.

procedure is the name of a procedure.

Java Mode Syntax

The following specific syntaxes are valid in Java mode.

when at line-number

Execute command when source line-number is reached.

when at filename.line-number

Execute command when filename.line-number is reached.

when in class-name.method-name

Execute command when class-name.method-name is called.

when in class-name.method-name([parameters])

Execute command when class-name.method-name([parameters]) is called.

class-name is the name of a Java class. You can use either of the following:

  • The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner

  • The full path name preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers. For example, #test1/extra/T1$Inner. Enclose class-name in quotation marks if you use the $ qualifier.

filename is the name of a file.

line-number is the number of a source code line.

method-name is the name of a Java method.

parameters are the method’s parameters.

For a list and the syntax of all events, see Setting Event Specifications.

See wheni Command for information about executing commands on a specified low-level event.

wheni Command

The wheni command executes commands when a specified low-level event occurs. It is valid only in native mode.

Syntax

wheni event-specification [modifier]{command... ; }

When the specified event occurs, the commands are executed.

The following specific syntax is valid:

wheni at address { command; }

Execute command when address is reached.

where:

address is any expression resulting in or usable as an address.

command is the name of a command.

For a list and the syntax of all events see Setting Event Specifications.

where Command

The where command prints the call stack. For OpenMP slave threads, the command also prints the master thread's stack trace if the relevant frames are still active.

Native Mode Syntax

where

Print a procedure traceback.

where number

Print the number top frames in the traceback.

where –f number

Start traceback from frame number.

where –fp address-expression

Print traceback as if fp register had address-expression value.

where –h

Include hidden frames.

where –l

Include library name with function name.

where –q

Quick traceback (only function names).

where –v

Verbose traceback, which includes the function arguments and line information.

where:

address-expression is any expression resulting in or usable as an address.

number is a number of call stack frames.

Any of these options can be combined with a thread or LWP ID to obtain the traceback for the specified entity.

The –fp option is useful when the fp (frame pointer) register is corrupted, in which event dbx cannot reconstruct call stack properly. This option provides a shortcut for testing a value for being the correct fp register value. Once you have identified that the correct value has been identified, you can set it with an assign command or lwp command.

Java Mode Syntax

where [thread-ID]

Print a method traceback.

where -f [thread-ID] number

Print the number top frames in the traceback.

If f is specified, start traceback from frame number.

where -q [thread-ID]

Quick trace back (only method names).

where -v [thread-ID]

Verbose traceback, which includes the method arguments and line information.

where:

number is a number of call stack frames.

thread-ID is a dbx-style thread ID or the Java thread name specified for the thread.

whereami Command

The whereami command displays the current source line. It is valid only in native mode.

Syntax

whereami

Display the source line corresponding to the current location (top of the stack), and the source line corresponding to the current frame, if different.

whereami -instr

Same as previous, except that the current disassembled instruction is printed instead of the source line.

whereis Command

The whereis command prints all uses of a specified name, or symbolic name of an address. It is valid only in native mode.

Syntax

whereis name

Print all declarations of name.

whereis -a address-expression

Print location of an address-expression.

where:

name is the name of a loadable object that is in scope, for example, a variable, function, class template, or function template.

address is any expression resulting in or usable as an address.

which Command

The which command prints the full qualification of a specified name. It is valid only in native mode.

Syntax

which [-n] [–m] [+m] name

Print full qualification of name.

which -t type

Print full qualification of type.

where:

name is the name of loadable object that is in scope, for example, a variable, function, class template, or function template.

type is the name of a type.

–n displays the full qualification of a non-type. It is not necessary to specify –n; this is the default if you type the which command with no options.

–t displays the full qualification of a type.

–m forces macro lookup even if the dbxenv variable macro_expand is set to off.

+m defeats macro lookup so that any symbols that might have been shadowed by macros are found instead.

whocatches Command

The whocatches command tells where a C++ exception would be caught. It is valid only in native mode.

Syntax

whocatches type

Tell where (if at all) an exception of type type would be caught if thrown at the current point of execution. Assume the next statement to be executed is a throw x where x is of type type, and display the line number, function name, and frame number of the catch clause that would catch it.

Will return "type is unhandled" if the catch point is in the same function that is doing the throw.

where:

type is the type of an exception.