gdis.1
3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
'\"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.