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 Breakpoints are typically set to stop program execution at a specific place in the program, such as the beginning of a function, so that the contents of registers and memory can be examined. For example, the command main:br sets a breakpoint at the start of the function main. The breakpoint is taken just as control enters the function and before the function's stack frame is created. A breakpoint with a count is typically used within a function that is called several times during execution of a program, or within the instructions that correspond to a for or while statement. Such a breakpoint allows the program to cont inue to execute until the given function or instructions have been executed the specified number of times. For example, the command light,S:br sets a breakpoint at the fifth invocation of the function light. The breakpoint does not stop the program until function light has been called five times. Note that no more than 16 breakpoints at a time are allowed. Displaying Breakpoints The command $b displays the location and count of each currently defined breakpoint. Breakpoints are listed by address, along with any count and/or command associated with them. Continuing Execution You can continue the execution of a program after it has been stopped by a breakpoint by using the :co command. The command has the form [ address 1 [,count] :co [signal] where address is the address of the instruction at which you wish to continue execution, count is the number of breakpoints you wish to ignore, and signal is the number of the signal to send to the program (see signal in "System Functions" in the XENIX 286 C Library Guide). If no address is given, the program starts at the next instruction after the breakpoint. If count is given, adb ignores the first count breakpoints. 6-15
adb: Program Debugger XENIX Programming Stopping a Program with Interrupt and Quit You can stop execution of a program at any time by pressing the INTERRUPT or QUIT keys. These keys stop the current program and return control to adb. These keys are especially useful for programs with infinite loops or other program errors. Note that whenever you press the INTERRUPT or QUIT key to stop a program, adb automatically saves the signal and passes it to the program if you start it again by using the :co command. This is very useful if you wish to test a program that uses these signals as part of its processing. If you wish to continue execution of the program but do not wish to send the signals, type :co 0 The command argument 0 prevents a pending signal from being sent to the program. Single-Stepping a Program You can single-step a program, i.e., execute it one instruction at a time, by using the :s command. The command executes an instruction and returns control to adb. The command has the form [ address ] [, count ] :s where address is the address of the instruction you wish to execute, and count is the number of times you wish to repeat the command. If no address is given, adb uses the current address. If count is given, adb continues to execute each successive instruction until count instructions have been executed. For example, the com mand main,S:s executes the first five instructions in the function main. Killing a Program You can kill the program you are debugging by using the :k command. The com mand kills the process created for the program and returns control to adb. The command is typically used to clear the current contents of the CPU registers and stack and begin the program again. 6-16
- Page 61 and 62: make: Program Maintainer XENIX Prog
- 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 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 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 -
<strong>XENIX</strong> Programming adb: Program Debugger<br />
Breakpoints are typically set to stop program execution at a specific place in the<br />
program, such as the beginning of a function, so that the contents of registers and<br />
memory can be examined. For example, the command<br />
main:br<br />
sets a breakpoint at the start of the function main. The breakpoint is taken just as<br />
control enters the function and before the function's stack frame is created.<br />
A breakpoint with a count is typically used within a function that is called several times<br />
during execution of a program, or within the instructions that correspond to a for or<br />
while statement. Such a breakpoint allows the program to cont inue to execute until the<br />
given function or instructions have been executed the specified number of times. For<br />
example, the command<br />
light,S:br<br />
sets a breakpoint at the fifth invocation of the function light. The breakpoint does not<br />
stop the program until function light has been called five times.<br />
Note that no more than 16 breakpoints at a time are allowed.<br />
Displaying Breakpoints<br />
The command $b displays the location and count of each currently defined breakpoint.<br />
Breakpoints are listed by address, along with any count and/or command associated with<br />
them.<br />
Continuing Execution<br />
You can continue the execution of a program after it has been stopped by a breakpoint<br />
by using the :co command. The command has the form<br />
[ address 1 [,count] :co [signal]<br />
where address is the address of the instruction at which you wish to continue execution,<br />
count is the number of breakpoints you wish to ignore, and signal is the number of the<br />
signal to send to the program (see signal in "System Functions" in the <strong>XENIX</strong> <strong>2<strong>86</strong></strong> C<br />
Library <strong>Guide</strong>).<br />
If no address is given, the program starts at the next instruction after the breakpoint. If<br />
count is given, adb ignores the first count breakpoints.<br />
6-15