Annotation of 43BSDReno/pgrm/dbx/dbx.1, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1983, 1990 The Regents of the University of California.
                      2: .\" All rights reserved.
                      3: .\"
                      4: .\" Redistribution and use in source and binary forms are permitted provided
                      5: .\" that: (1) source distributions retain this entire copyright notice and
                      6: .\" comment, and (2) distributions including binaries display the following
                      7: .\" acknowledgement:  ``This product includes software developed by the
                      8: .\" University of California, Berkeley and its contributors'' in the
                      9: .\" documentation or other materials provided with the distribution and in
                     10: .\" all advertising materials mentioning features or use of this software.
                     11: .\" Neither the name of the University nor the names of its contributors may
                     12: .\" be used to endorse or promote products derived from this software without
                     13: .\" specific prior written permission.
                     14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     17: .\"
                     18: .\"     @(#)dbx.1      6.5 (Berkeley) 7/24/90
                     19: .\"
                     20: .Dd July 24, 1990
                     21: .Dt DBX 1
                     22: .Os BSD 4.2
                     23: .Sh NAME
                     24: .Nm dbx
                     25: .Nd debugger
                     26: .Sh SYNOPSIS
                     27: .Nm Dbx
                     28: .Op Fl r
                     29: .Op Fl i
                     30: .Op Fl k
                     31: .Op Fl I Ar dir
                     32: .Op Fl c Ar file
                     33: .Op Ar objfile Op Ar coredump
                     34: .Sh DESCRIPTION
                     35: .Nm Dbx
                     36: is a tool for source level debugging and execution of
                     37: programs under UNIX.
                     38: The
                     39: .Ar objfile
                     40: is an object file produced by a compiler
                     41: with the appropriate flag (usually
                     42: .Fl g )
                     43: specified to produce symbol information in the object file.
                     44: Currently,
                     45: .Xr cc 1 ,
                     46: .Xr f77 1 ,
                     47: .Xr pc 1 ,
                     48: and the DEC Western
                     49: Research Laboratory Modula-2 compiler,
                     50: .Xr mod l ,
                     51: produce the appropriate source information.
                     52: The machine level facilities of
                     53: .Nm dbx
                     54: can be used on any program.
                     55: .Pp
                     56: The object file contains a symbol table that includes the names of
                     57: all the source files translated by the compiler to create it.
                     58: These files are available for perusal while using the debugger.
                     59: .Pp
                     60: If a file named
                     61: .Pa core
                     62: exists in the current directory
                     63: or a
                     64: .Ar coredump
                     65: file is specified,
                     66: .Nm dbx
                     67: can be used
                     68: to examine the state of the program when it faulted.
                     69: .Pp
                     70: If the file
                     71: .Pa .dbxinit
                     72: exists in the current directory then the
                     73: debugger commands in it are executed.
                     74: .Nm Dbx
                     75: also checks for a
                     76: .Pa .dbxinit
                     77: in the user's home directory
                     78: if there isn't one in the current directory.
                     79: .Pp
                     80: The command line options and their meanings are:
                     81: .Tw Fl
                     82: .Tp Fl r
                     83: Execute
                     84: .Ar objfile
                     85: immediately.
                     86: If it terminates successfully
                     87: .Nm dbx
                     88: exits.
                     89: Otherwise the reason for termination will be reported
                     90: and the user offered the option of entering the debugger
                     91: or letting the program fault.
                     92: .Nm Dbx
                     93: will read from
                     94: .Pa /dev/tty
                     95: when
                     96: .Fl r
                     97: is specified
                     98: and standard input is not a terminal.
                     99: .Tp Fl i
                    100: Force
                    101: .Nm dbx
                    102: to act as though standard input is a terminal.
                    103: .Tp Fl k
                    104: Map memory addresses, useful for kernel debugging.
                    105: .Tp Cx Fl I
                    106: .Cx \&\ \&
                    107: .Ar dir
                    108: .Cx
                    109: Add
                    110: .Ar dir
                    111: to the list of directories
                    112: that are searched when looking for a source file.
                    113: Normally
                    114: .Nm dbx
                    115: looks for source files in the current directory
                    116: and in the directory where
                    117: .Ar objfile
                    118: is located.
                    119: The directory search path can also be set with the
                    120: .Ic use
                    121: command.
                    122: .Tp Cx Fl c
                    123: .Cx \&\ \&
                    124: .Ar file
                    125: .Cx
                    126: Execute the
                    127: .Nm dbx
                    128: commands in the
                    129: .Ar file
                    130: before
                    131: reading from standard input.
                    132: .Tp
                    133: .Pp
                    134: Unless
                    135: .Fl r
                    136: is specified,
                    137: .Nm dbx
                    138: just prompts and waits for a command.
                    139: .Ss Execution and Tracing Commands
                    140: .Dw Fl
                    141: .Di L
                    142: .Dp Cx Ic run
                    143: .Cx \&\ \&
                    144: .Op Ar args
                    145: .Cx \&\ \&
                    146: .Op Sy < Ar filename
                    147: .Cx \&\ \&
                    148: .Op Sy > Ar filename
                    149: .Cx
                    150: .Dp Cx Ic rerun
                    151: .Cx \&\ \&
                    152: .Op Ar args
                    153: .Cx \&\ \&
                    154: .Op Sy < Ar filename
                    155: .Cx \&\ \&
                    156: .Op Sy > Ar filename
                    157: .Cx
                    158: Start executing
                    159: .Ar objfile  ,
                    160: passing
                    161: .Ar args
                    162: as command line arguments;
                    163: .Sy <
                    164: or
                    165: .Sy >
                    166: can be used to redirect input or output in the usual manner.
                    167: When
                    168: .Ic rerun
                    169: is used without any arguments the previous
                    170: argument list is passed to the program;
                    171: otherwise it is identical to
                    172: .Ic run .
                    173: If
                    174: .Ar objfile
                    175: has been written since the last time the symbolic information
                    176: was read in,
                    177: .Nm dbx
                    178: will read in the new information.
                    179: .Dp Cx Ic trace
                    180: .Cx \&\ \&
                    181: .Op Ic in Ar procedure/function
                    182: .Cx \&\ \&
                    183: .Op Ic if Ar condition
                    184: .Cx
                    185: .Dp Cx Ic trace
                    186: .Cx \&\ \&
                    187: .Ar source-line-number
                    188: .Cx \&\ \&
                    189: .Op Ic if Ar condition
                    190: .Cx
                    191: .Dp Cx Ic trace
                    192: .Cx \&\ \&
                    193: .Ar procedure/function
                    194: .Cx \&\ \&
                    195: .Op Ic in Ar procedure/function
                    196: .Cx \&\ \&
                    197: .Op Ic if Ar condition
                    198: .Cx
                    199: .Dp Cx Ic trace
                    200: .Cx \&\ \&
                    201: .Ar expression
                    202: .Cx \&\ \&
                    203: .Ic at
                    204: .Cx \&\ \&
                    205: .Ar source-line-number
                    206: .Cx \&\ \&
                    207: .Op Ic if Ar condition
                    208: .Cx
                    209: .Dp Cx Ic trace
                    210: .Cx \&\ \&
                    211: .Ar variable
                    212: .Cx \&\ \&
                    213: .Op Ic in Ar procedure/function
                    214: .Cx \&\ \&
                    215: .Op Ic if Ar condition
                    216: .Cx
                    217: Have tracing information printed when the program is executed.
                    218: A number is associated with the command that is used
                    219: to turn the tracing off (see the
                    220: .Ic delete
                    221: command).
                    222: .Pp
                    223: The first argument describes what is to be traced.
                    224: If it is a
                    225: .Ar source-line-number ,
                    226: then the line is printed
                    227: immediately prior to being executed.
                    228: Source line numbers in a file other than the current one
                    229: must be preceded by the name of the file in quotes and a colon, e.g.
                    230: "mumble.p":17.
                    231: .Pp
                    232: If the argument is a procedure or function name then
                    233: every time it is called, information is printed telling
                    234: what routine called it, from what source line it was called,
                    235: and what parameters were passed to it.
                    236: In addition, its return is noted, and if it's a function
                    237: then the value it is returning is also printed.
                    238: .Pp
                    239: If the argument is an
                    240: .Ar expression
                    241: with an
                    242: .Ic at
                    243: clause
                    244: then the value of the expression is printed whenever the
                    245: identified source line is reached.
                    246: .Pp
                    247: If the argument is a variable then the name and value of the variable
                    248: is printed whenever it changes.
                    249: Execution is substantially slower during this form of tracing.
                    250: .Pp
                    251: If no argument is specified then all source lines are printed
                    252: before they are executed.
                    253: Execution is substantially slower during this form of tracing.
                    254: .Pp
                    255: The clause
                    256: .Ic in
                    257: .Ar procedure/function
                    258: restricts tracing information
                    259: to be printed only while executing inside the given procedure
                    260: or function.
                    261: .Pp
                    262: .Ar Condition
                    263: is a boolean expression and is
                    264: evaluated prior to printing the tracing information;
                    265: if it is false then the information is not printed.
                    266: .Dp Cx Ic stop if
                    267: .Cx \&\ \&
                    268: .Ar condition
                    269: .Cx
                    270: .Dp Cx Ic stop at
                    271: .Cx \&\ \&
                    272: .Ar source-line-number
                    273: .Cx \&\ \&
                    274: .Op Ic if Ar condition
                    275: .Cx
                    276: .Dp Cx Ic stop in
                    277: .Cx \&\ \&
                    278: .Ar source-line-number
                    279: .Cx \&\ \&
                    280: .Op Ic if Ar condition
                    281: .Cx
                    282: .Dp Cx Ic stop
                    283: .Cx \&\ \&
                    284: .Ar variable
                    285: .Cx \&\ \&
                    286: .Op Ic if Ar condition
                    287: .Cx
                    288: Stop execution when the given line is reached, procedure or function
                    289: called, variable changed, or condition true.
                    290: .Dp Cx Ic status
                    291: .Cx \&\ \&
                    292: .Op Ic \&> Ar filename
                    293: .Cx
                    294: Print out the currently active
                    295: .Ic trace
                    296: and
                    297: .Ic stop
                    298: commands.
                    299: .Dp Cx Ic delete
                    300: .Cx \&\ \&
                    301: .Ar command-number ...
                    302: .Cx
                    303: The traces or stops corresponding to the given numbers are removed.
                    304: The numbers associated with traces and stops are printed by
                    305: the
                    306: .Ic status
                    307: command.
                    308: .Dp Cx Ic catch
                    309: .Cx \&\ \&
                    310: .Ar number
                    311: .Cx
                    312: .Dp Cx Ic catch
                    313: .Cx \&\ \&
                    314: .Ar signal-name
                    315: .Cx
                    316: .Dp Cx Ic ignore
                    317: .Cx \&\ \&
                    318: .Ar number
                    319: .Cx
                    320: .Dp Cx Ic ignore
                    321: .Cx \&\ \&
                    322: .Ar signal-name
                    323: .Cx
                    324: Start or stop trapping a signal before it is sent
                    325: to the program.
                    326: This is useful when a program being debugged
                    327: handles signals such as interrupts.
                    328: A signal may be specified by number or by a name
                    329: (e.g., SIGINT).
                    330: Signal names are case insensitive and the ``SIG'' prefix is optional.
                    331: By default all signals are trapped except SIGCONT, SIGCHILD,
                    332: SIGALRM and SIGKILL.
                    333: .Dp Cx Ic cont
                    334: .Cx \&\ \&
                    335: .Ar integer
                    336: .Cx
                    337: .Dp Cx Ic cont
                    338: .Cx \&\ \&
                    339: .Ar signal-name
                    340: .Cx
                    341: Continue execution from where it stopped.
                    342: If a signal is specified, the process continues as though
                    343: it received the signal.
                    344: Otherwise, the process is continued as though it had not been stopped.
                    345: .Pp
                    346: Execution cannot be continued if the process has ``finished'',
                    347: that is, called the standard procedure ``exit''.
                    348: .Nm Dbx
                    349: does not allow the process to exit, thereby
                    350: letting the user to examine the program state.
                    351: .Dp Ic step
                    352: Execute one source line.
                    353: .Dp Ic next
                    354: Execute up to the next source line.
                    355: The difference between this and
                    356: .Ic step
                    357: is that
                    358: if the line contains a call to a procedure or function
                    359: the
                    360: .Ic step
                    361: command will stop at the beginning of that
                    362: block, while the
                    363: .Ic next
                    364: command will not.
                    365: .Dp Cx Ic return
                    366: .Cx \&\ \&
                    367: .Op Ar procedure
                    368: .Cx
                    369: Continue until a return to
                    370: .Ar procedure
                    371: is executed, or
                    372: until the current procedure returns if none is specified.
                    373: .Dp Cx Ic call
                    374: .Cx \&\ \&
                    375: .Ar procedure (parameters )
                    376: .Cx
                    377: Execute the object code associated with the named procedure or function.
                    378: .Dp
                    379: .Ss Printing Variables and Expressions
                    380: Names are resolved first using the static scope of the current function,
                    381: then using the dynamic scope if the name is not defined
                    382: in the static scope.
                    383: If static and dynamic searches do not yield a result,
                    384: an arbitrary symbol is chosen and
                    385: the message
                    386: .Dq Li [using Ar qualified name]
                    387: is printed.
                    388: The name resolution procedure may be overridden by qualifying an identifier
                    389: with a block name, e.g.,
                    390: .Dq Li module.variable
                    391: For C, source files are treated as modules named
                    392: by the file name without ``.c''.
                    393: .Pp
                    394: Expressions are specified with an approximately
                    395: common subset of C and Pascal (or equivalently Modula-2) syntax.
                    396: Indirection can be denoted using either a prefix ``*'' or
                    397: a postfix ``^'' and
                    398: array expressions are subscripted by brackets
                    399: .Cx (``
                    400: .Op
                    401: .Cx \'\').
                    402: .Cx
                    403: The field reference operator (``.'') can be used with pointers
                    404: as well as records, making the C operator ``\->'' unnecessary
                    405: (although it is supported).
                    406: .Pp
                    407: Types of expressions are checked;
                    408: the type of an expression may be overridden
                    409: by using
                    410: .Cx ``
                    411: .Ar type-name (expression)
                    412: .Cx \'\'.
                    413: .Cx
                    414: When there is no corresponding named type
                    415: the special constructs
                    416: .Cx ``&
                    417: .Ar type-name
                    418: .Cx \'\'
                    419: .Cx
                    420: and
                    421: .Cx ``$$
                    422: .Ar tag-name
                    423: .Cx \'\'
                    424: .Cx
                    425: can be used to represent a pointer to a named type or C structure tag.
                    426: .Dw Fl
                    427: .Di L
                    428: .Dp Cx Ic assign
                    429: .Cx \&\ \&
                    430: .Ar variable
                    431: .Ic =
                    432: .Ar expression
                    433: .Cx
                    434: Assign the value of the expression to the variable.
                    435: .Dp Cx Ic dump
                    436: .Cx \&\ \&
                    437: .Op Ar procedure
                    438: .Cx \&\ \&
                    439: .Op Ic > Ar filename
                    440: .Cx
                    441: Print the names and values of variables in the given procedure,
                    442: or the current one if none is specified.
                    443: If the procedure given is ``.'', then the all active variables
                    444: are dumped.
                    445: .Dp Cx Ic print
                    446: .Cx \&\ \&
                    447: .Ar expression
                    448: .Cx \&\ \&
                    449: .Op Ic \&, Ar expression ...
                    450: .Cx
                    451: Print out the values of the expressions.
                    452: .Dp Cx Ic whatis
                    453: .Cx \&\ \&
                    454: .Ar name
                    455: .Cx
                    456: Print the declaration of the given name, which may be qualified
                    457: with block names as above.
                    458: .Dp Cx Ic which
                    459: .Cx \&\ \&
                    460: .Ar identifier
                    461: .Cx
                    462: Print the full qualification of the given identifer, i.e.
                    463: the outer blocks that the identifier is associated with.
                    464: .Dp Cx Ic up
                    465: .Cx \&\ \&
                    466: .Op Ar count
                    467: .Cx
                    468: .Dp Cx Ic down
                    469: .Cx \&\ \&
                    470: .Op Ar count
                    471: .Cx
                    472: Move the current function, which is used for resolving names,
                    473: up or down the stack
                    474: .Ar count
                    475: levels.
                    476: The default
                    477: .Ar count
                    478: is 1.
                    479: .Dp Ic where
                    480: Print out a list of the active procedures and function.
                    481: .Dp Cx Ic whereis
                    482: .Cx \&\ \&
                    483: .Ar identifier
                    484: .Cx
                    485: Print the full qualification of all the symbols whose
                    486: name matches the given identifier.
                    487: The order in which the symbols are printed is not meaningful.
                    488: .Dp
                    489: .Ss Accessing Source Files
                    490: .Pp
                    491: .Di L
                    492: .Dp Cx Ar /regular expression
                    493: .Op /
                    494: .Cx
                    495: .Dp Cx Ar ?regular expression
                    496: .Op ?
                    497: .Cx
                    498: Search forward or backward in the current source file
                    499: for the given pattern.
                    500: .Dp Cx Ic edit
                    501: .Cx \&\ \&
                    502: .Op Ar filename
                    503: .Cx
                    504: .Dp Cx Ic edit
                    505: .Cx \&\ \&
                    506: .Ar procedure/function-name
                    507: .Cx
                    508: Invoke an editor on
                    509: .Ar filename
                    510: or the current source file if none
                    511: is specified.
                    512: If a
                    513: .Ar procedure
                    514: or
                    515: .Ar function
                    516: name is specified,
                    517: the editor is invoked on the file that contains it.
                    518: Which editor is invoked by default depends on the installation.
                    519: The default can be overridden by setting the environment variable
                    520: .Ev EDITOR
                    521: to the name of the desired editor.
                    522: .Dp Cx Ic file
                    523: .Cx \&\ \&
                    524: .Op Ar filename
                    525: .Cx
                    526: Change the current source file name to
                    527: .Ar filename  .
                    528: If none is specified then the current source file name is printed.
                    529: .Dp Cx Ic func
                    530: .Cx \&\ \&
                    531: .Op Ar procedure/function
                    532: .Cx
                    533: Change the current function.
                    534: If none is specified then print the current function.
                    535: Changing the current function implicitly changes the current source file
                    536: to the one that contains the function; it also changes the current scope
                    537: used for name resolution.
                    538: .Dp Cx Ic list
                    539: .Cx \&\ \&
                    540: .Op Ar source-line-number Op Ic \&, Ar source-line-number
                    541: .Cx
                    542: .Dp Cx Ic list
                    543: .Cx \&\ \&
                    544: .Ar procedure/function
                    545: .Cx
                    546: List the lines in the current source file from the first line number to
                    547: the second inclusive.
                    548: If no lines are specified, the next 10 lines are listed.
                    549: If the name of a procedure or function is given
                    550: lines
                    551: .Ar n-k
                    552: to
                    553: .Ar n+k
                    554: are listed where
                    555: .Ar n
                    556: is the first statement
                    557: in the procedure or function and
                    558: .Ar k
                    559: is small.
                    560: .Dp Cx Ic use
                    561: .Cx \&\ \&
                    562: .Ar directory-list
                    563: .Cx
                    564: Set the list of directories to be searched
                    565: when looking for source files.
                    566: .Dp
                    567: .Ss Command Aliases and Variables
                    568: .Dw Fl
                    569: .Di L
                    570: .Dp Cx Ic alias
                    571: .Cx \&\ \&
                    572: .Ar name
                    573: .Cx \&\ \&
                    574: .Ar name
                    575: .Cx
                    576: .Dp Cx Ic alias
                    577: .Cx \&\ \&
                    578: .Ar name
                    579: .Cx \&\ \&
                    580: .Ar string
                    581: .Cx
                    582: .Dp Cx Ic alias
                    583: .Cx \&\ \&
                    584: .Ar name (parameters)
                    585: .Cx \&\ \&
                    586: .Cx ``
                    587: .Ar string
                    588: .Cx \'\'
                    589: .Cx
                    590: When commands are processed,
                    591: dbx first checks to see if the word
                    592: is an alias for either a command or a string.
                    593: If it is an alias, then dbx treats the input as though
                    594: the corresponding string (with values substituted for any parameters)
                    595: had been entered.
                    596: For example,
                    597: to define an alias ``rr'' for the command ``rerun'',
                    598: one can say
                    599: .Pp
                    600: .Dl alias rr rerun
                    601: .Pp
                    602: To define an alias called ``b'' that sets a stop at a particular line
                    603: one can say
                    604: .Pp
                    605: .Dl alias b(x) ``stop at x''
                    606: .Pp
                    607: Subsequently, the command ``b(12)'' will expand to ``stop at 12''.
                    608: .Pp
                    609: .Dp Cx Ic set
                    610: .Ws
                    611: .Ar name
                    612: .Op \&= Ar expression
                    613: .Cx
                    614: The
                    615: .Ic set
                    616: command defines values for debugger variables.
                    617: The names of these variables cannot conflict with names in the program
                    618: being debugged, and are expanded to the corresponding expression
                    619: within other commands.
                    620: The following variables have a special meaning:
                    621: .Dw Ds
                    622: .Di L
                    623: .Dp Li $frame
                    624: Setting this variable to an address causes dbx to use the stack frame
                    625: pointed to by the address for
                    626: doing stack traces and accessing local variables.
                    627: This facility is of particular use for kernel debugging.
                    628: .Dp Li $hexchars
                    629: .Dp Li $hexints
                    630: .Dp Li $hexoffsets
                    631: .Dp Li $hexstrings
                    632: When set, dbx prints out
                    633: out characters, integers, offsets from registers, or character pointers
                    634: respectively in hexadecimal.
                    635: .Dp Li $listwindow
                    636: The value of this variable specifies the number
                    637: of lines to list around a function or when the
                    638: .Ic list
                    639: command
                    640: is given without any parameters.
                    641: Its default value is 10.
                    642: .Dp Li $mapaddrs
                    643: Setting (unsetting) this variable causes dbx to start (stop)
                    644: mapping addresses.
                    645: As with ``$frame'', this is useful for kernel debugging.
                    646: .Dp Li $unsafecall
                    647: .Dp Li $unsafeassign
                    648: When ``$unsafecall'' is set,
                    649: strict type checking is turned off for arguments to
                    650: subroutine or function calls (
                    651: .Ar e .g .
                    652: in the
                    653: .Ic call
                    654: statement).
                    655: When ``$unsafeassign'' is set,
                    656: strict type checking between the two sides
                    657: of an
                    658: .Ic assign
                    659: statement is turned off.
                    660: These variables should be used only with great care,
                    661: because they severely limit dbx's usefulness
                    662: for detecting errors.
                    663: .Dp
                    664: .Dp Cx Ic unalias
                    665: .Cx \&\ \&
                    666: .Ar name
                    667: .Cx
                    668: Remove the alias with the given name.
                    669: .Dp Cx Ic unset
                    670: .Cx \&\ \&
                    671: .Ar name
                    672: .Cx
                    673: Delete the debugger variable associated with
                    674: .Ar name  .
                    675: .Dp
                    676: .Ss Machine Level Commands
                    677: .Dw Fl
                    678: .Di L
                    679: .Dp Cx Ic tracei
                    680: .Cx \&\ \&
                    681: .Op Ar address
                    682: .Cx \&\ \&
                    683: .Op .Ic if Ar cond
                    684: .Cx
                    685: .Dp Cx Ic tracei
                    686: .Cx \&\ \&
                    687: .Op Ar variable
                    688: .Cx \&\ \&
                    689: .Op Ic at Ar address
                    690: .Cx \&\ \&
                    691: .Op Ic if Ar cond
                    692: .Cx
                    693: .Dp Cx Ic stopi
                    694: .Cx \&\ \&
                    695: .Op Ar address
                    696: .Cx \&\ \&
                    697: .Op Ic if Ar cond
                    698: .Cx
                    699: .Dp Cx Ic stopi
                    700: .Cx \&\ \&
                    701: .Op Ic at
                    702: .Cx \&\ \&
                    703: .Op Ar address
                    704: .Cx \&\ \&
                    705: .Op Ic if Ar cond
                    706: .Cx
                    707: Turn on tracing or set a stop using a machine instruction address.
                    708: .Dp Ic stepi
                    709: .Dp Ic nexti
                    710: Single step as in
                    711: .Ic step
                    712: or
                    713: .Ic next  ,
                    714: but do a single instruction
                    715: rather than source line.
                    716: .Dp Cx Ar address
                    717: .Cx \&,
                    718: .Ar address
                    719: .Cx \&/
                    720: .Op Ar mode
                    721: .Cx
                    722: .Dp Cx Ar address
                    723: .Cx \&/
                    724: .Op Ar count
                    725: .Op Ar mode
                    726: .Cx
                    727: Print the contents of memory starting at the first
                    728: .Ar address
                    729: and continuing up to the second
                    730: .Ar address
                    731: or until
                    732: .Ar count
                    733: items are printed.
                    734: If the address is ``.'', the address following the one
                    735: printed most recently is used.
                    736: The
                    737: .Ar mode
                    738: specifies how memory is to be printed;
                    739: if it is omitted the previous mode specified is used.
                    740: The initial mode is ``X''.
                    741: The following modes are supported:
                    742: .Dw Cm
                    743: .Dp Cm i
                    744: print the machine instruction
                    745: .Dp Cm d
                    746: print a short word in decimal
                    747: .Dp Cm D
                    748: print a long word in decimal
                    749: .Dp Cm o
                    750: print a short word in octal
                    751: .Dp Cm O
                    752: print a long word in octal
                    753: .Dp Cm x
                    754: print a short word in hexadecimal
                    755: .Dp Cm X
                    756: print a long word in hexadecimal
                    757: .Dp Cm b
                    758: print a byte in octal
                    759: .Dp Cm c
                    760: print a byte as a character
                    761: .Dp Cm s
                    762: print a string of characters terminated by a null byte
                    763: .Dp Cm f
                    764: print a single precision real number
                    765: .Dp Cm g
                    766: print a double precision real number
                    767: .Dp
                    768: .Pp
                    769: Symbolic addresses are specified by preceding the name with an ``&''.
                    770: Registers are denoted by ``$rN'' where N is the number of the register.
                    771: Addresses may be expressions made up of other addresses and
                    772: the operators ``+'', ``-'', and indirection (unary ``*'').
                    773: .Dp
                    774: .Ss Miscellaneous Commands
                    775: .Tw Ic
                    776: .Tp Ic gripe
                    777: Invoke a mail program to send a message to the person in charge of
                    778: .Nm dbx  .
                    779: .Tp Ic help
                    780: Print out a synopsis of
                    781: .Nm dbx
                    782: commands.
                    783: .Tp Ic quit
                    784: Exit
                    785: .Nm dbx  .
                    786: .Tp Cx Ic sh
                    787: .Cx \&\ \&
                    788: .Ar command-line
                    789: .Cx
                    790: Pass the command line to the shell for execution.
                    791: The SHELL environment variable determines which shell is used.
                    792: .Tp Cx Ic source
                    793: .Cx \&\ \&
                    794: .Ar filename
                    795: .Cx
                    796: Read
                    797: .Nm dbx
                    798: commands from the given
                    799: .Ar filename  .
                    800: .Tp
                    801: .Sh ENVIRONMENT
                    802: .Nm Dbx
                    803: utilizes the following environment variables:
                    804: .Ds I
                    805: EDITOR
                    806: HOME
                    807: PATH
                    808: SHELL
                    809: .De
                    810: .Sh FILES
                    811: .Dw .dbxinit
                    812: .Di L
                    813: .Dp Pa a.out
                    814: object file
                    815: .Dp Pa .dbxinit
                    816: initial commands
                    817: .Dp
                    818: .Sh SEE ALSO
                    819: .Xr cc 1 ,
                    820: .Xr mod l ,
                    821: .Xr f77 1 ,
                    822: .Xr pc 1
                    823: .Sh HISTORY
                    824: .Nm Dbx
                    825: appeared in 4.2 BSD.
                    826: .Sh BUGS
                    827: .Nm Dbx
                    828: suffers from the same ``multiple include'' malady as did
                    829: .Nm sdb  .
                    830: If you have a program consisting of a number of object files
                    831: and each is built from source files that include header files,
                    832: the symbolic information for the header files is replicated in
                    833: each object file.
                    834: Since about one debugger start-up is done for each link,
                    835: having the linker
                    836: .Xr ld 1
                    837: re-organize the symbol information
                    838: would not save much time, though it would reduce some of the
                    839: disk space used.
                    840: .Pp
                    841: This problem is an artifact of the unrestricted semantics
                    842: of #include's in C; for example an include file can contain
                    843: static declarations that are separate entities for each file
                    844: in which they are included.
                    845: However, even with Modula-2 there is a substantial amount of duplication
                    846: of symbol information necessary for inter-module type checking.
                    847: .Pp
                    848: Some problems remain with the support for individual languages.
                    849: Fortran problems include:
                    850: inability to assign to logical, logical*2, complex
                    851: and double complex variables;
                    852: inability to represent parameter constants
                    853: which are not type integer or real;
                    854: peculiar representation for the values of dummy procedures
                    855: (the value shown for a dummy procedure is actually
                    856: the first few bytes of the procedure text;
                    857: to find the location of the procedure,
                    858: use ``&'' to take the address of the variable).

unix.superglobalmegacorp.com

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