Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming adb: Program Debugger Setting the Maximum Offset adb normally displays memory and file addresses as the sum of a symbol and an offset. This helps associate the instructions and data you are viewing with a given function or variable. When first invoked, adb sets the maximum offset to 255. This means instructions or data no more than 255 bytes from the start of the function or variable are given symbolic addresses. Instructions or data beyond this point are given numeric addresses. In many programs, the size of a function or variable is actually larger than 255 bytes. For this reason adb lets you change the maximum offset to accommodate larger programs. You can change the maximum offset by using the $s command. The command has the form n$s where n is an integer giving the new offset. For example, the command 4095$s increases the maximum possible offset to 4095. All instructions and data no more than 4095 bytes away are given symbolic addresses. Note that you can disable all sy mbolic addressing by setting the maximum offset to zero. All addresses will be given nu meric values instead. Setting Default Input Format You can set the default format for numbers used in commands with the $d (decimal), $o (octal), and $x (hexadecimal) commands. The default format tells adb how to interpret numbers that do not begin with "O" or "Ox" and how to display numbers when no specific format is given. The commands are useful if you wish to work with a combination of decimal, octal, and hexadecimal numbers. For example, if you use $x you may give addresses in hexadecimal without prepending each address with "Ox". Furthermore, adb displays all numbers in hexadecimal except those specifically requested to be in some other format. When you first start adb, the default format is decimal. You may change this at any time and restore it as necessary using the $d command. 6-27
adb: Program Debugger XENIX Programming Using XENIX Commands You can execute XENIX commands without leaving adb by using the adb escape command !. The escape command has the form command where command is the XENIX command you wish to execute. The command must have any required arguments. adb passes this command to the system shell, which executes it. When finished, the shell returns control to adb. For example, to display the date, type ! date The system displays the date at your terminal and returns control to adb. Computing Numbers and Displaying Text You can perform arithmetic calculations while in adb by using the = command. The command directs adb to display the value of an expression in a given format. The command is often used to convert numbers in one base to another, to double-check the arithmetic performed by a program, and to display complex addresses in simpler form. For example, the command Ox2a = d displays the hexadecimal number Ox2a as the decimal nu mber 42, but Ox2a = c displays it as the ASCII character "*"· Expressions in a com mand may have any combination of symbols and operators. For example, the command
- Page 73 and 74: SCCS: Source Code Control System XE
- Page 75 and 76: SCCS: Source Code Control System XE
- Page 77 and 78: SCCS: Source Code Control System XE
- Page 79 and 80: SCCS: Source Code Control System XE
- Page 81 and 82: SCCS: Source Code Control System XE
- Page 83 and 84: SCCS: Source Code Control System XE
- Page 85 and 86: SCCS: Source Code Control System XE
- Page 87 and 88: SCCS: Source Code Control System XE
- Page 89 and 90: SCCS: Source Code Control System XE
- Page 91 and 92: SCCS: Source Code Control System XE
- Page 93 and 94: SCCS: Source Code Control System XE
- Page 95 and 96: SCCS: Source Code Control System XE
- Page 98 and 99: CHAPTER 6 adb: PROGRAM DEBUGGER adb
- Page 100 and 101: XENIX Programming adb: Program Debu
- Page 102 and 103: XENIX Programming adb: Program Debu
- Page 104 and 105: XENIX Programming adb: Program Debu
- Page 106 and 107: XENIX Programming adb: Program Debu
- Page 108 and 109: XENIX Programming adb: Program Debu
- Page 110 and 111: XENIX Programming adb: Program Debu
- Page 112 and 113: XENIX Programming adb: Program Debu
- Page 114 and 115: XENIX Programming adb: Program Debu
- Page 116 and 117: XENIX Programming int fcnt,gcnt,hcn
- Page 118 and 119: XENIX Programming adb: Program Debu
- Page 120 and 121: XENIX Programming adb: Program Debu
- Page 122 and 123: XENIX Programming adb: Program Debu
- Page 126 and 127: XENIX Programming adb: Program Debu
- Page 128: XENIX Programming adb: Program Debu
- Page 131 and 132: as: A sse m bier XENIX Programming
- Page 133 and 134: as: Assembler XENIX Programming The
- Page 135 and 136: as: Assembler XENIX Programming Key
- Page 137 and 138: as: Assembler The combination rules
- Page 139 and 140: as: Assembler XENIX Programming Ins
- Page 141 and 142: as: Assembler Initial Value Directi
- Page 143 and 144: as: Assembler XENIX Programming int
- Page 145 and 146: as: A sse m bier sub subb test test
- Page 147 and 148: as: Assembler XENIX Programming lnt
- Page 149 and 150: as: Assembler XENIX Programming lnt
- Page 151 and 152: as: Assembler XENIX Programming Imm
- Page 153 and 154: as: A sse m bier XENIX Programming
- Page 156 and 157: CHAPTER 8 csh : C SHEll The C shell
- Page 158 and 159: XENIX Programming csh: C Shell Some
- Page 160 and 161: XENIX Programm ing *w 32 * q % !c -
- Page 162 and 163: XENIX Programming csh: C Shell the
- Page 164 and 165: XENIX Programming csh: C Shell Usin
- Page 166 and 167: XENIX Programming csh: C Shell Usin
- Page 168 and 169: XENIX Programming csh: C Shell The
- Page 170 and 171: XENIX Programming csh: C Shell Note
- Page 172 and 173: XENIX Programming switch ( string c
<strong>XENIX</strong> Programming adb: Program Debugger<br />
Setting the Maximum Offset<br />
adb normally displays memory and file addresses as the sum of a symbol and an offset.<br />
This helps associate the instructions and data you are viewing with a given function or<br />
variable. When first invoked, adb sets the maximum offset to 255. This means<br />
instructions or data no more than 255 bytes from the start of the function or variable<br />
are given symbolic addresses. Instructions or data beyond this point are given numeric<br />
addresses.<br />
In many programs, the size of a function or variable is actually larger than 255 bytes.<br />
For this reason adb lets you change the maximum offset to accommodate larger<br />
programs. You can change the maximum offset by using the $s command. The<br />
command has the form<br />
n$s<br />
where n is an integer giving the new offset. For example, the command<br />
4095$s<br />
increases the maximum possible offset to 4095. All instructions and data no more than<br />
4095 bytes away are given symbolic addresses.<br />
Note that you can disable all sy mbolic addressing by setting the maximum offset to<br />
zero. All addresses will be given nu meric values instead.<br />
Setting Default Input Format<br />
You can set the default format for numbers used in commands with the $d (decimal), $o<br />
(octal), and $x (hexadecimal) commands. The default format tells adb how to interpret<br />
numbers that do not begin with "O" or "Ox" and how to display numbers when no specific<br />
format is given.<br />
The commands are useful if you wish to work with a combination of decimal, octal, and<br />
hexadecimal numbers. For example, if you use<br />
$x<br />
you may give addresses in hexadecimal without prepending each address with "Ox".<br />
Furthermore, adb displays all numbers in hexadecimal except those specifically<br />
requested to be in some other format.<br />
When you first start adb, the default format is decimal. You may change this at any<br />
time and restore it as necessary using the $d command.<br />
6-27