Sun Studio 12 Update 1: Debugging a Program With dbx

loadobject Command

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

Syntax

loadobject -list [regexp] [-a]

Show currently loaded load objects (see loadobject -list Command

loadobject -load loadobject

Load symbols for specified load object (see loadobject -load Command).

loadobject -unload [regexp]

Unload specified load objects (see loadobject -unload Command).

loadobject -hide [regexp]

Remove load object from dbx's search algorithm (see loadobject -hide Command).

loadobject -use [regexp]

Add load object to dbx's search algorithm (see loadobject -use Command).

loadobject -dumpelf [regexp]

Show various ELF details of the load object (see loadobject -dumpelf Command).

loadobject -exclude ex_regexp

Don't automatically load load objects matching ex_regexp (see loadobject -exclude Command).

loadobject exclude -clear

Clear the exclude list of patterns (see loadobject -exclude Command).

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 Solaris OS commands dump or elfdump.

loadobject -exclude Command

The loadobject -exclude command tells dbx not to automatically load load objects 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 loadobjects 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

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 loadobject

where:

loadobject can be a full path name or a library in /usr/lib, /usr/lib/sparcv9, or /usr/lib/amd64. If there is a program 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 may 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.