gdis.1 3.64 KB
'\"macro stdmacro
.\" -----------------------------------------------------
.\" | Copyright MIPS Computer Systems, Inc.  All Rights | 
.\" | Reserved. 	                                       |
.\" -----------------------------------------------------
.\" %Q% %M% %I% 
.TH DIS 1
.SH NAME
gdis \- disassemble an object file
.SH SYNOPSIS
.B gdis 
[ options ] file
.SH DESCRIPTION
.I gdis
disassembles object files into machine instructions.  
The options are as follows:
.PP
.TP 9
.BI \-b "\ \ beginaddress"
disassemble starting at the given address.
The address can be in decimal, octal (with a leading 0), or hexadecimal (with
a leading 0x).
.TP 9
.B \-d "\ \ section"
disassemble the named section as data,
printing the offset from the beginning of the section.
.TP 9
.B \-C 
demangle C++ names.
.TP 9
.BI \-D "\ \ section"
disassemble the named section as data,
printing the actual address of the data.
.TP 9
.BI \-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).
.TP 9
.BI \-F "\ \ function"
disassemble the named function only in each object file
specified on the command line.
This option may be specified multiple times
on the command line.
.TP 9
.B \-h
substitute the general register names for the software register names 
in the output.
.TP 9
.B \-H
remove the leading source line, leaving hex value and the instructions.
.TP 9
.B \-i
remove the leading source line and hexadecimal value of disassembly, 
leaving only the instructions.
.TP 9
.BI \-I  "\ \ directory"
use the \f2directory\f1 to help find the source code.
.TP 9
.BI \-l "\ \ string"
disassemble the archive file specified by \f2string\fP.
For example,
.B gdis -l x
would add \f2usr/lib/libx.a\fP to the files to be disassembled.
.TP 9
.B \-L
look up source labels for subsequent printing.
This option works only if the file was compiled
with debugging information.
.TP 9
.B \-o
print addresses and contents in octal.
The default is hexadecimal.
.TP 9
.B \-p "\ \ function"
Exactly the same meaning as \f4\-F \f2function\f1
.TP 9
.B \-s
perform 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
.B -svr4
option is given.
.TP 9
.B \-svr4
Print using svr4 output format.
This means (if no other options given) no externals are named (when loading
data off of the $gp register).
.TP 9
.B \-S
display 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, since \f2gdis\fP
simply looks for a source file starting with name/path
given in the object and continuing by looking in directories
specified with \f2-I\fP (if any) and accepts the first 
appropriately-named file
it finds as the source file.
.TP 9
.B \-T
trace flag is for debugging of the disassembler itself.
.TP 9
.BI \-t "\ \ section"
disassemble the named section as a text section.
.TP 9
.B \-V
print the version of
.I gdis
being executed.
.TP 9
.B \-w
attempts to
print source information (names of user variables involved)
after (to the right of) assembly codes.
This option  comes into effect only if \fI-s\fP is also specified,
but does not imply \fI-s\fP.
(But recall from above that -s is on by default unless -svr4 is specified,
so -w is effective by itself unless -svr4 was specified.)
.TP 9
.B \-x
prints offsets as hex numbers. This is the default.
.PP
If the
.BR \-d ,
.B \-D
or
.B \-t
options are specified, only those named sections
from each user-supplied filename will be disassembled.
Otherwise, all sections containing text will be disassembled.