Annotation of researchv10dc/man/adm/man1/adb.1, revision 1.1.1.1

1.1       root        1: .TH ADB 1
                      2: .CT 1 debug_tune
                      3: .ds TW \v'.25m'\s+2~\s-2\v'-.25m'
                      4: .ds ST \v'.25m'*\v'-.25m'
                      5: .ds IM \v'.1m'=\v'-.1m'\s-2\h'-.1m'>\h'.1m'\s+2
                      6: .ds LE \(<=
                      7: .ds LT \s-2<\s+2
                      8: .ds GT \s-2>\s+2
                      9: .SH NAME
                     10: adb \- debugger
                     11: .SH SYNOPSIS
                     12: .B adb
                     13: [
                     14: .I option ...
                     15: ]
                     16: [
                     17: .I objfil
                     18: [
                     19: .I corfil
                     20: ]
                     21: ]
                     22: .SH DESCRIPTION
                     23: .I Adb
                     24: is a general purpose debugging program.
                     25: It may be used to examine files and to provide
                     26: a controlled environment for the execution
                     27: of UNIX programs.
                     28: .PP
                     29: .I Objfil
                     30: is normally an executable program file, preferably
                     31: containing a symbol table;
                     32: if not then the
                     33: symbolic features of
                     34: .I  adb
                     35: cannot be used although the file can still
                     36: be examined.
                     37: The default for
                     38: .I objfil
                     39: is
                     40: .LR a.out .
                     41: .I Corfil
                     42: is assumed to be a core image file produced after
                     43: executing
                     44: .IR objfil ;
                     45: the default for
                     46: .I corfil
                     47: is
                     48: .LR core .
                     49: .PP
                     50: Requests to
                     51: .I  adb
                     52: are read from the standard input and
                     53: responses are to the standard output.
                     54: Quit signals are ignored; interrupts
                     55: cause return to the next
                     56: .I adb
                     57: command.
                     58: The options are
                     59: .TP
                     60: .B -w
                     61: Create
                     62: .I objfil
                     63: and
                     64: .I corfil
                     65: if they don't exist; open them for writing
                     66: as well as reading.
                     67: .TP
                     68: .BI -I path
                     69: Directory in which to look for relative pathnames in
                     70: .B $<
                     71: and
                     72: .B $<<
                     73: commands.
                     74: .PP
                     75: In general requests to
                     76: .I  adb
                     77: have the following form.
                     78: Multiple requests on one line must be separated by
                     79: .LR ; .
                     80: .IP
                     81: .RI [ address ]
                     82: .RB [ ,
                     83: .IR count ]
                     84: .RI [ command ]
                     85: .PP
                     86: If
                     87: .I address
                     88: is present then the current position, called `dot',
                     89: is set to
                     90: .IR address .
                     91: Initially dot
                     92: is set to 0.
                     93: In general commands are repeated
                     94: .I count
                     95: times.
                     96: Dot advances between repetitions.
                     97: The default
                     98: .I count
                     99: is 1.
                    100: .I Address
                    101: and
                    102: .I count
                    103: are expressions.
                    104: .PP
                    105: Some formats,
                    106: data sizes,
                    107: and command details have
                    108: different behavior
                    109: on different systems.
                    110: See the
                    111: .SM "MACHINE DEPENDENCIES"
                    112: attachment for details.
                    113: .SS Expressions
                    114: Expressions are computed with sufficient precision
                    115: to address the largest possible file;
                    116: generally this means a long integer.
                    117: On the VAX,
                    118: expressions are 32 bits;
                    119: on the Cray,
                    120: 64 bits.
                    121: .TP 7.2n
                    122: .B .
                    123: The value of dot.
                    124: .TP 7.2n
                    125: .B +
                    126: The value of dot
                    127: incremented by the current increment.
                    128: .TP 7.2n
                    129: .B ^
                    130: The value of dot
                    131: decremented by the current increment.
                    132: .TP 7.2n
                    133: .B \&"
                    134: The last
                    135: .I address
                    136: typed.
                    137: .TP 7.2n
                    138: .I integer
                    139: A number
                    140: in the
                    141: .IR "default radix" ;
                    142: see the
                    143: .B $d
                    144: command.
                    145: Regardless of the default,
                    146: the prefixes
                    147: .L 0o
                    148: and
                    149: .L 0O
                    150: (zero oh) force interpretation
                    151: in octal radix; the prefixes
                    152: .L 0t
                    153: and
                    154: .L 0T
                    155: force interpretation in
                    156: decimal radix; the prefixes
                    157: .LR 0x ,
                    158: .LR 0X ,
                    159: and
                    160: .L #
                    161: force interpretation in
                    162: hexadecimal radix.
                    163: Thus
                    164: .LR 0o20 ,
                    165: .LR 0t16 ,
                    166: and
                    167: .L #10 
                    168: all represent sixteen.
                    169: .TP 7.2n
                    170: .IB integer . fraction
                    171: A floating point number.
                    172: .TP 7.2n
                    173: .BI \' cccc\| \'
                    174: The
                    175: .SM ASCII 
                    176: value of one or more characters.
                    177: .L \e
                    178: may be used to escape a
                    179: .LR \' .
                    180: .TP 7.2n
                    181: .BI < name
                    182: The value of
                    183: .IR name ,
                    184: which is either a variable name or a register name.
                    185: .I Adb
                    186: maintains a number of variables
                    187: named by single letters or digits.
                    188: The register names are
                    189: those printed by the
                    190: .B $r
                    191: command.
                    192: .TP 7.2n
                    193: .I symbol
                    194: A
                    195: .I symbol
                    196: is a sequence
                    197: of upper or lower case letters, underscores or
                    198: digits, not starting with a digit.
                    199: .L \e
                    200: may be used to escape other characters.
                    201: The value of the
                    202: .I symbol
                    203: is taken from the symbol table
                    204: in
                    205: .IR objfil .
                    206: .TP 7.2n
                    207: .IB routine . name
                    208: The address of the variable
                    209: .I name
                    210: in the specified
                    211: C routine.
                    212: Both
                    213: .I routine
                    214: and
                    215: .I name
                    216: are
                    217: .IR symbols .
                    218: If
                    219: .I name
                    220: is omitted the value is the address of the
                    221: most recently activated C stack frame
                    222: corresponding to
                    223: .IR routine ;
                    224: if
                    225: .I routine
                    226: is omitted,
                    227: the active procedure
                    228: is assumed.
                    229: .TP 7.2n
                    230: .BI ( exp )
                    231: The value of the expression
                    232: .IB exp .
                    233: .LP
                    234: .I  Monadic operators
                    235: .TP 7.2n
                    236: .BI * exp
                    237: The contents of the location addressed
                    238: by
                    239: .I exp
                    240: in
                    241: .IR corfil .
                    242: .TP 7.2n
                    243: .BI @ exp
                    244: The contents of the location addressed by
                    245: .I exp
                    246: in
                    247: .IR objfil .
                    248: .TP 7.2n
                    249: .BI - exp
                    250: Integer negation.
                    251: .TP 7.2n
                    252: .BI ~ exp
                    253: Bitwise complement.
                    254: .TP 7.2n
                    255: .BI % exp
                    256: If
                    257: .I exp
                    258: is used as an address,
                    259: it is in register space;
                    260: see `Addresses'.
                    261: .LP
                    262: .I "Dyadic\ operators"
                    263: are left associative
                    264: and are less binding than monadic operators.
                    265: .TP 7.2n
                    266: .IB e1 + e2
                    267: Integer addition.
                    268: .TP 7.2n
                    269: .IB e1 - e2
                    270: Integer subtraction.
                    271: .TP 7.2n
                    272: .IB e1 * e2
                    273: Integer multiplication.
                    274: .TP 7.2n
                    275: .IB e1 % e2
                    276: Integer division.
                    277: .TP 7.2n
                    278: .IB e1 & e2
                    279: Bitwise conjunction.
                    280: .TP 7.2n
                    281: .IB e1 | e2
                    282: Bitwise disjunction.
                    283: .TP 7.2n
                    284: .IB e1 # e2
                    285: .I E1
                    286: rounded up to the next multiple of
                    287: .IR e2 .
                    288: .DT
                    289: .SS Commands
                    290: Most commands consist of a verb followed by a modifier or list
                    291: of modifiers.
                    292: The following verbs are available.
                    293: (The commands
                    294: .L ?
                    295: and
                    296: .L /
                    297: may be followed by 
                    298: .LR * ;
                    299: see `Addresses'
                    300: for further details.)
                    301: .TP .5i
                    302: .BI ? f
                    303: Locations starting at
                    304: .I address
                    305: in
                    306: .I  objfil
                    307: are printed according to the format
                    308: .IR f .
                    309: .TP
                    310: .BI / f
                    311: Locations starting at
                    312: .I address
                    313: in
                    314: .I  corfil
                    315: are printed according to the format
                    316: .I f.
                    317: .TP
                    318: .BI  = f
                    319: The value of
                    320: .I address
                    321: itself is printed in the
                    322: styles indicated by the format
                    323: .IR f .
                    324: (For
                    325: .B i 
                    326: format 
                    327: .L ?
                    328: is printed for the parts of the instruction that reference
                    329: subsequent words.)
                    330: .PP
                    331: A
                    332: .I format
                    333: consists of one or more characters that specify a style
                    334: of printing.
                    335: Each format character may be preceded by a decimal integer
                    336: that is a repeat count for the format character.
                    337: If no format is given then the last format is used.
                    338: .PP
                    339: Most format letters fetch some data,
                    340: print it,
                    341: and advance (a local copy of) dot
                    342: by the number of bytes fetched.
                    343: The total number of bytes in a format becomes the
                    344: .I current increment.
                    345: `Long integers' are full words,
                    346: the size of an expression item:
                    347: e.g.\&
                    348: 4 bytes on the VAX,
                    349: 8 bytes on the Cray.
                    350: `Short integers'
                    351: are some useful shorter size:
                    352: 2 byte short integers on the VAX,
                    353: 2 byte parcels on the Cray.
                    354: .ta 2.5n .5i
                    355: .RS
                    356: .TP
                    357: .PD 0
                    358: .B r
                    359: Print short integer in the current default radix.
                    360: .TP
                    361: .PD 0
                    362: .B R
                    363: Print long integer in the current default radix.
                    364: .TP
                    365: .PD 0
                    366: .B o
                    367: Print short integer in octal.
                    368: .TP
                    369: .B O
                    370: Print long integer in octal.
                    371: .TP
                    372: .B q
                    373: Print short in signed octal.
                    374: .TP
                    375: .B Q
                    376: Print long in signed octal.
                    377: .TP
                    378: .B d
                    379: Print short in decimal.
                    380: .TP
                    381: .B D
                    382: Print long in decimal.
                    383: .TP
                    384: .B x
                    385: Print short in hexadecimal.
                    386: .TP
                    387: .B X
                    388: Print long in hexadecimal.
                    389: .TP
                    390: .B u
                    391: Print short in unsigned decimal.
                    392: .TP
                    393: .B U
                    394: Print long in unsigned decimal.
                    395: .TP
                    396: .B f
                    397: Print
                    398: as a floating point number.
                    399: .TP
                    400: .B F
                    401: Print double-precision floating point.
                    402: .TP
                    403: .B b
                    404: Print the addressed byte in octal.
                    405: .TP
                    406: .B c
                    407: Print the addressed character.
                    408: .TP
                    409: .B C
                    410: Print the addressed character.
                    411: Control characters
                    412: are printed in the form
                    413: .BI ^ X
                    414: and the delete character is printed as
                    415: .LR ^? .
                    416: .TP
                    417: .B s
                    418: Print the addressed characters until a zero character
                    419: is reached.
                    420: Advance dot
                    421: by the length of the string,
                    422: including the zero terminator.
                    423: .TP
                    424: .B S
                    425: Print a string using 
                    426: the
                    427: .BI ^ X
                    428: escape convention (see
                    429: .B C
                    430: above).
                    431: .TP
                    432: .B Y
                    433: Print a long integer in date format (see
                    434: .IR ctime (3)).
                    435: .TP
                    436: .B i
                    437: Print as machine instructions.
                    438: This style of printing causes variables
                    439: 0, (1, ...)
                    440: to be set to the offset parts
                    441: of the first (second, ...)
                    442: operand of the instruction.
                    443: .TP
                    444: .B a
                    445: Print the value of dot
                    446: in symbolic form.
                    447: Dot is unaffected.
                    448: .TP
                    449: .B p
                    450: Print the addressed value in symbolic form.
                    451: Dot is advanced by the size of a machine address
                    452: (4 bytes on the VAX,
                    453: 8 bytes on the Cray).
                    454: .TP
                    455: .B t
                    456: When preceded by an integer tabs to the next
                    457: appropriate tab stop.
                    458: For example,
                    459: .B 8t 
                    460: moves to the next 8-space tab stop.
                    461: Dot is unaffected.
                    462: .TP
                    463: .B n
                    464: Print a newline.
                    465: Dot is unaffected.
                    466: .tr '"
                    467: .TP
                    468: .BR ' ... '
                    469: Print the enclosed string.
                    470: Dot is unaffected.
                    471: .br
                    472: .tr ''
                    473: .TP
                    474: .B ^
                    475: Dot is decremented by the current increment.
                    476: Nothing is printed.
                    477: .TP
                    478: .B +
                    479: Dot is incremented by 1.
                    480: Nothing is printed.
                    481: .TP
                    482: .B -
                    483: Dot is decremented by 1.
                    484: Nothing is printed.
                    485: .RE
                    486: .PD
                    487: .TP
                    488: newline
                    489: Update dot by the current increment.
                    490: Repeat the previous command with a
                    491: .I count
                    492: of 1.
                    493: .TP
                    494: .RB [ ?/ ] l "\fI value mask\fR"
                    495: Words starting at dot
                    496: are masked with
                    497: .I mask
                    498: and compared with
                    499: .I value
                    500: until
                    501: a match is found.
                    502: If
                    503: .B l
                    504: is used,
                    505: the match is for a short integer;
                    506: .B L
                    507: matches longs.
                    508: If no match is found then dot
                    509: is unchanged; otherwise dot
                    510: is set to the matched location.
                    511: If
                    512: .I mask
                    513: is omitted then \-1 is used.
                    514: .TP
                    515: .RB [ ?/ ] w "\fI value ...\fR"
                    516: Write the short
                    517: .I value
                    518: into the addressed
                    519: location.
                    520: If the command is
                    521: .BR W ,
                    522: write a long.
                    523: Option
                    524: .B -w
                    525: must be in effect.
                    526: .TP
                    527: .RB [ ?/ ] "m\fI b e f \fP" [ ?\fR]
                    528: .br
                    529: New values for
                    530: .RI ( b,\ e,\ f )
                    531: in the first map entry
                    532: are recorded.
                    533: If less than three expressions are given then
                    534: the remaining map parameters are left unchanged.
                    535: The address type (instruction or data)
                    536: is unchanged in any case.
                    537: If the
                    538: .L ?
                    539: or
                    540: .L /
                    541: is followed by
                    542: .L *
                    543: then
                    544: the second segment
                    545: of the mapping is changed.
                    546: If the list is terminated by
                    547: .L ?
                    548: or
                    549: .L /
                    550: then the file
                    551: .RI ( objfil
                    552: or
                    553: .I corfil
                    554: respectively) is used
                    555: for subsequent requests.
                    556: For example,
                    557: .L /m?
                    558: will cause
                    559: .L /
                    560: to refer to
                    561: .IR objfil .
                    562: .TP
                    563: .BI > name
                    564: Dot is assigned to the variable or register named.
                    565: .TP
                    566: .B !
                    567: A shell is called to read the
                    568: rest of the line following `!'.
                    569: .TP
                    570: .BI $ modifier
                    571: Miscellaneous commands.
                    572: The available 
                    573: .I modifiers 
                    574: are:
                    575: .RS
                    576: .TP
                    577: .PD 0
                    578: .BI < f
                    579: Read commands from the file
                    580: .IR f .
                    581: If
                    582: .I f
                    583: cannot be found, try
                    584: .BI /usr/lib/adb/ f.
                    585: If this command is executed in a file, further commands
                    586: in the file are not seen.
                    587: If
                    588: .I f
                    589: is omitted, the current input stream is terminated.
                    590: If a
                    591: .I count
                    592: is given, and is zero, the command will be ignored.
                    593: The value of the count will be placed in variable
                    594: .B 9
                    595: before the first command in
                    596: .I f
                    597: is executed.
                    598: .TP
                    599: .BI << f
                    600: Similar to
                    601: .B <
                    602: except it can be used in a file of commands without
                    603: causing the file to be closed.
                    604: Variable
                    605: .B 9
                    606: is saved during the execution of this command, and restored
                    607: when it completes.
                    608: There is a (small) limit to the number of
                    609: .B <<
                    610: files that can be open at once.
                    611: .br
                    612: .ns
                    613: .TP
                    614: .BI > f
                    615: Append output to the file
                    616: .IR f ,
                    617: which is created if it does not exist.
                    618: If
                    619: .I f
                    620: is omitted, output is returned to the terminal.
                    621: .TP
                    622: .B ?
                    623: Print process id, the signal which caused stopping or termination,
                    624: as well as the registers.
                    625: This is the default if
                    626: .I modifier
                    627: is omitted.
                    628: .TP
                    629: .B r
                    630: Print the general registers and
                    631: the instruction addressed by
                    632: .BR pc .
                    633: Dot is set to
                    634: .BR pc .
                    635: .TP
                    636: .B R
                    637: Like
                    638: .BR $r ,
                    639: but include miscellaneous registers
                    640: such as the kernel stack pointer.
                    641: .TP
                    642: .B b
                    643: Print all breakpoints
                    644: and their associated counts and commands.
                    645: .TP
                    646: .B c
                    647: C stack backtrace.
                    648: If
                    649: .I address
                    650: is given then it is taken as the
                    651: address of the current frame;
                    652: otherwise,
                    653: the current C frame pointer
                    654: is used.
                    655: If
                    656: .B C 
                    657: is used then the names and (long) values of all
                    658: parameters,
                    659: automatic
                    660: and static variables are printed for each active function.
                    661: If
                    662: .I count
                    663: is given then only the first
                    664: .I count
                    665: frames are printed.
                    666: .TP
                    667: .B a
                    668: Set the maximum number of arguments
                    669: printed by
                    670: .B $c
                    671: or
                    672: .B $C
                    673: to
                    674: .IR address .
                    675: The default is 20.
                    676: .TP
                    677: .B d
                    678: Set the default radix to
                    679: .I address
                    680: and report the new value.
                    681: .I Address
                    682: is interpreted in the (old) current radix;
                    683: .L 10$d
                    684: never changes the default radix.
                    685: To make decimal the default radix, use
                    686: .LR 0t10$d .
                    687: A radix of zero (the initial default) is a special case;
                    688: input with a leading zero is octal,
                    689: that with a leading sharp-sign
                    690: .L #
                    691: is hexadecimal,
                    692: other numbers are decimal.
                    693: When the default radix is zero,
                    694: the default output radix is
                    695: appropriate to the machine:
                    696: hexadecimal on the VAX,
                    697: octal on the Cray.
                    698: .TP
                    699: .B e
                    700: The names and values of all
                    701: external variables are printed.
                    702: .TP
                    703: .B w
                    704: Set the page width for output to
                    705: .I address
                    706: (default 80).
                    707: .TP
                    708: .B s
                    709: Set the limit for symbol matches to
                    710: .I address
                    711: (default 255).
                    712: .TP
                    713: .B q
                    714: Exit from
                    715: .IR adb .
                    716: .TP
                    717: .B v
                    718: Print all non zero variables in the current radix.
                    719: .TP
                    720: .B m
                    721: Print the address maps.
                    722: .TP
                    723: .B k
                    724: Simulate kernel memory management.
                    725: .TP
                    726: .B p
                    727: Simulate per-process memory management.
                    728: .IP
                    729: .B $k
                    730: and
                    731: .B $p
                    732: are used for system debugging.
                    733: Their details vary with machine and operating system.
                    734: .PD
                    735: .RE
                    736: .TP
                    737: .BI : modifier
                    738: Manage a subprocess.
                    739: Available modifiers are:
                    740: .RS
                    741: .TP
                    742: .PD 0
                    743: .BI b c
                    744: Set breakpoint at
                    745: .IR address .
                    746: The breakpoint is executed
                    747: .IR count \-1
                    748: times before
                    749: causing a stop.
                    750: Each time the breakpoint is encountered
                    751: the command
                    752: .I c
                    753: is executed.
                    754: If this command is omitted or sets dot
                    755: to zero
                    756: then the breakpoint causes a stop.
                    757: .TP
                    758: .B d
                    759: Delete breakpoint at
                    760: .IR address .
                    761: .TP
                    762: .B r
                    763: Run
                    764: .I objfil
                    765: as a subprocess.
                    766: If
                    767: .I address
                    768: is given explicitly then the
                    769: program is entered at this point; otherwise
                    770: the program is entered at its standard entry point.
                    771: .I count
                    772: specifies how many breakpoints are to be
                    773: ignored before stopping.
                    774: Arguments to the subprocess may be supplied on the
                    775: same line as the command.
                    776: An argument starting with < or > causes the standard
                    777: input or output to be established for the command.
                    778: All signals are enabled on entry to the subprocess.
                    779: .TP
                    780: .BI c s
                    781: The subprocess is continued.
                    782: If
                    783: .I s
                    784: is omitted
                    785: or nonzero,
                    786: the subprocess
                    787: is sent the signal that caused it to stop;
                    788: if 0
                    789: is specified,
                    790: no signal is sent.
                    791: Breakpoints
                    792: and single-stepping
                    793: don't count as signals.
                    794: Breakpoint skipping is the same
                    795: as for
                    796: .BR r .
                    797: .TP
                    798: .BI s s
                    799: As for
                    800: .B c 
                    801: except that
                    802: the subprocess is single stepped
                    803: .I count
                    804: times.
                    805: If a signal is sent,
                    806: it is received
                    807: before the first instruction is executed.
                    808: If there is no current subprocess then
                    809: .I objfil
                    810: is run
                    811: as a subprocess as for
                    812: .BR r .
                    813: In this case no signal can be sent; the remainder of the line
                    814: is treated as arguments to the subprocess.
                    815: .TP
                    816: .B k
                    817: The current subprocess, if any, is terminated.
                    818: .PD
                    819: .RE
                    820: .SS Variables
                    821: .I Adb
                    822: provides a number of variables.
                    823: Named variables are set initially by
                    824: .I  adb
                    825: but are not used subsequently.
                    826: Numbered variables are reserved for communication
                    827: as follows.
                    828: .TP
                    829: .BR 0 ", " 1 ", ..."
                    830: The offset parts of the first, second, ...
                    831: operands of the last instruction printed.
                    832: Meaningless if the operand was a register.
                    833: .br
                    834: .ns
                    835: .TP
                    836: .B 9
                    837: The count on the last
                    838: .B $<
                    839: or
                    840: .B $<<
                    841: command.
                    842: .PP
                    843: On entry the following are set
                    844: from the system header in the
                    845: .IR corfil .
                    846: If
                    847: .I corfil
                    848: does not appear to be a
                    849: core image then
                    850: these values are set from
                    851: .IR objfil .
                    852: .TP
                    853: .B b
                    854: The base address of the data segment.
                    855: .PD 0
                    856: .TP
                    857: .B d
                    858: The data segment size.
                    859: .TP
                    860: .B e
                    861: The entry point.
                    862: .TP
                    863: .B m
                    864: The `magic' number
                    865: .RI ( a.out (5)).
                    866: .TP
                    867: .B s
                    868: The stack segment size.
                    869: .TP
                    870: .B t
                    871: The text segment size.
                    872: .PD
                    873: .SS Addresses
                    874: The address in a file associated with
                    875: a written address is determined by a mapping
                    876: associated with that file.
                    877: Each mapping is represented by one or more quadruples
                    878: .RI ( "t, b, e, f" ),
                    879: each mapping addresses of type
                    880: .I t
                    881: (instruction,
                    882: data,
                    883: user block)
                    884: in the range
                    885: .I b
                    886: through
                    887: .I e
                    888: to the part of the file
                    889: beginning at
                    890: address
                    891: .IR f .
                    892: An address
                    893: .I a
                    894: of type
                    895: .I t
                    896: is mapped
                    897: to a file address
                    898: by finding a quadruple
                    899: of type
                    900: .IR t ,
                    901: for which
                    902: .IR b \*(LE a < e ;
                    903: the file address
                    904: is
                    905: .IR address + f \(mi b .
                    906: As a special case,
                    907: if an instruction space address is not found,
                    908: a second search is made
                    909: for the same address in data space.
                    910: .PP
                    911: Typically,
                    912: the text segment of a program
                    913: is mapped as instruction space,
                    914: the data and bss segments
                    915: as data space.
                    916: If
                    917: .I objfil
                    918: is an
                    919: .IR a.out,
                    920: or if
                    921: .I corfil
                    922: is a core image
                    923: or process file,
                    924: maps are set accordingly.
                    925: Otherwise,
                    926: a single `data space'
                    927: map is set up,
                    928: with
                    929: .I b
                    930: and
                    931: .I f
                    932: set to zero,
                    933: and
                    934: .I e
                    935: set to a huge number;
                    936: thus the entire file can be examined
                    937: without address translation.
                    938: .PP
                    939: The
                    940: .B ?
                    941: and
                    942: .B /
                    943: commands attempt to examine
                    944: instruction and data space
                    945: respectively.
                    946: .B ?*
                    947: tries for data space
                    948: (in
                    949: .IR objfil );
                    950: .B /*
                    951: accesses instruction space
                    952: (in
                    953: .IR corfil ).
                    954: .PP
                    955: Registers in
                    956: process and core images
                    957: are a special case;
                    958: they live in a special `register' address space.
                    959: The contents of register 0
                    960: are located at address
                    961: .BR %0 ;
                    962: register 1
                    963: at
                    964: .BR %4
                    965: (if registers are 4 bytes long);
                    966: and so on.
                    967: .B %
                    968: addresses
                    969: are mapped to the registers
                    970: for the `current frame,'
                    971: set by local variable references,
                    972: and reset to the outermost frame
                    973: (the `real' registers)
                    974: whenever a process runs
                    975: or a stack trace is requested.
                    976: .PP
                    977: Simulated memory management
                    978: translations
                    979: (the
                    980: .B $k
                    981: and
                    982: .B $p
                    983: commands)
                    984: are done before the mapping described above.
                    985: .SH FILES
                    986: .F a.out
                    987: .br
                    988: .F core
                    989: .br
                    990: .F /usr/lib/adb/*
                    991: parameter files
                    992: .br
                    993: .F /proc/*
                    994: .SH SEE\ ALSO
                    995: .IR cin (1),
                    996: .IR pi (9.1),
                    997: .IR nm (1),
                    998: .IR proc (4),
                    999: .IR a.out (5),
                   1000: .IR bigcore (1)
                   1001: .br
                   1002: J. F. Maranzano and S. R. Bourne, 
                   1003: `A Tutorial Introduction to ADB' in
                   1004: Bell Laboratories,
                   1005: .I UNIX Programmer's Manual,
                   1006: Volume\ 2,
                   1007: Holt, Rinehart and Winston (1984)
                   1008: .SH DIAGNOSTICS
                   1009: `Adb' when there is no current command or format.
                   1010: Exit status is 0, unless last command failed or
                   1011: returned nonzero status.
                   1012: .SH BUGS
                   1013: Either the explanation
                   1014: or the implementation
                   1015: of register variables
                   1016: is too complex and arcane.
                   1017: .SH MACHINE DEPENDENCIES
                   1018: .SS PDP-11
                   1019: Short integers (printed by
                   1020: .B r
                   1021: format)
                   1022: are 2 bytes;
                   1023: long integers
                   1024: (printed by
                   1025: .B R
                   1026: format)
                   1027: are 4 bytes.
                   1028: Addresses printed by
                   1029: .B a
                   1030: format are 2 bytes.
                   1031: .PP
                   1032: Register variables match the hardware in the
                   1033: obvious way:
                   1034: .B r0
                   1035: is at address
                   1036: .BR %0 ,
                   1037: .B r1
                   1038: at
                   1039: .BR %2 ,
                   1040: and so on.
                   1041: .PP
                   1042: The default output radix
                   1043: is octal.
                   1044: .PP
                   1045: .B $k
                   1046: and
                   1047: .B $p
                   1048: are unimplemented.
                   1049: .SS VAX
                   1050: Short integers are 2 bytes,
                   1051: long integers are 4 bytes,
                   1052: addresses are 4 bytes.
                   1053: .PP
                   1054: Register variables match the hardware in the
                   1055: obvious way: r0
                   1056: is at address
                   1057: .BR %0 ,
                   1058: r1 at
                   1059: .BR %4 ,
                   1060: and so on.
                   1061: .PP
                   1062: The default output radix
                   1063: is hexadecimal.
                   1064: .PP
                   1065: .B $k
                   1066: sets the system base register pointer to
                   1067: .IR address .
                   1068: System space addresses are thereafter
                   1069: mapped according to the system page table
                   1070: starting at that physical address.
                   1071: An
                   1072: .I address
                   1073: of zero
                   1074: turns off mapping.
                   1075: .PP
                   1076: .B $p
                   1077: sets the process control block pointer to
                   1078: .IR address ;
                   1079: user space addresses are thereafter
                   1080: translated according to the user page tables
                   1081: described by the PCB.
                   1082: Kernel mapping must already be in effect.
                   1083: .I Address
                   1084: may be a physical address
                   1085: (that of the PCB)
                   1086: or the system space virtual address
                   1087: of a page table entry
                   1088: pointing to the PCB
                   1089: (the number stored in
                   1090: .IR p_addr ).
                   1091: If
                   1092: .I address
                   1093: is zero,
                   1094: user mapping is turned off;
                   1095: addresses less than
                   1096: 0x80000000
                   1097: will be treated as physical addresses.
                   1098: .PP
                   1099: The command
                   1100: .L "$<crash"
                   1101: will initialize registers
                   1102: and mapping from a kernel crash dump.
                   1103: .SS Cray
                   1104: Short integers are 2 bytes;
                   1105: long integers are 8 bytes.
                   1106: Addresses are 8 bytes.
                   1107: .PP
                   1108: Registers are funny,
                   1109: and yet to be described.
                   1110: .PP
                   1111: The default output radix is octal.
                   1112: .PP
                   1113: .B $k
                   1114: and
                   1115: .B $p
                   1116: are unimplemented.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.