#       adb.help 1.3 94/10/10
#
# Copyright 10/10/94 Sun Microsystems, Inc. All Rights Reserved
#
# Help file for adb.so: `help adb'
#
adb                     # enter adb mode
adb <cmd>               # execute one adb command

When in adb mode, variable ($foo) substitution is disabled.
Command-line editing and history are supported in adb mode.

Quick Start Summary:

    $c                  # show the call stack
    $C                  # show a verbose call stack

    <sym>:b             # set breakpoint at symbol
    :d                  # delete all breakpoints at $pc

    :r                  # run; begin executing from the beginning
    :c                  # continue execution
    :s                  # single step one instruction
    :e                  # single step, do not stop in called functions

    $r                  # display registers
    $b                  # list breakpoints

    <sym>?X             # display value of variable as hex word (4 bytes)

    $q                  # quit (exit adb mode; does not exit dbx)
    @<dbxcmd>           # execute a dbx command, return to adb mode

Usage:
        <objfile> refers to to the executable image on disk; <corefile> refers
        to the live process or core file, as appropriate.

        The symbol `.' represents the current location.

        Commands consist of three optional parts and are separated by
        semicolons or newlines:

                [ <address> ]  [ , <count> ]  [ <command> ]  [ ; ]

        <address> and <count> are expressions (see below).  The default
        <address> is `.'; the default <count> is 1.

        In the following, an asterisk (*) at the left margin marks significant
        differences between this command and the `adb' program.

Numbers:
        The current input radix (see `$d') determines the interpretation
        of numbers which start with a digit from 0 through 9.

*       Unlike the adb program, this command does not accept hex numbers which
*       start with a letter; use `0x...'.

        Regardless of the current input radix, numbers which start with
        `0o' or `0O' are taken as octal, `0t' or `0T' as decimal, and
        `0x' or `0X' as hexadecimal.

Expressions:
        .       the current location
        +       `.' incremented by the current increment
        ^       `.' decremented by the current increment
        &       the last address typed

        n       an integer constant
        n.n     a floating point number
        'c'     ASCII constant (one to four characters)
        <name   the value of <name>, which is either a variable name or
                a register name
        sym     a symbol

        (exp)   parentheses may be used for grouping

        *exp    the contents of <exp> in <corefile>
        %exp    the contents of <exp> in <objfile>

        -exp    integer negation
        ~exp    bitwise complement
        #exp    logical negation

        e+e     integer addition
        e-e     integer subtraction
        e*e     integer multiplication
        e%e     integer division
        e&e     bitwise `and'
        e|e     bitwise `or'
        e1#e2   <e1> rounded up to the next multiple of <e2>

#Variables:
#       <0      The last value printed
#       <1      The last offset part of an instruction source
#       <2      The previous value of <1
#       <9      The count on the last $< or $<< command
#       <b      The base address of the data segment
#       <d      The data segment size
#       <e      The entry point
#       <m      The `magic number'
#       <t      The text segment size

Commands:
        ?       print locations starting at <addr> in <objfile>
        /       print locations startind at <addr> in <corefile>
        =       print the value of <addr>
        :       manage a subprocess
        $       status, miscellaneous actions
        >       assign a value to a variable or register
#       !       shell escape
        <RET>   repeat the previous command with <count> of 1 and increment `.'
*       @       execute a dbx-style command

Modifiers of ?, /, and =:
     The following format modifiers apply to the commands  ?,  /,
     and  =.   To  specify a format, follow the command with an
     optional repeat count, and the desired format letter or
     letters:

          {?,/,=} [ [ r ] f ... ] ]

     where <r> is a repeat count,  and <f> is one of the format letters
     listed below:
     o              (`.' increment: 2) Print 2 bytes in octal
     O              (4) Print 4 bytes in octal
     q              (2) Print in signed octal
     Q              (4) Print long signed octal
     d              (2) Print in decimal
     D              (4) Print long decimal
     x              (2) Print 2 bytes in hexadecimal
     X              (4) Print 4 bytes in hexadecimal
     u              (2) Print as an unsigned decimal number
     U              (4) Print long unsigned decimal
     f              (4) Print a single-precision floating-point number
     F              (8) Print a double-precision floating-point number
     b              (1) Print the addressed byte in octal
     c              (1) Print the addressed character
     C              (1) Print the addressed character using ^ escape convention
     s              (n) Print the addressed string
     S              (n) Print a string using the ^ escape convention.
     Y              (4) Print 4 bytes in date format
     i              (4 on SPARC;  n  on  x86)  Print as machine instructions
     a              (0) Print the value of `.' in symbolic form
     p              (4) Print the addressed value in symbolic form
     t              (0) Tab to the next appropriate TAB stop
     r              (0) Print a SPACE
     n              (0) Print a NEWLINE
     "..."          (0) Print the enclosed string
     ^              (0) Decrement `.'
     +              (0) Increment `.'
     -              (0) Decrement `.' by 1

\: Modifiers
     b              Set breakpoint
     b <cmds>       Set breakpoint, execute commands when reached
     r              Run <objfile> as a subprocess with previous arguments
#     r <args>       Run <objfile> as a subprocess with new arguments
     d              Delete breakpoint at <addr>
     z              Delete all breakpoints
*    D              Delete all breakpoints
     c              Continue the subprocess
     s              Single-step the subprocess
*    e              Single-step, but do not stop in called functions
     i              Add the signal specified by <addr> to the list of signals
                    passed directly to the subprocess (`ignore')
*    I              Add all signals to the list of signals to be passed directly
                    to the process (`ignore all')
     t              Remove the signal specified by <addr> from the list
                    implicitly passed to the subprocess (`catch')
*    T              Remove all signals from the list from the list implicitly
                    passed to the subprocess (`catch all')
     k              Terminate (kill) the current  subprocess, if any
     A              Attach to an existing process id.  (For example, 
                    0t1234:A would attach to decimal process number 1234.)
     R              Release a previously attached process

\$ Modifiers
     <filename      Read commands from the file <filename>
     <<filename     Similar to <, but can be used in a file of commands
                    without closing the file
     >filename      Append output to filename, which is created if it does
                    not exist.
#     l              x86:  Show the  current  lightweight  process
#                    (lwp) ID.
#     L              x86:  Show all the lwp IDs.
#     P              Specify the adb prompt string.
     ?              Print process ID, the signal which stopped the subprocess,
                    and the registers.
     r              Print the names and contents of the general registers, and
                    the instruction addressed by <pc.
#     x or X         x86:  Print the contents  of  floating  point
#                    registers.  $x  and $X accept a "count" which
#                    determines the precision in which the  float-
#                    ing  point  registers  will  be  printed; the
#                    default is 25.  Using $X  will  produce  more
#                    verbose output than using $x.
#     x              SPARC:   Print  the  names  and  contents  of
#                    floating-point registers 0 through 15.
#     X              SPARC:   Print  the  names  and  contents  of
#                    floating-point registers 16 through 31.
     b              Print all breakpoints and their associated counts and
                    commands
*    c              C stack backtrace, no arguments, file names, or line numbers
*    C              Same as $c, but in addition it displays the arguments, 
                    file name, and line number for each frame
     d              Set the default radix to address and report the new value.
                    Note: <addr> is interpreted in the current radix.  Thus
                    `10$d' never changes the default radix.
#     e              Print the names and values of external  vari-
#                    ables.
#     w              Set the page  width  for  output  to  address
#                    (default 80).
#     s              Set the limit for symbol matches  to  address
#                    (default 255).
     o              All integers input are regarded as octal
*    q              Exit from adb mode (does not quit from dbx)
     v              Print all non-zero user variables in hex
*    V              Print the values of all (user) variables in hex
*    m              Print the address map (list of loadobjects with low and
                    high text addresses)
#     f              Print a list of known source filenames.
     i              Show which signals are passed to the  subprocess with
                    the minimum of interference
*    I              List all signals and indicate which will be passed
                    implicitly to the subprocess (flag == 1)
#     W              Reopen objectfile and corefile  for  writing,
#                    as  though  the  -w command-line argument had
#                    been given.
