Вы находитесь на странице: 1из 272

GDB

gnu
, GDB 5.0
2000

, , .

( GDB bug-gdb@gnu.org.)
GDB
TEXinfo 1999-10-01.07

c 1988-2000 Free Software Foundation, Inc.


Copyright
c 2000 .

Published by the Free Software Foundation


59 Temple Place - Suite 330,
Boston, MA 02111-1307 USA
ISBN 1-882114-77-9
Permission is granted to make and distribute verbatim copies of this manual provided the
copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed
under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language,
under the above conditions for modified versions.

GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
. . . . . . . . . . . . . . . . . . . . . . . . . 1
GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1 GDB. . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 GDB . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 GDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 GDB
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .

21
21
22
23
24
24
25
25
26
28

5 . . . . . . . 31
5.1 , . . . . . .
5.1.1 . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.2 . . . . . . . . . . . . . . . . . . . . . .
5.1.3 . . . . . . . . . . . . . . . . . . . . . . . .
5.1.4 . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.5 . . . . . . . . . . . . . . . . . . . . . . .
5.1.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.7 . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.9 . . . . . . . . . . . .
5.2 . . . . . . . . . . . . . . . . . . . . . .
5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4 . . . . . . . . . . . . . . .

31
32
35
37
38
39
40
41
42
43
44
46
48

ii

GDB

6 . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.1
6.2
6.3
6.4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51
52
52
53

7 . . . . . . . . . . . . . . 55
7.1
7.2
7.3
7.4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .

55
56
57
58

8 . . . . . . . . . . . . . . . . . . . . . . . 61
8.1
8.2
8.3
8.4
8.5
8.6
8.7
8.8
8.9
8.10
8.11

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61
62
63
64
65
66
68
72
73
74
75

9 GDB
. . . . . . . . . . . . . . . . . . . . . . . . . 77
9.1 . . . . . . . . . . . . . . . . . . . . . . . . 77
9.1.1 . . . . . . . . 77
9.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.1.3 GDB . . . . . . . . . . . . . . 78
9.2 . . . . . . . . . . . . . . . . . . . . . 78
9.3 . . . . . . . . . . . . . . . 79
9.3.1 . . . . . . . 79
9.3.2 . . . . . . . . . . . . . . . . 80
9.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.4.1 ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.4.1.1 ++ . . . . . . . . . . . . . . . . . . . . 81
9.4.1.2 ++ . . . . . . . . . . . . . . . . . . . . 83
9.4.1.3 ++ . . . . . . . . . . . . . . . . . . . . . . . . . 84
9.4.1.4 ++ . . . . . . . 85
9.4.1.5
++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
9.4.1.6 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
9.4.1.7 GDB ++. . . . . . . . . . . . . . 85
9.4.2 -2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
9.4.2.1 -2 . . . . . . . . . . . . . . . . . . . . . 87
9.4.2.2 . . . . . . . . 88
9.4.2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.4.2.4 -2 . . . . . . . 90
9.4.2.5 -2 . . . . . . 90
9.4.2.6
-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

iii
9.4.2.7
:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
9.4.2.8 GDB -2 . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.4.3 Chill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.4.3.1 . . . . . . . . . . . . . . . 91
9.4.3.2 . . . . . . . . . . 93
9.4.3.3 . . . . . . . . . . . . . . 93
9.4.3.4 Chill . . . . . . . 96
9.4.3.5 Chill . . . . . . . . . . . . 96

10 . . . . . . . . . . . 97
11 . . . . . . . . . . . . . . . . . . . . 101
11.1
11.2
11.3
11.4
11.5
11.6

p . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .

101
102
103
103
104
104

12 GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
12.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
12.2 . . . . . . . . . . . . . . . . . . . . . 108

13 . . . . . . . . . . . . . 111
13.1
13.2
13.3
13.4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.4.1 GDB . . . .
13.4.1.1 . . .
13.4.1.2 . .
13.4.1.3 . . . . . . . . . . . . . . . . . . .
13.4.1.4 . . . . . . . . . . .
13.4.1.5 gdbserver . . .
13.4.1.6 gdbserve.nlm
.............................................
13.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

111
111
113
113
114
115
115
116
118
130
131
132

iv

GDB

14 . . . . . . . . . . . . . . 133
14.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.1.1 HP-UX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.1.2 SVR4 . . . . . . . . . . . . . . . . . . 133
14.2 . . . . . . . . . . . . . . . . . . . . . . 134
14.2.1 GDB VxWorks . . . . . . . . . . . . . . . . . . 134
14.2.1.1 VxWorks . . . . . . . . . . . . . . . . . 134
14.2.1.2 VxWorks . . . . . . . . . . . . . . . . . . . 135
14.2.1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
14.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
14.3.1 AMD A29K . . . . . . . . . . . . . . . . . . . . . . . . 136
14.3.1.1 A29K UDI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
14.3.1.2 EBMON AMD29K . . . . . . . . 136
14.3.1.3 . . . . . . . . . . . . . . . . . . . . . . . . 136
14.3.1.4 - EB29K . . . . . . . . . . . . . . . . . . 138
14.3.1.5 . . . . . . . . . . . . . . . . . . . . . 138
14.3.2 ARM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
14.3.3 Hitachi H8/300 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
14.3.3.1 Hitachi . . . . . . . . . . 139
14.3.3.2 E7000
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
14.3.3.3 GDB Hitachi
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
14.3.4 H8/500 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
14.3.5 Intel i960 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
14.3.5.1 Nindy . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
14.3.5.2 Nindy . . . . . . . . . . . . . . . . . . 142
14.3.5.3 Nindy . . . . . . . . . . . . . . . . . . 142
14.3.6 Mitsubishi M32R/D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
14.3.7 M68k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
14.3.8 M88K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
14.3.9 MIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
14.3.10 PowerPC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
14.3.11 HP PA . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
14.3.12 Hitachi SH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
14.3.13 Tsqware Sparclet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
14.3.13.1 . . . . . . . . . 146
14.3.13.2 Sparclet . . . . . . . . . . . . . . . . . 146
14.3.13.3 Sparclet . . . . . . . . . . . . . . . . . . . 147
14.3.13.4 . . . . . . . . . . . . . . . . 147
14.3.14 Fujitsu Sparclite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
14.3.15 Tandem ST2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
14.3.16 Zilog Z8000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
14.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
14.4.1 A29K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
14.4.2 Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
14.4.3 MIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

15 GDB . . . . . . . . . . . . . . . . . . . . . . . . . 151
15.1
15.2
15.3
15.4
15.5
15.6
15.7

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . .

151
151
151
153
153
154
155

16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
16.1
16.2
16.3
16.4

, . . . . . . . . . . . . . . . . . . .
- . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .

157
158
158
159

17 GDB gnu
Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
18 GDB . . . . . . . . . . . . . . . . . . . . . . . . . 163
18.1
18.2
18.3
18.4
18.5
18.6
18.7
18.8
18.9
18.10
18.11
18.12

? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
, . . . .

163
163
164
165
166
167
168
168
169
169
170
170

19 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . 171
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
19.1 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.1.1 gdb/mi . . . . . . . . . . . . . . . . . . . . . .
19.1.2 gdb/mi . . . . . . . . . . . . . . . . . . . .
19.1.3 gdb/mi . . . . .
19.2 gdb/mi CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.3 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.3.1 gdb/mi . . . . . . . . . . . . . . . .
19.3.2 gdb/mi. . . . . . . . . . . . . . . . . . . . . . . .
19.3.3 gdb/mi. . . . . . . . . . . . . . . . . . . .
19.4 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . .
19.5 gdb/mi . . . . . . . . . . .
19.6 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.7 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . .
19.8 GDB gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . .
19.9 gdb/mi . . . . . . . . . . . . . . . . . . .
19.10 gdb/mi . . . . . . . . . . . . . . . . . .
19.11 gdb/mi . . . . . . . . . . . . . . . . . . . .
19.12 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.13 gdb/mi . . . . . . . . . . . . . . . .
19.14 gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.15 gdb/mi . . .

171
171
171
171
172
174
174
174
175
175
175
175
176
183
193
203
204
209
212
217
218
218
222

20 GDB . . . . . . . . . . . . . . . 225
20.1 ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
20.2 . . . . . . . . . . . . . . . . . . . . . . 225

vi

GDB

21 . . . . . . . . 229
21.1 . . . . . . . . . . . . . . . . . . . . . . . .
21.2 Readline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.2.1 . . . . . . . . . . . . . . . . .
21.2.2 Readline . . . . . . . . . . . . . . . . .
21.2.3 Readline . . . . . . . . . . . . . . . . .
21.2.4 Readline . . . . . . . . . . . . . . . . . . . . .
21.2.5 . . . . . . . . . . . . . . . . . . . . . . . . .
21.3 Readline. . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.3.1 Readline . . . . . . .
21.3.2 . . . . . . . . . .
21.3.3 . . . . . . . . . . . . . . . . . . .
21.4 Readline. . . . . . . . . . . . . . . . . . . . . . . .
21.4.1 . . . . . . . . . . . . . . . . . . . . . .
21.4.2 . . . . . . . . . . . .
21.4.3 . . . . . . . . . . . . . . . . .
21.4.4 . . . . . . . . . . . . . . . . . .
21.4.5 . . . . . . . . . . . . . .
21.4.6 Readline . . . . . . . . . . . . . . . . . . . . . . . . . .
21.4.7 . . . . . . . . . . . . . . . . . . . . . . . . .
21.4.8 . . . . . . . . . . . . . . . . . . . . .
21.5 vi Readline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

229
229
229
230
230
231
231
232
232
235
236
239
239
239
240
241
242
242
243
243
244

22
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
22.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

245
245
245
246

A
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
B GDB . . . . . . . . . . . . . . 249
B.1 GDB . . . . . . . . . . . . . . . . . . . . . . 250
B.2 . . . . . . . . . . . . . . 251
B.3 configure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

. . . . . . . . . . . . . . . . . . . . . . . 253

GDB

GDB
, GDB , ,
.
GDB ( , ), :
, , .
.
, , .
,
.
GDB , ++.
, 9.4 [ ],
. 81. , 9.4.1 [ ++], . 81.
GDB -2 Chill.
-2, 9.4.2 [-2], . 87. Chill, .
9.4.3 [Chill], . 91
, , , , . GDB , , ,
.
GDB , ,

.


GDB ,
gnu (GPL). GPL , , , ( ,
), . , ,
; GPL .
, , ,
- .

GDB
GDB, gnu, . .
.
, ; ,
. ChangeLog
GDB .
, 2.0 .
: .
( , ) , !

GDB

, GDB
, : ( 5.0); ( 4.18); (
4.17); ( 4.14); ( 4.16, 4.15, 4.13, 4.12, 4.11, 4.10, 4.9);
( 4.8, 4.7, 4.6, 4.5, 4.4); (
4.3, 4.2, 4.1, 4.0, 3.9); ( 3.5, 3.4, 3.3) (
3.2, 3.1, 3.0).
, , , 2.8.
gnu ++ GDB, . 1 gnu ++. ++ (
, 3.0).
, GDB 4 BFD. BFD . -,
, , .
COFF; COFF.
Harris Computer Systems DWARF 2.
ISI Optimum V. , , MIPS. -
Sun 386i. HP9000. Sony/News OS 3. Encore
Umax. Altos 3068. HP
PA SOM. NS32K. Acorn
Risc Machine. Harris Nighthawk CX-UX.
Convex ( ). Pyramid. SPARC.
Gould NP1 Gould Powernode. Intel 386.
Symmetry.
1

++ - ,
, . :
int add_two(int a, int b);
double add_two(double a, double b);
double add_two(double a, int b);

. .
, , . ( mangle) ,
. ,
:
add_two_Ret_int_int_int
add_two_Ret_double_double_double
add_two_Ret_double_double_int
( ). . ( demangler)
( ), : ,
. , ,
. ,
++, . (. )

GDB

M68K Linux.

SunOS.
GDB GAS
.
, ,
. Intel Corporation, Wind River Systems, AMD ARM
i960, VxWorks, A29K UDI, RDI .
Readline,
.
SUNY Buffalo ,
-2, .
Unix System Vr4.
++.
Hitachi America, Ltd. H8/300, H8/500 SuperH.
NEC v850, Vr4xxx Vr5xxx.
Mitsubishi D10V, D30V M32R/D.
Toshiba TX39 Mips.
Matsushita MN10200 MN10300.
Fujitsu SPARClite FR30.
, .
.
gdbserver.
, ,
GDB.
Hewlett-Packard Company PARISC 2.0, HP-UX 10.20, 10.30 11.0 ( ), HP ,
HP aC++, : , ,
, , , , ,
. HP .
Cygnus Solutions GDB 1991
. Cygnus, GDB , , , , , , ,
, , , , , , , , , , , ,
, , , . , , , , , , ,
, , , , , , , , , , ,
, , , , , ,
-, , , , , ,
, , ,
.

GDB

1: GDB

1 GDB
,
GDB . , ,
. .
: ,
.
gnu m4 ( ), : , ,
, , , , . m4,
foo, 0000; m4 defn, bar . ,
<QUOTE>, <UNQUOTE>,
baz:
$ cd gnu/m4
$ ./m4
define(foo,0000)
foo
0000
define(bar,defn(foo))
bar
0000
changequote(<QUOTE>,<UNQUOTE>)
define(baz,defn(<QUOTE>foo<UNQUOTE>))
baz
C-d
m4: End of input: 0: fatal error: EOF in string1
GDB , .
$ gdb m4
GDB is free software and you are welcome to distribute copies
of it under certain conditions; type "show copying" to see
the conditions.
There is absolutely no warranty for GDB; type "show warranty"
for details.
GDB 5.0, Copyright 1999 Free Software Foundation, Inc...
(gdb)
GDB , , ,
;
. GDB , ,
.
(gdb) set width 70
, m4 changequote. , , m4_
changequote, GDB
break.
1

m4: : 0: : EOF (. )

GDB

(gdb) break m4 changequote


Breakpoint 1 at 0x62f4: file builtin.c, line 879.
run, m4 GDB; , m4_changequote, :
(gdb) run
Starting program: /work/Editorial/gdb/gnu/m4/m4
define(foo,0000)
foo
0000
, changequote. GDB
m4, , .
changequote(<QUOTE>,<UNQUOTE>)
Breakpoint 1, m4_changequote (argc=3, argv=0x33c70)
at builtin.c:879
879
if (bad_argc(TOKEN_DATA_TEXT(argv[0]),argc,1,3))
n (next),
.
(gdb) n
882
set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1])\
: nil,
set_quotes . ,
s (step) next. step
, set_quotes.
(gdb) s
set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
at input.c:530
530
if (lquote != def_lquote)
, ( ), m4 , . .
backtrace ( bt), ,
: backtrace
.
(gdb) bt
#0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>")
at input.c:530
#1 0x6344 in m4_changequote (argc=3, argv=0x33c70)
at builtin.c:882
#2 0x8174 in expand_macro (sym=0x33320) at macro.c:242
#3 0x7a88 in expand_token (obs=0x0, t=209696, td=0xf7fffa30)
at macro.c:71
#4 0x79dc in expand_input () at macro.c:40
#5 0x2930 in main (argc=0, argv=0xf7fffb20) at m4.c:195
, , . s; n,
xstrdup.
(gdb) s
0x3b5c 532
if (rquote != def_rquote)
(gdb) s

1: GDB

0x3b80 535
lquote = (lq == nil || *lq == \0) ? \
def_lquote : xstrdup(lq);
(gdb) n
536
rquote = (rq == nil || *rq == \0) ? def_rquote\
: xstrdup(rq);
(gdb) n
538
len_lquote = strlen(rquote);
; lquote rquote, ,
. p (print), .
(gdb) p lquote
$1 = 0x35d40 "<QUOTE>"
(gdb) p rquote
$2 = 0x35d50 "<UNQUOTE>"
, lquote rquote . , , ,
l (list).
(gdb) l
533
xfree(rquote);
534
535
lquote = (lq == nil || *lq == \0) ? def_lquote\
: xstrdup (lq);
536
rquote = (rq == nil || *rq == \0) ? def_rquote\
: xstrdup (rq);
537
538
len_lquote = strlen(rquote);
539
len_rquote = strlen(lquote);
540
}
541
542
void
, len_lquote len_rquote,
.
(gdb) n
539
len_rquote = strlen(lquote);
(gdb) n
540
}
(gdb) p len lquote
$3 = 9
(gdb) p len rquote
$4 = 7
, , , len_lquote len_rquote lquote rquote . , p, ,
.
(gdb) p len lquote=strlen(lquote)
$5 = 7
(gdb) p len rquote=strlen(rquote)
$6 = 9

GDB

,
m4 defn? m4 c (continue),
, :
(gdb) c
Continuing.
define(baz,defn(<QUOTE>foo<UNQUOTE>))
baz
0000
! , . , ,
. m4 , EOF:
C-d
Program exited normally.2
Program exited normally. GDB; , m4
. GDB quit.
(gdb) quit

. (. )

2: GDB

2 GDB
, GDB . :
gdb GDB.
quit C-d .

2.1 GDB
GDB gdb. , GDB , .
gdb ,
.
, , ; , .
GDB ,
:
gdb
,
:
gdb
, ,
:
gdb 1234
GDB 1234 (, , 1234, GDB
).
, , ; GDB ,
, ,
. GDB ,
.
gdb ,
, -silent:
gdb -silent
, GDB . GDB .

gdb -help

( gdb -h).
. -x.

10

GDB

2.1.1
, GDB , , ( ), ,
-se -c . (GDB
, , -se, ; ,
, , -c, .)
GDB ,
,
.
, ; . GDB , . ( , , -, -,
.)
-symbols
-s
.
-exec
-e

, .
-se

-core
-c
.
-c

, ,
attach ( , ;
-c ).

-command
-x
GDB . . 16.3 [ ],
. 158.
-directory
-d
.
-m
-mapped

-r
-readnow

: , .
mmap, , GDB
, . , , /tmp/fred,
/tmp/fred.syms. GDB

, .
.syms , GDB.
GDB.
.
, ,
, , -

2: GDB

11

. ,
.
-mapped -readnow ,
.syms, . (. 12.1 [ ], . 105, .syms.)
GDB, , .syms :
gdb -batch -nx -mapped -readnow -

2.1.2
GDB , .
-nx
-n

-quiet
-silent
-q
-batch

(
.gdbinit, gdb.ini PC). , GDB .
. 16.3 [ ], . 158.

. .
.
. 0
, -x ( , -n). , GDB
.
GDB ; ,
. ,
,
Program exited normally.
( ,
GDB), .

-nowindows
-nw
. GDB
(GUI), GDB
. GUI , .
-windows
-w

GDB GUI, ,
.

-cd
GDB, , .
-fullname
-f
gnu Emacs , GDB .
GDB ,
, ( ). \032, ,

12

GDB

, , . Emacs-GDB \032
.
-epoch

Emacs-GDB Epoch , GDB


. GDB ,
Epoch .

-annotate
GDB. set annotate (. 18 [],
. 163). ,
GDB , , . 0 , 1 , GDB gnu Emacs, 2 , GDB.
-async

.
GDB , ,
. GDB 1 , GDB,
. (: 5.0, , -async
.)
, GDB ,
-noasync.

-noasync

-baud --
-b --
( , ) , GDB .
-tty
-t
,
.
-interpreter

. , , GDB,
. , -interpreter=mi GDB
gdbmi (. 19 [ gdb/mi], . 171).
-write

,
. GDB set write on (. 11.6 [ ], . 104).

-statistics
GDB
.
1

GDB, djgpp MS-DOS/MS-Windows, , , .

2: GDB

-version

13

GDB , .

2.2 GDB
quit []
q
GDB, quit ( q),
( C-d). , GDB
; ,
.
( C-c) GDB, . , GDB
, .
GDB , detach (. 4.7 [
], . 25).

2.3
, GDB;
shell.
shell
. SHELL, , ,
. , GDB
(/bin/sh Unix, COMMAND.COM MS-DOS, ).
make.
shell GDB:
make make-
make .
shell make make-.

14

GDB

3: GDB

15

3 GDB
GDB ,
; GDB
hRETi. hTABi ,
GDB ( ,
).

3.1
GDB .
. , ,
. , step
, step 5. step .
.
GDB , .
. , ; ,
s step, ,
s. ,
help.
( hRETi), . (, run) ; ,
.
list x, hRETi,
. .
GDB hRETi -: ,
more (. 15.4 [ ], . 153).
hRETi , GDB
, .
, # ;
. , (. 16.3 [
], . 158).

3.2
GDB ,
; ,
. GDB,
.
hTABi , , GDB
. , GDB ,
( hRETi, ). ,

(gdb) info bre hTABi


GDB breakpoints, info
, bre:
(gdb) info breakpoints

16

GDB

hRETi, info breakpoints,


- , breakpoints , . ( , info
breakpoints, hRETi, info bre,
).
hTABi , GDB
. ,
hTABi ; GDB . ,
,
make_, b make_hTABi, GDB .
hTABi , .
:
(gdb) b make_ hTABi
GDB ; hTABi , :
make_a_section_from_file
make_environ
make_abs_section
make_function_type
make_blockvector
make_pointer_type
make_cleanup
make_reference_type
make_command
make_symbol_completion_list
(gdb) b make_
, GDB (b make_
), .
, M-?,
hTABi . M-? hMETAi ?.
, hMETAi ( ), ?,
hESCi, ?.
, ,
, GDB . ,
GDB ( ).
, , ++. , ++
( , ). , ,
, name , name(int),
, name(float).
, . GDB,
, , hTABi M-? :
(gdb) b bubble( M-?
bubble(double,double)
bubble(int,int)
(gdb) b bubble(
, GDB , . , GDB (
, ), :
(gdb) b bub hTABi
GDB , :
(gdb) b bubble(
, GDB , ( ), , .

3: GDB

17

, 9.4.1.3 [ ++], . 84. set overload-resolution off


; 9.4.1.7 [ GDB ++], . 85.

3.3
help,
GDB.
help
h

help ( h) ,
:
(gdb) help
List of classes of commands:
aliases - Aliases of other commands
breakpoints - Making program stop at certain points
data - Examining data
files - Specifying and examining files
internals - Maintenance commands
obscure - Obscure features
running - Running the program
stack - Examining the stack
status - Status inquiries
support - Support facilities
tracepoints - Tracing of program execution without
stopping the program
user-defined - User-defined commands
Type "help" followed by a class name for a list of
commands in that class.
Type "help" followed by command name for full
documentation.
Command name abbreviations are allowed if unambiguous.
(gdb)

help
,
. , ,
status:
(gdb) help status
Status inquiries.
List of commands:
info about
show about

Generic command for showing things


the program being debugged
Generic command for showing things
the debugger

Type "help" followed by command name for full

18

GDB

documentation.
Command name abbreviations are allowed if unambiguous.
(gdb)
help
help, GDB
, .
apropos
apropos ,
, GDB .
. :
apropos reload
:
set symbol-reloading - Set dynamic symbol table reloading
multiple times in one run
show symbol-reloading - Show dynamic symbol table reloading
multiple times in one run
complete
complete . ,
. ,
complete i
:
if
ignore
info
inspect
gnu Emacs.
help, GDB info show , GDB.
; . info show
. . [ ], . 253.
info

( i) . , info args ,
, info registers , info breakpoints .
info help info.

set

set.
, GDB $ set
prompt $.

show

info, show GDB. , show,


set. , set radix , , ,
show radix.
,
show ; info
set. .

3: GDB

19

show, set:
show version
, GDB . GDB. GDB,
, ; , .
, GDB, GDB
gnu/Linux. , .
show copying
GDB.
show warranty
gnu , ,
GDB .

20

GDB

4: GDB

21

4 GDB
GDB,
.
GDB , .
, GDB,
,
, .

4.1
, . ;
,
.
, -g
.
-g -O . , ,
.
GCC, gnu , -g -O,
. , -g . , ,
.
, -g -O, , ; , . ,
! : ,
, GDB ,
.
-g -O , -g, , . ,
-g, , ,
( !).
gnu -gg. GDB ;
gnu , .

4.2
run
r

run
GDB. ( VxWorks)
GDB (. 2 [ GDB], . 9),
file exec-file (. 12.1 [ ],
. 105).

, ,
run , . ( ,
, run .)

22

GDB

,
. GDB ,
. ( ,
.)
:
.
, , run. ,
,
( ). Unix, , , SHELL. . 4.3 [
], . 22.
.

GDB, GDB set environment unset environment,


, . . 4.4 [
], . 23.

.
GDB. GDB cd. . 4.5 [
], . 24.
.

, GDB.
run, tty,
. . 4.6 [ ], . 24.
: , ; , GDB
.
run, .
. 5 [ ], . 31, ,
. , , print call. . 8 [ ],
. 61.
, GDB ,
. GDB .

4.3
run.
, -, .
SHELL ( ) , GDB.
SHELL, (/bin/sh Unix).
-Unix , GDB, - , , .
run ,
run, set args.

4: GDB

set args

23

, . set args , run . ,



set args run.

show args , .

4.4
.
, , ,
. ,
, .
, GDB.
path
PATH (
), GDB, . , -
(: Unix, ; MS-DOS MS-Windows).
, ,
.
cwd, ,
, GDB .
., ,
path. GDB .
( ) .
show paths
(
PATH).
show environment [-]
-,
. -, , .
environment env.
set environment - [=]
-.
, GDB.
; , . ; , .
, :
set env USER = foo
,
foo. (, =,
; , .)
unset environment -
- , .
set env - =; unset environment
, .

24

GDB

: Unix, GDB , , SHELL, ( /bin/sh,


). SHELL ,
.cshrc C-shell, .bashrc BASH
, , .
, ,
, .login .profile.

4.5
, run,
GDB. , GDB
( ),
cd GDB.
GDB ,
. . 12.1 [ ], . 105.
cd
GDB .
pwd

GDB.

4.6
, , GDB, , GDB. , GDB
, , , ,
.
info terminal
, GDB , .
/ , run. ,
run > -
, -.
,
tty. ,
run. run.
,
tty /dev/ttyb
, , run, /dev/ttyb,
.
run tty , .
tty run,
. GDB
.

4: GDB

25

4.7
attach -
,
GDB. ( info files .) . Unix-
ps jobs -l.
attach , hRETi
.
attach, , ; , attach ,
.
.
attach, ,
, ( ),
(. 7.3 [ ], . 57). ,
file. . 12.1 [ ], . 105.
, GDB
.
GDB, ,
run.
;
, .
GDB,
continue.
detach

, GDB detach. . detach,


GDB , run . detach ,
hRETi .

GDB run,
, . , GDB ,
; ,
, set confirm (. 15.6 [
], . 154).

4.8
kill

,
GDB.

, ,
. GDB , .
, GDB,
, .
kill,
.

26

GDB

kill ,
,
. ,
run, GDB , , (
).

4.9
, HP-UX Solaris,
.
, ,
, ( ,
). , , , ,
.
GDB :

thread -,
info threads,
thread apply [-] [all] ,

,
:
GDB, . GDB , . ,
, GDB info threads,
thread, :
(gdb) info threads
(gdb) thread 1
Thread ID 1 not known. Use the "info threads" command to
see the IDs of currently known threads.1
GDB , GDB,
. . .
GDB , [New -]. -
, .
, LynxOS
[New process 35 thread 27]
GDB . , SGI, -
process 368, .
, GDB
.
info threads

. , GDB ( ):
1

1 . "info threads", . (. )

4: GDB

27

1. , GDB
2. (-)
3.
* GDB .
,
(gdb) info threads
3 process 35 thread 27 0x34e5 in sigpause ()
2 process 35 thread 23 0x34e5 in sigpause ()
* 1 process 35 thread 13 main (argc=1, argv=0x7ffffff8)
at threadtest.c:68
HP-UX:
, GDB
, .
GDB , ,
GDB,
[New -]. - ,
. , HP-UX, GDB
,
[New thread 2 (system thread 26594)]
info threads

. , GDB ( ):
1. , GDB
2. (-)
3.
* GDB .
,
(gdb) info threads
* 3 system thread 26607 worker (wptr=0x7b09c318 "@") \

2 system thread 26606

at quicksort.c:137
0x7b0030d8 in __ksleep () \

1 system thread 27905

from /usr/lib/libc.2
0x7b003498 in _brk () \
from /usr/lib/libc.2

thread -
- . , -,
GDB, info
threads. GDB ,
, :
(gdb) thread 2
[Switching to process 35 thread 23]
0x34e5 in sigpause ()
[New ...], Switching to .

28

GDB

threads apply [-] [all]


thread apply . , ,
-. - GDB, info threads.
, thread apply all .
GDB , ,
, . GDB
[Switching to ] .
. 5.4 [ ], . 48, GDB,
.
. 5.1.2 [ ], . 35, .

4.10
, GDB ,
fork. fork, GDB , .
, , SIGTRAP,
( ).
, ,
. sleep ,
fork. sleep
,
, .
, ps . GDB ( GDB, )
(. 4.7 [], . 25).
, ,
, .
HP-UX ( 11.x ?) GDB , , fork vfork.
, , GDB , .
, set follow-fork-mode.
set follow-fork-mode
fork vfork . fork vfork . :
parent

. . .

child

. .

ask

4: GDB

29

show follow-fork-mode
fork vfork.
vfork exec, GDB , .
main , main .
vfork, , exec.
GDB run exec,
. , file
.
catch, GDB,
fork, vfork exec. . 5.1.3 [ ], . 37.

30

GDB

5:

31

5
,
.
GDB ,
, , GDB, step.
, , . , GDB
,
.
info program
:
, .

5.1 ,
, .
. break (. 5.1.1 [ ], . 32),
, , ,
.
HP-UX, SunOS 4.x, SVR4 Alpha OSF/1,
.
HP-UX : ,
,
, (, ,
pthread_create).
, .
(. 5.1.2 [ ], . 35),
, , : ,
.
, , GDB . . 8.6 [
], . 66.
, , ++ . ,
, (. 5.1.3 [ ], . 37), , ,
. ( , ,
handle; 5.3 [], . 46.)
, , GDB
; , . ,
, . ; ,
, .

32

GDB

GDB ,
, . ,
5, , , , 5-7. ,
.

5.1.1
break ( b). $bpnum ;
8.9 [ ], . 73, ,
.
.
break
.
, , ++,
. . 5.1.8
[ ], . 42, .
break +
break -
, .
(. 6.1 [ ], . 51, .)
break -
- .
, .
- .
break -:-
- .
break -:
, . ,
,
.
break *
.
,
.
break

, break , (.
6 [ ], . 51). , , ,
. finish , finish
. break
, GDB ,
; .

5:

33

GDB , ,
. ,
,
. ,
, .
break ... if
; ,
, , , . ...
, (
), . . 5.1.6 [ ], . 40, .
tbreak
.
, break, , ,
. . 5.1.5 [
], . 39.
hbreak
- . , break, ,
.
EPROM/ROM,
. , SPARClite DSU
x86. , ,
. , . , DSU,
, GDB ,
. (. 5.1.5 [
], . 39). . 5.1.6 [], . 40.
thbreak
- ,
. , hbreak,
. , tbreak, ,
. , hbreak, . . 5.1.5 [
], . 39. 5.1.6 [ ], . 40.
rbreak -
,
-.
, .
, , , break. , ,
, .
,
, grep. , , -

34

GDB

; , , foo* ,
fo, o. .*
, , foo, ^foo.
, ++, rbreak
,
.
info breakpoints [n]
info break [n]
info watchpoints [n]
, , :

, .


y. n .

, .

,
.

, info break , ; , ,
.
info break n . $_
x
(. 8.5 [ ], . 65).
info break , . ignore.
,
, ,
, , .
.
GDB
. .
, (. 5.1.6 [ ], . 40).
GDB
, longjmp ( ).
, -1; info breakpoints
.
GDB maint
info breakpoints.
maint info breakpoints
, info breakpoints,
, , , GDB
. . , :

5:

35

breakpoint
, .
watchpoint
, .
longjmp

, longjmp.

longjmp resume
longjmp.
until

,
GDB until.

finish

,
GDB finish.

shlib events
.

5.1.2
, - , , .
, . GDB
, . (
, , ,
, .)
, HP-UX, Linux , x86, GDB ,
.
watch
. GDB ,
.
rwatch
, , .
awatch
, ,
, .
info watchpoints
, ;
, info break.
, GDB . ,
, . GDB
, ,
, , .
watch, GDB

36

GDB

Hardware watchpoint :
.
, awatch rwatch
, , ,
, GDB . GDB , awatch rwatch, ,
:
Expression cannot be implemented with read/access
watchpoint.1
GDB - ,
, . , , 4 ; ,
( 8 ). , ,
.
, GDB
, . ,
, GDB
, ,
:
Hardware watchpoint : Could not insert watchpoint2
, .
SPARClite DSU , , .
, DSU watch. , ,
. ,
watch, rwatch,
awatch, ,
. GDB ,
.
.
, print call, , GDB
, .
GDB ,
, , ,
, ,
. , , ,
, . ,
1
2

/. (. )
: (. )

5:

37

. main, , ,
.
:
. , GDB
.
,
( ,
), .
, GDB ,
.
HP-UX: , . GDB , . ,
( ,
),
. , GDB , . (
, .)

5.1.3
,
, ++
. catch.
catch
, . :
throw

++.

catch

++.

exec

exec. HP-UX.

fork

fork. HP-UX.

vfork

vfork. HP-UX.

load
load -
, -.
HP-UX.
unload
unload -
, -.
HP-UX.
tcatch
, .
, .

38

GDB

info break .
, GDB ++ (catch throw catch catch):
, GDB
, . , , , ,
, ,
, , GDB,
. ;
.
.
.
catch :
, , ,
, ,
- . , ,
.
, . gnu ++,
__raise_exception, ANSI :
/* addr - .
id - . */
void __raise_exception (void **addr, void *id);
, , , __raise_exception (. 5.1 [
], . 31).
(. 5.1.6 [ ], . 40), id, ,
. ,
, .

5.1.4
, , .
. , ,
; .
clear ,
. delete
, , .
, . GDB
,
, .
clear

, , (. 6.3 [
], . 52). , , .

5:

39

clear
clear -:
, .
clear -
clear -:-
,
.
delete [breakpoints] [...]
, ,
. , (GDB , set confirm
off). d.

5.1.5
, , ,
. ,
, ,
.
,
enable disable, . info break info watch
, , .
, :
. . , break, .
. .
. ,
.
. ,
. , tbreak,
.

, :
disable [breakpoints] [...]
, ,
. ,
. , ,
, ,
. disable dis.
enable [breakpoints] [...]
( ) . .
enable [breakpoints] once ...
. GDB
.

40

GDB

enable [breakpoints] delete ...


, . GDB , .
, tbreak (. 5.1.1 [
], . 32), ; ,
. ( until
, ; . 5.2 [ ], . 44.)

5.1.6
, . .
(. 8.1 [], . 61). ,
, ,
.
; , , , . , ,
assert, ! assert .
; ,
, ,
, , , .
,
. , , , ,
.
, . ( , GDB
.) , , ,
, (. 5.1.7
[ ], . 41).
,
if break. . 5.1.1 [ ], . 32.
condition.
if watch. catch
if; condition
.
condition
,
. , ,

(, ). condition, GDB
,
. ,
, GDB :

5:

41

No symbol "foo" in current context.3


, GDB
condition ( , , break if ...). . 8.1 [], . 61.
condition
.
.

. , , .
, .
, , , ,
. ,
, ,
. , n,
n , .
ignore
. , , ; , GDB .
, .
continue , continue, ignore. . 5.2
[ ], . 44.
,
. ,
GDB .

, $foo- <= 0, ,
. . 8.9 [ ], . 73.
,
.

5.1.7
( ) , . , ,
.
commands []
... - ...
end
.
. ,
, end.
3

"foo". (. )

42

GDB

, commands
end, .
, commands
, ( ).
hRETi, GDB,
-.
,
. continue, step,
, .
, , . , , (
next step),
, ,
.
silent, .
, ,
. , , . silent
.
echo, output printf
, . . 16.4 [
], . 159.
, x foo, x .
break foo if x>0
commands
silent
printf "x is %d\n",x
cont
end
, ,
. , , , -
, ,
. continue,
, silent, . :
break 403
commands
silent
set x = y + 4
cont
end

5.1.8
( ++) ,
, .
. , break , GDB, .

5:

43

, - break () , . , GDB

, >.
[0] cancel [1] all. 1 , 0 break .
,
String::after. :
(gdb) b String::after
[0] cancel
[1] all
[2] file:String.cc; line number:867
[3] file:String.cc; line number:860
[4] file:String.cc; line number:875
[5] file:String.cc; line number:853
[6] file:String.cc; line number:846
[7] file:String.cc; line number:735
> 2 4 6
Breakpoint 1 at 0xb26c: file String.cc, line 867.
Breakpoint 2 at 0xb344: file String.cc, line 875.
Breakpoint 3 at 0xafcc: file String.cc, line 846.
Multiple breakpoints were set.
Use the "delete" command to delete unwanted
breakpoints.
(gdb)

5.1.9

, - . ,

, GDB :
Cannot insert breakpoints.
The same program may be running in another process.4
, :
1. , .
2. GDB , ,
. GDB exec-file ,
GDB .
.
3. , ,
-N.
.
, - :
Stopped; cannot insert breakpoints.
4

. . (. )

44

GDB

You may have requested too many hardware breakpoints and watchpoints.5
, ,
GDB ,
.
,
- , .

5.2
. ,
, , ( , ).
, ,
, . ( , handle, signal 0 . .
5.3 [], . 46.)
continue [-]
c [-]
fg [-]
, , ; , ,
. -
; ignore (. 5.1.6 [ ], . 40).
- . , continue .
c fg ( foregroung,
), ,
, continue.
, return (.
11.4 [ ], . 103) ; jump (. 11.2 [ ], . 102)
.

(. 5.1 [ ], . 31)
, , ,
, , ,
.
step

, ,
GDB. s.
: step, ,

; . . (. )

5:

45

, , , . , ,
.
stepi, .
step
. ,
switch, for, . step , , ,
. , step ,
.
, step . next.
, cc -gl MIPS.
step , -
.
step
step, .
, ,
, , .
next []

() . step, , , .
,
, , next.
n.
, step.
next .
, switch, for, .
finish

until
u

.
( ).
return (. 11.4 [ ], . 103).
,
, . .
next, , until , ,
, .
,
, until ,
. , next
, .
until , .
until ,
. ,

46

GDB

, f (frame) , 206; , until,


195:
(gdb) f
#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
206
expand_input();
(gdb) until
195
for ( ; argc > 0; NEXTARG) {
, ,
for . , until ,
; ,
.
until
, , , , until .
until
u
, , . break (. 5.1.1 [ ], . 32).
, , , , until .
stepi
stepi
si
,
.
,
display/i $pc. GDB , , , . . 8.6 [ ], . 66.
, step.
nexti
nexti
ni
, , .
, next.

5.3
, . .
Unix, , SIGINT , ,
( C-c); SIGSEGV,
, ; SIGALRM
( ,
).
, SIGALRM,
. , SIGSEGV, ;

5:

47

( ),
. SIGINT ,
, :
.
GDB .
GDB, .
, GDB , ,
SIGALRM ( ),
, .
handle.
info signals
info handle
, GDB . ,
.
info handle info signals.
handle -...
, GDB .
( SIG ). , .
, handle, .
:
nostop

GDB .
, .

stop

GDB .
print.

print

GDB .

noprint

GDB . nostop.

pass

GDB ; , ,
.

nopass

GDB .

, , . ,
pass. , , GDB , handle c pass
nopass, , .
signal , , , , . ,
- ,
,
,
- , . , signal 0. . 11.3 [
], . 103.

48

GDB

5.4
(. 4.9 [
], . 26), ,
, - .
break - thread -
break - thread - if ...
- ; ,
.
thread - ,
GDB, , . - , GDB,
info threads.
thread -,
.
thread
; , thread - , :
(gdb) break frik.c:13 thread 28 if bartab > lim
GDB, , .
, , ,
- .
, , .
, step next.
, GDB . (
GDB), ,
. , , ,
.
, .
, ,
, ,
.

.
set scheduler-locking
.
off, . on, ,
. step
.
. , .
, next ,

5:

49

, ,
continue, until finish. ,
,
GDB .
show scheduler-locking
.

50

GDB

6:

51

6
, , .
, , . ,
.
, . , .
GDB
.
GDB, GDB . , GDB
, .
GDB. . 6.3 [ ], . 52.
, GDB , frame (. 6.4 [ ], . 53).

6.1
C , , ; ,
. , ,
, .
, main.
. . , . , .
, , .
, .
.
, ;
,
. , ,
, .
GDB , , , . ,
; GDB,
GDB.
, . (, gcc
-fomit-frame-pointer
.) , , . GDB
.
, GDB, ,
, , , , 0, . , GDB
.

52

GDB

frame frame ,
. ,
. , frame .
select-frame
select-frame
. frame.

6.2
, , . ,
( 0), ,
( 1), .
backtrace
bt
: ,
.
,
, C-c.
backtrace n
bt n
, n .
backtrace -n
bt -n
, n .
where info stack ( info s) backtrace.
. , set print address off.
, . , .
. bt 3,
.
#0 m4_traceon (obs=0x24eb0, argc=1, argv=0x2b8c8)
at builtin.c:993
#1 0x6e38 in expand_macro (sym=0x2b600) at macro.c:242
#2 0x6840 in expand_token (obs=0x0, t=177664, td=0xf7fffb08)
at macro.c:71
(More stack frames follow...)
,
, 993 builtin.c.

6.3
.
; .
frame n
fn

n. , ( ) , ,
, .
main.

6:

53

frame
f
, . ,
- ,
GDB .
, ,
.
SPARC, frame : .
MIPS Alpha :
.
29k : ,
.
up n

n . n,
,
, , . n
.

down n

n . n,
,
, , . ,
n . down do.

, . , , , .
.
:
(gdb) up
#1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc)
at env.c:10
10
read_input_file (argv[i]);
, list , . . 7.1 [ ],
. 55.
up-silently n
down-silently n
up down ,
, , .
GDB,
.

6.4
.
frame
f

, ,
.
f. ,
. . 6.3 [ ], . 52.

54

GDB

info frame
info f
, :

( )
(,
)
, ,


( , )
,
, - -
.
info frame
info f
, ,
. .
, frame (
, ). . 6.3 [ ], . 52.
info args , .
info locals
, . ( ), .
info catch
, .
,
( up, down frame); info catch.
. 5.1.3 [ ], . 37.

7:

55

7
GDB ,
, , GDB,
. , GDB ,
. , (. 6.3
[ ], . 52), GDB ,
.
.
GDB gnu Emacs, Emacs ; 17 [ GDB gnu Emacs], . 161.

7.1
, list ( l). . , .
list:
list -
, - .
list
, .
list

. list, ,
; , ,
, (. 6
[ ], . 51), , .

list -

, .

, list GDB
. set listsize:
set listsize
list ( list - ).
show listsize
, list.
list hRETi , list. , .
-; , .
list , .
; ,
.
list:
list -
, , -.

56

GDB

list ,
. .
list ,
, .
list ,
, .
list +

, .

list -

, .

list

.
list ,
, .

+
, .
list, , ,
, .
-
,
.
-:
-.

, . ,
.

-:
,
-.
, ,
.
*

, .
.

7.2

.
forward-search -
search -
forward-search -
- , , . .
search - fo.

7:

57

reverse-search -
reverse-search -, , - , . .
rev.

7.3
,
, , .
,
. GDB ; . , GDB ,
,
. , ,
,
.
GDB , ,
- , GDB
. ,
, GDB .
, GDB ,
.
GDB, cdir cwd,
. , directory.
directory - ...
dir - ...
- .
, : (; MS-DOS
MS-Windows, : )
. ,
; , GDB .
$cdir
( ), $cwd
. $cwd , ..
,
GDB,
.
directory
. .
show directories
: , .
,
GDB , .
:
1. directory , .

58

GDB

2. directory , , .
.

7.4
info line, c
( ), disassemble,
. gnu Emacs, info
line , . info line
, .
info line -
, -. , list (. 7.1
[ ], . 55).
, info line
m4_changequote:
(gdb) info line m4_changequote
Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350.
( * -),
:
(gdb) info line *0x63ff
Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404.
info line, , x, , x/i
(. 8.5 [ ], . 65).
$_ (. 8.9 [ ], . 73).
disassemble

. ,
. ; GDB
, . ( , ).

HP PA-RISC 2.0:
(gdb) disas 0x32c4 0x32e4
Dump of assembler code from 0x32c4 to 0x32e4:
0x32c4 <main+204>:
addil 0,dp
0x32c8 <main+208>:
ldw 0x22c(sr0,r1),r26
0x32cc <main+212>:
ldil 0x3000,r31
0x32d0 <main+216>:
ble 0x3f8(sr4,r31)
0x32d4 <main+220>:
ldo 0(r31),rp
0x32d8 <main+224>:
addil -0x800,dp
0x32dc <main+228>:
ldo 0x588(r1),r26
0x32e0 <main+232>:
ldil 0x3000,r31
End of assembler dump.

7:

59

.
set disassembly-flavor -
disassemble x/i.
, Intel x86. - intel att.
att, AT&T Unix , x86.

60

GDB

8:

61

8
print ( p) inspect. ,
, (. 9 [ GDB
], . 77).
print
print /f
( ). ,
, ; , /f , f, ;
8.4 [ ], . 64.
print
print /f

, GDB ( ; . 8.8 [ ], . 72).


.

x . . . 8.5
[ ], . 65.
,
, ptype print. . 10 [
], . 97.

8.1
print GDB
. GDB , , , , ,
. , ,
#define.
GDB - , . : {, . . . }. ,
print {1, 2, 3}, ,
, malloc.
,
. . 9 [ GDB ],
. 77, .
, GDB .
, ,
, , .
GDB , ,
:
@

@ , . . 8.3 [ ], . 63, .

::

:: ,
. . 8.2 [ ], . 62.

62

GDB

{}
, .
,
( , , ). ,
, .

8.2
.
(. 6.3 [ ], . 52);
( )

, .
,
foo (a)
int a;
{
bar (a);
{
int b = test ();
bar (b);
}
}
a ,
foo, b , ,
.
: , , .
( ). , . ,
,
:
::
::
.
, GDB
; , x, f2.c:
(gdb) p f2.c::x
::
++. GDB
++ .
: , (
,
) , .

8:

63

. - , ( )
; ,
, , . ,
; ,
.
, .
, , .
, ( ).
, , , GDB . , GDB , :
No symbol "foo" in current context.
, ,
,
. GCC, gnu /++, -gstabs. -gstabs , , COFF.
DWARF-2 (-gdwarf-2), . gnu
CC gnu CC, .

8.3
, ; ,
.
, , @. @
, .
. ,
, .
; , , , . ,

int *array = (int *) malloc (len * sizeof (int));
array
p *array@len
@ . , @, , ,
.
(. 8.8 [
], . 72), .
.
, .
.

64

GDB

(gdb) p/x (short[2])0x12345678


$1 = {0x1234, 0x5678}
( ([])), GDB ( sizeof()/sizeof():
(gdb) p/x (short[])0x12345678
$2 = {0x1234, 0x5678}
;
,
, .
(. 8.9 [ ], . 73) , , hRETi. ,
, dtab ,
fv . :
set $i = 0
p dtab[$i++]->fv
hRETi
hRETi

...

8.4
, GDB .
. , , .
. ,
.
. print
. :
x

, .

. t two.1

, ,
.
, , ( )
- :
(gdb) p/a 0x54320
$3 = 0x54320 <_initialize_vx+396>

.
1

b , x,
b byte; 8.5 [ ], . 65.

8:

65

, (. 8.10 [], . 74),


p/x $pc
, ,
GDB .
,
print . ,
p/x .

8.5
x ( examine)
, .
x/nfu
x
x
x.
n, f u , ,
; , ,
. nfu,
/.
.
n,
; 1.
, ( u).
f,
, print,
s (, ), i ( ). , x ( ).
, x,
print.
u,

b

( ).

( ). .

( ).

, x,
x.
( s i,
.)
,
, , GDB . (
); . .
8.1 [], . 61, . ,

66

GDB

, : info breakpoints (
), info line ( ) print (
).
, x/3uh 0x54320 (h) (u), 0x54320. x/4xw $sp
(w) , ( $sp; . 8.10
[], . 74), (x).
, , , , , ; .
4xw 4wx . (, n ;
wx4 .)
u s i, n; , 3i ,
, .
disassemble ;
7.4 [ ], . 58.
x ,

x. , , x/3i , ,
x/7. x hRETi,
n ; ,
x.
, x, ,
. , GDB
$_ $__.
x,
$_. , ,
$__.
x ,
; ,
, .

8.6
- ( ,
), ,
GDB . , , ;
, .
:
2: foo = 38
3: bar[5] = (struct hack *) 0x3804
, .
, x print,
; , display ,
print x, , :
x, (i s),
x; print.

8:

67

display
, ,
. . 8.1 [], . 61.
display , hRETi .
display/
, , , . .
8.4 [ ], . 64.
display/
i s,
,
.
x/ . . 8.5 [
], . 65.
, display/i $pc ,
, ($pc
; . 8.10 [], . 74).
undisplay ...
delete display ...
, .
undisplay hRETi. (
No display number ....)
disable display ...
. , .
.
enable display ...
. , , , .
display

, ,
.

info display
, , , .
, .
, ,
, .
,
, . , ,
. , display last_char, last_char, GDB ,
. last_char .

68

GDB

, last_char
.

8.7
GDB , .
:
set print address
set print address on
GDB , , , , , , . on. ,
set print address
on:
(gdb) f
#0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
at input.c:530
530
if (lquote != def_lquote)
set print address off
. , ,
, set print address off:
(gdb) set print addr off
(gdb) f
#0 set_quotes (lq="<<", rq=">>") at input.c:530
530
if (lquote != def_lquote)
set print address off, GDB. , print address off,
,
, .
show print address
, .
, GDB .
(, , ), . info line;
, info line *0x4537. , GDB
:
set print symbol-filename on
GDB .
set print symbol-filename off
.
.
show print symbol-filename
, GDB .

8:

69

, , ; GDB ,
.
, :
set print max-symbolic-offset -
GDB ,
,
-. - 0;
GDB ,
- .
show print max-symbolic-offset
, GDB .
, , , set print
symbol-filename on. , , p/a .
. , GDB , ptt
t, hi2.c:
(gdb) set print symbol-filename on
(gdb) p/a ptt
$4 = 0xe008 <t in hi2.c>
: , ,
p/a , , set print.
:
set print array
set print array on
. ,
. .
set print array off
.
show print array
, ( )
.
set print elements -
GDB .
GDB , ,
set print elements .
. GDB , 200. -
, .
show print elements
,
GDB. 0, .

70

GDB

set print null-stop


GDB , null. ,
. .
set print pretty on
GDB ,
, :
$1 = {
next = 0x0,
flags = {
sweet = 1,
sour = 1
},
meat = 0x54 "Pork"
}
set print pretty off
GDB , :
$1 = {next = 0x0, flags = {sweet = 1, sour = 1}, \
meat = 0x54 "Pork"}
.
show print pretty
, GDB .
set print sevenbit-strings on
, ; , GDB ( ), \nnn.
, (ascii)
-.
set print sevenbit-strings off
.
,
.
show print sevenbit-strings
, GDB .
set print union on
GDB , . .
set print union off
GDB , .
show print union
GDB, , .
,
typedef enum {Tree, Bug} Species;
typedef enum {Big_tree, Acorn, Seedling} Tree_forms;
typedef enum {Caterpillar, Cocoon, Butterfly}
Bug_forms;

8:

71

struct thing {
Species it;
union {
Tree_forms tree;
Bug_forms bug;
} form;
};
struct thing foo = {Tree, {Acorn}};
set print union on, p foo
$1 = {it = Tree, form = {tree = Acorn, bug = Cocoon}}
set print union off,
$1 = {it = Tree, form = {...}}
++:
set print demangle
set print demangle on
++ , () , . .
show print demangle
, ++.
set print asm-demangle
set print asm-demangle on
++ , ,
, . .
show print asm-demangle
, ++
.
set demangle-style
, ++. :
auto

GDB .

gnu

gnu ++ (g++). .

hp

HP ANSI
++ (aCC).

lucid

Lucid ++ (lcc).

arm

, C++ Annotated Reference


Manual. : , ,
cfront. , GDB .

72

GDB

, .
show demangle-style
,
++.
set print object
set print object on
, (), ,
.
set print object off
, . .
show print object
, .
set print static-members
set print static-members on
++.
.
set print static-members off
++.
show print static-members
, ++ .
set print vtbl
set print vtbl on
++.
. ( vtbl , HP ANSI ++ (aCC).)
set print vtbl off
++.
show print vtbl
,
++ .

8.8
, print, GDB.
. ,
(, file
symbol-file). , ,
, .
,
. ,
. print , ,
$ = , .
- , $,
. , print ,
. $ ,
$$ . $$n n- ; $$2,
$$, $$1 $$, $$0 $.

8:

73

, , .
p *$
, next ,
:
p *$.next
.
hRETi.
, , .
x 4, :
print x
set x=5
, print, - 4,
x .
show values
, .
p $$9, , , show
values .
show values n
, n.
show values +
, . , show values +
.
hRETi show values n , show values +.

8.9
GDB , , .
GDB;
. .
$. $ , - , (. 8.10 [], . 74).
( , , , $. .
8.8 [ ], . 72.)

, . :
set $foo = *object_ptr
$foo , object_ptr.
,
void, .
.

74

GDB

.
, , .
, .
show convenience
.
show conv.
. ,
:
set $i = 0
print bar[$i++]->contents
hRETi.
GDB , , .
$_

$__

$_ x (. 8.5 [ ], . 65). , x,
$_ ; info line
info breakpoint. $_ void *, x;
$__.
$__ x , . , .

$_exitcode
$_exitcode ,
.
HP-UX, , , GDB
, .

8.10
, , , $.
; , , info registers.
info registers
,
( ).
info all-registers
,
.
info registers - ...
- .
, . -
, $ .

8:

75

GDB , ( )
. $pc $sp
. $fp
, , $ps , . ,

p/x $pc
,
x/i $pc
2
set $sp += 4
, , , . info registers . SPARC, , info
registers $psr, $ps; , x86, $ps
eflags.
, GDB . ,
;
.
(
print , print/f $-).

. , ,
, , . , 68881 () ,
() . , GDB
(, ),
info registers .
(. 6.3 [ ], . 52). , ,
,
. , ( frame 0).
, GDB, , , , . ,
GDB ,
.

8.11

, GDB .
2

, ( , ),
. , ;
, $sp . return ,
; 11.4 [ ], . 103.

76

GDB

info float
- .
. ,
info float ARM x86.

9: GDB

77

9 GDB

,
. , ANSI , p
*p, -2 p^. ( )
.
0x1ae, -2 1AEH.
GDB , , , , GDB
, , . ,
, .

9.1
: GDB , .
set language. , GDB
. , , , .
, , GDB,
. , . ,
GDB . ,
++; , backtrace
.
GDB, ,
. . 9.2 [ ], . 78.
, ,
cfront f2c, , .
, #line ;
GDB ,
, .

9.1.1
, GDB
.
.c

.C
.cc
.cp
.cpp
.cxx
.c++

++

.f
.F

.ch
.c186
.c286

CHILL

.mod

-2

78

.s
.S

GDB

. , , , GDB
.

, ,
. . 9.2 [ ], . 78.

9.1.2
GDB , .
, . set
language , , , c modula-2.
, set language.
GDB .
, , ,
, . ,
, GDB -2,
print a = b + c
. b c a. a. -2
a b+c, BOOLEAN.

9.1.3 GDB
GDB , set language local
set language auto. GDB .
(, ), GDB
, .
( , , ,
, ),
, GDB .
, , . , , , , . set language
auto .

9.2
, ,
.
show language
. , print ,
.
info frame
.
, . . 6.4
[ ], . 53, .

9: GDB

79

info source
. . 10 [ ], . 97, .
, ,
. , :
set extension-language .
.
.
info extensions
.

9.3
: GDB , .
.

.
.
,
.
, GDB . GDB , , , ,
GDB print. ,
GDB , ,
. . 9.4 [ ], . 81,
.

9.3.1
, -2, ,
,
.
, . ,
1 + 2 3

error 1 + 2.3
, CARDINAL 1 REAL 2.3.
, GDB, GDB
; ; , . , GDB
, ,
.
, GDB , . , GDB ,
int struct foo.
, , .

80

GDB

. , 2, , . ,
,
. . 9.4 [ ], . 81, .
GDB :
set check type auto
, . . 9.4 [ ], . 81,
.
set check type on
set check type off
, . ,
.
, GDB .
set check type warn
, .
. , GDB
.
show type ,
GDB .

9.3.2
(, -2), ; .
,
.
, GDB, GDB : ,
, .
, ,
. , . ,
. , m , s,
m + 1 s
,
. ,
. 9.4 [ ], . 81.
GDB :
set check range auto
, . . 9.4 [ ], . 81,
.

9: GDB

81

set check range on


set check range off
, . , .
,
.
set check range warn
, GDB ,
. ,
, , ( Unix).
show range

GDB .

9.4
GDB , ++, , Java, Chill, -2.
GDB
: GDB @ :: {} (. 8.1 [],
. 61) .
, GDB.
; ,
GDB,
. ; , , .

9.4.1 ++
++ , GDB . , .
++ ++ GDB. , ++,
, gnu g++, HP ANSI ++
(aCC).
gnu ++, stabs. -gstabs -gstabs+.
gnu CC gnu CC, .

9.4.1.1 ++
. , +
, .
.
++, :
int ; char; enum; ,
++, bool.

82

GDB

float, double long double ( ).


, ( *).
.
, :
,

, . , , ; , .

.
.
.

a = b
a = a b. = = .
|, ^, &, <<, >>, +, -, *, /, %.

?:

. a ? b : c : a, b, c. a
.

||

. .

&&

. .

. .

. .

&

. .

==, !=

. .
0 .

<, >, <=, >=


, , , .
. 0
.
<<, >>

. .

GDB (. 8.1 [], . 61).

+, -

. , .

*, /, %

, . . .

++, -

. , , ;
, .

. . , ++.

&

. . , ++.
++, GDB & ,
++: &(&) ( &&), , ++ ( &).

9: GDB

83

.
. , ++.

. .
, ++.

. .
, ++.

., ->

. , GDB
, , ,
. (struct) (union).

.*, ->*

[]

. a[i] *(a+i). ,
->.

()

. , ->.

::

++ . struct,
union class.

::

GDB (.
8.1 [], . 61). , ::,
.

, GDB , .

9.4.1.2 ++
GDB ++ :
.
0 ( ), 0x 0X. l, ,
(long).
,
, , , , .
e[[+]|-]nnn, nnn . + .
f F, ,
float ( double ),
l L, long double.
, .
,
(), (
ascii). , ,
, \nnn, nnn
; \x,
x , , \n .
( ), ("). ( ).
, "a\"bc", ,
.

84

GDB

- .
, C &.
- ({ }) ,
; , {1,2,3} , {{1,2}, {3,4}, {5,6}}
, {&"hi", &"there", &"fred"} .

9.4.1.3 ++
GDB ++.
: GDB ++
. , ++
, ,
, . , a.out, MIPS ecoff, RS/6000 xcoff, elf
stabs , . ( gnu CC -gstabs,
stabs). , coff
dwarf elf, ++ GDB .
1. -;
count = aml->GetOriginal(x, y)
2. - ( ),
, -; GDB
this , ++.
3. ; GDB , . GDB , ,
, .
.
, , , ,
, ;
.
, set overloadresolution off. . 9.4.1.7 [ GDB ++], . 85.
set overload-resolution off,
,
p foo(char,int)(x, 13)
GDB ; 3.2
[ ], . 15.
4. GDB , ++;
, ++
.
, GDB ,
- ( ); - ,
. - ,
set print address off.

9: GDB

85

5. GDB ++ ::
, . , ::, , 1::2::.
GDB , , ++ (. 8.2 [ ],
. 62).
, HP ++, GDB , ,
, , .

9.4.1.4 ++
GDB
, ,
++. , GDB.
GDB ,
, .c, .C .cc, ,
GDB , , ++. . 9.1.3 [ GDB
], . 78, .

9.4.1.5 ++
GDB ++, . , , GDB
, :
,
.

typedef.
, , .
,
, .

9.4.1.6 GDB
set print union show print union union.
on, , , .
, {...}.
@ ,
. . 8.1 [], . 61.

9.4.1.7 GDB ++
GDB ++,
. :

,
GDB ,
. . 5.1.8 [ ], . 42.

86

GDB

rbreak -

,
. . 5.1.1 [ ], . 32.
catch throw
catch catch
++ . . 5.1.3 [ ], . 37.
ptype -
. . 10 [ ], . 97.
set print demangle
show print demangle
set print asm-demangle
show print asm-demangle
++ ,
++, . . 8.7 [ ], . 68.
set print object
show print object
, () .
. 8.7 [ ], . 68.
set print vtbl
show print vtbl
. . 8.7
[ ], . 68. ( vtbl , HP ANSI ++ (aCC).)
set overload-resolution on

++. on. , GDB , , ++ ( 9.4.1.3 [ ++], . 84, ).
GDB , .
set overload-resolution off

++. , - , GDB ,
, ,
. , - , GDB , .

, , ++: () . GDB, , . . 3.2 [
], . 15, , .

9: GDB

87

9.4.2 -2
, GDB -2,
, gnu -2 ( ). -2 ,
, ,
GDB .

9.4.2.1 -2
. , +
, .
. -2, :
INTEGER, CARDINAL .
CHAR .
REAL.
- , POINTER TO .
.
- SET BITSET.
BOOLEAN.
; :
,

:=

. := .

<, >

, ,
.

<=, >=

, . ,
. .
, <.

=, <>, #

; . , <. GDB, <>, # .

IN

. .
, <.

OR

( ). .

AND, &

( ). .

GDB (. 8.1 [], . 61).

+, -

,
.

, -.

.
-. , *.

DIV, MOD

. .
, *.

88

GDB

. INTEGER REAL.

. -.

NOT

. . ,
^.

RECORD. RECORD. , ^.

[]

. ARRAY. ,
^.

()

. PROCEDURE.
, ^.

::, .

GDB -2 .
: ,
GDB IN +, -, *, /,
=, , <>, #, <=, >= .

9.4.2.2
-2 .
, :
a

ARRAY.

CHAR.

, . s. s SET OF
( m).

. .
-2, .

ABS(n)

n.

CAP(c)

c ,
, .

CHR(i)

, i.

DEC(v)

v . .

DEC(v,i)

v i. .

EXCL(m,s)
m s. .
FLOAT(i)

i .

9: GDB

89

HIGH(a)

a.

INC(v)

v . .

INC(v,i)

v i. .

INCL(m,s)
m s, .
.
MAX(t)

t.

MIN(t)

t.

ODD(i)

TRUE, i .

ORD(x)

. , ascii- ( , ascii). x ,
, .

SIZE(x)

. x .

TRUNC(r)

r.

VAL(t,i)

t, i.

: ,
GDB INCL EXCL .

9.4.2.3
GDB -2 :
.
, ,
. H, B.
,
.
E[+|-]nnn, [+|-]nnn .
( 10).
, : (), (").
( ascii-), C.
,
: (), (").
. . 9.4.1.2 [
++], . 83, .
.
TRUE FALSE.
- .
- .

90

GDB

9.4.2.4 -2
GDB , on,
-2. , GDB.
GDB , , , .mod, GDB
-2. . 9.1.3 [ GDB ], . 78, .

9.4.2.5 -2
-2 .
, :
-2, - . - . ( -2, , , ;
- , .)
,
. GDB
.
CHR(nnn).
(:=) .
, .

9.4.2.6 -2
: , GDB
.
GDB -2 , :
TYPE t1 = t2
. (: gnu -2, .)
, .
, ,
.

9.4.2.7 :: .
-2 (.) GDB (::). :
.
::
, , , , .
:: GDB .
, GDB , .

9: GDB

91

. GDB ,
, . c ,
, .

9.4.2.8 GDB -2
GDB -2.
set print show print
++: vtbl, demangle, asm-demangle, object union.
++, union, -2.
@ (. 8.1 [], . 61)
, -2. ,
, -2
++. , {}- ,
.
GDB, -2 #
. <>.

9.4.3 Chill
, GDB Chill, , gnu Chill. Chill
, , ,
, GDB
.
, Chill, GDB .

9.4.3.1
GDB () Chill gnu Chill, , , . :
:
, BYTE, UBYTE, INT,
UINT, LONG, ULONG,
, BOOL,
, CHAR,
-, SET.
(gdb) ptype x
type = SET (karli = 10, susi = 20, fritzi = 100)
, .
-,
= <->(< > : < >)
< >, < > (, ).
powerset:
Powerset POWERSET,
.

92

GDB

(gdb) ptype x
type = POWERSET SET (egon, hugo, otto)
-:
, REF,
, .
, PTR.

= PROC(< >)
< > EXCEPTIONS (< >). <
> . < >
, .
< > ,
.
:
,
EVENT (< >)
< > .
,
BUFFER (< >)< >
(< >) .
:
, DURATION
, TIME
:
REAL LONG_REAL.
:
,
CHARS(< >)
VARYING,
,
BOOLS(< >)
:
ARRAY(<>), (, ,
).
(gdb) ptype x
type = ARRAY (1:42)
ARRAY (1:20)
SET (karli = 10, susi = 20, fritzi = 100)

STRUCT(< >).
< > .
CASE <> OF < > ESAC
. gnu Chill ( , ,
, ), .

9: GDB

93

(gdb) ptype str


type = STRUCT (
as x,
bs x,
CASE bs OF
(karli):
cs a
(ott):
ds x
ESAC
)

9.4.3.2
Chill , .
()
.
Chill. , , , 9.4.3.3 [ ], . 93.
- RESULT ( result)
, :
set result := EXPR
, Chill RESULT EXPR ( GDB ).
, , PTR(< >), (REF < >)
(< >) . <
> , .
, , ->.

{ PROC
(< > ) < > } <> <
>
< > , , <> .
, (, , )
, , 9.4.3.3
[ ], . 93.

.
< >(<>). ,
, . , ,
, , .
(gdb) print int (s(3 up 4)) XXX TO be filled in !! XXX

9.4.3.3
,

94

GDB

. ( ), . -,
,
. (, ),
GDB .
,
.

, gnu Chill.
, 1.5 gnu
Chill.
-
< >[<>], < >
, . . <>
:
powerset


-powerset, ,
Chill.


< >(<>)
<> .
, ,
<>.

< >(<
>), < >
, < > up <>.
<> , .
, .

< >(<>) .

< >(< >),
< > , , < > up <>. <> , . ,
.

< >.< >,
< > , .
.

9: GDB

95


, 1 .

ULONG.
-
TIME(<>:<>).


.

, , . ( , ),
. ,
,
. GDB :
OR, ORIF, XOR
AND, ANDIF
NOT
, .
=, /=
>, >=
<, <=

, .
, .

+, *, /, MOD, REM
, .

//

()

->

, (->loc),
(loc->).

OR, XOR
AND
NOT

powerset .

>, >=
<, <=

powerset.

IN

, , ,
. .

96

GDB

9.4.3.4 Chill
GDB Chill , .
. ,
, (
, , , , )
.
, ,
.
GDB set check strong.
,
Chill (, , ), , z.200.
GDB set check off.

9.4.3.5 Chill
GDB , , Chill.
, GDB.
GDB , , , .ch,
Chill. . 9.1.3 [ GDB ], . 78,
.

10:

97

10
, ,
( , ), . . GDB
, , (. 2.1.1 [ ], . 10),
(. 12.1 [ ], . 105).
, ,
GDB .
(. 8.2 [ ], . 62).
, GDB , foo.c,
: foo . c. GDB foo.c ,
; ,
p foo.c::x
x foo.c.
info address
, .
, .
,
.
print &,
,
.
whatis
. , (
) . . 8.1 [], . 61.
whatis

$, .

ptype -
-. - , , class -, struct , union - enum -.
ptype
ptype
. ptype whatis ,
, .
, :
struct complex {double real; double imag;} v;
:
(gdb) whatis v
type = struct complex
(gdb) ptype v
type = struct complex {
double real;
double imag;
}
whatis, ptype $, .

98

GDB

info types -
info types
, - ( , ). ,
; , i type value
, p
value, i type ^value$ p
value.
ptype : -p, whatis,
; -, ,
.
info source
, , , p .
info sources
,
p, : , , p, .
info functions
p .
info functions -
p , -. , info fun step
, step; info fun ^step
, step.
info variables
p,
( p).
info variables -
p (p ),
-.
, , . ,
VxWorks p
. , GDB
:
set symbol-reloading on

, .
set symbol-reloading off
p
. ; ,
, symbol-reloading
off, GDB

10:

99

p , p
( ).
show symbol-reloading
on off.
set opaque-type-resolution on
GDB .
, struct, class union,
struct MyType * , ,
struct MyType .
on.
,
.
set opaque-type-resolution off
GDB .
, :
{<no data fields>}
show opaque-type-resolution
, .
maint print symbols -
maint print psymbols -
maint print msymbols -
-. GDB, .
.
maint print symbols, GDB ,
: - , GDB .
info sources, , .
maint print psymbols, , GDB ,
, GDB , . , maint print msymbols,
, , GDB p - . . 12.1 [ ],
. 105, GDB ( symbol-file).

100

GDB

11:

101

11
, , ,
. ,
GDB .
, , ,
.

11.1 p
, . . 8.1 [], . 61. ,
print x=4
4 x ( 4). . 9 [ GDB ], . 77, p .
, set
print. set print , (. 8.8 [ ],
. 72). .
set set,
set variable. set,
. , width,
, set width=13,
GDB set width:
(gdb) whatis width
type = double
(gdb) p width
$4 = 13
(gdb) set width=47
Invalid syntax in expression.
, , , =47.
width,
(gdb) set var width=47
set ,
, set
variable set. , g,
, set
g=4, GDB set gnutarget, set g:

102

GDB

(gdb) whatis g
type = double
(gdb) p g
$1 = 1
(gdb) set g=4
(gdb) p g
$2 = 1
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/smith/cc_progs/a.out
"/home/smith/cc_progs/a.out": cant open to read symbols:
Invalid bfd target.
(gdb) show g
The current BFD target is "=4".
g , gnutarget
. g,
(gdb) set var g=4
GDB , ; - ,
, .
,
{...} (.
8.1 [], . 61). , {int}0x83040
0x83040 ( ),
set {int}0x83040 = 4
4.

11.2
, , ,
, continue. ,
:
jump -
-. ,
. . 7.1 [
], . 55, -.
tbreak jump . . 5.1.1 [
], . 32.
jump , ,
- , . -
, ,
. , jump ,
, . , ,
.

11:

103

jump *
, .
, , jump,
$pc. , , ,
, . ,
set $pc = 0x485
continue
0x485, , . . 5.2 [
], . 44.
jump , ,
, .

11.3
signal
,
. .
, signal 2 signal SIGINT
.
, ,
. , -
continue;
signal 0 .
signal , hRETi
.
signal kill . kill GDB , ,
(. 5.3 [], . 46). signal
.

11.4
return
return
return.
,
.
return, GDB (
).
. ,
return.
(. 6.3 [ ], . 52)
, ,
. . ,
.
return ;
, . ,

104

GDB

finish (. 5.2 [ ], . 44)


.

11.5
call
(void)
.
print, , .
, .
A29K, call_scratch_address
, , GDB
. ,
.

11.6
, GDB ,
( ), .
;
.
,
set write. , .
set write on
set write off
set write on, GDB ; set write
off ( ), GDB
.
, set write ( exec-file core-file),
.
show write
,
.

12: GDB

105

12 GDB
GDB , , .
, GDB .

12.1
.
GDB, GDB (.
2 [ GDB], . 9).
GDB .
GDB , .
GDB .
file -
- .
. ,
run.
, GDB, PATH , ,
, .
path, GDB,
.
,
- .syms. , GDB -.syms, .
-mapped -readnow ( file, symbol-file add-symbol-file, ), .
file

file GDB
, .

exec-file [ - ]
, , (
), -. , GDB PATH. - ,
.
symbol-file [ - ]
-. PATH.
, file.
symbol-file GDB
.
symbol-file GDB
, ,
, ,
, GDB.

106

GDB

symbol-file , hRETi .
GDB , , ; gnu, ,
. gnu; , gcc,
.
,
SVR3, COFF, symbol-file . ,
, .
, , .
, GDB . ,
. ( set verbose
. . 15.6 [ ],
. 154.)
COFF.
COFF, symbol-file
. , stabs-in-COFF ,
stabs.
symbol-file - [ -readnow ] [ -mapped ]
file - [ -readnow ] [ -mapped ]
, GDB ,
,
-readnow ,
.
mmap, , -mapped,
GDB . GDB ( ), ,
. -mapped ,
GDB -mapped.
, ,

.
myprog
myprog.syms. ( , ), GDB
myprog; .
.syms , GDB. GDB.
.
core-file [ - ]
,
.

12: GDB

107

, ; GDB
.
core-file ,
.
, ,
GDB. , ,
, . kill (. 4.8 [ ], . 25).
add-symbol-file -
add-symbol-file - [ -readnow ] [ -mapped ]
add-symbol-file - -s
add-symbol-file
-. ,
- ( ) . ,
; GDB . -s ,
.
.
- ,
symbol-file. addsymbol-file ;
. , symbol-file .
add-symbol-file , hRETi
.
GDB -,
-mapped -readnow , symbol-file.
add-shared-symbol-file
add-shared-symbol-file Motorola 88k Harris CXUX. GDB , , , add-shared-symbol-file. .
section

section
. ,
, ( a.out), , , . .
info files, , .

info files
info target
info files info target ;
(. 13 [ ], . 111),
, GDB, , . help target
, .
,
. GDB
.

108

GDB

GDB HP-UX, SunOS, SVr4, Irix 5 IBM


RS/6000.
run, , GDB . (,
, GDB , run.)
HP-UX, , GDB shl_load.
info share
info sharedlibrary
, .
sharedlibrary -
share -
, Unix. , , run.
- , ,
.
HP-UX, GDB ,
, .
, . , sharedlibrary . GDB
.
, :
set auto-solib-add
.
, ,
GDB , , ,
. ,
, sharedlibrary. ,
100 .
show auto-solib-add
.

12.2
, GDB , , , .
, GDB ,
, .
, GDB ,
, ; GDB

12: GDB

109

, , , set complaints
(. 15.6 [ ], . 154).
, :
inner block not inside outer block in
, (, ).
,
.
GDB , ,
, . , (dont
known).
block at out of order

. , .
GDB ,
, .
( , set
verbose on. . 15.6 [ ],
. 154.)
bad block start address patched
, . ,
SunOS 4.1.1 ( ).
GDB , .
bad string table offset in symbol n
n , .
GDB , , foo,
, .
unknown symbol type 0xnn
, GDB
, . 0xnn , .
GDB , .
, . ,
gdb , complain, read_dbx_symtab *bufp,
.
stub type has NULL name
GDB .
const/volatile indicator missing (ok if using g++ v1.x), got...
- ++ , .
info mismatch between compiler and debugger
GDB , .

110

GDB

13:

111

13
, .
GDB , ; ,
file core.
, GDB ,
TCP/IP target
, GDB (. 13.2 [
], . 111).

13.1
: , . GDB ,
. () ,
.
, gdb a.out, a.out . , GDB
, , , . (
, ,
( ), ,

.)
run,
. , GDB,
, ;
, .
core-file exec-file (. 12.1 [ ], . 105).
, , attach (. 4.7 [ ], . 25).

13.2
target
GDB . .
, .
,
, , , .
target hRETi .
help target
. , info target, info files (. 12.1 [ ], . 105).

112

GDB

help target
, ,
.
set gnutarget
GDB BFD1 . GDB , ,
(.o) ;
set gnutarget. target, gnutarget, target , .
: set
gnutarget, BFD.
. 12.1 [ ], . 105.
show gnutarget
show gnutarget , gnutarget . gnutarget, GDB
, show gnutarget The current BFD target is "auto".
( ,
GDB):
target exec
. target exec , exec-file
.
target core -
. target core - , core-file
-.
target remote
GDB .
,
(, /dev/ttya). . 13.4 [ ], . 113. target remote load. ,
-
, .
target sim
. GDB . ,
target sim
load
run
; , ,
, , , .
, 14.3 [ ], . 136.
:
target nrom
NetROM ROM. .
1

Binary File Descriptor ( ). (. )

13:

113

GDB ; .
, ,
.
load -
, GDB, load. ,
- ( )
,
. load - GDB, add-symbol-file.
GDB load, You cant do that when your target is ....
, . ,
; , a.out,
.
load , hRETi .

13.3
, MIPS, PowerPC Hitachi SH,
,
. , , . ,
, GDB.
set endian big
GDB , .
set endian little
GDB , .
set endian auto
GDB , .
show endian
GDB .
,
, .

13.4
, ,
GDB , . ,
,
.
GDB TCP/IP , . ,
GDB ( GDB,

114

GDB

), ,
, GDB.
GDB ;
help target, .

13.4.1 GDB
, ( ), . , :
1. ;
crt0. ,
.
2. ,
.
3. , . ,
,
.
, GDB ( ).
, :

GDB , ;
, target remote (. 13 [ ], . 111).


,
GDB. , ,
.
, gdbserver .
. 13.4.1.5 [ gdbserver], . 130, .
; , sparc-stub.c sparc.
GDB:
i386-stub.c
Intel 386 .
m68k-stub.c
Motorola 680x0.
sh-stub.c
Hitachi SH.
sparc-stub.c
sparc.
sparcl-stub.c
Fujitsu spacrlite.
README GDB .

13:

115

13.4.1.1
:
set_debug_traps
, handle_exception.
.
handle_exception
,
handle_exception, .
handle_exception , (, ),
GDB . ; handle_
exception GDB .
, , , GDB, GDB,
; handle_exception .
breakpoint
. ,
GDB . , ,
; handle_exception , GDB.

; , breakpoint target remote GDB
.
breakpoint, ,
, .

13.4.1.2
, GDB, ,
.
, ,
.
int getDebugChar()

. getchar ;
, , .
void putDebugChar(int)

. putchar ;
, , .

116

GDB

, GDB ,
^C (\003, control-C). ,
GDB .
GDB , , ; ( , GDB
SIGTRAP SIGINT).
, :
void exceptionHandler (int -, void *-)
- . ,
,
(, , , ). -
, ; (, , , ). , -, (,
) , .
-, ,
.
386, -
,
. 0 ( ). sparc 68k
exceptionHandler.
void flush_i_cache()
sparc sparclite.
, , .
, .
, , GDB ,
, .
, :
void *memset(void *, int, int)
memset, .
libc.a, memset ;
, .
gnu ,
; ,
, ,
gcc .

13.4.1.3
, ,
.

13:

117

1. , (. 13.4.1.2 [ ], . 115):
getDebugChar, putDebugChar,
flush_i_cache, memset, exceptionHandler.
2. :
set_debug_traps();
breakpoint();
3. 680x0, exceptionHook.
:
void (*exceptionHook)() = 0;
set_debug_traps . , GDB
(, ). , exceptionHook,
int, .
4. : , GDB
.
5. ,
, .
6. ( , ) .
7. , GDB , .
GDB,
.
8. , target remote. ,
, , TCP ( , , , ). , ,
/dev/ttyb, :
target remote /dev/ttyb
TCP-, :.
, 2828 manyfarms:
target remote manyfarms:2828

, .
, detach.
, GDB , ( C-C), GDB .
, , .
, GDB :
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n)
y, GDB . ( , , target remote,
.) n, GDB .

118

GDB

13.4.1.4
, GDB,
, GDB GDB
remote.c. ,
. ( ,
: .
sparc-stub.c , .)
, , -
, ,
, - , GDB .
, <- -> .
GDB ( ), .
$, - #, -:
$-#-
- 256
$ # ( ).
, GDB 5.0
-:
$-:-#-
- . GDB -.
, , GDB 5.0,
-.
, ,
: + ( , ), -
( ):
<- $-#-
-> +
(GDB) , ( , ) .
, , ( ).
- , # $ (
, X).
,, ; :.
, .
, GDB 5.0, :
( ).
, . * , ascii-,
, *. n+29, n >=3 (
). $, #, +, -, , 126, .

13:

119


, cisco-. * , .
:
"0* "
, "0000".
, , ,
. .
, ,
($#00). , . GDB
, , .
g, G, m, M, c s.
.
,
:

120

GDB

.
.
R.
, ,
, , ,
, , .

()

A-,,,...

,
.
, .

argv[].
- . gdbserver .
OK
ENN
(
)


( )

B,

( S) ( C)
. Z z.

. ,
.

13:

( )

121

). ; ,

.

GDB
.
, GDB
.
GDB .

C;

.

. .

g GDB REGISTER RAW SIZE
REGISTER NAME. g .
.

XX...

ENN

GXX...
OK
ENN

g XX... .


122

GDB

Hct...

OK
ENN

(m, M, g, G,
). c = c , ; t... -1 . c
= g ,
.
.

()

i,nnn

,nnn , nnn
. ,
.

,
()

i S, .

FIXME: , , ( k
?).

m,

,
. GDB,
,
, . FIXME:
,
.

13:

XX...

ENN

M,:XX...
OK
ENN

123

XX... .
,

. GDB, , ,
. FIXME:
,
.
NN
, . XX...
.

( ,
).

()

pn...

r....

,
.

Pn...=r...

n...
r...,
( ).

OK
ENN

124

GDB

XX...

ENN

. , GDB . (
). : qfsf.var.
,
, ;.
,
.
, .

.

.

Q=


.
q ,
.

( )

RXX

.
XX, , . FIXME:
,

.

.
,
.

S;

C, ,
step continue.

t:PP,MM

,
, PP
MM. PP MM4 .
.

TXX

, XX.

13:

125

OK
ENN

()

X,:XX...

,
, XX... .
$, # 0x7d 0x7d.

OK
ENN

()

zt,,

Z.

126


()

GDB

Zt,,

ENN
OK

<>

t : 0 , 1 , 2
, 3
, 4 ; ; .
, ,
.
,

.
, .


.

C, c, S, s ? .
C, c, S s, ,
. , . ,
UNIX .

SAA

AA

TAAn...:r...;n...:r...;n...:r...;

AA = ; n... = () ,
r... = ,
REGISTER_RAW_SIZE; n... =
thread, r... = ,
; n... = ,
. GDB
n..., r...
.
.

WAA

AA. .

XAA

AA.

13:

127

NAA;t...;d...;b... ()

AA = ; t... = " start";


d... = ; b... = bss. :
Cisco Systems.
"qOffsets" , N ,
qOffsets .

OXX...

XX... ascii. , W, T, ..

qC
QC
*

qfThreadInfo
qsThreadInfo

m<>

m<>,<>...
l

.
-16- , .
.

. , : /,
.
qfThreadInfo; qsThreadInfo.
: qL ( ).

,

( l )
.
,
, ,
. GDB

( qs ),
l ( l ,
last).

qThreadExtraInfo,

128

GDB

XX...


- (
)

qL-

qM...

CRC

,
.
. , GDB .
GDB info threads. "Runnable"
"Blocked on Mutex".
XX...ascii-
, .

, . : ( ) , , ,
; - (
)
, ;
- ( ),
(- ), -.
:
qfThreadInfo ( ).

: ( )
; ( ), , , , , , ; - ( ) ; ... . ( ).
remote.c:parse_threadlist_response().

qCRC:,
ENN
CCRC32

(, )
32-
.

qOffsets

, . : Bss
, GDB
Bss Data.

Text=xxx;Data=yyy;Bss=zzz

13:

qP

129

-. :
32- ; -64
.
remote.c:remote_unpack_thread_info_
response().

qRcmd,

ENN

( )
.
. ,

O . ,
.
.
,
.
.

reply

qRcmd .

OK

g/G . , 32- 64 . /
(?), .
. .
MIPS32

32-
: 32 ; sr; lo; hi; bad; cause; pc; 32 ; fsr; fir; fp.

MIPS64

64-
( 32- , sr). ,
MIPS32.

. ,
:
<- R00
-> +
target restarts
<- ?
-> +
-> T001:1234123412341234
<- +
:
<- G1445...

130

GDB

-> +
<- s
-> +
time passes
-> T001:1234123412341234
<- +
<- g
-> +
-> 1455...
<- +

13.4.1.5 gdbserver
gdbserver Unix- , GDB
target remote, .
gdbserver ,
, GDB. , ,
gdbserver GDB,
GDB ! , gdbserver ,
, GDB. gdbserver , GDB,
, . ,
, , , ,
, ,
-. gdbserver,
.
GDB gdbserver ,
TCP, GDB.

, .
gdbserver ,
, . GDB .
, ,
GDB, . :
target> gdbserver comm [ ... ]
comm ( ),
TCP. , Emacs
foo.txt GDB
/dev/com1:
target> gdbserver /dev/com1 emacs foo.txt
gdbserver GDB .
TCP- :
target> gdbserver host:2345 emacs foo.txt
, , GDB TCP.
host:2345 , gdbserver TCP- host TCP 2345. ( host
.) , ,

13:

131

- TCP, (, 23 telnet).1
GDB target remote.
GDB
, GDB
. GDB
, . ( -baud, , 9600 /.)
, target remote, gdbserver.
( , /dev/ttyb), TCP :. :
(gdb) target remote /dev/ttyb
/dev/ttyb,
(gdb) target remote the-target:2345
TCP- 2345
the-target. TCP-, gdbserver target remote. ,
, : Connection refused.

13.4.1.6 gdbserve.nlm
gdbserve.nlm NetWare, GDB target
remote.
GDB gdbserve.nlm ,
GDB.

, .
gdbserve.nlm ,
, . GDB .
,
GDB, . :
load gdbserve [ BOARD= ] [ PORT= ]
[ BAUD= ] [ ... ]
;
, . node
0, 9600 /.
, Emacs foo.txt
GDB 2 1,
19200 /:
load gdbserve BOARD=1 PORT=2 BAUD=19200 emacs foo.txt
GDB
, GDB
. GDB ,
1

, , gdbserver
.

132

GDB

. ( -baud, , 9600 /.) ,


target remote gdbserve.nlm. ( , /dev/ttyb). :
(gdb) target remote /dev/ttyb
/dev/ttyb.

13.5
. , GDB
, ,
. ,
.
set os, . GDB, :
(gdb) set os cisco
set os , GDB
, info,
. info :
(gdb) info cisco
List of Cisco Kernel Objects
Object
Description
any
Any and all objects
,
.
,
, .

14:

133

14
GDB -
, . ,
.
: ,
, , ,
, .

14.1
, .

14.1.1 HP-UX
HP-UX, ,
, GDB ,
.

14.1.2 SVR4
SVR4 , /proc, , . GDB ,
, info proc
, . info proc
SVR4, procfs. :
OSF/1 (Digital Unix), Solaris, Irix Unixware, HP-UX Linux, .
info proc .
info proc mappings
, , ,
, , .
info proc times
, .
info proc id
,
: , , .
info proc status
. ,
.
info proc all
.

134

GDB

14.2
, , .
GDB , .

14.2.1 GDB VxWorks


target vxworks -
VxWorks,
TCP/IP.
- IP- .

VxWorks, load - ,
GDB.
GDB Unix- , VxWorks. ,
VxWorks, . GDB ,
Unix, VxWorks. gdb
Unix-. ( vxgdb,
GDB .)
VxWorks-timeout
, VxWorks, vxworkstimeout. ,
, GDB
. , VxWorks
, .
VxWorks ,
; VxWorks .
GDB VxWorks, VxWorks,
VxWorks
rdb.a. , INCLUDE_RDB VxWorks
configAll.h VxWorks. rdb.a, tRdbTask, VxWorks .
VxWorks, .
rdb.a VxWorks
, GDB,
. Unix-, gdb ( vxgdb,
).
GDB :
(vxgdb)

14.2.1.1 VxWorks
GDB target VxWorks .
, tt, :
(vxgdb) target vxworks tt

14:

135

GDB , :
Attaching remote machine across net...
Connected to tt.
GDB ,
VxWorks , . GDB
, (. 4.4
[ ], . 23); ,
:
prog.o: No such file or directory.
,
GDB path, target .

14.2.1.2 VxWorks
VxWorks ,
, GDB load,
Unix VxWorks. , load, : VxWorks, ,
GDB, . ,
.
NFS , , . ,
, , , . , prog.o vxpath/vw/demo/rdb
VxWorks hostpath/vw/demo/rdb . ,
VxWorks :
-> cd "vxpath/vw/demo/rdb"
, GDB, :
(vxgdb) cd hostpath/vw/demo/rdb
(vxgdb) load prog.o
GDB , :
Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
load, , .
, GDB ,
, , . ( , , .)

14.2.1.3
, attach
:
(vxgdb) attach
VxWorks.
, . .

136

GDB

14.3
, .

14.3.1 AMD A29K


target adapt
Adapt A29K.
target amd-eb
PC- AMD EB29K, . ,
target remote; ;
, , , . . 14.3.1.2 [ EBMON AMD29K],
. 136.

14.3.1.1 A29K UDI


a29k, GDB AMD UDI
(Universal Debugger Interface1 ). AMD,
MiniMON, MONTIP,
AMD. GDB ISSTIP, UDI a29k, AMD.
target udi -
UDI a29k . -
AMD udi_soc. , ,
a29k. udi_soc
,
UDICONF.

14.3.1.2 EBMON AMD29K


AMD 29K, ,
EBMON, . EB29K. GDB Unix-
EB29K,
( EB29K) Unix-.
, COM1 /dev/ttya Unix-.

14.3.1.3
, -
:
C:\> MODE com1:9600,n,8,1,none
, MS DOS 4.0, 9600 /,
, , -
;
Unix.
Unix, :
1

. (. )

14:

137

C:\> CTTY com1


(, , CTTY con , ,
COM1.)
Unix-, ,
tip cu.
cu -s 9600 -l /dev/ttya
cu , , . tip,
:
tip -9600 /dev/ttya
, /dev/ttya
tip. , , tip remote /etc/remote.
tip cu, , 29K, EBMON (
EB29K, AMD ).
EBMON, , EBMON #:
C:\> G:
G:\> CD \usr\joe\work29k
G:\USR\JOE\WORK29K> EBMON
Am29000 PC Coprocessor Board Monitor, version 3.0-18
Copyright 1990 Advanced Micro Devices, Inc.
Written by Gibbons and Associates, Inc.
Enter ? or H for help
PC Coprocessor Type
I/O Base
Memory Base

= EB29K
= 0x208
= 0xd0000

Data Memory Size


= 2048KB
Available I-RAM Range = 0x8000 to 0x1fffff
Available D-RAM Range = 0x80002000 to 0x801fffff
PageSize
Register Stack Size
Memory Stack Size

= 0x400
= 0x800
= 0x1800

CPU PRL
Am29027 Available
Byte Write Available

= 0x3
= No
= Yes

# ~.
cu tip (
~. EBMON). EBMON , , GDB
.

138

GDB

, , PC/NFS,
Unix- G: . , , , 29K
, Unix-. PC/NFS - , , 29K
Unix . GDB
.

14.3.1.4 - EB29K
, , 29K Unix-,
GDB, :
cd /usr/joe/work29k
gdb myfoo
target:
target amd-eb /dev/ttya 9600 MYFOO
, myfoo. , , target amd-eb,
, . , MYFOO, , , ,
Unix-.
;
29K, GDB run.
, GDB detach.
, tip cu , GDB, EBMON.
q, EBMON, . CTTY con, ,
~., tip cu.

14.3.1.5
target amd-eb eb.log, . eb.log EBMON,
. tail -f
EBMON, .

14.3.2 ARM
target rdi
ARM Angel, RDI ADP.
,
Angel, EmbeddedICE JTAG.
target rdp
ARM Demon.

14.3.3 Hitachi H8/300

14:

139

target hms
Hitachi SH, H8/300 H8/500,
. device speed
.
target e7000
E7000 Hitachi H8 SH.
target sh3
target sh3e
Hitachi SH-3 SH-3E.
Hitachi SH, H8/300 H8/500,
load Hitachi,
GDB ( file).
Hitachi SH, H8/300 H8/500, GDB :
1. : target hms, Hitachi, target e7000, Hitachi SH
Hitachi 300H. (target hms , GDB
Hitachi SH, H8/300 H8/500.)
2. Hitachi ( , ).
3. .

14.3.3.1 Hitachi
GDB device ,
. ,
. Unix-, -
/dev/ttya.
GDB : speed bps.
Unix-; , GDB mode (, mode com2:9600,n,8,1,p
9600 /.
device speed Hitachi,
Unix. , GDB
asynctsr. mode, .
,
H8/300 GDB. H8/300
t.x. Hitachi SH H8/500 .
. , , COM2. ,
mode. asynctsr, , ,
; , asynctsr 2 asynctsr
COM2.
C:\H8300\TEST> asynctsr 2
C:\H8300\TEST> mode com2:9600,n,8,1,p

140

GDB

Resident portion of MODE loaded


COM2: 9600, n, 8, 1, p
: PC-NFS,
asynctsr. PC-NFS -,
, ,
asynctsr .
, , GDB. gdb . GDB : (gdb).
: target hms - Hitachi,
load . load ,
* . (
GDB , GDB
file symbol-file. , load, .
12.1 [ ], . 105.)
(eg-C:\H8300\TEST) gdb t.x
GDB is free software and you are welcome to distribute copies
of it under certain conditions; type "show copying" to see
the conditions.
There is absolutely no warranty for GDB; type "show warranty"
for details.
GDB 5.0, Copyright 1992 Free Software Foundation, Inc...
(gdb) target hms
Connected to remote H8/300 HMS system.
(gdb) load t.x
.text
: 0x8000 .. 0xabde ***********
.data
: 0xabde .. 0xad30 *
.stack : 0xf000 .. 0xf014 *
. ,
GDB. break ; run ; print x ;
continue . help , GDB.
, , ; , ,
reset!
reset
( ctl-C
);
GDB , . GDB ,
.
, GDB reset .

14:

141

14.3.3.2 E7000
E7000
Hitachi SH, H8/300H. target e7000
GDB E7000:
target e7000
, E7000
. , (, com2).
(, 9600).
target e7000 -
E7000 TCP/IP,
; GDB telnet.

14.3.3.3 GDB Hitachi


GDB H8/300:
set machine h8300
set machine h8300h
GDB H8/300
set machine. show machine, , .

14.3.4 H8/500
set memory
show memory
, H8/500 () set
memory; , show memory. small, big, medium compact.

14.3.5 Intel i960


target mon960
MON960 Intel i960.
target nindy -
Intel 960, Nindy Monitor. - , ,
/dev/ttya.
Nindy ROM Monitor Intel 960. GDB Intel 960 Nindy,
, 960 :
, Nindy
;
;
target GDB. . 13.2 [ ], . 111.
Nindy Intel 960, load - 960,
GDB.

142

GDB

14.3.5.1 Nindy
gdb , , , ,
GDB:
Attach /dev/ttyNN - specify NN, or "quit" to quit:
( /dev/tty), , . , ,
Nindy, . Nindy, target (. 13.2
[ ], . 111).

14.3.5.2 Nindy
GDB Nindy960:
-r

, . GDB Intel 960.


: (, -r
/dev/ttya), /dev (, -r ttya) tty (, -r a).

-O

( O, .) , GDB
Nindy .
GDB
Intel 960.
: -O,
,
, , . GDB
.
.

-brk

, GDB BREAK,
, Nindy.
:
;
.

-b ,
.

14.3.5.3 Nindy
reset

Nindy, break ;
, ( , )
.

14.3.6 Mitsubishi M32R/D


target m32r
ROM Mitsubishi M32R/D.

14:

143

14.3.7 M68k
Motorola m68k ColdFire, target
ROM.
target abug
ABug ROM M68K.
target cpu32bug
CPU32BUG, CPU32 (M68K).
target dbug
dBUG ROM Motorola ColdFire.
target est
EST-300 ICE, CPU32 (M68K).
target rom68k
ROM 68K, M68K IDP.
GDB m68*-ericsson-*,
target:
target es1800
ES-1800 M68K.
target rombug
ROMBUG ROM OS/9000.

14.3.8 M88K
target bug
BUG, MVME187 (m88k).

14.3.9 MIPS
GDB MIPS
MIPS, . ,
GDB -target=mips-idt-ecoff.
GDB :
target mips
, gdb,
. , target
mips , , .
,
load, .
GDB.
, ,
prog:
host$ gdb prog
GDB is free software and ...
(gdb) target mips /dev/ttyb
(gdb) load prog
(gdb) run

144

GDB

target mips -:-


GDB, TCP-
(,
,

) ,
-:-.
target pmon
ROM PMON.
target ddb
NEC DDB- PMON Vr4300.
target lsi
LSI- PMON.
target r3900
Densan DVE-R3900 ROM Toshiba R3900 Mips.
target array
RAID Array Tech LSI33K.
GDB MIPS:
set processor
show processor
set processor MIPS, , . , set processor r3041 GDB CPO,
3041. show processor, , MIPS GDB.
info reg , GDB.
set mipsfpu double
set mipsfpu single
set mipsfpu none
show mipsfpu
MIPS
, set mipsfpu none (
,
GDB). GDB, ,
. GDB .
, r4650,
set mipsfpu single. ;
set mipsfpu double.
,
, set mipsfpu
on , set mipsfpu off .
, mipsfpu
show mipsfpu.
set remotedebug n
show remotedebug
, remotedebug. 1 set

14:

145

remotedebug 1, . 2,
.
show remotedebug.
set timeout
set retransmit-timeout
show timeout
show retransmit-timeout
, MIPS, set timeout .
5 . , , set retransmit-timeout . 3 . show timeout show retransmittimeout. ( GDB
-target=mips-idt-ecoff.)
, set timeout, ,
GDB . , GDB
, ,
, .

14.3.10 PowerPC
target dink32
ROM DINK32.
target ppcbug
target ppcbug1
ROM PPCBUG PowerPC.
target sds
SDS, PowerPC ( Motorola ADS).

14.3.11 HP PA
target op50n
OP50N, OKI HPPA.
target w89k
W89K, Winbond HPPA.

14.3.12 Hitachi SH
target hms
Hitachi SH, . device speed .
target e7000
E7000 Hitachi SH.
target sh3
target sh3e
Hitachi SH-3 SH-3E.

146

GDB

14.3.13 Tsqware Sparclet


GDB Unix- ,
Sparclet. GDB , Unix-,
Sparclet. gdb Unix-.
remotetimeout
GDB remotetimeout. , , GDB .
, -g , -Ttext , ,
. -n -N,
. :
sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N
, , , objdump:
sparclet-aout-objdump -headers -syms prog
, , GDB, . Unix,
gdb ( sparclet-aout-gdb, ).
GDB :
(gdbslet)

14.3.13.1
GDB file .
(gdbslet) file prog
GDB prog.
, . ( -g),
. GDB , ,
(. 4.4 [ ], . 23).
, , :
prog: No such file or directory.
,
GDB path dir, target .

14.3.13.2 Sparclet
GDB target Sparclet.
ttya, :
(gdbslet) target sparclet /dev/ttya
Remote target sparclet connected to /dev/ttya
main () at ../prog.c:3
GDB , :
Connected to ttya.

14:

147

14.3.13.3 Sparclet
Sparclet,
GDB load .
load .
aout, . ,
, objdump. ,
VMA (Virtual Memory Address2 ) . ,
prog 0x1201000,
0x12010160 0x12010170, GDB:
(gdbslet) load prog 0x12010000
Loading section .text, size 0xdb0 vma 0x12010000
, ,
, section add-symbolfile, GDB, .

14.3.13.4
, GDB
, b, step, run, . .
(gdbslet) b main
Breakpoint 1 at 0x12010000: file prog.c, line 3.
(gdbslet) run
Starting program: prog
Breakpoint 1, main (argc=1, argv=0xeffff21c) at prog.c:3
3
char *symarg = 0;
(gdbslet) step
4
char *execarg = "hello!";
(gdbslet)

14.3.14 Fujitsu Sparclite


target sparclite
Fujitsu sparclite, . , . , target remote , GDB.

14.3.15 Tandem ST2000


GDB Tandem ST2000, Tandem STDBUG.
ST2000 , . , ST2000 , :
target st2000
. , /dev/ttya, ST2000
. , TCP- (, , ), -:-.
2

(. )

148

GDB

load attach ;
ST2000 , . GDB
(, ) ,
, .
GDB
ST2000:
st2000
STDBUG. .
connect

STDBUG.
STDBUG, GDB: hRETi~. (Return,
) hRETi~hC-di (Return,
control-D).

14.3.16 Zilog Z8000


Zilog Z8000, GDB
Z8000.
Z8000, target sim Z8002 ( Z8000), Z8001 ( ).
.
target sim
. , .
,
, ;
file , run ,
.
, (. 8.10 [], . 74), Z8000 :
cycles

insts

, .

time

GDB ; , b fputc if $cycles>5000 ,


5000 .

14.4
,
GDB , , -.

14.4.1 A29K

14:

149

set rstack_high_address
AMD 29000,
.
. , GDB , .
, GDB
. , ,
set rstack_high_
address. , , ,
0x, .
show rstack_high_address

AMD 29000.

14.4.2 Alpha
.

14.4.3 MIPS
, Alpha MIPS,
, GDB , .
( , GDB ),
, :
set heuristic-fence-post
GDB
. 0 ( ) . , 0, , heuristic-fence-post
, , , .
show heuristic-fence-post
.
GDB
Alpha MIPS.

150

GDB

15: GDB

151

15 GDB
GDB , set.
, GDB, 8.7
[ ], . 68. .

15.1
GDB , ,
. (gdb).
set prompt. , GDB GDB,
, , .
: set prompt .
, .
set prompt -
GDB, p
-.
show prompt
: Gdbs prompt is: -

15.2
GDB readline. gnu ,
. gnu Emacs vi, csh-
.
GDB
set.
set editing
set editing on
( ).
set editing off
.
show editing
, .

15.3
GDB , , , . GDB.
set history filename -
GDB -. , GDB .

152

GDB

, . , GDBHISTFILE, , ,
./.gdb_history (./_gdb_history MS-DOS).
set history save
set history save on
, set history filename. , .
set history save off
.
set history size
, GDB . HISTSIZE, 256, .
!.
! , .
set history expansion on, ! ( ) ,
. Readline != !(, .
:
set history expansion on
set history expansion
. .
set history expansion off
.
Readline
. , gnu Emacs vi, .
show
show
show
show
show

history
history filename
history save
history size
history expansion
GDB. show
history .

show commands
.
show commands n
, n.
show commands +
, .

15: GDB

153

15.4
GDB
. , GDB . hRETi,
, q . ,
, . , , GDB
p ,
.
GDB . ,
Unix GDB termcap, TERM
stty rows stty cols. ,
set height set width:
set height lpp
show height
set width cpl
show width
set lpp cpl .
show .
, GDB
, , . ,
.
, set width 0, GDB .

15.5
GDB , , c : 0, .
0x. , c ,
; ,
10. set radix
, .
set input-radix
.
8, 10 16. ,
; ,
set radix 012
set radix 10.
set radix 0xa
. , set radix 10 ,
.
set output-radix
.
8, 10 16. ,
.

154

GDB

show input-radix
.
show output-radix
.

15.6
, GDB . , set verbose.
GDB , ,
, .
, set verbose ; 12.1 [ ], . 105, symbol-file.
set verbose on
GDB p .
set verbose off
GDB p .
show verbose
, set verbose on off.
, GDB
, ; ,
(. 12.2 [ ], . 108).
set complaints
GDB , p .
, , .
show complaints
GDB .
GDB , , ,
, . , , :
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n)
, :
set confirm off
.
set confirm on
( ).
show confirm
, .

15: GDB

155

15.7
set debug arch
gdbarch.
.
show debug arch
gdbarch.
set debug event
GDB.
.
show debug event

GDB.
set debug expression
GDB.
.
show debug expression

GDB.
set debug overload
GDB
++. , , . .
show debug overload
GDB ++.
set debug remote
, .
GDB. .
show debug remote
.
set debug serial
GDB . .
show debug serial
GDB .
set debug target
GDB . , GDB.
.
show debug target
GDB .
set debug varobj
GDB . .

156

GDB

show debug varobj


GDB .

16:

157

16
(. 5.1.7 [ ], . 41),
GDB
: .

16.1 ,
, GDB,
, . define. 10 , . , $arg0. . . $arg9.
:
define adder
print $arg0 + $arg1 + $arg2
:
adder 1 2 3
adder, .
, ,
,
.
define -
-.
, .
GDB, define. p, end.
if

. , ,
( ). p else, ,
. p, end.

while

if: , , p,
end. ,
.

document -
-, ,
help. -
. p
, define p , end.
document,
help -.
document , . define .
help user-defined
, ( ).

158

GDB

show user
show user -
GDB, - (
). - ,
.
, , .
.
, , , , . GDB,
, , .

16.2 -
,
. , foo, hook-foo ( ), .
, stop. (hook-stop) : , .
, SIGALRM
, , :
define hook-stop
handle SIGALRM nopass
end
define hook-run
handle SIGALRM pass
end
define hook-continue
handle SIGLARM pass
end
GDB, ; , ,
backtrace, bt. , GDB , ( ,
).
,
, define.

16.3
GDB , GDB.
(, #).
; ,
.

16:

159

GDB, . , .gdbinit Unix gdb.ini DOS/Windows.


, GDB :
1. ( ) 1 .
2. .
3. ( ) .
4. , -x.

( set complaints), . ,
-nx . 2.1.2 [ ], . 11.
GDB,
( , GDB , ). :
VxWorks ( Wind River Systems): .vxgdbinit
OS68K ( Enea Data Systems): .os68gdbinit
ES-1800 ( Ericsson Telecom AB M68000): .esgdbinit
source:
source -
-.
, .
.
, ,
. GDB,
, .

16.4
, GDB ; , . ,
, .
echo
. , \n
. , .
, , , .
, .
and foo = , echo \ and foo = \ .
, ,
. ,
1

DOS/Windows, ,
HOME.

160

GDB

echo ,\n\
\n\
.\n

echo ,\n
echo \n
echo .\n
output
: ,
$nn = . . . 8.1 [], . 61, .
output/
.
, print. . 8.4 [ ], . 64,
.
printf , ...
, . , .
, , ,

printf (, ...);
, :
printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
, , , .

17: GDB gnu Emacs

161

17 GDB gnu
Emacs
gnu Emacs ( ) , GDB.
, M-x gdb Emacs. , .
GDB Emacs .
Emacs, GDB , ,
:
Emacs.
GDB , , .
,
; .
Emacs . , , C-c C-c
, C-c C-z .
GDB Emacs.
, GDB , Emacs (=>) . Emacs
, ,
GDB, .
, GDB list search ,
Emacs.
: , , , Emacs ;
. GDB ,
PATH, ; Emacs
GDB,
. , GDB
, ,
, M-x gdb.
, GDB file,
, - , GDB Emacs.
, M-x gdb gdb.
GDB (, ), Emacs gdb-command-name; ,

(setq gdb-command-name "mygdb")


( M-: ESC :, *scratch*
.emacs), Emacs mygdb.
- GDB,
Emacs :
C-h m

GDB Emacs.

M-s

, GDB step;

.

162

GDB

M-n

, , GDB next.
, .

M-i

, GDB stepi;
.

M-x gdb-nexti
, GDB nexti; .
C-c C-f

, GDB
finish.

M-c

, GDB continue.
: Emacs 19, C-c
C-p.

M-u

, ,
GDB up (.
gnu Emacs).
: Emacs 19, C-c
C-u.

M-d

, ,
GDB down.
: Emacs 19, C-c
C-d.

C-x &

GDB. , ,
, disassemble;
disassemble, C-x &.
, gdb-printcommand; , -
, C-x &, .
C-x & , ,
.
, Emacs format; ,
.

, Emacs C-x SPC (gdb-break) GDB


, .
, , f GDB, ;
Emacs,
, .
, Emacs, Emacs, .
; , GDB Emacs
. , GDB
.

18: GDB

163

18 GDB
GDB.
GDB , GDB .

18.1 ?
, GDB --annotate=2.
, control-z
. , , .
, ,
. .
, control-z, GDB. GDB control-z
, , , .
GDB :
$ gdb -annotate=2
GNU GDB 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty"
for details.
This GDB was configured as "sparc-sun-sunos4.1.3"
^Z^Zpre-prompt
(gdb)
^Z^Zprompt
quit
^Z^Zpost-prompt
$
quit GDB ; GDB. , ^Z^Z ( ^Z control-z), ;
GDB.

18.2 server
GDB, ,
, server . ,
, GDB ,
, hRETi.
server ;
, , output print.

164

GDB

18.3
, GDB , .
print , :
^Z^Zvalue-history-begin -- -
-
^Z^Zvalue-history-value

^Z^Zvalue-history-end
--, , -
, $5 = , ,
, , -* ,
, -, .
(
, output),
:
^Z^Zvalue-begin -

^Z^Zvalue-end
GDB (, backtrace),
:
^Z^Zarg-begin
-
^Z^Zarg-name-end
-
^Z^Zarg-value -

^Z^Zarg-end
- , - ( =), , -
, value-history-begin.
, GDB :
^Z^Zfield-begin -
-
^Z^Zfield-name-end
-
^Z^Zfield-value

^Z^Zfield-end
- , - ( =), , -
, value-history-begin.
, GDB :
^Z^Zarray-section-begin -- -
-- , - , value-history-begin. .

18: GDB

^Z^Zelt

165

,
;

^Z^Zelt-rep -
-
^Z^Zelt-rep-end
, , , . ,
- , , - ,
, .
, ,
:
^Z^Zarray-section-end

18.4
GDB , . ,
, GDB, ,
backtrace up, .

^Z^Zframe-begin
-
(0 , ), , ,
-, . 0x,
(, ). :
^Z^Zframe-end
,

^Z^Zfunction-call
--
-- ,
, , GDB .

^Z^Zsignal-handler-caller
---
---,
, , ( , , ).

166

GDB

.
, ( , , ),
^Z^Zframe-address

^Z^Zframe-address-end
-
, ( , frame-begin, ,
, ), - , ,
.

^Z^Zframe-function-name
-
^Z^Zframe-args

- , , ??,
, , (
, . 18.3 [ ], . 164).
, :
^Z^Zframe-source-begin
--
^Z^Zframe-source-file
-
^Z^Zframe-source-file-end
:
^Z^Zframe-source-line
-
^Z^Zframe-source-end
-- , , - , -
( 1).
GDB , (
, , ;
RS/6000), :
^Z^Zframe-where

,
(, backtrace), source (. 18.11 [ ], . 170).
, , , .

18.5
GDB - display, :

18: GDB

167

^Z^Zdisplay-begin

^Z^Zdisplay-number-end
-
^Z^Zdisplay-format

^Z^Zdisplay-expression

^Z^Zdisplay-expression-end
-
^Z^Zdisplay-value

^Z^Zdisplay-end
, - , ,
, , , ,
, - ,
, .

18.6 GDB
GDB , ,
, ,
, .
.
: pre-, , , ,
post-, , (
) . , prompt
:
^Z^Zpre-prompt
^Z^Zprompt
^Z^Zpost-prompt
:
prompt

GDB ( GDB).

commands

GDB , commands.
.

overload-choice
GDB , .
query

GDB , .

prompt-for-continue
GDB . : , ;
set height 0 . ,
.

168

GDB

18.7
^Z^Zquit
, GDB .
^Z^Zerror
, GDB .
, , GDB, . , valuehistory-begin error, value-history-end.
, , ; , GDB .

^Z^Zerror-begin

.
.

18.8
, info breakpoints, :
^Z^Zbreakpoints-headers
-
^Z^Zbreakpoints-table
- , ( ), , ,
. . , . .
:
^Z^Zrecord
^Z^Zfield 0

^Z^Zfield 1

^Z^Zfield 2

^Z^Zfield 3

^Z^Zfield 4

^Z^Zfield 5

^Z^Zfield 6

^Z^Zfield 7

^Z^Zfield 8
-
^Z^Zfield 9

18: GDB

169

, .
:
^Z^Zbreakpoints-table-end

18.9
, , , .
^Z^Zframes-invalid
(, backtrace) .
^Z^Zbreakpoints-invalid
. , .

18.10
GDB, step
continue,
^Z^Zstarting
,
^Z^Zstopped
stopped, , .
^Z^Zexited -
, - ( , ).
^Z^Zsignalled
. ^Z^Zsignalled, :
-
^Z^Zsignal-name

^Z^Zsignal-name-end
--
^Z^Zsignal-string

^Z^Zsignal-string-end
-
, SIGILL SIGSEGV, , Illegal Instruction
Segmentation fault. -, --
.

170

GDB

^Z^Zsignal
, signalled, GDB ,
, , -
.
^Z^Zbreakpoint
.
^Z^Zwatchpoint
.

18.11
:
^Z^Zsource -:::middle:
- , ( 1), (
0) ( ), middle middle,
, beg, , , .
0x,
(, ).

18.12 ,
- target-invalid
(,
). ,
register-invalid all-register-invalid

- set/show (
).
- , info
.

19: gdb/mi

171

19 gdb/mi

gdb/mi , -
GDB. , .
gdb/mi. .
, gdb/mi ,
.


:
| .
[ ] , : ,
.
( )* , .
( )+ , .
"" .


: , , .

19.1 gdb/mi
19.1.1 gdb/mi
7
-cli | -mi
7
-cli
[ ] -cli nl, -cli
GDB CLI.
7
-mi
[ ] "-" ( " " )* [ " --" ] ( " " )* nl
7
" "
7

"-" [ " " ]

7
- | -
7
,

172

GDB

- 7
, , "-", nl, """ ,
, " "
- 7
""" ---iso- """
nl 7

CR | CR-LF

:
CLI mi; .
, , , .
mi . -,
.
- ( , ).
:
CLI ( ).
, mi .

19.1.2 gdb/mi
gdb/mi ,
. .
(gdb).
,
.
7

( - )* [ - ] "(gdb)" nl

- 7
[ ] "^" - ( "," )* nl
- 7
- | -
- 7
-- | -- | --
-- 7
[ ] "*" -
-- 7
[ ] "+" -
-- 7
[ ] "=" -
- 7
- ( "," )* nl
- 7
"done" | "running" | "connected" | "error" | "exit"
- 7
"stopped" | (
).

19: gdb/mi

173

7
[ "=" ]
7
| "{" ( "," )* "}"
7
-
- 7
-- | -- | --
-- 7
"~" -
-- 7
"@" -
-- 7
"&" -
nl 7

CR | CR-LF

7
.
, :

:
, .
. -exec-interrupt, , *stopped,
, .
--
. .
+.
-- (, , ). *.
-- , (, ). =.
-- , . CLI.
~.
-- , . @.
-- , GDB, , ,
. &.
. 19.3.2 [ gdb/mi], . 175,
.
. 19.15 [ gdb/mi], . 222,
.

174

GDB

19.1.3 gdb/mi
gdb/mi. , -> ,
gdb/mi , <- , gdb/mi.


:
-> -stop
<- (gdb)
:
<- *stop,reason="stop",address="0x123",source="a.c:123"
<- (gdb)

CLI
CLI, gdb/mi.
-> print 1+2
<- ~3\n
<- (gdb)


-> -symbol-file xyz.exe
<- *breakpoint,nr="3",address="0x123",source="a.c:123"
<- (gdb)


, :
-> -rubbish
<- error,"Rubbish not found"
<- (gdb)

19.2 gdb/mi CLI


, GDB CLI,
gdb/mi CLI. , gdb/mi, GDB .
gdb/mi,
CLI. , gdb/mi,
gdb/mi CLI.

19.3 gdb/mi

19: gdb/mi

175

19.3.1 gdb/mi
, gdb/mi :
"^done" [ "," ]
,
.
"^running"
. .
"^error" "," -
. - .

19.3.2 gdb/mi
GDB : , . , , gdb/mi
.
, (. 19.1.2 [ gdb/mi], . 172).
, -. (
), - (
).
"~" -
,
CLI. CLI.
"@" -
.
"&" -
,
GDB.

19.3.3 gdb/mi
gdb/mi
. gdb/mi (,
), (, ).
.
"*" "stop"

19.4 gdb/mi
. .
, .
. ,
(..) .

176

GDB

, :


-command ...

GDB
CLI GDB.

19.5 gdb/mi
gdb/mi .

-break-after

-break-after
,
. , -break-list,
-break-list.

GDB
GDB ignore.

19: gdb/mi

177

(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x000100d0",file="hello.c",line="5"}
(gdb)
-break-after 1 3
~
^done
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
ignore="3"}}
(gdb)

-break-condition

-break-condition
, .
-break-list (
-break-list).

GDB
GDB condition.

(gdb)
-break-condition 1 1
^done
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
times="0",ignore="3"}}
(gdb)

-break-delete

-break-delete ( - )+
, . , ,
.

178

GDB

GDB
GDB delete.

(gdb)
-break-delete 1
^done
(gdb)
-break-list
^done,BreakpointTable={}
(gdb)

-break-disable

-break-disable ( - )+
-. - enabled
n.

GDB
GDB disable.

(gdb)
-break-disable 2
^done
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="2",type="breakpoint",disp="keep",enabled="n",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}}
(gdb)

-break-enable

-break-enable ( - )+
( ) -.

GDB
GDB enable.

19: gdb/mi

179

(gdb)
-break-enable 2
^done
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}}
(gdb)

-break-info

-break-info -
.

GDB
GDB info break -.

..

-break-insert

-break-insert [ -t ] [ -h ] [ -r ]
[ -c ] [ -i - ]
[ -p ] [ | ]
, , :

-:-
-:
*
:
-t

-h

-c
.
-i -
-.
-r

,
.
.

180

GDB

:
^done,bkptno="",func="-",
file="-",line="-"
GDB, - ,
, - ,
, -
.
: .

GDB
GDB break, tbreak, hbreak, thbreak
rbreak.

(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
(gdb)
-break-insert -t foo
^done,bkpt={number="2",addr="0x00010774",file="recursive2.c",line="11"}
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"},
bkpt={number="2",type="breakpoint",disp="del",enabled="y",
addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"}}
(gdb)
-break-insert -r foo.*
~int foo(int, int);
^done,bkpt={number="3",addr="0x00010774",file="recursive2.c",line="11"}
(gdb)

-break-list

-break-list
, :
Number

Type

: breakpoint watchpoint

Disposition
:
keep nokeep
Enabled

: y n

19: gdb/mi

181

Address

What

, ,
,

Times

, BreakpointTable .

GDB
GDB info break.

(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"},
bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x00010114",func="foo",file="hello.c",line="13",times="0"}}
(gdb)
, :
(gdb)
-break-list
^done,BreakpointTable={}
(gdb)

-break-watch

-break-watch [ -a | -r ]
. -a , , ,
. -r ,
.
, ,
. . 5.1.2 [
], . 35.
, -break-list
.

GDB
GDB watch, awatch rwatch.

182

GDB

main:
(gdb)
-break-watch x
^done,wpt={number="2",exp="x"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt={number="2",exp="x"},
value={old="-268439212",new="55"},
frame={func="main",args={},file="recursive2.c",line="5"}
(gdb)
. GDB : ,
.
(gdb)
-break-watch C
^done,wpt={number="5",exp="C"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",
wpt={number="5",exp="C"},value={old="-276895068",new="3"},
frame={func="callee4",args={},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame={func="callee3",args={{name="strarg",
value="0x11940 \"A string argument.\""}},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)
, . , , .
(gdb)
-break-watch C
^done,wpt={number="2",exp="C"}
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
bkpt={number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="0"}}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt={number="2",exp="C"},

19: gdb/mi

183

value={old="-276895068",new="3"},
frame={func="callee4",args={},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
bkpt={number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="-5"}}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="2",
frame={func="callee3",args={{name="strarg",
value="0x11940 \"A string argument.\""}},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)
-break-list
^done,BreakpointTable={hdr={"Num","Type","Disp","Enb","Address","What"},
bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"}}
(gdb)

19.6 gdb/mi
gdb/mi : , , .

-data-disassemble

-data-disassemble
[ -s - -e - ]
| [ -f - -l - [ -n ] ]
-
:
-

( $pc)

-

-
,

, . -1 - , .

184

GDB

- , , - -, .
, - -,
-.

0 ( ), 1 (
).

:

-


, , ,
gdb/mi, .

GDB
CLI .

$pc $pc + 20:


(gdb)
-data-disassemble -s $pc -e "$pc + 20" - 0
^done,
asm_insns={
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"},
{address="0x000107c8",func-name="main",offset="12",
inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"},
{address="0x000107cc",func-name="main",offset="16",
inst="sethi %hi(0x11800), %o2"},
{address="0x000107d0",func-name="main",offset="20",
inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"}}
(gdb)
main. 32 main.
-data-disassemble -f basics.c -l 32 - 0
^done,asm_insns={
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"},
{address="0x000107c0",func-name="main",offset="4",
inst="mov
2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"},
[...]
{address="0x0001081c",func-name="main",offset="96",inst="ret "},

19: gdb/mi

185

{address="0x00010820",func-name="main",offset="100",inst="restore "}}
(gdb)
3 main:
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 - 0
^done,asm_insns={
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"},
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}}
(gdb)
3 main :
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 - 1
^done,asm_insns={
src_and_asm_line={line="31",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn={
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"}}},
src_and_asm_line={line="32",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn={
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}}}}
(gdb)

-data-evaluate-expression

-data-evaluate-expression
. . . ,
.

GDB
GDB print, output call. gdbtk
gdb_eval.

, , . , . 19.1 [ gdb/mi], . 171. ,


gdb/mi .

186

GDB

211-data-evaluate-expression
211^done,value="1"
(gdb)
311-data-evaluate-expression
311^done,value="0xefffeb7c"
(gdb)
411-data-evaluate-expression
411^done,value="4"
(gdb)
511-data-evaluate-expression
511^done,value="4"
(gdb)

&A

A+3

"A + 3"

-data-list-changed-registers

-data-list-changed-registers
, .

GDB
GDB ; gdbtk gdb_changed_register_list.

PPC MBX:
(gdb)
-exec-continue
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",frame={func="main",
args={},file="try.c",line="5"}
(gdb)
-data-list-changed-registers
^done,changed-registers={"0","1","2","4","5","6","7","8","9",
"10","11","13","14","15","16","17","18","19","20","21","22","23",
"24","25","26","27","28","30","31","64","65","66","67","69"}
(gdb)

-data-list-register-names

-data-list-register-names [ ( - )+ ]
. , . ,
, .

19: gdb/mi

187

GDB
GDB , -data-list-register-names. gdbtk
gdb_regnames.

PPC MBX:
(gdb)
-data-list-register-names
^done,register-names={"r0","r1","r2","r3","r4","r5","r6","r7",
"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
"pc","ps","cr","lr","ctr","xer"}
(gdb)
-data-list-register-names 1 2 3
^done,register-names={"r1","r2","r3"}
(gdb)

-data-list-register-values

-data-list-register-values [ ( - )*]
. ,
, , , .
, .
:
x

GDB
GDB info reg, info all-reg ( gdbtk)
gdb_fetch_registers.

188

GDB

PPC MBX ( : ,
):
(gdb)
-data-list-register-values r 64 65
^done,register-values={{number="64",value="0xfe00a300"},
{number="65",value="0x00029002"}}
(gdb)
-data-list-register-values x
^done,register-values={{number="0",value="0xfe0043c8"},
{number="1",value="0x3fff88"},{number="2",value="0xfffffffe"},
{number="3",value="0x0"},{number="4",value="0xa"},
{number="5",value="0x3fff68"},{number="6",value="0x3fff58"},
{number="7",value="0xfe011e98"},{number="8",value="0x2"},
{number="9",value="0xfa202820"},{number="10",value="0xfa202808"},
{number="11",value="0x1"},{number="12",value="0x0"},
{number="13",value="0x4544"},{number="14",value="0xffdfffff"},
{number="15",value="0xffffffff"},{number="16",value="0xfffffeff"},
{number="17",value="0xefffffed"},{number="18",value="0xfffffffe"},
{number="19",value="0xffffffff"},{number="20",value="0xffffffff"},
{number="21",value="0xffffffff"},{number="22",value="0xfffffff7"},
{number="23",value="0xffffffff"},{number="24",value="0xffffffff"},
{number="25",value="0xffffffff"},{number="26",value="0xfffffffb"},
{number="27",value="0xffffffff"},{number="28",value="0xf7bfffff"},
{number="29",value="0x0"},{number="30",value="0xfe010000"},
{number="31",value="0x0"},{number="32",value="0x0"},
{number="33",value="0x0"},{number="34",value="0x0"},
{number="35",value="0x0"},{number="36",value="0x0"},
{number="37",value="0x0"},{number="38",value="0x0"},
{number="39",value="0x0"},{number="40",value="0x0"},
{number="41",value="0x0"},{number="42",value="0x0"},
{number="43",value="0x0"},{number="44",value="0x0"},
{number="45",value="0x0"},{number="46",value="0x0"},
{number="47",value="0x0"},{number="48",value="0x0"},
{number="49",value="0x0"},{number="50",value="0x0"},
{number="51",value="0x0"},{number="52",value="0x0"},
{number="53",value="0x0"},{number="54",value="0x0"},
{number="55",value="0x0"},{number="56",value="0x0"},
{number="57",value="0x0"},{number="58",value="0x0"},
{number="59",value="0x0"},{number="60",value="0x0"},
{number="61",value="0x0"},{number="62",value="0x0"},
{number="63",value="0x0"},{number="64",value="0xfe00a300"},
{number="65",value="0x29002"},{number="66",value="0x202f04b5"},
{number="67",value="0xfe0043b0"},{number="68",value="0xfe00b3e4"},
{number="69",value="0x20002b03"}}
(gdb)

-data-read-memory

19: gdb/mi

189


-data-read-memory [ -o ]
- -
- - [ as ]
:

, , . , , .

-
, . , GDB print (. 8.4 [ ],
. 64).
-
.
-
.
-
.
as

, ascii-.
as ,
ascii ( ascii
, 32 126 ).

, ,
.
-
- , - . - * - * - (
total-bytes). , N/A. , ,
nr-bytes, , ,
addr.
/ next-row
prev-row, next-page prev-page.

GDB
GDB x. gdbtk
gdb_get_mem.

, bytes+6, -6 . . .
.
(gdb)
9-data-read-memory -o -6 - bytes+6 x 1 3 2
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",

190

GDB

next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
prev-page="0x0000138a",memory={
{addr="0x00001390",data={"0x00","0x01"}},
{addr="0x00001392",data={"0x02","0x03"}},
{addr="0x00001394",data={"0x04","0x05"}}}
(gdb)
, shorts + 64
.
(gdb)
5-data-read-memory shorts+64 d 2 1 1
5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
next-row="0x00001512",prev-row="0x0000150e",
next-page="0x00001512",prev-page="0x0000150e",memory={
{addr="0x00001510",data={"128"}}}
(gdb)
, bytes+16, . , x
.
(gdb)
4-data-read-memory bytes+16 x 1 8 4 x
4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
next-row="0x000013c0",prev-row="0x0000139c",
next-page="0x000013c0",prev-page="0x00001380",memory={
{addr="0x000013a0",data={"0x10","0x11","0x12","0x13"},ascii="xxxx"},
{addr="0x000013a4",data={"0x14","0x15","0x16","0x17"},ascii="xxxx"},
{addr="0x000013a8",data={"0x18","0x19","0x1a","0x1b"},ascii="xxxx"},
{addr="0x000013ac",data={"0x1c","0x1d","0x1e","0x1f"},ascii="xxxx"},
{addr="0x000013b0",data={"0x20","0x21","0x22","0x23"},ascii=" !\"#"},
{addr="0x000013b4",data={"0x24","0x25","0x26","0x27"},ascii="$%&"},
{addr="0x000013b8",data={"0x28","0x29","0x2a","0x2b"},ascii="()*+"},
{addr="0x000013bc",data={"0x2c","0x2d","0x2e","0x2f"},ascii=",-./"}}
(gdb)

-display-delete

-display-delete
, .

GDB
GDB delete display.

..

-display-disable

19: gdb/mi

191


-display-disable
, .

GDB
GDB disable display.

..

-display-enable

-display-enable
, .

GDB
GDB enable display.

..

-display-insert

-display-insert
, .

GDB
GDB display.

..

-display-list

-display-list
, .
.

192

GDB

GDB
GDB info display.

..

-environment-cd

-environment-cd
GDB.

GDB
GDB cd.

(gdb)
-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
(gdb)

-environment-directory

-environment-directory
.

GDB
GDB dir.

(gdb)
-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
(gdb)

-environment-path

-environment-path ( )+
.

19: gdb/mi

193

GDB
GDB path.

(gdb)
-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
^done
(gdb)

-environment-pwd

-environment-pwd
.

GDB
GDB pwd.

(gdb)
-environment-pwd
~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
^done
(gdb)

19.7 gdb/mi

, ,
. ,
.

:
(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited-normally"
(gdb)
:

194

GDB

(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited",exit-code="01"
(gdb)
, , ,
SIGINT. , gdb/mi :
(gdb)
*stopped,reason="exited-signalled",signal-name="SIGINT",
signal-meaning="Interrupt"

-exec-abort

-exec-abort
.

GDB
GDB kill.

..

-exec-arguments

-exec-arguments
,
-exec-run.

GDB
GDB set args.

-exec-continue

-exec-continue
. ,
, .

19: gdb/mi

195

GDB
GDB continue.

-exec-continue
^running
(gdb)
@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame={func="foo",args={},
file="hello.c",line="13"}
(gdb)

-exec-finish

-exec-finish
. ,
. , .

GDB
GDB finish.

, void.
-exec-finish
^running
(gdb)
@hello from foo
*stopped,reason="function-finished",frame={func="main",args={},
file="hello.c",line="7"}
(gdb)
, - void. GDB, , .
-exec-finish
^running
(gdb)
*stopped,reason="function-finished",frame={addr="0x000107b0",func="foo",
args={{name="a",value="1"},{name="b",value="9"}},
file="recursive2.c",line="14"},
gdb-result-var="$1",return-value="0"
(gdb)

-exec-interrupt

196

GDB


-exec-interrupt
. . , ,
, , .
^done. , .

GDB
GDB interrupt.

(gdb)
111-exec-continue
111^running
(gdb)
222-exec-interrupt
222^done
(gdb)
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
frame={addr="0x00010140",func="foo",args={},file="try.c",line="13"}
(gdb)
(gdb)
-exec-interrupt
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
(gdb)

-exec-next

-exec-next
. , , .

GDB
GDB next.

-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",line="8",file="hello.c"
(gdb)

19: gdb/mi

197

-exec-next-instruction

-exec-next-instruction
. . , . ,
.

GDB
GDB nexti.

(gdb)
-exec-next-instruction
^running
(gdb)
*stopped,reason="end-stepping-range",
addr="0x000100d4",line="5",file="hello.c"
(gdb)

-exec-return

-exec-return
. .
.

GDB
GDB return.

(gdb)
200-break-insert callee4
200^done,bkpt={number="1",addr="0x00010734",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="callee4",args={},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)

198

GDB

205-break-delete
205^done
(gdb)
111-exec-return
111^done,frame={level="0 ",func="callee3",
args={{name="strarg",
value="0x11940 \"A string argument.\""}},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)

-exec-run

-exec-run
. .
, ,
.

GDB
GDB run.

(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
(gdb)
-exec-run
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="main",args={},file="recursive2.c",line="4"}
(gdb)

-exec-show-arguments

-exec-show-arguments
.

GDB
GDB show args.

..

19: gdb/mi

199

-exec-step

-exec-step
. , , , ,
. , .

GDB
GDB step.

:
-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args={{name="a",value="10"},
{name="b",value="0"}},file="recursive2.c",line="11"}
(gdb)
:
-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
(gdb)

-exec-step-instruction

-exec-step-instruction
. ,
. , GDB , , . ,
, , .

GDB
GDB stepi.

(gdb)
-exec-step-instruction
^running

200

GDB

(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args={},file="try.c",line="10"}
(gdb)
-exec-step-instruction
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={addr="0x000100f4",func="foo",args={},file="try.c",line="10"}
(gdb)

-exec-until

-exec-until [ ]
. ,
. ,
, ,
. , location-reached.

GDB
GDB until.

(gdb)
-exec-until recursive2.c:6
^running
(gdb)
x = 55
*stopped,reason="location-reached",frame={func="main",args={},
file="recursive2.c",line="6"}
(gdb)

-file-exec-and-symbols

-file-exec-and-symbols
. ,
. ,
.
, GDB . ,
, .

GDB
GDB file.

19: gdb/mi

201

(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

-file-exec-file

-file-exec-file
. -file-exec-and-symbols,
. ,
GDB . ,
.

GDB
GDB exec-file.

(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

-file-list-exec-sections

-file-list-exec-sections
.

GDB
GDB info file , , ,
. gdbtk gdb_load_info.

..

-file-list-exec-source-files

-file-list-exec-source-files
.

202

GDB

GDB
GDB , . gdbtk
gdb_listfiles.

..

-file-list-shared-libraries

-file-list-shared-libraries
.

GDB
GDB info shared.

..

-file-list-symbol-files

-file-list-symbol-files
.

GDB
GDB info file ( ).

..

-file-symbol-file

-file-symbol-file
.
, GDB.
, .

GDB
GDB symbol-file.

19: gdb/mi

(gdb)
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

19.8 GDB gdb/mi


-gdb-exit

-gdb-exit
GDB.

GDB
quit.

(gdb)
-gdb-exit

-gdb-set

-gdb-set
GDB.

GDB
GDB set.

(gdb)
-gdb-set $foo=3
^done
(gdb)

-gdb-show

-gdb-show
GDB.

203

204

GDB

GDB
GDB show.

(gdb)
-gdb-show annotate
^done,value="0"
(gdb)

-gdb-version

-gdb-version
GDB. .

GDB
GDB . , GDB ,
.

(gdb)
-gdb-version
~GNU gdb 5.2.1
~Copyright 2000 Free Software Foundation, Inc.
~GDB is free software, covered by the GNU General Public License, and
~you are welcome to change it and/or distribute copies of it under
~ certain conditions.
~Type "show copying" to see the conditions.
~There is absolutely no warranty for GDB. Type "show warranty" for
~ details.
~This GDB was configured as
"-host=sparc-sun-solaris2.5.1 -target=ppc-eabi".
^done
(gdb)

19.9 gdb/mi
-stack-info-frame

-stack-info-frame
.

19: gdb/mi

205

GDB
GDB info frame frame ( ).

..

-stack-info-depth

-stack-info-depth [ - ]
. -,
- .

GDB
GDB .

0 11:
(gdb)
-stack-info-depth
^done,depth="12"
(gdb)
-stack-info-depth 4
^done,depth="4"
(gdb)
-stack-info-depth 12
^done,depth="12"
(gdb)
-stack-info-depth 11
^done,depth="11"
(gdb)
-stack-info-depth 13
^done,depth="12"
(gdb)

-stack-list-arguments

-stack-list-arguments -
[ - - ]
- - ().
- - , .
- 0 1. 0 , , 1, , .

206

GDB

GDB
GDB . gdbtk gdb_get_args,
-stack-list-arguments.

(gdb)
-stack-list-frames
^done,
stack={
frame={level="0 ",addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"},
frame={level="1 ",addr="0x0001076c",func="callee3",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"},
frame={level="2 ",addr="0x0001078c",func="callee2",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"},
frame={level="3 ",addr="0x000107b4",func="callee1",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"},
frame={level="4 ",addr="0x000107e0",func="main",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"}}
(gdb)
-stack-list-arguments 0
^done,
stack-args={
frame={level="0",args={}},
frame={level="1",args={name="strarg"}},
frame={level="2",args={name="intarg",name="strarg"}},
frame={level="3",args={name="intarg",name="strarg",name="fltarg"}},
frame={level="4",args={}}}
(gdb)
-stack-list-arguments 1
^done,
stack-args={
frame={level="0",args={}},
frame={level="1",
args={{name="strarg",value="0x11940 \" .\""}}},
frame={level="2",args={
{name="intarg",value="2"},
{name="strarg",value="0x11940 \" .\""}}},
{frame={level="3",args={
{name="intarg",value="2"},
{name="strarg",value="0x11940 \" .\""},
{name="fltarg",value="3.5"}}},
frame={level="4",args={}}}
(gdb)
-stack-list-arguments 0 2 2
^done,stack-args={frame={level="2",args={name="intarg",name="strarg"}}}
(gdb)
-stack-list-arguments 1 2 2
^done,stack-args={frame={level="2",
args={{name="intarg",value="2"},

19: gdb/mi

207

{name="strarg",value="0x11940 \" .\""}}}}


(gdb)

-stack-list-frames

-stack-list-frames [ - - ]
, . , :
level

, 0 , .

addr

$pc .

func

file

, .

line

, $pc.

,
. ,
(). ,
.

GDB
GDB backtrace where.

:
(gdb)
-stack-list-frames
^done,stack=
{frame={level="0 ",addr="0x0001076c",func="foo",
file="recursive2.c",line="11"},
frame={level="1 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="2 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="3 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="4 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="5 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="6 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="7 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="8 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},

208

GDB

frame={level="9 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="10",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="11",addr="0x00010738",func="main",
file="recursive2.c",line="4"}}
(gdb)
- -:
(gdb)
-stack-list-frames 3 5
^done,stack=
{frame={level="3 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="4 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="5 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"}}
(gdb)
:
(gdb)
-stack-list-frames 3 3
^done,stack=
{frame={level="3 ",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"}}
(gdb)

-stack-list-locals

-stack-list-locals -
. 0
, 1 .

GDB
info locals GDB, gdb_get_locals gdbtk.

(gdb)
-stack-list-locals 0
^done,locals={name="A",name="B",name="C"}
(gdb)
-stack-list-locals 1
^done,locals={{name="A",value="1"},{name="B",value="2"},
{name="C",value="3"}}
(gdb)

-stack-select-frame

19: gdb/mi

209


-stack-select-frame -
. - .

GDB
GDB frame, up, down, select-frame,
up-silent down-silent.

(gdb)
-stack-select-frame 2
^done
(gdb)

19.10 gdb/mi
-symbol-info-address

-symbol-info-address
, .

GDB
GDB info address.

..

-symbol-info-file

-symbol-info-file
.

GDB
GDB . gdbtk gdb_find_file.

..

210

GDB

-symbol-info-function

-symbol-info-function
, .

GDB
gdb_get_function gdbtk.

..

-symbol-info-line

-symbol-info-line
.

GDB
GDB info line.
gdb_get_line gdb_get_file.

..

-symbol-info-symbol

-symbol-info-symbol
, .

GDB
GDB info symbol.

..

-symbol-list-functions

gdbtk

19: gdb/mi

211


-symbol-list-functions
, .

GDB
info functions GDB, gdb_listfunc gdb_search gdbtk.

..

-symbol-list-types

-symbol-list-types
.

GDB
info types GDB gdb_search gdbtk.

..

-symbol-list-variables

-symbol-list-variables
.

GDB
info variables GDB, gdb_search gdbtk.

..

-symbol-locate

-symbol-locate

212

GDB

GDB
gdb_loc gdbtk.

..

-symbol-type

-symbol-type
.

GDB

gdb_obj_variable.

GDB

ptype,

gdbtk

..

19.11 gdb/mi
-target-attach

-target-attach - |
- GDB.

GDB
GDB attach.

..

-target-compare-sections

-target-compare-sections [ ]
. .

19: gdb/mi

213

GDB
GDB compare-sections.

..

-target-detach

-target-detach
. .

GDB
GDB detach.

(gdb)
-target-detach
^done
(gdb)

-target-download

-target-download
. , :
section

section-sent
.
section-size
.
total-sent
( ).
total-size
, .
(. 19.1.2 [
gdb/mi], . 172).
, , .
:
section

214

GDB

section-size
.
total-size
, .
.

GDB
GDB load.

: .
, .
(gdb)
-target-download
+download,{section=".text",section-size="6668",total-size="9880"}
+download,{section=".text",section-sent="512",section-size="6668",
total-sent="512",total-size="9880"}
+download,{section=".text",section-sent="1024",section-size="6668",
total-sent="1024",total-size="9880"}
+download,{section=".text",section-sent="1536",section-size="6668",
total-sent="1536",total-size="9880"}
+download,{section=".text",section-sent="2048",section-size="6668",
total-sent="2048",total-size="9880"}
+download,{section=".text",section-sent="2560",section-size="6668",
total-sent="2560",total-size="9880"}
+download,{section=".text",section-sent="3072",section-size="6668",
total-sent="3072",total-size="9880"}
+download,{section=".text",section-sent="3584",section-size="6668",
total-sent="3584",total-size="9880"}
+download,{section=".text",section-sent="4096",section-size="6668",
total-sent="4096",total-size="9880"}
+download,{section=".text",section-sent="4608",section-size="6668",
total-sent="4608",total-size="9880"}
+download,{section=".text",section-sent="5120",section-size="6668",
total-sent="5120",total-size="9880"}
+download,{section=".text",section-sent="5632",section-size="6668",
total-sent="5632",total-size="9880"}
+download,{section=".text",section-sent="6144",section-size="6668",
total-sent="6144",total-size="9880"}
+download,{section=".text",section-sent="6656",section-size="6668",
total-sent="6656",total-size="9880"}
+download,{section=".init",section-size="28",total-size="9880"}
+download,{section=".fini",section-size="28",total-size="9880"}
+download,{section=".data",section-size="3156",total-size="9880"}
+download,{section=".data",section-sent="512",section-size="3156",
total-sent="7236",total-size="9880"}
+download,{section=".data",section-sent="1024",section-size="3156",
total-sent="7748",total-size="9880"}
+download,{section=".data",section-sent="1536",section-size="3156",

19: gdb/mi

total-sent="8260",total-size="9880"}
+download,{section=".data",section-sent="2048",section-size="3156",
total-sent="8772",total-size="9880"}
+download,{section=".data",section-sent="2560",section-size="3156",
total-sent="9284",total-size="9880"}
+download,{section=".data",section-sent="3072",section-size="3156",
total-sent="9796",total-size="9880"}
^done,address="0x10004",load-size="9880",transfer-rate="6586",
write-rate="429"
(gdb)

-target-exec-status

-target-exec-status
(, ).

GDB
GDB .

..

-target-list-available-targets

-target-list-available-targets
, .

GDB
GDB help target.

..

-target-list-current-targets

-target-list-current-targets
.

GDB
( ) info file.

215

216

GDB

..

-target-list-parameters

-target-list-parameters

GDB
.

..

-target-select

-target-select . . .
GDB . :

, , async, remote, ..

, . . 13.2 [
], . 111, .
, , , :
^connected,addr="",func=" ",
args={ }

GDB
GDB target.

(gdb)
-target-select async /dev/ttya
^connected,addr="0xfe00a300",func="??",args={}
(gdb)

19: gdb/mi

217

19.12 gdb/mi
-thread-info

-thread-info

GDB
.

..

-thread-list-all-threads

-thread-list-all-threads

GDB
GDB info threads.

..

-thread-list-ids

-thread-list-ids
GDB .
.

GDB
info threads .

:
(gdb)
-thread-list-ids
^done,thread-ids={},number-of-threads="0"
(gdb)
:

218

GDB

(gdb)
-thread-list-ids
^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(gdb)

-thread-select

-thread-select -
- .
.

GDB
GDB thread.

(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="2",line="187",
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
(gdb)
-thread-list-ids
^done,
thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(gdb)
-thread-select 3
^done,new-thread-id="3",
frame={level="0 ",func="vprintf",
args={{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""},
{name="arg",value="0x2"}},file="vprintf.c",line="31"}
(gdb)

19.13 gdb/mi
.

19.14 gdb/mi
gdb/mi
( ,
, ..), ,
Insight.
:

19: gdb/mi

219

1. ( ).
2. ( , ).
Tcl,
, gdb/mi.
gdb/mi, ,
.
: , , gui , , :
-gdb-show output-radix
-stack-list-arguments
-stack-list-locals
-stack-select-frame

gdb/mi

, , .

.
, , , . , struct ,
. ,
.
, ++ Java.
, , .
: , , , . ,
(, int, ,
..).
gdb/mi, :

-var-create
-var-delete
-var-set-format
-var-show-format
-var-info-num-children
-var-list-children
-var-info-type
-var-info-expression
-var-show-attributes


,


,

?
?

-var-evaluateexpression
-var-assign

-var-update

.

220

GDB


-var-create

-var-create { | "-"}
{- | "*"}
. ,
, .
, .
. -, varNNNNNN. , ,
. , .
- , .
* , .
, (
*), :
*,
*- (TBD)
$-

, . , GDB CLI:
name="",numchild="N",type=""

-var-delete

-var-delete
.
, .

-var-set-format

-var-set-format -
- .
- :
- 7
{binary | decimal | hexadecimal | octal | natural}

-var-show-format

19: gdb/mi

221


-var-show-format
, .
7
-

-var-info-num-children

-var-info-num-children
:
numchild=n

-var-list-children

-var-list-children
:
numchild=n,children={{name=,
numchild=n,type=},( N )}

-var-info-type

-var-info-type
.
, GDB CLI:
type=-

-var-info-expression

-var-info-expression
, :
lang=-,exp=
- {"C" | "C++" | "Java"}.

-var-show-attributes

222

GDB


-var-show-attributes
:
status= [ ( , )* ]
{ { editable | noneditable } | TBD }.

-var-evaluate-expression

-var-evaluate-expression
, , :
value=

-var-assign

-var-assign
, .
editable.

-var-update

-var-update { | "*"}
, . *
.

19.15 gdb/mi
, gdb/mi,
:
{number="1",type="breakpoint",disp="keep",enabled="y"}
, :
{"1","2","4"}
{bp="1",bp="2",bp="4"}
, .
,
.
gdb/mi ,
, . gdb.

19: gdb/mi

223

gdb/mi .
, ,
.
7

{ - } [ - ] "(gdb)" nl

- 7
[ ] "^" - { "," } nl
- 7
- | -
- 7
-- | -- | --
-- 7
[ ] "*" -
-- 7
[ ] "+" -
-- 7
[ ] "=" -
- 7
- { "," } nl
- 7
"done" | "running" | "connected" | "error" | "exit"
- 7
"stopped" | , ..
7
"="
7
- | |
7

"{}" | "{" { "," } "}"

7 "[]" | "[" { "," } "]"


7 [-A-Za-z\.0-9 ]*
- 7

- 7
-- | -- | --
-- 7
"~" -
-- 7
"@" -
-- 7
"&" -
nl 7

CR | CR-LF

7
" "
, .

224

GDB

:
, .
. -exec-interrupt, , *stopped,
, .
-- . .
+.
-- (, , ). *.
-- , ( ).
=.
-- , . CLI.
~.
-- , . @.
-- , GDB, , , .
&.

20: GDB

225

20 GDB
GDB.
,
. ,
GDB .
GDB.
, ,
.

20.1 ?
, , :
, GDB,
. .
GDB . (, -, -
.)
GDB , .
, - ,
.
,
GDB .

20.2
gnu. GDB ,
.
etc/SERVICE gnu Emacs.
, GDB
:
bug-gdb@gnu.org
info-gdb, help-gdb, -
. GDB .
, , bug-gdb.
bug-gdb gnu.gdb.bug,
. . ,
. , , : .
, ,
. ,
.
, :

226

GDB

gnu Debugger Bugs


Free Software Foundation Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA
: . , , !
, , ,
, . , ,
, , .
, .
, , ; ,
, ,
. , , .
, .
, ,
. , , ,
, .
,
?. , , ,
.
,
:
GDB. GDB ;
, show version.
, .
, , .
( ) GDB. ,
gcc2.8.1.
( )
gcc2.8.1, HP92453-01 A.10.32.03 HP C Compiler.
gcc, gcc --version ;
, .
, ,
. , -O? ,
- , . Makefile (
make) .
,
.
, ,
.
, . ,
.
, GDB , , ,
. ,
, .
.

20: GDB

227

, . , - , ,
GDB ,
. ( !) , . , ,
, - . ,
.
GDB,
. -
, , .
.
.
, :
.
, , , , .
,
, .
- .
, , . ,
, .
, ;
, ,
.
.
, . , , , , .
,
.
, GDB, , .
, ,
, .
, ,
, .
.
, , .
. .

228

GDB

21:

229

21

gnu.

21.1
,
.
C-k Control-K ,
hki Control.
M-k Meta-K , hki
Meta ( ).
Meta hALTi. ,
hALTi ( ), hALTi Meta. hALTi
Meta, ,
Compose .
Meta hALTi, , Meta,
hESCi, hki. hki.
M-C-k Meta-Control-k ,
C-k.
, . , hDELi, hESCi, hLFDi,
hSPCi, hRETi hTABi (.
21.3 [ Readline], . 232). hLFDi, C-j . hRETi
hReturni hEnteri.

21.2 Readline

, , . Readline
, , .
, , ,
. , ,
hRETi. hRETi ;
.

21.2.1
, , .
, , .
, ,
.
, , . , C-b,
, . ,
C-f.

230

GDB

,
, . , , , , .
.
C-b

C-f

hDELi

C-d

hBackspacei
.
.


.
C-_ C-x C-u
. , .
( , hBackspacei , hDELi , C-d, ,
.)

21.2.2 Readline
, . ,
C-b, C-f, C-d hDELi .
, .
C-a

C-e

M-f

. .

M-b

C-l

, .

, C-f , M-f . , ontrol


, Meta .

21.2.3 Readline
,
, ( )
. (
.)
, ,
, ( )
.
,
.
, , .
; ,
, , .
.

21:

231

C-k

M-d

, ,
, . ,
M-f.

M-hDELi

, ,
, . ,
M-b.

C-w

.
M-hDELi, .

. .
C-y

M-y

,
. ,
C-y M-y.

21.2.4 Readline
Readline. , , .
, , . ,
, M- C-k.
Meta- . (-),
. - , , . ,
C-d 10, M-1 0 C-d.

21.2.5
Readline , . : .
, . , Readline
, , . ,
. ,
C-r. C-s . , isearch-terminators, . , hESCi C-J
. C-g
. , , , .
,
C-r C-s. ,
. ,
Readline, . ,
hRETi ,
.

232

GDB

, .
.

21.3 Readline
Readline , Emacs, .
, Readline, inputrc, .
INPUTRC. ,
~/.inputrc.
, Readline, .
, C-x C-r , , c , .

21.3.1 Readline
, Readline. . , #,
. , $, (. 21.3.2 [ ], . 235).
.

Readline , set .
Emacs, , vi:
set editing-mode vi

.
bell-style
, , Readline
. none, Readline
. visible, Readline , . audible
( ), Readline .
comment-begin
,
insert-comment. "#".
completion-ignore-case
on, Readline
. off.
completion-query-items
, , ,
. , Readline ,
; , .
100.

21:

233

convert-meta
on, Readline
ascii,
hESCi,
Meta. on.
disable-completion
on, Readline
. ,
self-insert. off.
editing-mode
editing-mode , . , Readline Emacs,
Emacs. emacs,
vi.
enable-keypad
on, Readline
, . .
off.
expand-tilde
on, ,
Readline . off.
horizontal-scroll-mode
on off. on ,
, ,
. , off.
input-meta
on, Readline
( ) , . off. meta-flag .
isearch-terminators
, (. 21.2.5 [ ], . 231). , hESCi
C-J.
keymap
Readline . keymap: emacs,
emacs-standard, emacs-meta, emacs-ctlx, vi, vi-command viinsert. vi vi-command; emacs emacsstandard. emacs.
editing-mode .
mark-directories
on, . on.

234

GDB

mark-modified-lines
, on, Readline (*) ,
. ,
off.
output-meta
on, Readline , Meta-. off.
print-completions-horizontally
on, Readline ,
,
. off.
show-all-if-ambiguous
.
on, , , .
off.
visible-stats
on, , , . off.

.
-, , . ,
, , , .
, , , ,
.
, , .
-: -
- , -.
:
Control-u: universal-argument
Meta-Rubout: backward-kill-word
Control-o: "> output"
, C-u universal-argument,
C-o ,
( , > output ).
"-": -
- - ,
, , . gnu Emacs, ,
.
"\C-u": universal-argument
"\C-x\C-r": re-read-init-file

21:

235

"\e[11~": "Function Key 1"


, C-u universal-argument
( ), C-x C-r re-read-init-file hESCi [ 1 1 ~
Function Key 1.
gnu Emacs
:
\C-

Control

\M-

Meta

\e

\\

\"

h"i,

hi,

gnu Emacs, :
\a

( )

\b

\d

\f

\n

\r

\t

\v

\nnn

, ASCII nnn (
)

\xnnn

, ASCII nnn
( )

, . ,
. ,
.
,
" . , C-x \ \
:
"\C-x\\": "\\"

21.3.2
Readline , , . , .
$if

$if
, , ,
Readline. ; .

236

GDB

mode

mode= $if
Readline: emacs vi. , , set keymap emacs-standard emacs-ctlx,
Readline emacs.

term

term= , - , . , =,
, ,
-. , , sun,
sun-cmd.

application
application ,
- . , Readline, application name,
. , . , , Bash:
$if Bash
# Quote the current or previous word
"\C-xq": "\eb\"\ef\""
$endif
$endif

, , $if.

$else

$if , .

$include


.
$include /etc/inputrc

21.3.3
inputrc. ,
.

21:

237

#
# , Gnu Readline.
# FTP, Bash, Gdb.
#
# inputrc C-x C-r.
# , #, .
#
# ,
# /etc/Inputrc
$include /etc/Inputrc
#
# emacs.
set editing-mode emacs
$if mode=emacs
Meta-Control-h:

backward-kill-word

#
#
#
#"\M-OD":
backward-char
#"\M-OC":
forward-char
#"\M-OA":
previous-history
#"\M-OB":
next-history
#
# ANSI
#
"\M-[D":
backward-char
"\M-[C":
forward-char
"\M-[A":
previous-history
"\M-[B":
next-history
#
#
#
#"\M-\C-OD":
backward-char
#"\M-\C-OC":
forward-char
#"\M-\C-OA":
previous-history
#"\M-\C-OB":
next-history
#
# ANSI
#
#"\M-\C-[D":
backward-char
#"\M-\C-[C":
forward-char
#"\M-\C-[A":
previous-history
#"\M-\C-[B":
next-history
C-q: quoted-insert

238

GDB

$endif
# .
TAB: complete

# ,
$if Bash
#
"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
# -
#
"\C-x\"": "\"\"\C-b"
# (testing backslash escapes in sequences
# and macros) "\C-x\\": "\\"
#
"\C-xq": "\eb\"\ef\""
# ,
"\C-xr": redraw-current-line
#
"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
$endif
# ,
set bell-style visible
# 7
set input-meta on
# iso-latin1,
# Meta-
# prefix-meta sequences
set convert-meta off
# ,
# Meta-
set output-meta on
# 150 ,
# ,
set completion-query-items 150
# FTP
$if Ftp
"\C-xg": "get \M-?"
"\C-xt": "put \M-?"
"\M-.": yank-last-arg
$endif

21:

239

21.4 Readline
Readline, .

21.4.1
beginning-of-line (C-a)
.
end-of-line (C-e)
.
forward-char (C-f)
.
backward-char (C-b)
.
forward-word (M-f)
.
.
backward-word (M-b)
. .
clear-screen (C-l)
, .
redraw-current-line ()
. .

21.4.2
accept-line (Newline, Return)
. ,
. ,
.
previous-history (C-p)
.
next-history (C-n)
.
beginning-of-history (M-<)
.
end-of-history (M->)
, , .
reverse-search-history (C-r)
. .

240

GDB

forward-search-history (C-s)

. .
non-incremental-reverse-search-history (M-p)
, ,
.
non-incremental-forward-search-history (M-n)

, , .
history-search-forward ()

. . .
history-search-backward ()

. . .
yank-nth-arg (M-C-y)
( ). n, n- ( 0).
n- .
yank-last-arg (M-., M-_)
( ). , , yanknth-arg. yank-last-arg , .

21.4.3
delete-char (C-d)
. ,
deletechar, eof.
backward-delete-char (Rubout)
.
, .
forward-backward-delete-char ()
, ,
. ,
- .
quoted-insert (C-q, C-v)
, .
, C-q.
tab-insert (M-TAB)
.

21:

241

self-insert (a, b, A, 1, !, ...)


.
transpose-chars (C-t)
, . , .
.
transpose-words (M-t)
.
.
upcase-word (M-u)
( ) . , , .
downcase-word (M-l)
( ) . , .
capitalize-word (M-c)
( ) . , ,
.

21.4.4
kill-line (C-k)
.
backward-kill-line (C-x Rubout)
.
unix-line-discard (C-u)
.
kill-whole-line ()
, .
.
kill-word (M-d)
, ,
, . ,
forward-word.
backward-kill-word (M-DEL)
. , backward-word.
unix-word-rubout (C-w)
, .
.
delete-horizontal-space ()
.
.

242

GDB

kill-region ()
. .
copy-region-as-kill ()
,
. .
copy-backward-word ()
.
, backward-word. .
copy-forward-word ()
, , .
, forward-word. .
yank (C-y)

.
yank-pop (M-y)

. yank yank-pop.

21.4.5
digit-argument (M-0, M-1, ... M-)
, . M .
universal-argument ()
.
, , . , universalargument , . ,
, , . ,
, , .
.

21.4.6 Readline
complete (hTABi)
. . , , ; , ;
GDB, ;
Bash, ,
.
possible-completions (M-?)
.

21:

243

insert-completions (M-*)
,
possible-completions.
menu-complete ()
complete,
. menu-complete , .
. n n ;

. hTABi,
.
delete-char-or-list ()
,
( delete-char). ,
possible-completions. .

21.4.7
start-kbd-macro (C-x ()
.
end-kbd-macro (C-x ))

.
call-last-kbd-macro (C-x e)
,
, .

21.4.8
re-read-init-file (C-x C-r)
inputrc, .
abort (C-g)
( bell-style).
do-uppercase-version (M-a, M-b, M-x, ...)
x , , .
prefix-meta (hESCi)
. ,
Meta. hESCi f M-f.
undo (C-_, C-x C-u)
, .
revert-line (M-r)
, . undo, .

244

GDB

tilde-expand (M-~)
.
set-mark (C-@)
. ,
.
exchange-point-and-mark (C-x C-x)
. ,
.
character-search (C-])
,
.
.
character-search-backward (M-C-])
,
.
.
insert-comment (M-#)
comment-begin ,
, .
dump-functions ()
Readline.
, ,
inputrc. , .
dump-variables ()

Readline. , ,
inputrc.
.
dump-macros ()
Readline, ,
. , , inputrc.
.

21.5 vi Readline
Readline vi,
. vi Readline
, posix 1003.2.
emacs vi, M-C-j (toggle-editing-mode). , Readline
emacs.
vi, , i. hESCi ,
vi, k
j, .

22:

245

22

, gnu History , c
. .

22.1
History , csh. , .
, , ,
.
. , .
. , ,
, . .
, Bash, , , .
, !.

22.1.1
.
!

, ! , , , = (.

!n

n.

!-n

, n .

!!

. !-1.

, .

!?[?]
, . ?
, .
^1^2^
. , 1
2. !!:s/1/2/.
!#

, .

22.1.2
.
. ,
^, $, *, - %. , 0 (). ,
.
,
!!

. ,
.

246

GDB

!!:$

. !$.

!fi:2

,
fi.

:
0 ()

. , .

n- .

, 1.

, ??.

x-y

; 0-y -y.

, . 1-$.
, * ;
.

x*

x-$

x-

x-$ x*, .

,
.

22.1.3
, , .
h

, .

, ., .

, .

, .

s///
. /
.
.
&, . &. ,
.
&

.
s, gs///, &.

A:

247

A
4 GDB ,
PostScript Ghostscript, gdb 1 .
PostScript Ghostscript ,
refcard.ps.
. TEX, :
make refcard.dvi
GDB landscape letter; 11 8.5 .

dvi.
GDB - . Texinfo,
, , ,
. Info,
, TEX ( texi2roff)
.
GDB Info gdb. Info gdb-5.0/gdb/gdb.info,
gdb.info* . , , ; ,
info gnu Emacs info,
gnu Texinfo.
Info- ,
Info, texinfo-format-buffer makeinfo.
makeinfo, GDB (gdb-5.0 5.0), Info, :
cd gdb
make gdb.info
, TEX,
dvi- Texinfo texinfo.tex.
TEX ; , , dvi-.
, dvi-.
TEX, , , .
; lpr -d ; ( PostScript) dvips. dvi- .dvi.
TEX texinfo.tex. TEX,
, Texinfo. TEX Texinfo. texinfo.tex GDB
gdb--/texinfo.
TEX dvi,
. gdb
(, gdb-5.0/gdb), :
make gdb.dvi
gdb.dvi dvi.
1

gdb-5.0/gdb/refcard.ps 5.0 .

248

GDB

B: GDB

249

B GDB
GDB configure,
GDB ; make gdb.1
GDB , GDB,
, gdb.
, GDB 5.0 gdb-5.0.
:
gdb-5.0/configure ( )
GDB
gdb-5.0/gdb
, GDB
gdb-5.0/bfd
(Binary File Descriptor)
gdb-5.0/include
gnu
gdb-5.0/libiberty
-liberty
gdb-5.0/opcodes

gdb-5.0/readline
gnu
gdb-5.0/glob
gnu
gdb-5.0/mmalloc
gnu
GDB configure
gdb--, gdb-5.0.
gdb--,
; configure. , GDB.
:
cd gdb-5.0
./configure
make
, sun4 decstation, ,
GDB. ( ; configure
, .)
configure make bfd, readline,
mmalloc libiberty, gdb. ,
, .
1

GDB, 5.0, README ;


.

250

GDB

configure Bourne (/bin/sh); , , sh :


sh configure
configure ,
, gdb-5.0 5.0, configure (
-norecursion).
configure GDB,
, ,
.
, 5.0, bfd, :
cd gdb-5.0/bfd
../configure
gdb ; .
, , (
SHELL) . , GDB
GDB , .

B.1 GDB
GDB ,
gdb,
. configure , ,
, .
make VPATH (gnu make ), make
gdb, .
gdb , configure -srcdir,
, . (
configure . configure
-srcdir, -srcdir ; .)
, 5.0, GDB Sun 4
:
cd gdb-5.0
mkdir ../gdb-sun4
cd ../gdb-sun4
../gdb-5.0/configure sun4
make
configure , ,
( ),
. ,
Sun 4 libiberty.a gdb-sun4/libiberty, GDB gdb-sun4/gdb.
GDB , GDB -
( GDB , ). configure -target=.
make ,
,
configure ( ).

B: GDB

251

Makefile, configure , . make ,


gdb-5.0 ( , -srcdir=/gdb-5.0), , GDB.
, make (,
NFS ); .

B.2
, configure,
, , . :
--
, sun4 ,
--target=. sparc-sun-sunos4.
configure, GDB,
.
configure Bourne config.sub
; ,
. :
% sh config.sub i386-linux
i386-pc-linux-gnu
% sh config.sub alpha-linux
alpha-unknown-linux-gnu
% sh config.sub hp9k700
hppa1.1-hp-hpux
% sh config.sub sun4
sparc-sun-sunos4.1.1
% sh config.sub sun3
m68k-sun-sunos4.1.1
% sh config.sub i986v
Invalid configuration i986v: machine i986v not recognized
config.sub GDB (gdb-5.0, 5.0).

B.3 configure
configure, GDB. configure ,
. . Info configure.info, node What Configure Does,
configure.
configure [-help]
[-prefix=]
[-exec-prefix=]
[-srcdir=-]
[-norecursion] [-rm]
[-target=]

, -, -;
, -.

252

-help

GDB

, configure.

-prefix=
, .
-exec-prefix=
, .
-srcdir=-
: gnu make
make, VPATH.
,
GDB. ,
( ) . configure , ,
, , -. configure
-.
-norecursion
, configure;
.
-target=
GDB - , . GDB , (), GDB.
.
...
GDB .
.
, .

253


default
#. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
# () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
# -2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
$. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
$$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
$bpnum, . . . . . . . . . . . 32
$cdir, . . . . . . . . . . . . 57
$cwd, . . . . . . . . . . . . . 57
$_ info breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . 34
$_ info line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
$_, $__ . . . . . . . . . . . . . . . . . . . . 66
$_, . . . . . . . . . . . . . . . 74
$_exitcode, . . . . . . . 74
$__, . . . . . . . . . . . . . . 74
--annotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--async . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--batch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--baud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--epoch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--fullname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--interpreter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--mapped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--noasync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--nowindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--nx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--quiet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--readnow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--se . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--silent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
--tty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
--version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
--windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
--write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
-b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
-break-after . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
-break-condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
-break-delete. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
-break-disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
-break-enable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
-break-info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
-break-insert. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
-break-list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
-break-watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
-c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-data-disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

-data-evaluate-expression . . . . . . . . . . . . . . . . . . . 185
-data-list-changed-registers . . . . . . . . . . . . . . . 186
-data-list-register-names . . . . . . . . . . . . . . . . . . . 186
-data-list-register-values. . . . . . . . . . . . . . . . . . 187
-data-read-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
-display-delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
-display-disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
-display-enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
-display-insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
-display-list. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
-e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-environment-cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
-environment-directory . . . . . . . . . . . . . . . . . . . . . . 192
-environment-path . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
-environment-pwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
-exec-abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
-exec-arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
-exec-continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
-exec-finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
-exec-interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
-exec-next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
-exec-next-instruction . . . . . . . . . . . . . . . . . . . . . . 197
-exec-return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
-exec-run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
-exec-show-arguments . . . . . . . . . . . . . . . . . . . . . . . . 198
-exec-step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
-exec-step-instruction . . . . . . . . . . . . . . . . . . . . . . 199
-exec-until . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
-file-exec-and-symbols . . . . . . . . . . . . . . . . . . . . . . 200
-file-exec-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
-file-list-exec-sections . . . . . . . . . . . . . . . . . . . . 201
-file-list-exec-source-files . . . . . . . . . . . . . . . 201
-file-list-shared-libraries . . . . . . . . . . . . . . . . 202
-file-list-symbol-files . . . . . . . . . . . . . . . . . . . . . 202
-file-symbol-file . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
-gdb-exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
-gdb-set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
-gdb-show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
-gdb-version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
-m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
-nw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
-q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
-r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
-stack-info-depth . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
-stack-info-frame . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
-stack-list-arguments . . . . . . . . . . . . . . . . . . . . . . . 205
-stack-list-frames . . . . . . . . . . . . . . . . . . . . . . . . . . 207
-stack-list-locals . . . . . . . . . . . . . . . . . . . . . . . . . . 208
-stack-select-frame . . . . . . . . . . . . . . . . . . . . . . . . . 208
-symbol-info-address . . . . . . . . . . . . . . . . . . . . . . . . 209
-symbol-info-file . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
-symbol-info-function . . . . . . . . . . . . . . . . . . . . . . . 210

254

-symbol-info-line . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
-symbol-info-symbol . . . . . . . . . . . . . . . . . . . . . . . . . 210
-symbol-list-functions . . . . . . . . . . . . . . . . . . . . . . 210
-symbol-list-types . . . . . . . . . . . . . . . . . . . . . . . . . . 211
-symbol-list-variables . . . . . . . . . . . . . . . . . . . . . . 211
-symbol-locate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
-symbol-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
-t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
-target-attach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
-target-compare-sections . . . . . . . . . . . . . . . . . . . . 212
-target-detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
-target-download . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
-target-exec-status . . . . . . . . . . . . . . . . . . . . . . . . . 215
-target-list-available-targets . . . . . . . . . . . . . 215
-target-list-current-targets . . . . . . . . . . . . . . . 215
-target-list-parameters . . . . . . . . . . . . . . . . . . . . . 216
-target-select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
-thread-info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
-thread-list-all-threads . . . . . . . . . . . . . . . . . . . . 217
-thread-list-ids . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
-thread-select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
-var-assign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
-var-create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
-var-delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
-var-evaluate-expression . . . . . . . . . . . . . . . . . . . . 222
-var-info-expression . . . . . . . . . . . . . . . . . . . . . . . . 221
-var-info-num-children . . . . . . . . . . . . . . . . . . . . . . 221
-var-info-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
-var-list-children . . . . . . . . . . . . . . . . . . . . . . . . . . 221
-var-set-format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
-var-show-attributes . . . . . . . . . . . . . . . . . . . . . . . . 221
-var-show-format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
-var-update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
-w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
-x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
., -2 . . . . . . 90
.esgdbinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
.gdbinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
.os68gdbinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
.vxgdbinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
/proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
::, -2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
::, / . . . . . . . . . 62
@, . . . . . . . . . . . . . 63
^done . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
^error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
^running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
No symbol "foo" in current context . . . . . . . . . . . . 63
{} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

GDB

A
a.out ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
abort (C-g) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
accept-line (Newline, Return) . . . . . . . . . . . . . . . 239
add-shared-symbol-file . . . . . . . . . . . . . . . . . . . . . . 107
add-symbol-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Alpha, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
AMD EB29K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
AMD29K UDI . . . . . . . . . . . . . . . . . . . . . . . . . . 136
AMD29K, . . . . . . . . . . . . . . . . . . . . . 148
apropos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
arg-begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
arg-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
arg-name-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
arg-value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
array-section-end . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
attach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
awatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

B
b (break) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
backtrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
backward-char (C-b) . . . . . . . . . . . . . . . . . . . . . . . . . 239
backward-delete-char (Rubout) . . . . . . . . . . . . . . . 240
backward-kill-line (C-x Rubout) . . . . . . . . . . . . . 241
backward-kill-word (M-DEL) . . . . . . . . . . . . . . . . . . 241
backward-word (M-b) . . . . . . . . . . . . . . . . . . . . . . . . . 239
beginning-of-history (M-<) . . . . . . . . . . . . . . . . . . 239
beginning-of-line (C-a) . . . . . . . . . . . . . . . . . . . . . 239
bell-style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
break ... thread - . . . . . . . . . . . . . . . . . . 48
breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
breakpoints-headers . . . . . . . . . . . . . . . . . . . . . . . . . 168
breakpoints-invalid . . . . . . . . . . . . . . . . . . . . . . . . . 169
breakpoints-table . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
breakpoints-table-end . . . . . . . . . . . . . . . . . . . . . . . 169
bt (backtrace) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

C
c () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
call-last-kbd-macro (C-x e) . . . . . . . . . . . . . . . . . 243
capitalize-word (M-c) . . . . . . . . . . . . . . . . . . . . . . . 241
catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch fork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch throw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch unload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
catch vfork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

255

cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
cdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
character-search (C-]) . . . . . . . . . . . . . . . . . . . . . . 244
character-search-backward (M-C-]) . . . . . . . . . . 244
Chill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
clear-screen (C-l). . . . . . . . . . . . . . . . . . . . . . . . . . . 239
coff ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41, 167
comment-begin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
complete (hTABi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
completion-query-items . . . . . . . . . . . . . . . . . . . . . . 232
condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
control C . . . . . . . . . . . . . . . . 116
convert-meta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
copy-backward-word () . . . . . . . . . . . . . . . . . . . . . . . 242
copy-forward-word () . . . . . . . . . . . . . . . . . . . . . . . . 242
copy-region-as-kill () . . . . . . . . . . . . . . . . . . . . . . 242
core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
core-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
cwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

D
d (delete) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
delete display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
delete-char (C-d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
delete-char-or-list () . . . . . . . . . . . . . . . . . . . . . . 243
delete-horizontal-space () . . . . . . . . . . . . . . . . . . 241
detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
digit-argument (M-0, M-1, ... M--). . . . . . . . . . . 242
dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
dis (disable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
disable breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . 39
disable display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
disable-completion . . . . . . . . . . . . . . . . . . . . . . . . . . 233
disassemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
display-begin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
display-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
display-expression . . . . . . . . . . . . . . . . . . . . . . . . . . 166
display-expression-end . . . . . . . . . . . . . . . . . . . . . . 166
display-format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
display-number-end . . . . . . . . . . . . . . . . . . . . . . . . . . 166
display-value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
do (down) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
do-uppercase-version (M-a, M-b, M-x, ...) . . . 243
document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
down-silently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
downcase-word (M-l) . . . . . . . . . . . . . . . . . . . . . . . . . 241
dump-functions () . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
dump-macros () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
dump-variables () . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

E
eb.log, EB29K . . . . . . . 138
EBMON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
ecoff ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
editing-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
elf/dwarf ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
elf/stabs ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
elt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
elt-rep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
elt-rep-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Emacs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
enable breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
enable display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
enable-keypad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
end-kbd-macro (C-x )) . . . . . . . . . . . . . . . . . . . . . . . . 243
end-of-history (M->) . . . . . . . . . . . . . . . . . . . . . . . . 239
end-of-line (C-e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
error-begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
exceptionHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
exchange-point-and-mark (C-x C-x) . . . . . . . . . . . 244
exec-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
exited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
expand-tilde . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

F
f (frame) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
fg ( )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
field-begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
field-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
field-name-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
field-value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
flush_i_cache. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
foo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
fork, ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
forward-backward-delete-char () . . . . . . . . . . . . 240

256

forward-char (C-f). . . . . . . . . . . . . . . . . . . . . . . . . . . 239


forward-search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
forward-search-history (C-s) . . . . . . . . . . . . . . . . 240
forward-word (M-f). . . . . . . . . . . . . . . . . . . . . . . . . . . 239
frame, command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
frame, selecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
frame-address. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-address-end . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
frame-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
frame-function-name . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-source-begin . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-source-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-source-file . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-source-file-end . . . . . . . . . . . . . . . . . . . . . . . 166
frame-source-line . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frame-where . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
frames-invalid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Fujitsu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
function-call. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

G
g++, gnu ++ . . . . . . . . . . . . . . . . . . . . . 81
gdb.ini . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
gdb/mi, . . . . . . . . . . . . . . . . . 175
gdb/mi, . . . . . . . . . . . . . . . . . . . 171
gdb/mi, . . . . . . . . . . . . . . . . . . 172
gdb/mi, . . . . . . . . . . . . . . . . . . . . . . . 171
gdb/mi, . . . . . . . . . . . . . 176
gdb/mi, . . . . . . . . . . . . . . . . . . . . . 175
gdb/mi, . . . . . . . . . . . . . . . . . . . . 174
gdb/mi, . . . . . . . . . . . . . . 175
gdb/mi, CLI . . . . . . . . . . . . . . . . . 174
gdb/mi, . . . . . . . . . . . . . . . . . 183
gdb/mi,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
GDBHISTFILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
gdbserve.nlm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
gdbserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
getDebugChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
gnu Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
gnu ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

H
h (help) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
H8/300 H8/500, . . . . . . . . . . . . . . 139
handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
handle_exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
hbreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
help target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
help user-defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

GDB

heuristic-fence-post (Alpha, MIPS) . . . . . . . . .


history-search-backward () . . . . . . . . . . . . . . . . . .
history-search-forward () . . . . . . . . . . . . . . . . . . .
Hitachi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hitachi SH, . . . . . . . . . . . . . . . . . . . . . . .
horizontal-scroll-mode . . . . . . . . . . . . . . . . . . . . . .

149
240
240
114
139
233

I
i (info) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
i386 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
i386-stub.c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
i960 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
ignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
INCLUDE_RDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
info address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
info all-registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
info args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
info breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
info catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
info display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
info extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
info f (info frame) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
info files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
info float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
info frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
info frame, . . . . . . . . . . . 78
info functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
info line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
info locals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
info proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
info proc id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
info proc mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
info proc status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
info proc times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
info program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
info registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
info s (info stack) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
info set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
info share . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
info sharedlibrary. . . . . . . . . . . . . . . . . . . . . . . . . . . 108
info signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
info source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
info source, . . . . . . . . . . 78
info sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
info stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
info target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
info terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
info threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 27
info types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
info variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
info watchpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
input-meta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

257

insert-comment (M-#) . . . . . . . . . . . . . . . . . . . . . . . . 244


insert-completions (M-*) . . . . . . . . . . . . . . . . . . . . 243
inspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Intel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
isearch-terminators . . . . . . . . . . . . . . . . . . . . . . . . . 233

J
jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

K
keymap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
kill-line (C-k) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
kill-region () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
kill-whole-line (). . . . . . . . . . . . . . . . . . . . . . . . . . . 241
kill-word (M-d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

L
l (info list) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
load - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

M
m680x0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
m68k-stub.c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
maint info breakpoints . . . . . . . . . . . . . . . . . . . . . . . . 34
maint print psymbols . . . . . . . . . . . . . . . . . . . . . . . . . . 99
maint print symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
mapped . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
mark-modified-lines . . . . . . . . . . . . . . . . . . . . . . . . . 234
memset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
menu-complete () . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
meta-flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
MIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
MIPS, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Motorola 680x0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

N
n (next) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
next-history (C-n). . . . . . . . . . . . . . . . . . . . . . . . . . . 239
nexti . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
ni (nexti) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Nindy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
non-incremental-forward-search-history (M-n)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
non-incremental-reverse-search-history (M-p)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

O
output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
output-meta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
overload-choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

P
path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
possible-completions (M-?) . . . . . . . . . . . . . . . . . . 242
post-commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
post-overload-choice . . . . . . . . . . . . . . . . . . . . . . . . 167
post-prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
post-prompt-for-continue . . . . . . . . . . . . . . . . . . . . 167
post-query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
pre-commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
pre-overload-choice . . . . . . . . . . . . . . . . . . . . . . . . . 167
pre-prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
pre-prompt-for-continue . . . . . . . . . . . . . . . . . . . . . 167
pre-query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
prefix-meta (hESCi) . . . . . . . . . . . . . . . . . . . . . . . . . . 243
previous-history (C-p) . . . . . . . . . . . . . . . . . . . . . . 239
print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
prompt-for-continue . . . . . . . . . . . . . . . . . . . . . . . . . 167
ptype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
putDebugChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
pwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Q
q (quit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
quit [] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
quoted-insert (C-q, C-v) . . . . . . . . . . . . . . . . . . . . 240

R
r (run) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
rbreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
re-read-init-file (C-x C-r) . . . . . . . . . . . . . . . . . 243
readline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
readnow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
redraw-current-line () . . . . . . . . . . . . . . . . . . . . . . 239
remotedebug, MIPS. . . . . . . . . . . . . . . . . . 144
remotetimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
RET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
RET ( ) . . . . . . . . . . . 15
retransmit-timeout, MIPS . . . . . . . . . . 145
return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
reverse-search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

258

reverse-search-history (C-r) . . . . . . . . . . . . . . . . 239


revert-line (M-r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
rwatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

S
s (step) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
select-frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
self-insert (a, b, A, 1, !, ...) . . . . . . . . . . . . . 241
set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
set args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
set auto-solib-add. . . . . . . . . . . . . . . . . . . . . . . . . . . 108
set check range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
set check type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
set check, . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
set check, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
set complaints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
set confirm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
set debug arch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug expression . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug overload . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set debug varobj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
set demangle-style. . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
set disassembly-flavour . . . . . . . . . . . . . . . . . . . . . . 59
set editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
set endian auto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
set endian big . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
set endian little . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
set environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
set extension-language . . . . . . . . . . . . . . . . . . . . . . . 79
set follow-fork-mode . . . . . . . . . . . . . . . . . . . . . . . . . 28
set gnutarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
set height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
set history expansion . . . . . . . . . . . . . . . . . . . . . . . . 152
set history filename . . . . . . . . . . . . . . . . . . . . . . . . . 151
set history save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
set history size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
set input-radix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
set language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
set listsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
set machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
set memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
set mipsfpu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
set opaque-type-resolution . . . . . . . . . . . . . . . . . . . 99
set overload-resolution . . . . . . . . . . . . . . . . . . . . . . 86
set print address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
set print array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
set print asm-demangle . . . . . . . . . . . . . . . . . . . . . . . . 71

GDB

set print demangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71


set print elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
set print max-symbolic-offset . . . . . . . . . . . . . . . . 69
set print null-stop . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
set print object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
set print pretty on . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
set print sevenbit-strings . . . . . . . . . . . . . . . . . . . 70
set print static-members . . . . . . . . . . . . . . . . . . . . . 72
set print symbol-filename . . . . . . . . . . . . . . . . . . . . 68
set print union . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
set print vtbl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
set processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
set prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
set remotedebug, MIPS . . . . . . . . . . . . . . 144
set retransmit-timeout . . . . . . . . . . . . . . . . . . . . . . 145
set rstack_high_address . . . . . . . . . . . . . . . . . . . . . 148
set symbol-reloading . . . . . . . . . . . . . . . . . . . . . . . . . 98
set timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
set variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
set verbose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
set width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
set write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
set-mark (C-@) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
set_debug_traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
SH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
sh-stub.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
share . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
sharedlibrary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
show args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
show auto-solib-add . . . . . . . . . . . . . . . . . . . . . . . . . 108
show check range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
show check type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
show complaints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
show confirm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
show convenience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
show copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
show debug arch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug expression . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug overload . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug target . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show debug varobj . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
show demangle-style . . . . . . . . . . . . . . . . . . . . . . . . . . 72
show directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
show editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
show environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
show gnutarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
show history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
show input-radix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
show language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
show listsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

259

show machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141


show mipsfpu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
show opaque-type-resolution . . . . . . . . . . . . . . . . . . 99
show output-radix . . . . . . . . . . . . . . . . . . . . . . . 153, 154
show paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
show print address . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
show print array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
show print asm-demangle. . . . . . . . . . . . . . . . . . . . . . . 71
show print demangle . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
show print elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
show print max-symbolic-offset . . . . . . . . . . . . . . . 69
show print object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
show print pretty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
show print sevenbit-strings . . . . . . . . . . . . . . . . . . 70
show print static-members . . . . . . . . . . . . . . . . . . . . 72
show print symbol-filename . . . . . . . . . . . . . . . . . . . 68
show print union . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
show print vtbl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
show processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
show prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
show remotedebug, MIPS. . . . . . . . . . . . . 144
show retransmit-timeout . . . . . . . . . . . . . . . . . . . . . 145
show rstack_high_address . . . . . . . . . . . . . . . . . . . . 149
show symbol-reloading . . . . . . . . . . . . . . . . . . . . . . . . 99
show timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
show user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
show values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
show verbose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
show version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
show warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
show width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
show wight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
show write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
show-all-if-ambiguous . . . . . . . . . . . . . . . . . . . . . . . 234
shows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
si (stepi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103, 169
signal-handler-caller . . . . . . . . . . . . . . . . . . . . . . . 165
signal-name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
signal-name-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
signal-string. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
signal-string-end . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
signalled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
silent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 170
Sparc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
sparc-stub.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
sparcl-stub.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Sparclet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
SparcLite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
st2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
start-kbd-macro (C-x () . . . . . . . . . . . . . . . . . . . . . 243
starting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
stepi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
stop, . . . . . . . . . . . . . . . . . . . . . . . . . . 158
stopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
symbol-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

T
tab-insert (M-TAB). . . . . . . . . . . . . . . . . . . . . . . . . . .
target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target abug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target adapt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target amd-eb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target cpu32bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target dbug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target ddb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target dink32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target e7000, c Hitachi ICE . . . . . . . . . . . . . . . . . . .
target e7000, H8/300 . . . . . . . . . . . . . . . . . . . . . . .
target e7000, Hitachi SH . . . . . . . . . . . . . . . . . . . .
target es1800 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target est . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target hms . . . . .
target hms, H8/300 . . . . . . . . . . . . . . . . . . . . . . . . .
target hms, Hitachi SH . . . . . . . . . . . . . . . . . . . . . .
target lsi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target m32r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target mips . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target mon960 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target nindy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target nrom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target op50n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target pmon . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target ppcbug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target ppcbug1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target r3900 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target rdi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target rdp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target rom68k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target rombug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sh3, H8/300 . . . . . . . . . . . . . . . . . . . . . . . . .
target sh3, SH . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sh3e, H8/300 . . . . . . . . . . . . . . . . . . . . . . . .
target sh3e, SH . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sim, Z8000 . . . . . . . . . . . . . . . . . . . . . . . . . . .
target sparclite . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
target vxworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

240
111
143
136
136
144
143
112
143
143
144
145
141
139
145
143
143
112
140
138
145
144
142
143
141
141
112
145
144
145
145
144
138
138
112
143
143
145
139
145
139
145
112
148
147
134

260

GDB

target w89k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145


tbreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
TCP-, target remote . . . . . . . . . . . . . . . . . . . . . 117
thbreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
this, - ++ . . . . . . . . . . . . 84
thread - . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
threads apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
tilde-expand (M-~). . . . . . . . . . . . . . . . . . . . . . . . . . . 244
timeout, MIPS . . . . . . . . . . . . . . . . . . . . . . 145
transpose-chars (C-t) . . . . . . . . . . . . . . . . . . . . . . . 241
transpose-words (M-t) . . . . . . . . . . . . . . . . . . . . . . . 241
tty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Y
yank (C-y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
yank-last-arg (M-., M-_) . . . . . . . . . . . . . . . . . . . .
yank-nth-arg (M-C-y) . . . . . . . . . . . . . . . . . . . . . . . .
yank-pop (M-y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

242
240
240
242

Z
Z8000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Zilog Z8000, . . . . . . . . . . . . . . . . . . . . . . . . 148

U
u (until) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
UDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
udi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
undisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
undo (C-_, C-x C-u) . . . . . . . . . . . . . . . . . . . . . . . . . . 243
universal-argument () . . . . . . . . . . . . . . . . . . . . . . . 242
unix-line-discard (C-u) . . . . . . . . . . . . . . . . . . . . . 241
unix-word-rubout (C-w) . . . . . . . . . . . . . . . . . . . . . . 241
unset environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
until . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
up-silently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
upcase-word (M-u) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

V
value-begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
value-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
value-history-begin . . . . . . . . . . . . . . . . . . . . . . . . .
value-history-end . . . . . . . . . . . . . . . . . . . . . . . . . . .
value-history-value . . . . . . . . . . . . . . . . . . . . . . . . .
visible-stats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
VxWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vxworks-timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

164
164
164
164
164
234
134
134

W
watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
watchpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
whatis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
where . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
while . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

X
x ( ) . . . . . . . . . . . . . . . . . . . . . . . 65
x() info line . . . . . . . . . . . . . . . . . . . . 58
xcoff ++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

. . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . 66
. . 28
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
. . . . . . . . . . . . . . . . . 35
( ) . . . . . . . . . . . . . . . . 22
gdb/mi . . . . . . . . . . . . . . . . . 173
. . . . . . . . . . . . . . . . . . 58, 59

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
readline . . . . . . . . . . . . . . . . . . . . . 229
gdb/mi . . . . . . . . . . . . . . . . 175
. . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
GDB. . . . . . . . . . . . . . . 34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . 38
. . . . . . . . . . . . . . . . . . . . . . . . . . 103
. . . . . . . . . . . . . . . . . . . . . 44
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
. . . . . . . . . . . . . . . . . . . . . . . . 230
, MIPS . . . . . . . . . . . . . . . . . . 149
ST2000 . . . . . . . . . . . . 148
. . . . . . . . . . . . . . . . . . 73
-2 . . . . . . . . . . . . . . . . 88
gdb/mi . . . . . . . . . . . . . . . . 171
. . . . . . . . . . . . . . . 113
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
. . . . . . . . . . . . . . 58, 59
gdb/mi . . . . . . . . . . . . . . . . . . . . 173
make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
. . . . . . . . . . . . . . . . 84
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
. . . . . . . . . . . . . . . . . . . . . . . . 51
Sparclet . . . . . 147
, Sparclet . . . . . . . . . . . . . . . . . . . . . . 146

261

. . . . . . . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
-2 . . . . . . . . . . . . . . . . . . . . . . . . 87
++ . . . . . . . . . . . . . . . . . . . . . . . 81
++. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
gdb/mi . . . . . . . . . . . . . . . . . . 172

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
,
/ . . . . . . . . . . . . . . . . . . . . . . 62
AT&T . . . . . . . . . . . . 59
Intel . . . . . . . . . . . . . . 59
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
. . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . . 107
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17, 247

gdb/mi . . . . . . . . . . . . . . . . . 173
EB29K . . . . . . . . . . . . . . . . 138

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
, . . . . . 16
H8/300 H8/500 . . . . . . . . . . . . . . . 139
Hitachi SH . . . . . . . . . . . . . . . . . . . . . . . 139
Nindy-960 . . . . . . . . . . . . . . . . . . . . . . . . 141
Sparclet . . . . . . . . . . . . . . . . . . . . . . . . . . 147
VxWorks . . . . . . . . . . . . . . . . . . . . . . . . . 135
. . . . . . . . . . . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
VxWorks . . . . . . . . . . . . . . . . . . . . . . . . 135
29K . . . . . . . . . . . . . . . . . . . . . . . . . 136
, . . . . . . . . . . . . . . . . 62
++ . . . . . . . . . . . . . 85

(GDB) . . . . . . . . . . . . . . . . 26, 27
() . . . . . . . . . . . . . . 26
(), HP-UX . . . . 27
,
GDB . . . . . . . . . . . . . . . . . . . . . . . . . 118
gdb/mi . . . . . . . . . . . . . . . . 219
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
, Z8000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
. . . . . . . . . . . . . . . . . . . . 159
. . . . . . . . . . . . . . . . . . . . . 58, 59
. . . . . . . . . . . . . . . . . . . . . . . . 63
. . . . . . . . . . . . . . . . . . . . . . . . . . 61
. . . . . . . . . . . . . . . . . . . . . . . . . . 65
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

. . . . . . . . . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
. . . . . . . . . . . . . . . . . . . . . . . . . . . 57
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
. . . . . . . . . . . . . . . . 57
. . . . . . . . . . . . . . . 230
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
STDBUG (ST2000) . . . . . . . . . . . . . . . . . . 148
STDBUG (ST2000) . . . . . . . . . . . . . . 148
++. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
. . . . . . . . . . . . . . . . . . . 41
gdb/mi . . . . . . . . . . 176
- . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
, . . . . . . . . . . . . . . . . . . . . . . . . . . 57
, Sparclet . . . . . . . . . . . . . . . . . . . . . . 146
gdb/mi . . . . . . . . . . . . . . . . . . 173
-2 . . . . . . . . . . . . . . . . . . . . . . . . . . 89
++. . . . . . . . . . . . . . . . . . . . . . . . . . 83
, GDB . . . . . 118
GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
. . . . . . . . . . . . . . . . . . . . 62
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

. . . . . . . . . . . . . . . . . . . . . . . . . . 158

262

GDB

, . . . . . . . . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
. . . . . . . . . . . . . . . . . . . . . . . 66
. . . . . . . . . . . . . . . . . . . 132
++ . . . . . . . . . . . . . . . . . . . 86
. . . . . . . . . 34
. . . . . . . . . . . . . . . . . . . . . . . . . . . 225
GDB. . . . . . . . . . . . . . . . . . . . 225
, ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
. . . . . 225
GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
GDB, . . . . . . . . . . . . . . . . . . . . . . . 225

. . . . . . . . . . . . . . . . . . . . . 58, 59
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . . . . . . . . 111
, H8/500 . . . . . . . . . . . . . . . . . . . . . . . 141
-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
-2, . . . . . . . . . . . . . . . . . . . . . . 90
-2, GDB . . . . . . . . . . . . . . . . . . . . 87

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
. . . . . . . . . . . . . . . . 225
, . . . . . . . . . . . . . . . . 64
. . . . . . . . . . . . . . . . . 106
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
. . . . . . . . . . . . . . . . . . . . . . 37
, . . . . . . . . . . . 28
, . . . . . . . . . . . . . . . . . . . . . . . . . . 48
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
, . . . . . . . . . . . . . . . . . 26
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 27
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
. . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . . 31

. . . 116
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
, readline . . . . . . . . . . . . . . . . . . . . . . . . . 229
++ . . . . . . . . . . . . . . . . . . . 86
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
. . . . . . . . . . . . . . . . . . . . . . 37
, . . 54
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
++ . . . . . . . . . . . . . . . . . . . 84
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
, . . . . . . . . . . 69
-2 . . . . . . . . . . . . . . . . . . . . . . . . . . 87
++ . . . . . . . . . . . . . . . . . . . . . . . . . . 81
++ . . . . . . . . 62
. . . . . . . . 157
, . . . . . . . . . . . . . . . 21
. . . . . . . . . . . . 85
. . . . . . . . . . . . . . . . . . . . . . . . . . . 48
. . . . . . . . . . . . . . 21

, . . . . . . . . . 155
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
. . . . . . . . . . . . . . . . . . . . . . . . . . . 68
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
, . . . . . . . . . . . . . . . . 84
,
. . . . . . . . . . . . . . . . . . . . . . 86
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
. . . . . . . . . . . . . . . . . . . . . . . . . . . 42
. . . . . . . . . . . . . . . . . . 26
, . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
, MIPS . . . . . . . . . . . 144
EB29K. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
. . . . . . . . . . . . . . . . . . 98
++, coff . . . . . . . . . . . . . . . . . . . . . 84
breakpoint, . . . . . . . . . 115
. . . . . . . . . . . . . . . . . . . . . . . . . 151
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
, GDB . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
. . . . . . . . . . . . . . . . . . . . . . 32
, target remote . . . . . . . 117
,
Hitachi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
, . . . . . . . . 155
, GDB
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
gdb/mi . . . . . . . . . . . . . . . . . . . . 175
. . . . . . . . . . . . . . . . . . . . . . . . . 44
. . . . . . . . . . . . . . . . . . . . . . . . . . 153

263

++ . . . . . . . . . . . . . . . . . . 84
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
. . . . . . . . . . . . 117
. . . . . . . . . . . . . . . . . 116
server . . . . . . . . . . . . . . . 163
. . . . . . . . . . . . . 61
, . . . . . . . . . . . . 61
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
, . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
. . . 169
. . . . . . . . . . . . . . . . . . . . . . 164
. . . . . . . . . . . . . . . . . . . . . . . . . 165
. . 170
. . . . . . . . . . . . . . . . . . 166
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
. . . . . . . . . . . . . . . . . 167
. . 169
. . . . . . . . . . . . . . . 168
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
. . . . . . . . . . . . . . . . . . . . . . . . . . . 80
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
++ . . . . . . . . . . . . . . . . . . . . . . . . . 85
-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
. . . . . . . . . . . . . . . 35
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
. . . . . . . . . . . . . . . . . . . . . . . . . 48
++ . . . . . . . . . . . . . . . . . . . . . 84
MIPS remotedebug . . . . . . . . . . . . . . . . . . 144
, GDB
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . 57

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
( ). . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
. . . . . . . . . . . . . . . . . . . . . . 107
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
. . . . . . . . . . . . . . . . . . . . 152, 245
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
. . . . . . . . . . . . . . . . . 74
. . . . . . . . . . . . . . . . . . . . . . . . . 33
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
. . . . . . . . . . . . . . . . . . . . . . . 229
. . . . . . . . . . . . 151
. . . . . . . . . . . . . 229
gdb/mi . . . . . . . . . . . . 175

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
++ . . . . . . . . . . . . . . . . . . . 84
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
, . . . . . . . . . . . . . . . . . 106
,
Hitachi . . . . . . . . . . . . . . . . . 139
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
, gdb/mi CLI . . . . . . . . . . . . . . . . . 174
, ,
gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
( STDBUG) . . . . . . . . . . . . . . . . . . . . . . 148
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
- . . . . . . . . . . . . . . . . . . . 26
-, HP-UX . . . . . . . . . . 27
. . . . . . . . . . . . . . . . . . . . . . . . . . 152
. . . . . . . . . . . . . . . . 106

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
. . . . . . . . . . . . . . . . . . . . . . . . . 247
GDB . . . . . . . . . . . . . . . . . 247
( ) . . . . . . . . . . . . . . . . . . . . . 23
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 52
Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
MIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
, AMD 29K . . . . . . . . . . . . . . . . . . . . 148
++ . . . . . . . . . . . 71
( ) . . . . . . . 41

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
. . . . . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
. . . . . . . . . . . . . . 31
. . . . . . 31
. . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . 37
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . 48
. . . . . . . . . . . . . . . . . . . . . . . . . 48
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
, . . . . . . . . . . . . . . . . . . . . 37
. . . . . . . . . . . . . . . . . . . . . . . . . . . 31

264

gdb/mi . . . . . . . . . . . . . . 173
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
, . . . . . . . . . . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . 113
. . . . . . . . 115
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
,
. . . . . . . . . . . . . . . . . . . . . . . . . . . 115
, . . . 114
. . . . . . . . . . . 130
, . . . . . . . . . . . 117
. . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . 245
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
, . . . . . . . . . 69
. . . . . . . . . . . . . . . . . . . . . . . . . . 230
. . . . . . . . . . . . . . . . . . . 39
, ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
, gdb/mi . . . . . . . . . . . . . . . 183
. . . . . . . . . . . . . . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . . . . 40
. . . . . . . . . . . . . . . . . . . . . . 40
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
. . . . . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . 35
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

GDB

-2 . . . . . . . . . . . . 90

. . . . . . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . . . . 158
, readline . . . . . . . . . . . . . . . . . 232
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
, . . . . . 106
. . . . . . . . . . . . . . . . . . . . . . . . . . . 46
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
. . . . . . . . . . . . . . . . . . . . . . 64
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

gdb/mi . . . . . . . . . . . . . . . . . . . . . . 173
. . . . . . . . . . . . . . . . . . . . . . . 113
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

. . . . . . . . . . . . . . . . . . . . . 99

gdb/mi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

. . . . . . . . . . . . . . . . . . . . . . 77

Вам также может понравиться