dis has different parameters that affect its output format. These can be set and listed with the mode option. If dis is given the mode list argument, the possible modes are listed:
debug0:2>If no modes are given, dis prints the currently set list.
u mode list
default - set default mode.
args - display '@' before function arguments.
binary - print instruction bytes.
disp - print #(reg) as (#+reg).
intel - display operands as <destination, source>.
reg - display '%' before register names.
sym - symbolic output.
immed - display '$' before immediate operands.
static - display static text symbols.
If a mode is input with a ``-'' before it (for example, -intel), that mode is turned off.
Specify default to set the default combination as configured.
The args mode causes memory references
to be printed as
rather than the explicit memory reference,
as an aid to show that the memory reference
is to a function argument.
This mode is set by default.
The following example shows the effect
of switching the value of the args mode:
debug0:3>If the binary mode is set, the binary values of the instruction's bytes are printed:
u copen+8copen+8 movl %esi,@1 debug0:4>
u mode -argsdebug0:5>
u copen+8copen+8 movl %esi,8(%ebp)
debug0:6>The disp mode modifies the output of displacements to a more intuitive format:
u copen+8copen+8 movl %esi,@1 debug0:7>
u mode binarydebug0:8>
u copen+8copen+8 8B 75 08 movl %esi,8(%ebp)
debug0:9>The intel mode shows operands in the "destination, source" order rather than the "source, destination" order. This mode is set by default:
u copen+8copen+8 movl %esi,8(%ebp) debug0:10>
u mode dispdebug0:11>
u copen+8copen+8 movl %esi,(8+%ebp)
debug0:12>The reg mode prefaces register names with a %, to make register names stand out. This mode is set by default:
u copen+8copen+8 movl %esi,@1 debug0:13>
u mode -inteldebug0:14>
u copen+8copen+8 movl @1,%esi
debug0:15>If the sym mode is set, u prints symbol names rather than addresses if a match is found. This mode is set by default. If the sym mode is not set, u will occasionally output constructs such as:
u copen+8copen+8 movl %esi,@1 debug0:16>
u mode -regdebug0:17>
u copen+8copen+8 movl esi,@1
<sym+offset>This output is only meant to be advisory, and is printed if an address or immediate value is close (within 0x10000 bytes) to a symbol.
The following example shows the effect of switching the value of the sym mode:
debug0:18>Note that structure fields are only printed if the structure being named has been associated with an address.
u main+9main+9 movl %eax,&u.u_tss debug0:19>
u mode -symdebug0:20>
u main+9main+9 movl %eax,(E00010000)
If immed mode is set, then all immediate mode symbols are preceded by an ``&'' character. This is synonymous with its use in C, where it distinguishes the address of a variable from the value of a variable.
If static mode is set, then static text symbols are displayed as well as global text symbols.