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 Validating Addresses Whenever you use an address in a command, adb checks the address to make sure it is valid. adb uses the segment number, file position, and size values in each map entry to validate the addresses. If an address is correct, adb carries out the command; otherwise, it displays an error message. The first step adb takes when validating an address is to check the segment value to make sure it belongs to the appropriate map. Segments used with the ? command must appear in the text segments map; segments used with the I command must appear in the data segments map. If the value does not belong to the map, adb displays a bad segment error. The next step is to check the offset to see if it is in range. The offset must be within the range 0 < = offset < = segment-size If it is not in this range, adb displays a bad address error. If adb is currently accessing memory, the validating segment and offset are used to access a memory location and no other processing takes place. If adb is accessing files, it computes an effective file address as follows: effective-fi le-address = offset + fi le-position then uses this effective address to read from the corresponding file. Miscellaneous Features The following sections explain how to use a number of useful miscellaneous commands and features of adb. Combining Comma nds on a Single Line You can give more than one command on a line by separating the commands with a semicolon (;). The com mands are performed one at a time, starting at the left. Changes to the current address and format are carried to the next command. If an error occurs, the remaining commands are ignored. One typical combination is to place a ? command after an 1 command. For example, the commands ?I 'Th'; ?s search for and display a string that begins with the characters "Th". 6-25
adb: Program Debugger XENIX Programming Creati ng adb Scripts You can direct adb to read commands from a text file instead of the keyboard by redirecting adb's standard input file at invocation. To redirect the standard input, use the standard redirection symbol < and supply a file name. For example, to read commands from the file script, type adb sample
- Page 71 and 72: SCCS: Source Code Control System XE
- 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 124 and 125: 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
<strong>XENIX</strong> Programming adb: Program Debugger<br />
Validating Addresses<br />
Whenever you use an address in a command, adb checks the address to make sure it is<br />
valid. adb uses the segment number, file position, and size values in each map entry to<br />
validate the addresses. If an address is correct, adb carries out the command;<br />
otherwise, it displays an error message.<br />
The first step adb takes when validating an address is to check the segment value to<br />
make sure it belongs to the appropriate map. Segments used with the ? command must<br />
appear in the text segments map; segments used with the I command must appear in the<br />
data segments map. If the value does not belong to the map, adb displays a bad segment<br />
error.<br />
The next step is to check the offset to see if it is in range. The offset must be within<br />
the range<br />
0 < = offset < = segment-size<br />
If it is not in this range, adb displays a bad address error.<br />
If adb is currently accessing memory, the validating segment and offset are used to<br />
access a memory location and no other processing takes place. If adb is accessing files,<br />
it computes an effective file address as follows:<br />
effective-fi le-address = offset + fi le-position<br />
then uses this effective address to read from the corresponding file.<br />
Miscellaneous Features<br />
The following sections explain how to use a number of useful miscellaneous commands<br />
and features of adb.<br />
Combining Comma nds on a Single Line<br />
You can give more than one command on a line by separating the commands with a<br />
semicolon (;). The com mands are performed one at a time, starting at the left. Changes<br />
to the current address and format are carried to the next command. If an error occurs,<br />
the remaining commands are ignored.<br />
One typical combination is to place a ? command after an 1 command. For example,<br />
the commands<br />
?I 'Th'; ?s<br />
search for and display a string that begins with the characters "Th".<br />
6-25