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 Deleting Breakpoints You can delete a breakpoint from a program by using the :dl command. The command has the form address :dl where address is the address of the breakpoint you wish to delete. The :dl command is typically used to delete breakpoints you no longer wish to use. The following command deletes the breakpoint set at the start of the function main: main:dl Displaying the C Stack Backtrace You can trace the path of all active functions by using the $c command. The command lists the names of all functions that have been called and have not yet returned control, as well as the address from which each function was called and the arguments passed to it. For example, the command $c displays a backtrace of the C language functions called. By default, the $c command displays all calls. If you wish to display just a few, you must supply a count of the number of calls you wish to see. For example, the command ,25$c displays up to 25 calls in the current call path. Note that function calls and argu ments are put on the stack after the function has been called. If you put breakpoints at the entry point to a function, the function will not appear in the list generated by the $c command. You can remedy this problem by placing breakpoints a few instructions into the function. 6-17
adb: Program Debugger XENIX Programming Displaying CPU Registers You can display the contents of all CPU registers by using the $r command. The command displays the name and contents of each register in the CPU as well as the current value of the program counter and the instruction at the current address. The display has the form ax OxO fl OxO bx OxO ip OxO ex OxO cs OxO dx OxO ds OxO di OxO ss OxO si OxO es OxO sp OxO sp OxO 0:0: ad db al, bl The value of each register is given in the current default format. Displaying External Variables You can display the values of all external variables in the program by using the $e command. External variables are the variables in your program that have global scope or have been defined outside of any function. This may include variables defined in library routines used by your program. The $e command is useful whenever you need a list of the names for all available variables or to quickly summarize their values. The command displays one name on each line with the variable's value (if any) on the same line. The display has the form fac: 0. errno: 0. - end: 0. - sobuf: 0. - obuf: 0. - lastbu: 0406. - sibuf: 0. - stkmax: 0. lscadr: 02. iob: 01664. - edata: 0. An Example: Tracing Multiple Functions The following example illustrates how to execute a program under adb control. In particular, it shows how to set breakpoints, start the program, and examine registers and memory. The program to be examined has the following source statements. 6-18
- Page 63 and 64: make: Program Maintainer XENIX Prog
- Page 65 and 66: make: Program Maintainer print: $(F
- Page 67 and 68: SCCS: Source Code Control System XE
- Page 69 and 70: SCCS: Source Code Control System XE
- 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 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 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
<strong>XENIX</strong> Programming adb: Program Debugger<br />
Deleting Breakpoints<br />
You can delete a breakpoint from a program by using the :dl command. The command<br />
has the form<br />
address :dl<br />
where address is the address of the breakpoint you wish to delete.<br />
The :dl command is typically used to delete breakpoints you no longer wish to use. The<br />
following command deletes the breakpoint set at the start of the function main:<br />
main:dl<br />
Displaying the C Stack Backtrace<br />
You can trace the path of all active functions by using the $c command. The command<br />
lists the names of all functions that have been called and have not yet returned control,<br />
as well as the address from which each function was called and the arguments passed to<br />
it.<br />
For example, the command<br />
$c<br />
displays a backtrace of the C language functions called.<br />
By default, the $c command displays all calls. If you wish to display just a few, you<br />
must supply a count of the number of calls you wish to see. For example, the command<br />
,25$c<br />
displays up to 25 calls in the current call path.<br />
Note that function calls and argu ments are put on the stack after the function has been<br />
called. If you put breakpoints at the entry point to a function, the function will not<br />
appear in the list generated by the $c command. You can remedy this problem by<br />
placing breakpoints a few instructions into the function.<br />
6-17