|
|
1.1 ! root 1: ! 2: ! 3: db Command db ! 4: ! 5: ! 6: ! 7: ! 8: Assembler-level symbolic debugger ! 9: ! 10: ddbb [-ccddeeffoorrtt] [_m_a_p_f_i_l_e] [_d_a_t_a_f_i_l_e] ! 11: ! 12: db is an assembly language-level debugger. It allows you to run ! 13: object files and executable programs under trace control (see ! 14: ppttrraaccee), run programs with embedded breakpoints, and dump and ! 15: patch files in a variety of forms. You can use it to debug as- ! 16: sembly-language programs that have been assembled by aass, the Mark ! 17: Williams assembler, as well as those that have been compiled with ! 18: the Mark Williams C compiler. ! 19: ! 20: ***** What is db? ***** ! 21: ! 22: db is a symbolic debugger, which means that it works with the ! 23: symbol tables that the compiler builds into the object files it ! 24: generates. Because db is designed to work on the level of as- ! 25: sembly language, the user needs a working knowledge of the ap- ! 26: propriate assembly language and microprocessor architecture. ! 27: ! 28: ***** Invoking db ***** ! 29: ! 30: To invoke db, type its name, plus the options you want (if any) ! 31: and the name of the files with which you will be working. map- ! 32: file is an object file that supplies a symbol table. datafile is ! 33: the executable program to be debugged. If both names are given, ! 34: the options default to -c. If only one name is given, it is the ! 35: program; in this case the options default to -o. If both names ! 36: are omitted, mapfile defaults to l.out and program defaults to ! 37: core. If possible, db accesses datafile with write permission. ! 38: ! 39: The following options to the db command specify the format of ! 40: program: ! 41: ! 42: -cc program is a core file produced by a user core dump. db ! 43: checks the name of the command that invoked the process that ! 44: produced the core, against the name of the mapfile, if given. ! 45: Pure segments are read from the mapfile. ! 46: ! 47: -dd program is a system dump. If only one file is mentioned, map- ! 48: file defaults to /coherent. ! 49: ! 50: -ee The next argument is an object file; db executes it as a child ! 51: process and passes it the rest of the command line. ! 52: ! 53: -ff Map program as a straight array of bytes (file). ! 54: ! 55: -oo program is an object file. If mapfile is given, it is another ! 56: object file that provides the symbol table. ! 57: ! 58: -rr Read file only, even though you can write into it. This is ! 59: used to give a file additional protection. ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66: ! 67: ! 68: ! 69: db Command db ! 70: ! 71: ! 72: ! 73: -tt Perform input and output for db via /dev/tty. This permits ! 74: the debugging of processes whose standard input or output have ! 75: been redirected. ! 76: ! 77: ***** Commands and Addresses ***** ! 78: ! 79: db executes commands that you give it from the standard input. A ! 80: command usually consists of an address, which tells db where in ! 81: the program to execute the command; and then the command name and ! 82: its options, if any. ! 83: ! 84: An address is represented by an expression, which can be built ! 85: out of one or more of the following elements: ! 86: ! 87: * The `.', which represents the current address. When an ad- ! 88: dress is entered, the current address is set to that location. ! 89: The current address can be advanced by typing <return>. ! 90: ! 91: * The name of a register. db recognizes the register names r0 ! 92: through r7, sp, and pc for the PDP-11; r0 through r15 and pc ! 93: for the Z-8001 and Z-8002; and ax, ah, al, bx, bh, bl, cx, ch, ! 94: cl, dx, dh, dl, si, di, bp, sp, sp, pc, cs, ds, es, and ss for ! 95: the i8086. Typing the name of a register displays its con- ! 96: tents. The usual numeric base (octal on the PDP-11, ! 97: hexadecimal on all other machines) is always used for register ! 98: display and stack tracebacks, regardless of the current ! 99: default radix. ! 100: ! 101: * The symbols dd, ii, and uu, which represent location 0 in, ! 102: respectively, the data space, the instruction space, and the ! 103: u-area. ! 104: ! 105: * The names of global symbols and symbolic addresses can be used ! 106: in place of the addresses where they occur. This is useful ! 107: when setting a breakpoint at the beginning of a subroutine. ! 108: ! 109: * An integer constant, which can be used in the same manner as a ! 110: global symbol. The default is decimal; a leading 0 indicates ! 111: octal and 0x indicates hexadecimal. ! 112: ! 113: * The following binary operators can be used: ! 114: + Addition ! 115: - Subtraction ! 116: * Multiplication ! 117: / Integer division ! 118: ! 119: All arithmetic is done in longs. ! 120: ! 121: * The following unary operators can be used: ! 122: ~ Complementation ! 123: - Negation ! 124: * Indirection ! 125: ! 126: All operators are supported with their normal level of ! 127: precedence. Parentheses `()' can be used for binding. ! 128: ! 129: ! 130: COHERENT Lexicon Page 2 ! 131: ! 132: ! 133: ! 134: ! 135: db Command db ! 136: ! 137: ! 138: ! 139: ! 140: ! 141: Every symbol refers to a segment: the data segment, the instruc- ! 142: tion segment, or the u-area. This segment, in turn, dictates the ! 143: format in which db displays by default what it finds at that ad- ! 144: dress. The format used by an expression is that of its leftmost ! 145: operand. The symbols dd, ii, and uu can name specific segments in ! 146: the absence of other symbols. ! 147: ! 148: ***** Display Commands ***** ! 149: ! 150: The following commands merely display information about program. ! 151: The symbol `.' represents the address, which defaults to the cur- ! 152: rent display address if omitted. count defaults to one. ! 153: ! 154: _a_d_d_r_e_s_s[,_c_o_u_n_t]?[_f_o_r_m_a_t] ! 155: Display the format count times, starting at address. The ! 156: format string consists of one or more of the following ! 157: characters: ! 158: ! 159: ^ Reset display address to `.' ! 160: + Increment display address ! 161: - Decrement display address ! 162: bb Byte ! 163: cc cchhaarr; control and non-cchhaarrs escaped ! 164: CC Like `c' except `\0' not displayed ! 165: dd Decimal ! 166: ff ffllooaatt ! 167: FF ddoouubbllee ! 168: ii Machine instruction, disassembled ! 169: ll lloonngg ! 170: nn Output `\n' ! 171: OO octal ! 172: pp Symbolic address ! 173: ss String terminated by `\0', with escapes ! 174: SS String terminated by `\0', no escapes ! 175: uu uunnssiiggnneedd ! 176: WW word ! 177: xx Hexadecimal ! 178: YY time (as in i-node etc.) ! 179: ! 180: The format characters d, o, u, and x, which specify a numeric ! 181: base, can be followed by b, l, or w, which specify a datum size, ! 182: to describe a single datum for display. A format item may also ! 183: be preceded by a count that specifies how many times the item is ! 184: to be applied. Note that format defaults to the previously set ! 185: format for the segment (initially oo for data and u-area, and i ! 186: for instructions). Except where otherwise noted, db increments ! 187: the display address by the size of the datum displayed after each ! 188: format item. ! 189: ! 190: ***** Execution Commands ***** ! 191: ! 192: In the following commands, address defaults to the address where ! 193: execution stopped, unless otherwise specified; count and expr ! 194: ! 195: ! 196: COHERENT Lexicon Page 3 ! 197: ! 198: ! 199: ! 200: ! 201: db Command db ! 202: ! 203: ! 204: ! 205: default to 1. commands is an arbitrary string of db commands, ! 206: terminated by a newline. A newline may be included by preceding ! 207: it with a backslash `\'. ! 208: ! 209: [_a_d_d_r_e_s_s]= ! 210: Print address in octal. address defaults to `.'. The com- ! 211: mand = assigns values to locations in the traced process. ! 212: The size of the assigned value is determined from the last ! 213: display format used. You can set and display the registers ! 214: of the traced process, just like any other address in the ! 215: traced process. ! 216: ! 217: [_a_d_d_r_e_s_s[,_c_o_u_n_t]]=_v_a_l_u_e[,_v_a_l_u_e[,_v_a_l_u_e]...] ! 218: Patch the contents starting at address to the given value. ! 219: address defaults to `.'. Up to ten values can be listed. ! 220: ! 221: ? Print verbose version of last error message. ! 222: ! 223: [_a_d_d_r_e_s_s] :aa ! 224: Print address symbolically. address defaults to `.'. ! 225: ! 226: [_a_d_d_r_e_s_s]:bb[_c_o_m_m_a_n_d_s] ! 227: Set breakpoint at address; save commands to be executed when ! 228: breakpoint is encountered. commands defaults to ! 229: .:aa\nnii+.?ii\nn:xx. ! 230: ! 231: :bbrr [_c_o_m_m_a_n_d_s] ! 232: Set breakpoint at return from current routine. The defaults ! 233: are the same as for :bb, above. ! 234: ! 235: [_a_d_d_r_e_s_s] :cc ! 236: Continue execution from address. ! 237: ! 238: [_a_d_d_r_e_s_s] :dd[rr][ss] ! 239: Delete breakpoint at address. If optional r or s is ! 240: specified, delete return or single-step breakpoint. address ! 241: defaults to `.'. ! 242: ! 243: [_a_d_d_r_e_s_s]:ee[_c_o_m_m_a_n_d_l_i_n_e] ! 244: Begin traced execution of the object file at address ! 245: (default, entry point). The commandline is parsed and ! 246: passed to the traced process. argv[0] must be typed ! 247: directly after :e if supplied. For example, :e3 foo bar baz ! 248: sets argv[0] to 3, argv[1] to foo, argv[2] to bar, and ! 249: argv[3] to baz. Quotation marks, apostrophes, and redirec- ! 250: tion are parsed as by sh, but special characters `?*[]' and ! 251: shell punctuation `(){}|;' are not. For complete shell com- ! 252: mand line parsing use the -e option. ! 253: ! 254: :ff Print type of fault which caused core dump or stopped the ! 255: traced process. ! 256: ! 257: :mm Display segmentation map. ! 258: ! 259: ! 260: ! 261: ! 262: COHERENT Lexicon Page 4 ! 263: ! 264: ! 265: ! 266: ! 267: db Command db ! 268: ! 269: ! 270: ! 271: [_e_x_p_r] :nn ! 272: Set default numeric display base to expr: 88, 1100, and 1166 in- ! 273: dicate, respectively, octal, decimal, and hexadecimal. ! 274: ! 275: :pp Display breakpoints. ! 276: ! 277: [_e_x_p_r] :qq ! 278: If expr is nonzero, quit the current level of command input ! 279: (see :x). expr defaults to 1. End of file is equivalent to ! 280: :q. ! 281: ! 282: :rr Display registers. ! 283: ! 284: [_a_d_d_r_e_s_s],[_c_o_u_n_t]:ss[cc][_c_o_m_m_a_n_d_s] ! 285: Single-step execution starting at address, for count steps, ! 286: executing commands at each step. commands defaults to ! 287: ii+.?ii. ! 288: ! 289: After a single-step command, <rreettuurrnn> is equivalent to ! 290: .,11:ss[cc]. If the optional c is present, db turns off ! 291: single-stepping at a subroutine call and turns it back on ! 292: upon return. ! 293: ! 294: [_d_e_p_t_h] :tt ! 295: Print a call traceback to depth levels. If depth is 0 ! 296: (default), unwind the whole stack. ! 297: ! 298: [_e_x_p_r] :xx ! 299: If expr is nonzero, read and execute commands from the stan- ! 300: dard input up to end of file or :q. expr defaults to 1. ! 301: ! 302: ***** See Also ***** ! 303: ! 304: commands, core, l.out.h, od, ptrace() ! 305: ! 306: ! 307: ! 308: ! 309: ! 310: ! 311: ! 312: ! 313: ! 314: ! 315: ! 316: ! 317: ! 318: ! 319: ! 320: ! 321: ! 322: ! 323: ! 324: ! 325: ! 326: ! 327: ! 328: COHERENT Lexicon Page 5 ! 329: ! 330:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.