| 1 | .TH ADB 1 "VAX/11" |
| 2 | .SH NAME |
| 3 | adb \- debugger |
| 4 | .SH SYNOPSIS |
| 5 | .B adb |
| 6 | [\fB\-w\fR] [ objfil [ corfil ] ] |
| 7 | .ds TW \v'.25m'\s+2~\s-2\v'-.25m' |
| 8 | .ds ST \v'.25m'*\v'-.25m' |
| 9 | .ds IM \v'.1m'=\v'-.1m'\s-2\h'-.1m'>\h'.1m'\s+2 |
| 10 | .ds LE \(<= |
| 11 | .ds LT \s-2<\s+2 |
| 12 | .ds GT \s-2>\s+2 |
| 13 | .SH DESCRIPTION |
| 14 | .I Adb |
| 15 | is a general purpose debugging program. |
| 16 | It may be used to examine files and to provide |
| 17 | a controlled environment for the execution |
| 18 | of UNIX programs. |
| 19 | .PP |
| 20 | .I Objfil |
| 21 | is normally an executable program file, preferably |
| 22 | containing a symbol table; |
| 23 | if not then the |
| 24 | symbolic features of |
| 25 | .I adb |
| 26 | cannot be used although the file can still |
| 27 | be examined. |
| 28 | The default for |
| 29 | .I objfil |
| 30 | is |
| 31 | .B a.out. |
| 32 | .I Corfil |
| 33 | is assumed to be a core image file produced after |
| 34 | executing |
| 35 | .IR objfil ; |
| 36 | the default for |
| 37 | .I corfil |
| 38 | is |
| 39 | .B core. |
| 40 | .PP |
| 41 | Requests to |
| 42 | .I adb |
| 43 | are read from the standard input and |
| 44 | responses are to the standard output. |
| 45 | If the |
| 46 | .B \-w |
| 47 | flag is present then both |
| 48 | .I objfil |
| 49 | and |
| 50 | .I corfil |
| 51 | are |
| 52 | created if necessary and |
| 53 | opened for reading and writing |
| 54 | so that files can be modified using |
| 55 | .IR adb . |
| 56 | .I Adb |
| 57 | ignores QUIT; INTERRUPT |
| 58 | causes return to the next |
| 59 | .I adb |
| 60 | command. |
| 61 | .PP |
| 62 | In general requests to |
| 63 | .I adb |
| 64 | are of the form |
| 65 | .PP |
| 66 | .if n .ti 16 |
| 67 | .if t .ti 1.6i |
| 68 | [\|\fIaddress\fR\|] [\|, |
| 69 | .IR count \|] |
| 70 | [\|\fIcommand\fR\|] [\|;\|] |
| 71 | .PP |
| 72 | If |
| 73 | .I address |
| 74 | is present then |
| 75 | .I dot |
| 76 | is set to |
| 77 | .IR address . |
| 78 | Initially |
| 79 | .I dot |
| 80 | is set to 0. |
| 81 | For most commands |
| 82 | .I count |
| 83 | specifies how many times |
| 84 | the command will be executed. |
| 85 | The default |
| 86 | .I count |
| 87 | is 1. |
| 88 | .I Address |
| 89 | and |
| 90 | .I count |
| 91 | are expressions. |
| 92 | .PP |
| 93 | The interpretation of an address depends |
| 94 | on the context it is used in. |
| 95 | If a subprocess is being debugged then |
| 96 | addresses are interpreted |
| 97 | in the usual way in the address space of the subprocess. |
| 98 | For further details of address mapping see |
| 99 | .SM ADDRESSES. |
| 100 | .SH EXPRESSIONS |
| 101 | .TP 7.2n |
| 102 | .B . |
| 103 | The value of |
| 104 | .IR dot . |
| 105 | .TP 7.2n |
| 106 | + |
| 107 | The value of |
| 108 | .I dot |
| 109 | incremented by the current increment. |
| 110 | .TP 7.2n |
| 111 | ^ |
| 112 | The value of |
| 113 | .I dot |
| 114 | decremented by the current increment. |
| 115 | .TP 7.2n |
| 116 | " |
| 117 | The last |
| 118 | .I address |
| 119 | typed. |
| 120 | .TP 7.2n |
| 121 | .I integer |
| 122 | A number. The prefixes 0o and 0O (``zero oh'') force interpretation |
| 123 | in octal radix; the prefixes 0t and 0T force interpretation in |
| 124 | decimal radix; the prefixes 0x and 0X force interpretation in |
| 125 | hexadecimal radix. Thus 0o20 = 0t16 = 0x10 = sixteen. |
| 126 | If no prefix appears, then the |
| 127 | .I default\ radix |
| 128 | is used; see the $d command. The default radix is initially hexadecimal. |
| 129 | The hexadecimal digits are 0123456789abcdefABCDEF with the obvious |
| 130 | values. Note that a hexadecimal number whose most significant |
| 131 | digit would otherwise be an alphabetic character must have a 0x |
| 132 | (or 0X) prefix (or a leading zero if the default radix is hexadecimal). |
| 133 | .TP 7.2n |
| 134 | .IB integer . fraction |
| 135 | A 32 bit floating point number. |
| 136 | .TP 7.2n |
| 137 | .I \'cccc\|\' |
| 138 | The ASCII value of up to 4 characters. |
| 139 | \\ may be used to escape a \'. |
| 140 | .TP 7.2n |
| 141 | .I \*(LT name |
| 142 | The value of |
| 143 | .IR name , |
| 144 | which is either a variable name or a register name. |
| 145 | .I Adb |
| 146 | maintains a number of variables |
| 147 | (see |
| 148 | .SM VARIABLES\*S) |
| 149 | named by single letters or digits. |
| 150 | If |
| 151 | .I name |
| 152 | is a register name then |
| 153 | the value of the register is obtained from |
| 154 | the system header in |
| 155 | .IR corfil . |
| 156 | The register names are |
| 157 | those printed by the $r command. |
| 158 | .TP 7.2n |
| 159 | .I symbol |
| 160 | A |
| 161 | .I symbol |
| 162 | is a sequence |
| 163 | of upper or lower case letters, underscores or |
| 164 | digits, not starting with a digit. |
| 165 | .BR \\ " may be used to escape other characters." |
| 166 | The value of the |
| 167 | .I symbol |
| 168 | is taken from the symbol table |
| 169 | in |
| 170 | .IR objfil . |
| 171 | An initial \_ or \*(TW will be prepended to |
| 172 | .I symbol |
| 173 | if needed. |
| 174 | .TP |
| 175 | .I _ symbol |
| 176 | In C, the `true name' of an external symbol begins with _. |
| 177 | It may be necessary to utter this name to disinguish it |
| 178 | from internal or hidden variables of a program. |
| 179 | .TP 7.2n |
| 180 | .IB routine . name |
| 181 | The address of the variable |
| 182 | .I name |
| 183 | in the specified |
| 184 | C routine. |
| 185 | Both |
| 186 | .I routine |
| 187 | and |
| 188 | .I name |
| 189 | are |
| 190 | .IR symbols . |
| 191 | If |
| 192 | .I name |
| 193 | is omitted the value is the address of the |
| 194 | most recently activated C stack frame |
| 195 | corresponding to |
| 196 | .IR routine . |
| 197 | .TP 7.2n |
| 198 | .RI ( exp \|) |
| 199 | The value of the expression |
| 200 | .IR exp . |
| 201 | .LP |
| 202 | .SM |
| 203 | .B "Monadic\ operators" |
| 204 | .TP 7.2n |
| 205 | .RI \*(ST exp |
| 206 | The contents of the location addressed |
| 207 | by |
| 208 | .I exp |
| 209 | in |
| 210 | .IR corfil . |
| 211 | .TP 7.2n |
| 212 | .RI @ exp |
| 213 | The contents of the location addressed by |
| 214 | .I exp |
| 215 | in |
| 216 | .IR objfil . |
| 217 | .TP 7.2n |
| 218 | .RI \- exp |
| 219 | Integer negation. |
| 220 | .TP 7.2n |
| 221 | .RI \*(TW exp |
| 222 | Bitwise complement. |
| 223 | .LP |
| 224 | .B "Dyadic\ operators" |
| 225 | are left associative |
| 226 | and are less binding than monadic operators. |
| 227 | .TP 7.2n |
| 228 | .IR e1 + e2 |
| 229 | Integer addition. |
| 230 | .TP 7.2n |
| 231 | .IR e1 \- e2 |
| 232 | Integer subtraction. |
| 233 | .TP 7.2n |
| 234 | .IR e1 \*(ST e2 |
| 235 | Integer multiplication. |
| 236 | .TP 7.2n |
| 237 | .IR e1 % e2 |
| 238 | Integer division. |
| 239 | .TP 7.2n |
| 240 | .IR e1 & e2 |
| 241 | Bitwise conjunction. |
| 242 | .TP 7.2n |
| 243 | .IR e1 \(bv e2 |
| 244 | Bitwise disjunction. |
| 245 | .TP 7.2n |
| 246 | .IR e1 # e2 |
| 247 | .I E1 |
| 248 | rounded up to the next multiple of |
| 249 | .IR e2 . |
| 250 | .DT |
| 251 | .SH COMMANDS |
| 252 | Most commands consist of a verb followed by a modifier or list |
| 253 | of modifiers. |
| 254 | The following verbs are available. |
| 255 | (The commands `?' and `/' may be followed by `\*(ST'; |
| 256 | see |
| 257 | .SM ADDRESSES |
| 258 | for further details.) |
| 259 | .TP .5i |
| 260 | .RI ? f |
| 261 | Locations starting at |
| 262 | .I address |
| 263 | in |
| 264 | .I objfil |
| 265 | are printed according to the format |
| 266 | .IR f . |
| 267 | .I dot |
| 268 | is incremented by the sum of the increments for each format letter (q.v.). |
| 269 | .TP |
| 270 | .RI / f |
| 271 | Locations starting at |
| 272 | .I address |
| 273 | in |
| 274 | .I corfil |
| 275 | are printed according to the format |
| 276 | .I f |
| 277 | and |
| 278 | .I dot |
| 279 | is incremented as for `?'. |
| 280 | .TP |
| 281 | .RI = f |
| 282 | The value of |
| 283 | .I address |
| 284 | itself is printed in the |
| 285 | styles indicated by the format |
| 286 | .IR f . |
| 287 | (For |
| 288 | .B i |
| 289 | format `?' is printed for the parts of the instruction that reference |
| 290 | subsequent words.) |
| 291 | .PP |
| 292 | A |
| 293 | .I format |
| 294 | consists of one or more characters that specify a style |
| 295 | of printing. |
| 296 | Each format character may be preceded by a decimal integer |
| 297 | that is a repeat count for the format character. |
| 298 | While stepping through a format |
| 299 | .I dot |
| 300 | is incremented |
| 301 | by the amount given for each format letter. |
| 302 | If no format is given then the last format is used. |
| 303 | The format letters available are as follows. |
| 304 | .ta 2.5n .5i |
| 305 | .RS |
| 306 | .TP |
| 307 | .BR o " 2" |
| 308 | Print 2 bytes in octal. |
| 309 | All octal numbers output by |
| 310 | .I adb |
| 311 | are preceded by 0. |
| 312 | .br |
| 313 | .ns |
| 314 | .TP |
| 315 | .BR O " 4" |
| 316 | Print 4 bytes in octal. |
| 317 | .br |
| 318 | .ns |
| 319 | .TP |
| 320 | .BR q " 2" |
| 321 | Print in signed octal. |
| 322 | .br |
| 323 | .ns |
| 324 | .TP |
| 325 | .BR Q " 4" |
| 326 | Print long signed octal. |
| 327 | .br |
| 328 | .ns |
| 329 | .TP |
| 330 | .BR d " 2" |
| 331 | Print in decimal. |
| 332 | .br |
| 333 | .ns |
| 334 | .TP |
| 335 | .BR D " 4" |
| 336 | Print long decimal. |
| 337 | .br |
| 338 | .ns |
| 339 | .TP |
| 340 | .BR r " 2" |
| 341 | Print in default radix. |
| 342 | .br |
| 343 | .ns |
| 344 | .TP |
| 345 | .BR R " 4" |
| 346 | Print long default radix. |
| 347 | .br |
| 348 | .ns |
| 349 | .TP |
| 350 | .BR x " 2" |
| 351 | Print 2 bytes in hexadecimal. |
| 352 | .br |
| 353 | .ns |
| 354 | .TP |
| 355 | .BR X " 4" |
| 356 | Print 4 bytes in hexadecimal. |
| 357 | .br |
| 358 | .ns |
| 359 | .TP |
| 360 | .BR u " 2" |
| 361 | Print as an unsigned decimal number. |
| 362 | .br |
| 363 | .ns |
| 364 | .TP |
| 365 | .BR U " 4" |
| 366 | Print long unsigned decimal. |
| 367 | .br |
| 368 | .ns |
| 369 | .TP |
| 370 | .BR f " 4" |
| 371 | Print the 32 bit value |
| 372 | as a floating point number. |
| 373 | .br |
| 374 | .ns |
| 375 | .TP |
| 376 | .BR F " 8" |
| 377 | Print double floating point. |
| 378 | .br |
| 379 | .ns |
| 380 | .TP |
| 381 | .BR b " 1" |
| 382 | Print the addressed byte in octal. |
| 383 | .br |
| 384 | .ns |
| 385 | .TP |
| 386 | .BR c " 1" |
| 387 | Print the addressed character. |
| 388 | .br |
| 389 | .ns |
| 390 | .TP |
| 391 | .BR C " 1" |
| 392 | Print the addressed character using |
| 393 | the following escape convention. |
| 394 | Character values 000 to 040 are printed as @ followed by the corresponding |
| 395 | character in the range 0100 to 0140. |
| 396 | The character @ is printed as @@. |
| 397 | .br |
| 398 | .ns |
| 399 | .TP |
| 400 | .BI s " n" |
| 401 | Print the addressed characters until a zero character |
| 402 | is reached. |
| 403 | .br |
| 404 | .ns |
| 405 | .TP |
| 406 | .BI S " n" |
| 407 | Print a string using |
| 408 | the @ escape convention. |
| 409 | .I n |
| 410 | is the length of the string including its zero terminator. |
| 411 | .br |
| 412 | .ns |
| 413 | .TP |
| 414 | .BR Y " 4" |
| 415 | Print 4 bytes in date format (see |
| 416 | .IR ctime (3)). |
| 417 | .br |
| 418 | .ns |
| 419 | .TP |
| 420 | .BR i " n" |
| 421 | Print as PDP11 instructions. |
| 422 | .I n |
| 423 | is the number of bytes occupied by the instruction. |
| 424 | This style of printing causes variables 1 and 2 to be set |
| 425 | to the offset parts of the source and destination respectively. |
| 426 | .br |
| 427 | .ns |
| 428 | .TP |
| 429 | .BR a " 0" |
| 430 | Print the value of |
| 431 | .I dot |
| 432 | in symbolic form. |
| 433 | Symbols are checked to ensure that they have an appropriate |
| 434 | type as indicated below. |
| 435 | .LP |
| 436 | / local or global data symbol |
| 437 | .br |
| 438 | ? local or global text symbol |
| 439 | .br |
| 440 | = local or global absolute symbol |
| 441 | .TP |
| 442 | .BR p " 2" |
| 443 | Print the addressed value in symbolic form using |
| 444 | the same rules for symbol lookup as |
| 445 | .BR a . |
| 446 | .br |
| 447 | .ns |
| 448 | .TP |
| 449 | .BR t " 0" |
| 450 | When preceded by an integer tabs to the next |
| 451 | appropriate tab stop. |
| 452 | For example, |
| 453 | .B 8t |
| 454 | moves to the next 8-space tab stop. |
| 455 | .br |
| 456 | .ns |
| 457 | .TP |
| 458 | .BR r " 0" |
| 459 | Print a space. |
| 460 | .br |
| 461 | .ns |
| 462 | .TP |
| 463 | .BR n " 0" |
| 464 | Print a newline. |
| 465 | .br |
| 466 | .ns |
| 467 | .tr '" |
| 468 | .TP |
| 469 | .BR '...' " 0" |
| 470 | Print the enclosed string. |
| 471 | .br |
| 472 | .tr '' |
| 473 | .br |
| 474 | .ns |
| 475 | .TP |
| 476 | .B ^ |
| 477 | .I Dot |
| 478 | is decremented by the current increment. |
| 479 | Nothing is printed. |
| 480 | .br |
| 481 | .ns |
| 482 | .TP |
| 483 | + |
| 484 | .I Dot |
| 485 | is incremented by 1. |
| 486 | Nothing is printed. |
| 487 | .br |
| 488 | .ns |
| 489 | .TP |
| 490 | \- |
| 491 | .I Dot |
| 492 | is decremented by 1. |
| 493 | Nothing is printed. |
| 494 | .RE |
| 495 | .TP |
| 496 | newline |
| 497 | Repeat the previous command with a |
| 498 | .I count |
| 499 | of 1. |
| 500 | .TP |
| 501 | .RB [ ?/ ] l "\fI value mask\fR" |
| 502 | Words starting at |
| 503 | .I dot |
| 504 | are masked with |
| 505 | .I mask |
| 506 | and compared with |
| 507 | .I value |
| 508 | until |
| 509 | a match is found. |
| 510 | If |
| 511 | .B L |
| 512 | is used then the match is for 4 bytes at a time instead of 2. |
| 513 | If no match is found then |
| 514 | .I dot |
| 515 | is unchanged; otherwise |
| 516 | .I dot |
| 517 | is set to the matched location. |
| 518 | If |
| 519 | .I mask |
| 520 | is omitted then \-1 is used. |
| 521 | .TP |
| 522 | .RB [ ?/ ] w "\fI value ...\fR" |
| 523 | Write the 2-byte |
| 524 | .I value |
| 525 | into the addressed |
| 526 | location. |
| 527 | If the command is |
| 528 | .BR W , |
| 529 | write 4 bytes. |
| 530 | Odd addresses are not allowed when writing to the subprocess |
| 531 | address space. |
| 532 | .TP |
| 533 | [\fB?/\fR]\fBm\fI b1 e1 f1\fR[\fB?/\fR] |
| 534 | .br |
| 535 | New values for |
| 536 | .RI ( b1,\ e1,\ f1 ) |
| 537 | are recorded. |
| 538 | If less than three expressions are given then |
| 539 | the remaining map parameters are left unchanged. |
| 540 | If the `?' or `/' is followed by `\*(ST' then |
| 541 | the second segment (\fIb2\fR\|,\|\fIe2\fR\|,\|\fIf2\fR) |
| 542 | of the mapping is changed. |
| 543 | If the list is terminated by `?' or `/' then the file |
| 544 | (\fIobjfil\fR or |
| 545 | .I corfil |
| 546 | respectively) is used |
| 547 | for subsequent requests. |
| 548 | (So that, for example, `/m?' will cause `/' to refer to |
| 549 | .IR objfil .) |
| 550 | .TP |
| 551 | .BI \*(GT name |
| 552 | .I Dot |
| 553 | is assigned to the variable or register named. |
| 554 | .TP |
| 555 | .B ! |
| 556 | A shell is called to read the |
| 557 | rest of the line following `!'. |
| 558 | .TP |
| 559 | .RI $ modifier |
| 560 | Miscellaneous commands. |
| 561 | The available |
| 562 | .I modifiers |
| 563 | are: |
| 564 | .RS |
| 565 | .TP |
| 566 | .BI < f |
| 567 | Read commands from the file |
| 568 | .I f |
| 569 | and return. |
| 570 | .br |
| 571 | .ns |
| 572 | .TP |
| 573 | .BI > f |
| 574 | Send output to the file |
| 575 | .I f, |
| 576 | which is created if it does not exist. |
| 577 | .br |
| 578 | .ns |
| 579 | .TP |
| 580 | .B r |
| 581 | Print the general registers and |
| 582 | the instruction addressed by |
| 583 | .BR pc . |
| 584 | .I Dot |
| 585 | is set to \fBpc\fR. |
| 586 | .br |
| 587 | .ns |
| 588 | .TP |
| 589 | .B b |
| 590 | Print all breakpoints |
| 591 | and their associated counts and commands. |
| 592 | .br |
| 593 | .ns |
| 594 | .TP |
| 595 | .B a |
| 596 | ALGOL 68 stack backtrace. |
| 597 | If |
| 598 | .I address |
| 599 | is given then it is taken to be the |
| 600 | address of the current frame (instead of |
| 601 | .BR r4 ). |
| 602 | If |
| 603 | .I count |
| 604 | is given then only the first |
| 605 | .I count |
| 606 | frames are printed. |
| 607 | .br |
| 608 | .ns |
| 609 | .TP |
| 610 | .B c |
| 611 | C stack backtrace. |
| 612 | If |
| 613 | .I address |
| 614 | is given then it is taken as the |
| 615 | address of the current frame (instead of |
| 616 | .BR r5 ). |
| 617 | If |
| 618 | .B C |
| 619 | is used then the names and (16 bit) values of all automatic |
| 620 | and static variables are printed for each active function. |
| 621 | If |
| 622 | .I count |
| 623 | is given then only the first |
| 624 | .I count |
| 625 | frames are printed. |
| 626 | .br |
| 627 | .ns |
| 628 | .TP |
| 629 | .B d |
| 630 | Set the default radix to |
| 631 | .I address |
| 632 | and report the new value. |
| 633 | Note that |
| 634 | .I address |
| 635 | is interpreted in the (old) current radix. |
| 636 | Thus ``10$d'' never changes the default radix. |
| 637 | To make decimal the default radix, use ``0t10$d''. |
| 638 | .br |
| 639 | .ns |
| 640 | .TP |
| 641 | .B e |
| 642 | The names and values of |
| 643 | external variables are printed. |
| 644 | .br |
| 645 | .ns |
| 646 | .TP |
| 647 | .B w |
| 648 | Set the page width for output to |
| 649 | .I address |
| 650 | (default 80). |
| 651 | .br |
| 652 | .ns |
| 653 | .TP |
| 654 | .B s |
| 655 | Set the limit for symbol matches to |
| 656 | .I address |
| 657 | (default 255). |
| 658 | .br |
| 659 | .ns |
| 660 | .TP |
| 661 | .B o |
| 662 | All integers input are regarded as octal. |
| 663 | .br |
| 664 | .ns |
| 665 | .TP |
| 666 | .B d |
| 667 | Reset integer input as described in |
| 668 | .SM EXPRESSIONS. |
| 669 | .br |
| 670 | .ns |
| 671 | .TP |
| 672 | .B q |
| 673 | Exit from |
| 674 | .IR adb . |
| 675 | .br |
| 676 | .ns |
| 677 | .TP |
| 678 | .B v |
| 679 | Print all non zero variables in octal. |
| 680 | .br |
| 681 | .ns |
| 682 | .TP |
| 683 | .B m |
| 684 | Print the address map. |
| 685 | .RE |
| 686 | .TP |
| 687 | .BI : modifier |
| 688 | Manage a subprocess. |
| 689 | Available modifiers are: |
| 690 | .RS |
| 691 | .TP |
| 692 | .BI b c |
| 693 | Set breakpoint at |
| 694 | .IR address . |
| 695 | The breakpoint is executed |
| 696 | .IR count \-1 |
| 697 | times before |
| 698 | causing a stop. |
| 699 | Each time the breakpoint is encountered |
| 700 | the command |
| 701 | .I c |
| 702 | is executed. |
| 703 | If this command sets |
| 704 | .I dot |
| 705 | to zero |
| 706 | then the breakpoint causes a stop. |
| 707 | .TP |
| 708 | .B d |
| 709 | Delete breakpoint at |
| 710 | .IR address . |
| 711 | .TP |
| 712 | .B r |
| 713 | Run |
| 714 | .I objfil |
| 715 | as a subprocess. |
| 716 | If |
| 717 | .I address |
| 718 | is given explicitly then the |
| 719 | program is entered at this point; otherwise |
| 720 | the program is entered at its standard entry point. |
| 721 | .I count |
| 722 | specifies how many breakpoints are to be |
| 723 | ignored before stopping. |
| 724 | Arguments to the subprocess may be supplied on the |
| 725 | same line as the command. |
| 726 | An argument starting with < or > causes the standard |
| 727 | input or output to be established for the command. |
| 728 | All signals are turned on on entry to the subprocess. |
| 729 | .TP |
| 730 | .BI c s |
| 731 | The subprocess is continued |
| 732 | with signal |
| 733 | .I s |
| 734 | c |
| 735 | .I s, |
| 736 | see |
| 737 | .IR signal (2). |
| 738 | If |
| 739 | .I address |
| 740 | is given then the subprocess |
| 741 | is continued at this address. |
| 742 | If no signal is specified then the signal |
| 743 | that caused the subprocess to stop is sent. |
| 744 | Breakpoint skipping is the same |
| 745 | as for |
| 746 | .BR r . |
| 747 | .TP |
| 748 | .BI s s |
| 749 | As for |
| 750 | .B c |
| 751 | except that |
| 752 | the subprocess is single stepped |
| 753 | .I count |
| 754 | times. |
| 755 | If there is no current subprocess then |
| 756 | .I objfil |
| 757 | is run |
| 758 | as a subprocess as for |
| 759 | .BR r . |
| 760 | In this case no signal can be sent; the remainder of the line |
| 761 | is treated as arguments to the subprocess. |
| 762 | .TP |
| 763 | .B k |
| 764 | The current subprocess, if any, is terminated. |
| 765 | .RE |
| 766 | .SH VARIABLES |
| 767 | .I Adb |
| 768 | provides a number of variables. |
| 769 | Named variables are set initially by |
| 770 | .I adb |
| 771 | but are not used subsequently. |
| 772 | Numbered variables are reserved for communication |
| 773 | as follows. |
| 774 | .TP |
| 775 | 0 |
| 776 | The last value printed. |
| 777 | .br |
| 778 | .ns |
| 779 | .TP |
| 780 | 1 |
| 781 | The last offset part of an instruction source. |
| 782 | .br |
| 783 | .ns |
| 784 | .TP |
| 785 | 2 |
| 786 | The previous value of variable 1. |
| 787 | .PP |
| 788 | On entry the following are set |
| 789 | from the system header in the |
| 790 | .IR corfil . |
| 791 | If |
| 792 | .I corfil |
| 793 | does not appear to be a |
| 794 | .B core |
| 795 | file then |
| 796 | these values are set from |
| 797 | .IR objfil . |
| 798 | .TP |
| 799 | b |
| 800 | The base address of the data segment. |
| 801 | .br |
| 802 | .ns |
| 803 | .TP |
| 804 | d |
| 805 | The data segment size. |
| 806 | .br |
| 807 | .ns |
| 808 | .TP |
| 809 | e |
| 810 | The entry point. |
| 811 | .br |
| 812 | .ns |
| 813 | .TP |
| 814 | m |
| 815 | The `magic' number (0405, 0407, 0410 or 0411). |
| 816 | .br |
| 817 | .ns |
| 818 | .TP |
| 819 | s |
| 820 | The stack segment size. |
| 821 | .br |
| 822 | .ns |
| 823 | .TP |
| 824 | t |
| 825 | The text segment size. |
| 826 | .SH ADDRESSES |
| 827 | The address in a file associated with |
| 828 | a written address is determined by a mapping |
| 829 | associated with that file. |
| 830 | Each mapping is represented by two triples |
| 831 | .RI ( "b1, e1, f1" ) |
| 832 | and |
| 833 | .RI ( "b2, e2, f2" ) |
| 834 | and the |
| 835 | .I file address |
| 836 | corresponding to a written |
| 837 | .I address |
| 838 | is calculated as follows. |
| 839 | .PP |
| 840 | .if t .ti 1.5i |
| 841 | .if n .ti 8 |
| 842 | .IR b1 \*(LE address < e1 |
| 843 | \*(IM |
| 844 | .IR "file address" = address + f1\-b1, |
| 845 | otherwise, |
| 846 | .PP |
| 847 | .if t .ti 1.5i |
| 848 | .if n .ti 8 |
| 849 | .IR b2 \*(LE address < e2 |
| 850 | \*(IM |
| 851 | .IR "file address" = address + f2\-b2, |
| 852 | .PP |
| 853 | otherwise, the requested |
| 854 | .I address |
| 855 | is not legal. |
| 856 | In some cases (e.g. for programs with separated I and D |
| 857 | space) the two segments for a file may overlap. |
| 858 | If a |
| 859 | .B ? |
| 860 | or |
| 861 | .B / |
| 862 | is followed by an |
| 863 | .B \*(ST |
| 864 | then only the second |
| 865 | triple is used. |
| 866 | .PP |
| 867 | The initial setting of both mappings is suitable for |
| 868 | normal |
| 869 | .B a.out |
| 870 | and |
| 871 | .B core |
| 872 | files. |
| 873 | If either file is not of the kind expected then, for that file, |
| 874 | .I b1 |
| 875 | is set to 0, |
| 876 | .I e1 |
| 877 | is set to |
| 878 | the maximum file size |
| 879 | and |
| 880 | .I f1 |
| 881 | is set to 0; in this way the whole |
| 882 | file can be examined with no address translation. |
| 883 | .PP |
| 884 | So that |
| 885 | .I adb |
| 886 | may be used on large files |
| 887 | all appropriate values are kept as signed 32 bit integers. |
| 888 | .SH FILES |
| 889 | /dev/mem |
| 890 | .br |
| 891 | /dev/swap |
| 892 | .br |
| 893 | a.out |
| 894 | .br |
| 895 | core |
| 896 | .SH SEE\ ALSO |
| 897 | ptrace(2), |
| 898 | a.out(5), |
| 899 | core(5) |
| 900 | .SH DIAGNOSTICS |
| 901 | `Adb' when there is no current command or format. |
| 902 | Comments about inaccessible files, syntax errors, |
| 903 | abnormal termination of commands, etc. |
| 904 | Exit status is 0, unless last command failed or |
| 905 | returned nonzero status. |
| 906 | .SH BUGS |
| 907 | A breakpoint set at the entry point is not effective |
| 908 | on initial entry to the program. |
| 909 | .br |
| 910 | When single stepping, system calls do not count as an |
| 911 | executed instruction. |
| 912 | .br |
| 913 | Local variables whose names are the same as an external |
| 914 | variable may foul up the accessing of the external. |