gdis (tool command)

Disassembles object files (.o)


gdis [ options ] file


gdis disassembles object files in machine instructions.

Command Line Options

-b beginaddress
Disassembles starting at the given address. The address can be in decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).

-d section
Disassembles the named section as data, printing the offset from the beginning of the section.

demangle C++ names.

-D section
Disassembles the named section as data, printing the actual address of the data.

-e endaddress
Disassembly stops at the given address. The address can be in decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).

-F function
Disassembles the named function only in each object file specified on the command line. This option may be specified multiple times on the command line.

Substitutes the general register names for the software register names in the output.

Removes the leading source line, leaving the hex value and the instructions.

Removes the leading source line and hexadecimal value of disassembly, leaving only the instructions.

-I directory
Uses the directory to help find the source code.

-l string
Disassembles the archive file specified by string.
For example, gdis -l x would add usr/lib/libx.a to the files to be disassembled.

Looks up source labels for subsequent printing. This option works only if the file was compiled with debugging information.

Prints addresses and contents in octal. The default is hexadecimal.

-p function
Exactly the same meaning as -F function.

Performs symbolic disassembly where possible. Symbolic disassembly output will appear on the line following the instruction. Symbol names will be printed in C syntax. This is the default unless the -svr4 option is given.

Prints using svr4 output format. This means (if no other options given) no externals are named (when loading data off of the $gp register).

Displays source code intermixed with the assembly code. There is no guarantee that the source code displayed is the source code used to compile the function because gdis simply looks for a source file starting with the name"/"path given in the object and continuing by looking in directories specified with -I (if any) and accepts the first appropriately-named file it finds as the source file.

Sets trace flag for debugging of the disassembler itself.

-t section
Disassembles the named section as a text section.

Prints the version of gdis being executed.

Attempts to print source information (names of user variables involved) after (to the right of) assembly codes. This option comes into effect only if -s is also specified, but does not imply -s. (But recall from above that -s is on by default unless -svr4 is specified, so -w is effective by itself unless -svr4 was specified.)

Prints offsets as hex numbers. This is the default.

If the -d, -D or -t options are specified, only those named sections from each user-supplied filename will be is assembled. Otherwise, all sections containing text will be disassembled.

Revision History

1999/04/30 Changed Format