DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using SCODB on SVR5

Options for modifying disassembly output

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> 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 no modes are given, dis prints the currently set list.

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 such as 8(%ebp) and C(%ebp) to be printed as @1 and @2, respectively, 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> u copen+8
   copen+8               movl   %esi,@1
   debug0:4> u mode -args
   debug0:5> u copen+8
   copen+8               movl   %esi,8(%ebp)
If the binary mode is set, the binary values of the instruction's bytes are printed:
   debug0:6> u copen+8
   copen+8               movl   %esi,@1
   debug0:7> u mode binary
   debug0:8> u copen+8
   copen+8                8B 75 08             movl   %esi,8(%ebp)
The disp mode modifies the output of displacements to a more intuitive format:
   debug0:9> u copen+8
   copen+8               movl   %esi,8(%ebp)
   debug0:10> u mode disp
   debug0:11> u copen+8
   copen+8               movl   %esi,(8+%ebp)
The intel mode shows operands in the "destination, source" order rather than the "source, destination" order. This mode is set by default:
   debug0:12> u copen+8
   copen+8               movl   %esi,@1
   debug0:13> u mode -intel
   debug0:14> u copen+8
   copen+8               movl   @1,%esi
The reg mode prefaces register names with a %, to make register names stand out. This mode is set by default:
   debug0:15> u copen+8
   copen+8               movl   %esi,@1
   debug0:16> u mode -reg
   debug0:17> u copen+8
   copen+8               movl   esi,@1
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:
   <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> u main+9
   main+9                movl   %eax,&u.u_tss
   debug0:19> u mode -sym
   debug0:20> u main+9
   main+9                movl   %eax,(E00010000)
Note that structure fields are only printed if the structure being named has been associated with an address.

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.


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005