1 |
1181 |
sfurman |
This is gdb.info, produced by makeinfo version 4.1 from ./gdb.texinfo.
|
2 |
|
|
|
3 |
|
|
INFO-DIR-SECTION Programming & development tools.
|
4 |
|
|
START-INFO-DIR-ENTRY
|
5 |
|
|
* Gdb: (gdb). The GNU debugger.
|
6 |
|
|
END-INFO-DIR-ENTRY
|
7 |
|
|
|
8 |
|
|
This file documents the GNU debugger GDB.
|
9 |
|
|
|
10 |
|
|
This is the Ninth Edition, December 2001, of `Debugging with GDB:
|
11 |
|
|
the GNU Source-Level Debugger' for GDB Version 5.3.
|
12 |
|
|
|
13 |
|
|
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
|
14 |
|
|
1998,
|
15 |
|
|
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
16 |
|
|
|
17 |
|
|
Permission is granted to copy, distribute and/or modify this document
|
18 |
|
|
under the terms of the GNU Free Documentation License, Version 1.1 or
|
19 |
|
|
any later version published by the Free Software Foundation; with the
|
20 |
|
|
Invariant Sections being "Free Software" and "Free Software Needs Free
|
21 |
|
|
Documentation", with the Front-Cover Texts being "A GNU Manual," and
|
22 |
|
|
with the Back-Cover Texts as in (a) below.
|
23 |
|
|
|
24 |
|
|
(a) The Free Software Foundation's Back-Cover Text is: "You have
|
25 |
|
|
freedom to copy and modify this GNU Manual, like GNU software. Copies
|
26 |
|
|
published by the Free Software Foundation raise funds for GNU
|
27 |
|
|
development."
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
File: gdb.info, Node: Value Annotations, Next: Frame Annotations, Prev: Server Prefix, Up: Annotations
|
31 |
|
|
|
32 |
|
|
Values
|
33 |
|
|
======
|
34 |
|
|
|
35 |
|
|
When a value is printed in various contexts, GDB uses annotations to
|
36 |
|
|
delimit the value from the surrounding text.
|
37 |
|
|
|
38 |
|
|
If a value is printed using `print' and added to the value history,
|
39 |
|
|
the annotation looks like
|
40 |
|
|
|
41 |
|
|
^Z^Zvalue-history-begin HISTORY-NUMBER VALUE-FLAGS
|
42 |
|
|
HISTORY-STRING
|
43 |
|
|
^Z^Zvalue-history-value
|
44 |
|
|
THE-VALUE
|
45 |
|
|
^Z^Zvalue-history-end
|
46 |
|
|
|
47 |
|
|
where HISTORY-NUMBER is the number it is getting in the value history,
|
48 |
|
|
HISTORY-STRING is a string, such as `$5 = ', which introduces the value
|
49 |
|
|
to the user, THE-VALUE is the output corresponding to the value itself,
|
50 |
|
|
and VALUE-FLAGS is `*' for a value which can be dereferenced and `-'
|
51 |
|
|
for a value which cannot.
|
52 |
|
|
|
53 |
|
|
If the value is not added to the value history (it is an invalid
|
54 |
|
|
float or it is printed with the `output' command), the annotation is
|
55 |
|
|
similar:
|
56 |
|
|
|
57 |
|
|
^Z^Zvalue-begin VALUE-FLAGS
|
58 |
|
|
THE-VALUE
|
59 |
|
|
^Z^Zvalue-end
|
60 |
|
|
|
61 |
|
|
When GDB prints an argument to a function (for example, in the output
|
62 |
|
|
from the `backtrace' command), it annotates it as follows:
|
63 |
|
|
|
64 |
|
|
^Z^Zarg-begin
|
65 |
|
|
ARGUMENT-NAME
|
66 |
|
|
^Z^Zarg-name-end
|
67 |
|
|
SEPARATOR-STRING
|
68 |
|
|
^Z^Zarg-value VALUE-FLAGS
|
69 |
|
|
THE-VALUE
|
70 |
|
|
^Z^Zarg-end
|
71 |
|
|
|
72 |
|
|
where ARGUMENT-NAME is the name of the argument, SEPARATOR-STRING is
|
73 |
|
|
text which separates the name from the value for the user's benefit
|
74 |
|
|
(such as `='), and VALUE-FLAGS and THE-VALUE have the same meanings as
|
75 |
|
|
in a `value-history-begin' annotation.
|
76 |
|
|
|
77 |
|
|
When printing a structure, GDB annotates it as follows:
|
78 |
|
|
|
79 |
|
|
^Z^Zfield-begin VALUE-FLAGS
|
80 |
|
|
FIELD-NAME
|
81 |
|
|
^Z^Zfield-name-end
|
82 |
|
|
SEPARATOR-STRING
|
83 |
|
|
^Z^Zfield-value
|
84 |
|
|
THE-VALUE
|
85 |
|
|
^Z^Zfield-end
|
86 |
|
|
|
87 |
|
|
where FIELD-NAME is the name of the field, SEPARATOR-STRING is text
|
88 |
|
|
which separates the name from the value for the user's benefit (such as
|
89 |
|
|
`='), and VALUE-FLAGS and THE-VALUE have the same meanings as in a
|
90 |
|
|
`value-history-begin' annotation.
|
91 |
|
|
|
92 |
|
|
When printing an array, GDB annotates it as follows:
|
93 |
|
|
|
94 |
|
|
^Z^Zarray-section-begin ARRAY-INDEX VALUE-FLAGS
|
95 |
|
|
|
96 |
|
|
where ARRAY-INDEX is the index of the first element being annotated and
|
97 |
|
|
VALUE-FLAGS has the same meaning as in a `value-history-begin'
|
98 |
|
|
annotation. This is followed by any number of elements, where is
|
99 |
|
|
element can be either a single element:
|
100 |
|
|
|
101 |
|
|
`,' WHITESPACE ; omitted for the first element
|
102 |
|
|
THE-VALUE
|
103 |
|
|
^Z^Zelt
|
104 |
|
|
|
105 |
|
|
or a repeated element
|
106 |
|
|
|
107 |
|
|
`,' WHITESPACE ; omitted for the first element
|
108 |
|
|
THE-VALUE
|
109 |
|
|
^Z^Zelt-rep NUMBER-OF-REPITITIONS
|
110 |
|
|
REPETITION-STRING
|
111 |
|
|
^Z^Zelt-rep-end
|
112 |
|
|
|
113 |
|
|
In both cases, THE-VALUE is the output for the value of the element
|
114 |
|
|
and WHITESPACE can contain spaces, tabs, and newlines. In the repeated
|
115 |
|
|
case, NUMBER-OF-REPITITONS is the number of consecutive array elements
|
116 |
|
|
which contain that value, and REPETITION-STRING is a string which is
|
117 |
|
|
designed to convey to the user that repitition is being depicted.
|
118 |
|
|
|
119 |
|
|
Once all the array elements have been output, the array annotation is
|
120 |
|
|
ended with
|
121 |
|
|
|
122 |
|
|
^Z^Zarray-section-end
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
File: gdb.info, Node: Frame Annotations, Next: Displays, Prev: Value Annotations, Up: Annotations
|
126 |
|
|
|
127 |
|
|
Frames
|
128 |
|
|
======
|
129 |
|
|
|
130 |
|
|
Whenever GDB prints a frame, it annotates it. For example, this
|
131 |
|
|
applies to frames printed when GDB stops, output from commands such as
|
132 |
|
|
`backtrace' or `up', etc.
|
133 |
|
|
|
134 |
|
|
The frame annotation begins with
|
135 |
|
|
|
136 |
|
|
^Z^Zframe-begin LEVEL ADDRESS
|
137 |
|
|
LEVEL-STRING
|
138 |
|
|
|
139 |
|
|
where LEVEL is the number of the frame (0 is the innermost frame, and
|
140 |
|
|
other frames have positive numbers), ADDRESS is the address of the code
|
141 |
|
|
executing in that frame, and LEVEL-STRING is a string designed to
|
142 |
|
|
convey the level to the user. ADDRESS is in the form `0x' followed by
|
143 |
|
|
one or more lowercase hex digits (note that this does not depend on the
|
144 |
|
|
language). The frame ends with
|
145 |
|
|
|
146 |
|
|
^Z^Zframe-end
|
147 |
|
|
|
148 |
|
|
Between these annotations is the main body of the frame, which can
|
149 |
|
|
consist of
|
150 |
|
|
|
151 |
|
|
* ^Z^Zfunction-call
|
152 |
|
|
FUNCTION-CALL-STRING
|
153 |
|
|
|
154 |
|
|
where FUNCTION-CALL-STRING is text designed to convey to the user
|
155 |
|
|
that this frame is associated with a function call made by GDB to a
|
156 |
|
|
function in the program being debugged.
|
157 |
|
|
|
158 |
|
|
* ^Z^Zsignal-handler-caller
|
159 |
|
|
SIGNAL-HANDLER-CALLER-STRING
|
160 |
|
|
|
161 |
|
|
where SIGNAL-HANDLER-CALLER-STRING is text designed to convey to
|
162 |
|
|
the user that this frame is associated with whatever mechanism is
|
163 |
|
|
used by this operating system to call a signal handler (it is the
|
164 |
|
|
frame which calls the signal handler, not the frame for the signal
|
165 |
|
|
handler itself).
|
166 |
|
|
|
167 |
|
|
* A normal frame.
|
168 |
|
|
|
169 |
|
|
This can optionally (depending on whether this is thought of as
|
170 |
|
|
interesting information for the user to see) begin with
|
171 |
|
|
|
172 |
|
|
^Z^Zframe-address
|
173 |
|
|
ADDRESS
|
174 |
|
|
^Z^Zframe-address-end
|
175 |
|
|
SEPARATOR-STRING
|
176 |
|
|
|
177 |
|
|
where ADDRESS is the address executing in the frame (the same
|
178 |
|
|
address as in the `frame-begin' annotation, but printed in a form
|
179 |
|
|
which is intended for user consumption--in particular, the syntax
|
180 |
|
|
varies depending on the language), and SEPARATOR-STRING is a string
|
181 |
|
|
intended to separate this address from what follows for the user's
|
182 |
|
|
benefit.
|
183 |
|
|
|
184 |
|
|
Then comes
|
185 |
|
|
|
186 |
|
|
^Z^Zframe-function-name
|
187 |
|
|
FUNCTION-NAME
|
188 |
|
|
^Z^Zframe-args
|
189 |
|
|
ARGUMENTS
|
190 |
|
|
|
191 |
|
|
where FUNCTION-NAME is the name of the function executing in the
|
192 |
|
|
frame, or `??' if not known, and ARGUMENTS are the arguments to
|
193 |
|
|
the frame, with parentheses around them (each argument is annotated
|
194 |
|
|
individually as well, *note Value Annotations::).
|
195 |
|
|
|
196 |
|
|
If source information is available, a reference to it is then
|
197 |
|
|
printed:
|
198 |
|
|
|
199 |
|
|
^Z^Zframe-source-begin
|
200 |
|
|
SOURCE-INTRO-STRING
|
201 |
|
|
^Z^Zframe-source-file
|
202 |
|
|
FILENAME
|
203 |
|
|
^Z^Zframe-source-file-end
|
204 |
|
|
:
|
205 |
|
|
^Z^Zframe-source-line
|
206 |
|
|
LINE-NUMBER
|
207 |
|
|
^Z^Zframe-source-end
|
208 |
|
|
|
209 |
|
|
where SOURCE-INTRO-STRING separates for the user's benefit the
|
210 |
|
|
reference from the text which precedes it, FILENAME is the name of
|
211 |
|
|
the source file, and LINE-NUMBER is the line number within that
|
212 |
|
|
file (the first line is line 1).
|
213 |
|
|
|
214 |
|
|
If GDB prints some information about where the frame is from (which
|
215 |
|
|
library, which load segment, etc.; currently only done on the
|
216 |
|
|
RS/6000), it is annotated with
|
217 |
|
|
|
218 |
|
|
^Z^Zframe-where
|
219 |
|
|
INFORMATION
|
220 |
|
|
|
221 |
|
|
Then, if source is to actually be displayed for this frame (for
|
222 |
|
|
example, this is not true for output from the `backtrace'
|
223 |
|
|
command), then a `source' annotation (*note Source Annotations::)
|
224 |
|
|
is displayed. Unlike most annotations, this is output instead of
|
225 |
|
|
the normal text which would be output, not in addition.
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
File: gdb.info, Node: Displays, Next: Prompting, Prev: Frame Annotations, Up: Annotations
|
229 |
|
|
|
230 |
|
|
Displays
|
231 |
|
|
========
|
232 |
|
|
|
233 |
|
|
When GDB is told to display something using the `display' command,
|
234 |
|
|
the results of the display are annotated:
|
235 |
|
|
|
236 |
|
|
^Z^Zdisplay-begin
|
237 |
|
|
NUMBER
|
238 |
|
|
^Z^Zdisplay-number-end
|
239 |
|
|
NUMBER-SEPARATOR
|
240 |
|
|
^Z^Zdisplay-format
|
241 |
|
|
FORMAT
|
242 |
|
|
^Z^Zdisplay-expression
|
243 |
|
|
EXPRESSION
|
244 |
|
|
^Z^Zdisplay-expression-end
|
245 |
|
|
EXPRESSION-SEPARATOR
|
246 |
|
|
^Z^Zdisplay-value
|
247 |
|
|
VALUE
|
248 |
|
|
^Z^Zdisplay-end
|
249 |
|
|
|
250 |
|
|
where NUMBER is the number of the display, NUMBER-SEPARATOR is intended
|
251 |
|
|
to separate the number from what follows for the user, FORMAT includes
|
252 |
|
|
information such as the size, format, or other information about how
|
253 |
|
|
the value is being displayed, EXPRESSION is the expression being
|
254 |
|
|
displayed, EXPRESSION-SEPARATOR is intended to separate the expression
|
255 |
|
|
from the text that follows for the user, and VALUE is the actual value
|
256 |
|
|
being displayed.
|
257 |
|
|
|
258 |
|
|
|
259 |
|
|
File: gdb.info, Node: Prompting, Next: Errors, Prev: Displays, Up: Annotations
|
260 |
|
|
|
261 |
|
|
Annotation for GDB Input
|
262 |
|
|
========================
|
263 |
|
|
|
264 |
|
|
When GDB prompts for input, it annotates this fact so it is possible
|
265 |
|
|
to know when to send output, when the output from a given command is
|
266 |
|
|
over, etc.
|
267 |
|
|
|
268 |
|
|
Different kinds of input each have a different "input type". Each
|
269 |
|
|
input type has three annotations: a `pre-' annotation, which denotes
|
270 |
|
|
the beginning of any prompt which is being output, a plain annotation,
|
271 |
|
|
which denotes the end of the prompt, and then a `post-' annotation
|
272 |
|
|
which denotes the end of any echo which may (or may not) be associated
|
273 |
|
|
with the input. For example, the `prompt' input type features the
|
274 |
|
|
following annotations:
|
275 |
|
|
|
276 |
|
|
^Z^Zpre-prompt
|
277 |
|
|
^Z^Zprompt
|
278 |
|
|
^Z^Zpost-prompt
|
279 |
|
|
|
280 |
|
|
The input types are
|
281 |
|
|
|
282 |
|
|
`prompt'
|
283 |
|
|
When GDB is prompting for a command (the main GDB prompt).
|
284 |
|
|
|
285 |
|
|
`commands'
|
286 |
|
|
When GDB prompts for a set of commands, like in the `commands'
|
287 |
|
|
command. The annotations are repeated for each command which is
|
288 |
|
|
input.
|
289 |
|
|
|
290 |
|
|
`overload-choice'
|
291 |
|
|
When GDB wants the user to select between various overloaded
|
292 |
|
|
functions.
|
293 |
|
|
|
294 |
|
|
`query'
|
295 |
|
|
When GDB wants the user to confirm a potentially dangerous
|
296 |
|
|
operation.
|
297 |
|
|
|
298 |
|
|
`prompt-for-continue'
|
299 |
|
|
When GDB is asking the user to press return to continue. Note:
|
300 |
|
|
Don't expect this to work well; instead use `set height 0' to
|
301 |
|
|
disable prompting. This is because the counting of lines is buggy
|
302 |
|
|
in the presence of annotations.
|
303 |
|
|
|
304 |
|
|
|
305 |
|
|
File: gdb.info, Node: Errors, Next: Breakpoint Info, Prev: Prompting, Up: Annotations
|
306 |
|
|
|
307 |
|
|
Errors
|
308 |
|
|
======
|
309 |
|
|
|
310 |
|
|
^Z^Zquit
|
311 |
|
|
|
312 |
|
|
This annotation occurs right before GDB responds to an interrupt.
|
313 |
|
|
|
314 |
|
|
^Z^Zerror
|
315 |
|
|
|
316 |
|
|
This annotation occurs right before GDB responds to an error.
|
317 |
|
|
|
318 |
|
|
Quit and error annotations indicate that any annotations which GDB
|
319 |
|
|
was in the middle of may end abruptly. For example, if a
|
320 |
|
|
`value-history-begin' annotation is followed by a `error', one cannot
|
321 |
|
|
expect to receive the matching `value-history-end'. One cannot expect
|
322 |
|
|
not to receive it either, however; an error annotation does not
|
323 |
|
|
necessarily mean that GDB is immediately returning all the way to the
|
324 |
|
|
top level.
|
325 |
|
|
|
326 |
|
|
A quit or error annotation may be preceded by
|
327 |
|
|
|
328 |
|
|
^Z^Zerror-begin
|
329 |
|
|
|
330 |
|
|
Any output between that and the quit or error annotation is the error
|
331 |
|
|
message.
|
332 |
|
|
|
333 |
|
|
Warning messages are not yet annotated.
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
File: gdb.info, Node: Breakpoint Info, Next: Invalidation, Prev: Errors, Up: Annotations
|
337 |
|
|
|
338 |
|
|
Information on Breakpoints
|
339 |
|
|
==========================
|
340 |
|
|
|
341 |
|
|
The output from the `info breakpoints' command is annotated as
|
342 |
|
|
follows:
|
343 |
|
|
|
344 |
|
|
^Z^Zbreakpoints-headers
|
345 |
|
|
HEADER-ENTRY
|
346 |
|
|
^Z^Zbreakpoints-table
|
347 |
|
|
|
348 |
|
|
where HEADER-ENTRY has the same syntax as an entry (see below) but
|
349 |
|
|
instead of containing data, it contains strings which are intended to
|
350 |
|
|
convey the meaning of each field to the user. This is followed by any
|
351 |
|
|
number of entries. If a field does not apply for this entry, it is
|
352 |
|
|
omitted. Fields may contain trailing whitespace. Each entry consists
|
353 |
|
|
of:
|
354 |
|
|
|
355 |
|
|
^Z^Zrecord
|
356 |
|
|
^Z^Zfield 0
|
357 |
|
|
NUMBER
|
358 |
|
|
^Z^Zfield 1
|
359 |
|
|
TYPE
|
360 |
|
|
^Z^Zfield 2
|
361 |
|
|
DISPOSITION
|
362 |
|
|
^Z^Zfield 3
|
363 |
|
|
ENABLE
|
364 |
|
|
^Z^Zfield 4
|
365 |
|
|
ADDRESS
|
366 |
|
|
^Z^Zfield 5
|
367 |
|
|
WHAT
|
368 |
|
|
^Z^Zfield 6
|
369 |
|
|
FRAME
|
370 |
|
|
^Z^Zfield 7
|
371 |
|
|
CONDITION
|
372 |
|
|
^Z^Zfield 8
|
373 |
|
|
IGNORE-COUNT
|
374 |
|
|
^Z^Zfield 9
|
375 |
|
|
COMMANDS
|
376 |
|
|
|
377 |
|
|
Note that ADDRESS is intended for user consumption--the syntax
|
378 |
|
|
varies depending on the language.
|
379 |
|
|
|
380 |
|
|
The output ends with
|
381 |
|
|
|
382 |
|
|
^Z^Zbreakpoints-table-end
|
383 |
|
|
|
384 |
|
|
|
385 |
|
|
File: gdb.info, Node: Invalidation, Next: Annotations for Running, Prev: Breakpoint Info, Up: Annotations
|
386 |
|
|
|
387 |
|
|
Invalidation Notices
|
388 |
|
|
====================
|
389 |
|
|
|
390 |
|
|
The following annotations say that certain pieces of state may have
|
391 |
|
|
changed.
|
392 |
|
|
|
393 |
|
|
`^Z^Zframes-invalid'
|
394 |
|
|
The frames (for example, output from the `backtrace' command) may
|
395 |
|
|
have changed.
|
396 |
|
|
|
397 |
|
|
`^Z^Zbreakpoints-invalid'
|
398 |
|
|
The breakpoints may have changed. For example, the user just
|
399 |
|
|
added or deleted a breakpoint.
|
400 |
|
|
|
401 |
|
|
|
402 |
|
|
File: gdb.info, Node: Annotations for Running, Next: Source Annotations, Prev: Invalidation, Up: Annotations
|
403 |
|
|
|
404 |
|
|
Running the Program
|
405 |
|
|
===================
|
406 |
|
|
|
407 |
|
|
When the program starts executing due to a GDB command such as
|
408 |
|
|
`step' or `continue',
|
409 |
|
|
|
410 |
|
|
^Z^Zstarting
|
411 |
|
|
|
412 |
|
|
is output. When the program stops,
|
413 |
|
|
|
414 |
|
|
^Z^Zstopped
|
415 |
|
|
|
416 |
|
|
is output. Before the `stopped' annotation, a variety of
|
417 |
|
|
annotations describe how the program stopped.
|
418 |
|
|
|
419 |
|
|
`^Z^Zexited EXIT-STATUS'
|
420 |
|
|
The program exited, and EXIT-STATUS is the exit status (zero for
|
421 |
|
|
successful exit, otherwise nonzero).
|
422 |
|
|
|
423 |
|
|
`^Z^Zsignalled'
|
424 |
|
|
The program exited with a signal. After the `^Z^Zsignalled', the
|
425 |
|
|
annotation continues:
|
426 |
|
|
|
427 |
|
|
INTRO-TEXT
|
428 |
|
|
^Z^Zsignal-name
|
429 |
|
|
NAME
|
430 |
|
|
^Z^Zsignal-name-end
|
431 |
|
|
MIDDLE-TEXT
|
432 |
|
|
^Z^Zsignal-string
|
433 |
|
|
STRING
|
434 |
|
|
^Z^Zsignal-string-end
|
435 |
|
|
END-TEXT
|
436 |
|
|
|
437 |
|
|
where NAME is the name of the signal, such as `SIGILL' or
|
438 |
|
|
`SIGSEGV', and STRING is the explanation of the signal, such as
|
439 |
|
|
`Illegal Instruction' or `Segmentation fault'. INTRO-TEXT,
|
440 |
|
|
MIDDLE-TEXT, and END-TEXT are for the user's benefit and have no
|
441 |
|
|
particular format.
|
442 |
|
|
|
443 |
|
|
`^Z^Zsignal'
|
444 |
|
|
The syntax of this annotation is just like `signalled', but GDB is
|
445 |
|
|
just saying that the program received the signal, not that it was
|
446 |
|
|
terminated with it.
|
447 |
|
|
|
448 |
|
|
`^Z^Zbreakpoint NUMBER'
|
449 |
|
|
The program hit breakpoint number NUMBER.
|
450 |
|
|
|
451 |
|
|
`^Z^Zwatchpoint NUMBER'
|
452 |
|
|
The program hit watchpoint number NUMBER.
|
453 |
|
|
|
454 |
|
|
|
455 |
|
|
File: gdb.info, Node: Source Annotations, Next: TODO, Prev: Annotations for Running, Up: Annotations
|
456 |
|
|
|
457 |
|
|
Displaying Source
|
458 |
|
|
=================
|
459 |
|
|
|
460 |
|
|
The following annotation is used instead of displaying source code:
|
461 |
|
|
|
462 |
|
|
^Z^Zsource FILENAME:LINE:CHARACTER:MIDDLE:ADDR
|
463 |
|
|
|
464 |
|
|
where FILENAME is an absolute file name indicating which source
|
465 |
|
|
file, LINE is the line number within that file (where 1 is the first
|
466 |
|
|
line in the file), CHARACTER is the character position within the file
|
467 |
|
|
(where 0 is the first character in the file) (for most debug formats
|
468 |
|
|
this will necessarily point to the beginning of a line), MIDDLE is
|
469 |
|
|
`middle' if ADDR is in the middle of the line, or `beg' if ADDR is at
|
470 |
|
|
the beginning of the line, and ADDR is the address in the target
|
471 |
|
|
program associated with the source which is being displayed. ADDR is
|
472 |
|
|
in the form `0x' followed by one or more lowercase hex digits (note
|
473 |
|
|
that this does not depend on the language).
|
474 |
|
|
|
475 |
|
|
|
476 |
|
|
File: gdb.info, Node: TODO, Prev: Source Annotations, Up: Annotations
|
477 |
|
|
|
478 |
|
|
Annotations We Might Want in the Future
|
479 |
|
|
=======================================
|
480 |
|
|
|
481 |
|
|
- target-invalid
|
482 |
|
|
the target might have changed (registers, heap contents, or
|
483 |
|
|
execution status). For performance, we might eventually want
|
484 |
|
|
to hit `registers-invalid' and `all-registers-invalid' with
|
485 |
|
|
greater precision
|
486 |
|
|
|
487 |
|
|
- systematic annotation for set/show parameters (including
|
488 |
|
|
invalidation notices).
|
489 |
|
|
|
490 |
|
|
- similarly, `info' returns a list of candidates for invalidation
|
491 |
|
|
notices.
|
492 |
|
|
|
493 |
|
|
|
494 |
|
|
File: gdb.info, Node: GDB/MI, Next: GDB Bugs, Prev: Annotations, Up: Top
|
495 |
|
|
|
496 |
|
|
The GDB/MI Interface
|
497 |
|
|
********************
|
498 |
|
|
|
499 |
|
|
Function and Purpose
|
500 |
|
|
====================
|
501 |
|
|
|
502 |
|
|
GDB/MI is a line based machine oriented text interface to GDB. It is
|
503 |
|
|
specifically intended to support the development of systems which use
|
504 |
|
|
the debugger as just one small component of a larger system.
|
505 |
|
|
|
506 |
|
|
This chapter is a specification of the GDB/MI interface. It is
|
507 |
|
|
written in the form of a reference manual.
|
508 |
|
|
|
509 |
|
|
Note that GDB/MI is still under construction, so some of the
|
510 |
|
|
features described below are incomplete and subject to change.
|
511 |
|
|
|
512 |
|
|
Notation and Terminology
|
513 |
|
|
========================
|
514 |
|
|
|
515 |
|
|
This chapter uses the following notation:
|
516 |
|
|
|
517 |
|
|
* `|' separates two alternatives.
|
518 |
|
|
|
519 |
|
|
* `[ SOMETHING ]' indicates that SOMETHING is optional: it may or
|
520 |
|
|
may not be given.
|
521 |
|
|
|
522 |
|
|
* `( GROUP )*' means that GROUP inside the parentheses may repeat
|
523 |
|
|
zero or more times.
|
524 |
|
|
|
525 |
|
|
* `( GROUP )+' means that GROUP inside the parentheses may repeat
|
526 |
|
|
one or more times.
|
527 |
|
|
|
528 |
|
|
* `"STRING"' means a literal STRING.
|
529 |
|
|
|
530 |
|
|
Acknowledgments
|
531 |
|
|
===============
|
532 |
|
|
|
533 |
|
|
In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
|
534 |
|
|
Elena Zannoni.
|
535 |
|
|
|
536 |
|
|
* Menu:
|
537 |
|
|
|
538 |
|
|
* GDB/MI Command Syntax::
|
539 |
|
|
* GDB/MI Compatibility with CLI::
|
540 |
|
|
* GDB/MI Output Records::
|
541 |
|
|
* GDB/MI Command Description Format::
|
542 |
|
|
* GDB/MI Breakpoint Table Commands::
|
543 |
|
|
* GDB/MI Data Manipulation::
|
544 |
|
|
* GDB/MI Program Control::
|
545 |
|
|
* GDB/MI Miscellaneous Commands::
|
546 |
|
|
* GDB/MI Stack Manipulation::
|
547 |
|
|
* GDB/MI Symbol Query::
|
548 |
|
|
* GDB/MI Target Manipulation::
|
549 |
|
|
* GDB/MI Thread Commands::
|
550 |
|
|
* GDB/MI Tracepoint Commands::
|
551 |
|
|
* GDB/MI Variable Objects::
|
552 |
|
|
|
553 |
|
|
|
554 |
|
|
File: gdb.info, Node: GDB/MI Command Syntax, Next: GDB/MI Compatibility with CLI, Up: GDB/MI
|
555 |
|
|
|
556 |
|
|
GDB/MI Command Syntax
|
557 |
|
|
=====================
|
558 |
|
|
|
559 |
|
|
* Menu:
|
560 |
|
|
|
561 |
|
|
* GDB/MI Input Syntax::
|
562 |
|
|
* GDB/MI Output Syntax::
|
563 |
|
|
* GDB/MI Simple Examples::
|
564 |
|
|
|
565 |
|
|
|
566 |
|
|
File: gdb.info, Node: GDB/MI Input Syntax, Next: GDB/MI Output Syntax, Up: GDB/MI Command Syntax
|
567 |
|
|
|
568 |
|
|
GDB/MI Input Syntax
|
569 |
|
|
-------------------
|
570 |
|
|
|
571 |
|
|
`COMMAND ==>'
|
572 |
|
|
`CLI-COMMAND | MI-COMMAND'
|
573 |
|
|
|
574 |
|
|
`CLI-COMMAND ==>'
|
575 |
|
|
`[ TOKEN ] CLI-COMMAND NL', where CLI-COMMAND is any existing GDB
|
576 |
|
|
CLI command.
|
577 |
|
|
|
578 |
|
|
`MI-COMMAND ==>'
|
579 |
|
|
`[ TOKEN ] "-" OPERATION ( " " OPTION )* `[' " --" `]' ( " "
|
580 |
|
|
PARAMETER )* NL'
|
581 |
|
|
|
582 |
|
|
`TOKEN ==>'
|
583 |
|
|
"any sequence of digits"
|
584 |
|
|
|
585 |
|
|
`OPTION ==>'
|
586 |
|
|
`"-" PARAMETER [ " " PARAMETER ]'
|
587 |
|
|
|
588 |
|
|
`PARAMETER ==>'
|
589 |
|
|
`NON-BLANK-SEQUENCE | C-STRING'
|
590 |
|
|
|
591 |
|
|
`OPERATION ==>'
|
592 |
|
|
_any of the operations described in this chapter_
|
593 |
|
|
|
594 |
|
|
`NON-BLANK-SEQUENCE ==>'
|
595 |
|
|
_anything, provided it doesn't contain special characters such as
|
596 |
|
|
"-", NL, """ and of course " "_
|
597 |
|
|
|
598 |
|
|
`C-STRING ==>'
|
599 |
|
|
`""" SEVEN-BIT-ISO-C-STRING-CONTENT """'
|
600 |
|
|
|
601 |
|
|
`NL ==>'
|
602 |
|
|
`CR | CR-LF'
|
603 |
|
|
|
604 |
|
|
Notes:
|
605 |
|
|
|
606 |
|
|
* The CLI commands are still handled by the MI interpreter; their
|
607 |
|
|
output is described below.
|
608 |
|
|
|
609 |
|
|
* The `TOKEN', when present, is passed back when the command
|
610 |
|
|
finishes.
|
611 |
|
|
|
612 |
|
|
* Some MI commands accept optional arguments as part of the parameter
|
613 |
|
|
list. Each option is identified by a leading `-' (dash) and may be
|
614 |
|
|
followed by an optional argument parameter. Options occur first
|
615 |
|
|
in the parameter list and can be delimited from normal parameters
|
616 |
|
|
using `--' (this is useful when some parameters begin with a dash).
|
617 |
|
|
|
618 |
|
|
Pragmatics:
|
619 |
|
|
|
620 |
|
|
* We want easy access to the existing CLI syntax (for debugging).
|
621 |
|
|
|
622 |
|
|
* We want it to be easy to spot a MI operation.
|
623 |
|
|
|
624 |
|
|
|
625 |
|
|
File: gdb.info, Node: GDB/MI Output Syntax, Next: GDB/MI Simple Examples, Prev: GDB/MI Input Syntax, Up: GDB/MI Command Syntax
|
626 |
|
|
|
627 |
|
|
GDB/MI Output Syntax
|
628 |
|
|
--------------------
|
629 |
|
|
|
630 |
|
|
The output from GDB/MI consists of zero or more out-of-band records
|
631 |
|
|
followed, optionally, by a single result record. This result record is
|
632 |
|
|
for the most recent command. The sequence of output records is
|
633 |
|
|
terminated by `(gdb)'.
|
634 |
|
|
|
635 |
|
|
If an input command was prefixed with a `TOKEN' then the
|
636 |
|
|
corresponding output for that command will also be prefixed by that same
|
637 |
|
|
TOKEN.
|
638 |
|
|
|
639 |
|
|
`OUTPUT ==>'
|
640 |
|
|
`( OUT-OF-BAND-RECORD )* [ RESULT-RECORD ] "(gdb)" NL'
|
641 |
|
|
|
642 |
|
|
`RESULT-RECORD ==>'
|
643 |
|
|
` [ TOKEN ] "^" RESULT-CLASS ( "," RESULT )* NL'
|
644 |
|
|
|
645 |
|
|
`OUT-OF-BAND-RECORD ==>'
|
646 |
|
|
`ASYNC-RECORD | STREAM-RECORD'
|
647 |
|
|
|
648 |
|
|
`ASYNC-RECORD ==>'
|
649 |
|
|
`EXEC-ASYNC-OUTPUT | STATUS-ASYNC-OUTPUT | NOTIFY-ASYNC-OUTPUT'
|
650 |
|
|
|
651 |
|
|
`EXEC-ASYNC-OUTPUT ==>'
|
652 |
|
|
`[ TOKEN ] "*" ASYNC-OUTPUT'
|
653 |
|
|
|
654 |
|
|
`STATUS-ASYNC-OUTPUT ==>'
|
655 |
|
|
`[ TOKEN ] "+" ASYNC-OUTPUT'
|
656 |
|
|
|
657 |
|
|
`NOTIFY-ASYNC-OUTPUT ==>'
|
658 |
|
|
`[ TOKEN ] "=" ASYNC-OUTPUT'
|
659 |
|
|
|
660 |
|
|
`ASYNC-OUTPUT ==>'
|
661 |
|
|
`ASYNC-CLASS ( "," RESULT )* NL'
|
662 |
|
|
|
663 |
|
|
`RESULT-CLASS ==>'
|
664 |
|
|
`"done" | "running" | "connected" | "error" | "exit"'
|
665 |
|
|
|
666 |
|
|
`ASYNC-CLASS ==>'
|
667 |
|
|
`"stopped" | OTHERS' (where OTHERS will be added depending on the
|
668 |
|
|
needs--this is still in development).
|
669 |
|
|
|
670 |
|
|
`RESULT ==>'
|
671 |
|
|
` VARIABLE "=" VALUE'
|
672 |
|
|
|
673 |
|
|
`VARIABLE ==>'
|
674 |
|
|
` STRING '
|
675 |
|
|
|
676 |
|
|
`VALUE ==>'
|
677 |
|
|
` CONST | TUPLE | LIST '
|
678 |
|
|
|
679 |
|
|
`CONST ==>'
|
680 |
|
|
`C-STRING'
|
681 |
|
|
|
682 |
|
|
`TUPLE ==>'
|
683 |
|
|
` "{}" | "{" RESULT ( "," RESULT )* "}" '
|
684 |
|
|
|
685 |
|
|
`LIST ==>'
|
686 |
|
|
` "[]" | "[" VALUE ( "," VALUE )* "]" | "[" RESULT ( "," RESULT )*
|
687 |
|
|
"]" '
|
688 |
|
|
|
689 |
|
|
`STREAM-RECORD ==>'
|
690 |
|
|
`CONSOLE-STREAM-OUTPUT | TARGET-STREAM-OUTPUT | LOG-STREAM-OUTPUT'
|
691 |
|
|
|
692 |
|
|
`CONSOLE-STREAM-OUTPUT ==>'
|
693 |
|
|
`"~" C-STRING'
|
694 |
|
|
|
695 |
|
|
`TARGET-STREAM-OUTPUT ==>'
|
696 |
|
|
`"@" C-STRING'
|
697 |
|
|
|
698 |
|
|
`LOG-STREAM-OUTPUT ==>'
|
699 |
|
|
`"&" C-STRING'
|
700 |
|
|
|
701 |
|
|
`NL ==>'
|
702 |
|
|
`CR | CR-LF'
|
703 |
|
|
|
704 |
|
|
`TOKEN ==>'
|
705 |
|
|
_any sequence of digits_.
|
706 |
|
|
|
707 |
|
|
Notes:
|
708 |
|
|
|
709 |
|
|
* All output sequences end in a single line containing a period.
|
710 |
|
|
|
711 |
|
|
* The `TOKEN' is from the corresponding request. If an execution
|
712 |
|
|
command is interrupted by the `-exec-interrupt' command, the TOKEN
|
713 |
|
|
associated with the `*stopped' message is the one of the original
|
714 |
|
|
execution command, not the one of the interrupt command.
|
715 |
|
|
|
716 |
|
|
* STATUS-ASYNC-OUTPUT contains on-going status information about the
|
717 |
|
|
progress of a slow operation. It can be discarded. All status
|
718 |
|
|
output is prefixed by `+'.
|
719 |
|
|
|
720 |
|
|
* EXEC-ASYNC-OUTPUT contains asynchronous state change on the target
|
721 |
|
|
(stopped, started, disappeared). All async output is prefixed by
|
722 |
|
|
`*'.
|
723 |
|
|
|
724 |
|
|
* NOTIFY-ASYNC-OUTPUT contains supplementary information that the
|
725 |
|
|
client should handle (e.g., a new breakpoint information). All
|
726 |
|
|
notify output is prefixed by `='.
|
727 |
|
|
|
728 |
|
|
* CONSOLE-STREAM-OUTPUT is output that should be displayed as is in
|
729 |
|
|
the console. It is the textual response to a CLI command. All
|
730 |
|
|
the console output is prefixed by `~'.
|
731 |
|
|
|
732 |
|
|
* TARGET-STREAM-OUTPUT is the output produced by the target program.
|
733 |
|
|
All the target output is prefixed by `@'.
|
734 |
|
|
|
735 |
|
|
* LOG-STREAM-OUTPUT is output text coming from GDB's internals, for
|
736 |
|
|
instance messages that should be displayed as part of an error
|
737 |
|
|
log. All the log output is prefixed by `&'.
|
738 |
|
|
|
739 |
|
|
* New GDB/MI commands should only output LISTS containing VALUES.
|
740 |
|
|
|
741 |
|
|
|
742 |
|
|
*Note GDB/MI Stream Records: GDB/MI Stream Records, for more details
|
743 |
|
|
about the various output records.
|
744 |
|
|
|
745 |
|
|
|
746 |
|
|
File: gdb.info, Node: GDB/MI Simple Examples, Prev: GDB/MI Output Syntax, Up: GDB/MI Command Syntax
|
747 |
|
|
|
748 |
|
|
Simple Examples of GDB/MI Interaction
|
749 |
|
|
-------------------------------------
|
750 |
|
|
|
751 |
|
|
This subsection presents several simple examples of interaction using
|
752 |
|
|
the GDB/MI interface. In these examples, `->' means that the following
|
753 |
|
|
line is passed to GDB/MI as input, while `<-' means the output received
|
754 |
|
|
from GDB/MI.
|
755 |
|
|
|
756 |
|
|
Target Stop
|
757 |
|
|
...........
|
758 |
|
|
|
759 |
|
|
Here's an example of stopping the inferior process:
|
760 |
|
|
|
761 |
|
|
-> -stop
|
762 |
|
|
<- (gdb)
|
763 |
|
|
|
764 |
|
|
and later:
|
765 |
|
|
|
766 |
|
|
<- *stop,reason="stop",address="0x123",source="a.c:123"
|
767 |
|
|
<- (gdb)
|
768 |
|
|
|
769 |
|
|
Simple CLI Command
|
770 |
|
|
..................
|
771 |
|
|
|
772 |
|
|
Here's an example of a simple CLI command being passed through
|
773 |
|
|
GDB/MI and on to the CLI.
|
774 |
|
|
|
775 |
|
|
-> print 1+2
|
776 |
|
|
<- &"print 1+2\n"
|
777 |
|
|
<- ~"$1 = 3\n"
|
778 |
|
|
<- ^done
|
779 |
|
|
<- (gdb)
|
780 |
|
|
|
781 |
|
|
Command With Side Effects
|
782 |
|
|
.........................
|
783 |
|
|
|
784 |
|
|
-> -symbol-file xyz.exe
|
785 |
|
|
<- *breakpoint,nr="3",address="0x123",source="a.c:123"
|
786 |
|
|
<- (gdb)
|
787 |
|
|
|
788 |
|
|
A Bad Command
|
789 |
|
|
.............
|
790 |
|
|
|
791 |
|
|
Here's what happens if you pass a non-existent command:
|
792 |
|
|
|
793 |
|
|
-> -rubbish
|
794 |
|
|
<- ^error,msg="Undefined MI command: rubbish"
|
795 |
|
|
<- (gdb)
|
796 |
|
|
|
797 |
|
|
|
798 |
|
|
File: gdb.info, Node: GDB/MI Compatibility with CLI, Next: GDB/MI Output Records, Prev: GDB/MI Command Syntax, Up: GDB/MI
|
799 |
|
|
|
800 |
|
|
GDB/MI Compatibility with CLI
|
801 |
|
|
=============================
|
802 |
|
|
|
803 |
|
|
To help users familiar with GDB's existing CLI interface, GDB/MI
|
804 |
|
|
accepts existing CLI commands. As specified by the syntax, such
|
805 |
|
|
commands can be directly entered into the GDB/MI interface and GDB will
|
806 |
|
|
respond.
|
807 |
|
|
|
808 |
|
|
This mechanism is provided as an aid to developers of GDB/MI clients
|
809 |
|
|
and not as a reliable interface into the CLI. Since the command is
|
810 |
|
|
being interpreteted in an environment that assumes GDB/MI behaviour,
|
811 |
|
|
the exact output of such commands is likely to end up being an
|
812 |
|
|
un-supported hybrid of GDB/MI and CLI output.
|
813 |
|
|
|
814 |
|
|
|
815 |
|
|
File: gdb.info, Node: GDB/MI Output Records, Next: GDB/MI Command Description Format, Prev: GDB/MI Compatibility with CLI, Up: GDB/MI
|
816 |
|
|
|
817 |
|
|
GDB/MI Output Records
|
818 |
|
|
=====================
|
819 |
|
|
|
820 |
|
|
* Menu:
|
821 |
|
|
|
822 |
|
|
* GDB/MI Result Records::
|
823 |
|
|
* GDB/MI Stream Records::
|
824 |
|
|
* GDB/MI Out-of-band Records::
|
825 |
|
|
|
826 |
|
|
|
827 |
|
|
File: gdb.info, Node: GDB/MI Result Records, Next: GDB/MI Stream Records, Up: GDB/MI Output Records
|
828 |
|
|
|
829 |
|
|
GDB/MI Result Records
|
830 |
|
|
---------------------
|
831 |
|
|
|
832 |
|
|
In addition to a number of out-of-band notifications, the response
|
833 |
|
|
to a GDB/MI command includes one of the following result indications:
|
834 |
|
|
|
835 |
|
|
`"^done" [ "," RESULTS ]'
|
836 |
|
|
The synchronous operation was successful, `RESULTS' are the return
|
837 |
|
|
values.
|
838 |
|
|
|
839 |
|
|
`"^running"'
|
840 |
|
|
The asynchronous operation was successfully started. The target is
|
841 |
|
|
running.
|
842 |
|
|
|
843 |
|
|
`"^error" "," C-STRING'
|
844 |
|
|
The operation failed. The `C-STRING' contains the corresponding
|
845 |
|
|
error message.
|
846 |
|
|
|
847 |
|
|
|
848 |
|
|
File: gdb.info, Node: GDB/MI Stream Records, Next: GDB/MI Out-of-band Records, Prev: GDB/MI Result Records, Up: GDB/MI Output Records
|
849 |
|
|
|
850 |
|
|
GDB/MI Stream Records
|
851 |
|
|
---------------------
|
852 |
|
|
|
853 |
|
|
GDB internally maintains a number of output streams: the console, the
|
854 |
|
|
target, and the log. The output intended for each of these streams is
|
855 |
|
|
funneled through the GDB/MI interface using "stream records".
|
856 |
|
|
|
857 |
|
|
Each stream record begins with a unique "prefix character" which
|
858 |
|
|
identifies its stream (*note GDB/MI Output Syntax: GDB/MI Output
|
859 |
|
|
Syntax.). In addition to the prefix, each stream record contains a
|
860 |
|
|
`STRING-OUTPUT'. This is either raw text (with an implicit new line)
|
861 |
|
|
or a quoted C string (which does not contain an implicit newline).
|
862 |
|
|
|
863 |
|
|
`"~" STRING-OUTPUT'
|
864 |
|
|
The console output stream contains text that should be displayed
|
865 |
|
|
in the CLI console window. It contains the textual responses to
|
866 |
|
|
CLI commands.
|
867 |
|
|
|
868 |
|
|
`"@" STRING-OUTPUT'
|
869 |
|
|
The target output stream contains any textual output from the
|
870 |
|
|
running target.
|
871 |
|
|
|
872 |
|
|
`"&" STRING-OUTPUT'
|
873 |
|
|
The log stream contains debugging messages being produced by GDB's
|
874 |
|
|
internals.
|
875 |
|
|
|
876 |
|
|
|
877 |
|
|
File: gdb.info, Node: GDB/MI Out-of-band Records, Prev: GDB/MI Stream Records, Up: GDB/MI Output Records
|
878 |
|
|
|
879 |
|
|
GDB/MI Out-of-band Records
|
880 |
|
|
--------------------------
|
881 |
|
|
|
882 |
|
|
"Out-of-band" records are used to notify the GDB/MI client of
|
883 |
|
|
additional changes that have occurred. Those changes can either be a
|
884 |
|
|
consequence of GDB/MI (e.g., a breakpoint modified) or a result of
|
885 |
|
|
target activity (e.g., target stopped).
|
886 |
|
|
|
887 |
|
|
The following is a preliminary list of possible out-of-band records.
|
888 |
|
|
|
889 |
|
|
`"*" "stop"'
|
890 |
|
|
|
891 |
|
|
File: gdb.info, Node: GDB/MI Command Description Format, Next: GDB/MI Breakpoint Table Commands, Prev: GDB/MI Output Records, Up: GDB/MI
|
892 |
|
|
|
893 |
|
|
GDB/MI Command Description Format
|
894 |
|
|
=================================
|
895 |
|
|
|
896 |
|
|
The remaining sections describe blocks of commands. Each block of
|
897 |
|
|
commands is laid out in a fashion similar to this section.
|
898 |
|
|
|
899 |
|
|
Note the the line breaks shown in the examples are here only for
|
900 |
|
|
readability. They don't appear in the real output. Also note that the
|
901 |
|
|
commands with a non-available example (N.A.) are not yet implemented.
|
902 |
|
|
|
903 |
|
|
Motivation
|
904 |
|
|
----------
|
905 |
|
|
|
906 |
|
|
The motivation for this collection of commands.
|
907 |
|
|
|
908 |
|
|
Introduction
|
909 |
|
|
------------
|
910 |
|
|
|
911 |
|
|
A brief introduction to this collection of commands as a whole.
|
912 |
|
|
|
913 |
|
|
Commands
|
914 |
|
|
--------
|
915 |
|
|
|
916 |
|
|
For each command in the block, the following is described:
|
917 |
|
|
|
918 |
|
|
Synopsis
|
919 |
|
|
........
|
920 |
|
|
|
921 |
|
|
-command ARGS...
|
922 |
|
|
|
923 |
|
|
GDB Command
|
924 |
|
|
...........
|
925 |
|
|
|
926 |
|
|
The corresponding GDB CLI command.
|
927 |
|
|
|
928 |
|
|
Result
|
929 |
|
|
......
|
930 |
|
|
|
931 |
|
|
Out-of-band
|
932 |
|
|
...........
|
933 |
|
|
|
934 |
|
|
Notes
|
935 |
|
|
.....
|
936 |
|
|
|
937 |
|
|
Example
|
938 |
|
|
.......
|
939 |
|
|
|
940 |
|
|
|
941 |
|
|
File: gdb.info, Node: GDB/MI Breakpoint Table Commands, Next: GDB/MI Data Manipulation, Prev: GDB/MI Command Description Format, Up: GDB/MI
|
942 |
|
|
|
943 |
|
|
GDB/MI Breakpoint table commands
|
944 |
|
|
================================
|
945 |
|
|
|
946 |
|
|
This section documents GDB/MI commands for manipulating breakpoints.
|
947 |
|
|
|
948 |
|
|
The `-break-after' Command
|
949 |
|
|
--------------------------
|
950 |
|
|
|
951 |
|
|
Synopsis
|
952 |
|
|
........
|
953 |
|
|
|
954 |
|
|
-break-after NUMBER COUNT
|
955 |
|
|
|
956 |
|
|
The breakpoint number NUMBER is not in effect until it has been hit
|
957 |
|
|
COUNT times. To see how this is reflected in the output of the
|
958 |
|
|
`-break-list' command, see the description of the `-break-list' command
|
959 |
|
|
below.
|
960 |
|
|
|
961 |
|
|
GDB Command
|
962 |
|
|
...........
|
963 |
|
|
|
964 |
|
|
The corresponding GDB command is `ignore'.
|
965 |
|
|
|
966 |
|
|
Example
|
967 |
|
|
.......
|
968 |
|
|
|
969 |
|
|
(gdb)
|
970 |
|
|
-break-insert main
|
971 |
|
|
^done,bkpt={number="1",addr="0x000100d0",file="hello.c",line="5"}
|
972 |
|
|
(gdb)
|
973 |
|
|
-break-after 1 3
|
974 |
|
|
~
|
975 |
|
|
^done
|
976 |
|
|
(gdb)
|
977 |
|
|
-break-list
|
978 |
|
|
^done,BreakpointTable={nr_rows="1",nr_cols="6",
|
979 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
980 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
981 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
982 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
983 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
984 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
985 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
986 |
|
|
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
|
987 |
|
|
ignore="3"}]}
|
988 |
|
|
(gdb)
|
989 |
|
|
|
990 |
|
|
The `-break-condition' Command
|
991 |
|
|
------------------------------
|
992 |
|
|
|
993 |
|
|
Synopsis
|
994 |
|
|
........
|
995 |
|
|
|
996 |
|
|
-break-condition NUMBER EXPR
|
997 |
|
|
|
998 |
|
|
Breakpoint NUMBER will stop the program only if the condition in
|
999 |
|
|
EXPR is true. The condition becomes part of the `-break-list' output
|
1000 |
|
|
(see the description of the `-break-list' command below).
|
1001 |
|
|
|
1002 |
|
|
GDB Command
|
1003 |
|
|
...........
|
1004 |
|
|
|
1005 |
|
|
The corresponding GDB command is `condition'.
|
1006 |
|
|
|
1007 |
|
|
Example
|
1008 |
|
|
.......
|
1009 |
|
|
|
1010 |
|
|
(gdb)
|
1011 |
|
|
-break-condition 1 1
|
1012 |
|
|
^done
|
1013 |
|
|
(gdb)
|
1014 |
|
|
-break-list
|
1015 |
|
|
^done,BreakpointTable={nr_rows="1",nr_cols="6",
|
1016 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1017 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1018 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1019 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1020 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1021 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1022 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1023 |
|
|
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
|
1024 |
|
|
times="0",ignore="3"}]}
|
1025 |
|
|
(gdb)
|
1026 |
|
|
|
1027 |
|
|
The `-break-delete' Command
|
1028 |
|
|
---------------------------
|
1029 |
|
|
|
1030 |
|
|
Synopsis
|
1031 |
|
|
........
|
1032 |
|
|
|
1033 |
|
|
-break-delete ( BREAKPOINT )+
|
1034 |
|
|
|
1035 |
|
|
Delete the breakpoint(s) whose number(s) are specified in the
|
1036 |
|
|
argument list. This is obviously reflected in the breakpoint list.
|
1037 |
|
|
|
1038 |
|
|
GDB command
|
1039 |
|
|
...........
|
1040 |
|
|
|
1041 |
|
|
The corresponding GDB command is `delete'.
|
1042 |
|
|
|
1043 |
|
|
Example
|
1044 |
|
|
.......
|
1045 |
|
|
|
1046 |
|
|
(gdb)
|
1047 |
|
|
-break-delete 1
|
1048 |
|
|
^done
|
1049 |
|
|
(gdb)
|
1050 |
|
|
-break-list
|
1051 |
|
|
^done,BreakpointTable={nr_rows="0",nr_cols="6",
|
1052 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1053 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1054 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1055 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1056 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1057 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1058 |
|
|
body=[]}
|
1059 |
|
|
(gdb)
|
1060 |
|
|
|
1061 |
|
|
The `-break-disable' Command
|
1062 |
|
|
----------------------------
|
1063 |
|
|
|
1064 |
|
|
Synopsis
|
1065 |
|
|
........
|
1066 |
|
|
|
1067 |
|
|
-break-disable ( BREAKPOINT )+
|
1068 |
|
|
|
1069 |
|
|
Disable the named BREAKPOINT(s). The field `enabled' in the break
|
1070 |
|
|
list is now set to `n' for the named BREAKPOINT(s).
|
1071 |
|
|
|
1072 |
|
|
GDB Command
|
1073 |
|
|
...........
|
1074 |
|
|
|
1075 |
|
|
The corresponding GDB command is `disable'.
|
1076 |
|
|
|
1077 |
|
|
Example
|
1078 |
|
|
.......
|
1079 |
|
|
|
1080 |
|
|
(gdb)
|
1081 |
|
|
-break-disable 2
|
1082 |
|
|
^done
|
1083 |
|
|
(gdb)
|
1084 |
|
|
-break-list
|
1085 |
|
|
^done,BreakpointTable={nr_rows="1",nr_cols="6",
|
1086 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1087 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1088 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1089 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1090 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1091 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1092 |
|
|
body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="n",
|
1093 |
|
|
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}]}
|
1094 |
|
|
(gdb)
|
1095 |
|
|
|
1096 |
|
|
The `-break-enable' Command
|
1097 |
|
|
---------------------------
|
1098 |
|
|
|
1099 |
|
|
Synopsis
|
1100 |
|
|
........
|
1101 |
|
|
|
1102 |
|
|
-break-enable ( BREAKPOINT )+
|
1103 |
|
|
|
1104 |
|
|
Enable (previously disabled) BREAKPOINT(s).
|
1105 |
|
|
|
1106 |
|
|
GDB Command
|
1107 |
|
|
...........
|
1108 |
|
|
|
1109 |
|
|
The corresponding GDB command is `enable'.
|
1110 |
|
|
|
1111 |
|
|
Example
|
1112 |
|
|
.......
|
1113 |
|
|
|
1114 |
|
|
(gdb)
|
1115 |
|
|
-break-enable 2
|
1116 |
|
|
^done
|
1117 |
|
|
(gdb)
|
1118 |
|
|
-break-list
|
1119 |
|
|
^done,BreakpointTable={nr_rows="1",nr_cols="6",
|
1120 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1121 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1122 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1123 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1124 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1125 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1126 |
|
|
body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
|
1127 |
|
|
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}]}
|
1128 |
|
|
(gdb)
|
1129 |
|
|
|
1130 |
|
|
The `-break-info' Command
|
1131 |
|
|
-------------------------
|
1132 |
|
|
|
1133 |
|
|
Synopsis
|
1134 |
|
|
........
|
1135 |
|
|
|
1136 |
|
|
-break-info BREAKPOINT
|
1137 |
|
|
|
1138 |
|
|
Get information about a single breakpoint.
|
1139 |
|
|
|
1140 |
|
|
GDB command
|
1141 |
|
|
...........
|
1142 |
|
|
|
1143 |
|
|
The corresponding GDB command is `info break BREAKPOINT'.
|
1144 |
|
|
|
1145 |
|
|
Example
|
1146 |
|
|
.......
|
1147 |
|
|
|
1148 |
|
|
N.A.
|
1149 |
|
|
|
1150 |
|
|
The `-break-insert' Command
|
1151 |
|
|
---------------------------
|
1152 |
|
|
|
1153 |
|
|
Synopsis
|
1154 |
|
|
........
|
1155 |
|
|
|
1156 |
|
|
-break-insert [ -t ] [ -h ] [ -r ]
|
1157 |
|
|
[ -c CONDITION ] [ -i IGNORE-COUNT ]
|
1158 |
|
|
[ -p THREAD ] [ LINE | ADDR ]
|
1159 |
|
|
|
1160 |
|
|
If specified, LINE, can be one of:
|
1161 |
|
|
|
1162 |
|
|
* function
|
1163 |
|
|
|
1164 |
|
|
* filename:linenum
|
1165 |
|
|
|
1166 |
|
|
* filename:function
|
1167 |
|
|
|
1168 |
|
|
* *address
|
1169 |
|
|
|
1170 |
|
|
The possible optional parameters of this command are:
|
1171 |
|
|
|
1172 |
|
|
`-t'
|
1173 |
|
|
Insert a tempoary breakpoint.
|
1174 |
|
|
|
1175 |
|
|
`-h'
|
1176 |
|
|
Insert a hardware breakpoint.
|
1177 |
|
|
|
1178 |
|
|
`-c CONDITION'
|
1179 |
|
|
Make the breakpoint conditional on CONDITION.
|
1180 |
|
|
|
1181 |
|
|
`-i IGNORE-COUNT'
|
1182 |
|
|
Initialize the IGNORE-COUNT.
|
1183 |
|
|
|
1184 |
|
|
`-r'
|
1185 |
|
|
Insert a regular breakpoint in all the functions whose names match
|
1186 |
|
|
the given regular expression. Other flags are not applicable to
|
1187 |
|
|
regular expresson.
|
1188 |
|
|
|
1189 |
|
|
Result
|
1190 |
|
|
......
|
1191 |
|
|
|
1192 |
|
|
The result is in the form:
|
1193 |
|
|
|
1194 |
|
|
^done,bkptno="NUMBER",func="FUNCNAME",
|
1195 |
|
|
file="FILENAME",line="LINENO"
|
1196 |
|
|
|
1197 |
|
|
where NUMBER is the GDB number for this breakpoint, FUNCNAME is the
|
1198 |
|
|
name of the function where the breakpoint was inserted, FILENAME is the
|
1199 |
|
|
name of the source file which contains this function, and LINENO is the
|
1200 |
|
|
source line number within that file.
|
1201 |
|
|
|
1202 |
|
|
Note: this format is open to change.
|
1203 |
|
|
|
1204 |
|
|
GDB Command
|
1205 |
|
|
...........
|
1206 |
|
|
|
1207 |
|
|
The corresponding GDB commands are `break', `tbreak', `hbreak',
|
1208 |
|
|
`thbreak', and `rbreak'.
|
1209 |
|
|
|
1210 |
|
|
Example
|
1211 |
|
|
.......
|
1212 |
|
|
|
1213 |
|
|
(gdb)
|
1214 |
|
|
-break-insert main
|
1215 |
|
|
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
|
1216 |
|
|
(gdb)
|
1217 |
|
|
-break-insert -t foo
|
1218 |
|
|
^done,bkpt={number="2",addr="0x00010774",file="recursive2.c",line="11"}
|
1219 |
|
|
(gdb)
|
1220 |
|
|
-break-list
|
1221 |
|
|
^done,BreakpointTable={nr_rows="2",nr_cols="6",
|
1222 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1223 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1224 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1225 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1226 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1227 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1228 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1229 |
|
|
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"},
|
1230 |
|
|
bkpt={number="2",type="breakpoint",disp="del",enabled="y",
|
1231 |
|
|
addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"}]}
|
1232 |
|
|
(gdb)
|
1233 |
|
|
-break-insert -r foo.*
|
1234 |
|
|
~int foo(int, int);
|
1235 |
|
|
^done,bkpt={number="3",addr="0x00010774",file="recursive2.c",line="11"}
|
1236 |
|
|
(gdb)
|
1237 |
|
|
|
1238 |
|
|
The `-break-list' Command
|
1239 |
|
|
-------------------------
|
1240 |
|
|
|
1241 |
|
|
Synopsis
|
1242 |
|
|
........
|
1243 |
|
|
|
1244 |
|
|
-break-list
|
1245 |
|
|
|
1246 |
|
|
Displays the list of inserted breakpoints, showing the following
|
1247 |
|
|
fields:
|
1248 |
|
|
|
1249 |
|
|
`Number'
|
1250 |
|
|
number of the breakpoint
|
1251 |
|
|
|
1252 |
|
|
`Type'
|
1253 |
|
|
type of the breakpoint: `breakpoint' or `watchpoint'
|
1254 |
|
|
|
1255 |
|
|
`Disposition'
|
1256 |
|
|
should the breakpoint be deleted or disabled when it is hit: `keep'
|
1257 |
|
|
or `nokeep'
|
1258 |
|
|
|
1259 |
|
|
`Enabled'
|
1260 |
|
|
is the breakpoint enabled or no: `y' or `n'
|
1261 |
|
|
|
1262 |
|
|
`Address'
|
1263 |
|
|
memory location at which the breakpoint is set
|
1264 |
|
|
|
1265 |
|
|
`What'
|
1266 |
|
|
logical location of the breakpoint, expressed by function name,
|
1267 |
|
|
file name, line number
|
1268 |
|
|
|
1269 |
|
|
`Times'
|
1270 |
|
|
number of times the breakpoint has been hit
|
1271 |
|
|
|
1272 |
|
|
If there are no breakpoints or watchpoints, the `BreakpointTable'
|
1273 |
|
|
`body' field is an empty list.
|
1274 |
|
|
|
1275 |
|
|
GDB Command
|
1276 |
|
|
...........
|
1277 |
|
|
|
1278 |
|
|
The corresponding GDB command is `info break'.
|
1279 |
|
|
|
1280 |
|
|
Example
|
1281 |
|
|
.......
|
1282 |
|
|
|
1283 |
|
|
(gdb)
|
1284 |
|
|
-break-list
|
1285 |
|
|
^done,BreakpointTable={nr_rows="2",nr_cols="6",
|
1286 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1287 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1288 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1289 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1290 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1291 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1292 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1293 |
|
|
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"},
|
1294 |
|
|
bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
|
1295 |
|
|
addr="0x00010114",func="foo",file="hello.c",line="13",times="0"}]}
|
1296 |
|
|
(gdb)
|
1297 |
|
|
|
1298 |
|
|
Here's an example of the result when there are no breakpoints:
|
1299 |
|
|
|
1300 |
|
|
(gdb)
|
1301 |
|
|
-break-list
|
1302 |
|
|
^done,BreakpointTable={nr_rows="0",nr_cols="6",
|
1303 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1304 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1305 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1306 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1307 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1308 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1309 |
|
|
body=[]}
|
1310 |
|
|
(gdb)
|
1311 |
|
|
|
1312 |
|
|
The `-break-watch' Command
|
1313 |
|
|
--------------------------
|
1314 |
|
|
|
1315 |
|
|
Synopsis
|
1316 |
|
|
........
|
1317 |
|
|
|
1318 |
|
|
-break-watch [ -a | -r ]
|
1319 |
|
|
|
1320 |
|
|
Create a watchpoint. With the `-a' option it will create an
|
1321 |
|
|
"access" watchpoint, i.e. a watchpoint that triggers either on a read
|
1322 |
|
|
from or on a write to the memory location. With the `-r' option, the
|
1323 |
|
|
watchpoint created is a "read" watchpoint, i.e. it will trigger only
|
1324 |
|
|
when the memory location is accessed for reading. Without either of
|
1325 |
|
|
the options, the watchpoint created is a regular watchpoint, i.e. it
|
1326 |
|
|
will trigger when the memory location is accessed for writing. *Note
|
1327 |
|
|
Setting watchpoints: Set Watchpoints.
|
1328 |
|
|
|
1329 |
|
|
Note that `-break-list' will report a single list of watchpoints and
|
1330 |
|
|
breakpoints inserted.
|
1331 |
|
|
|
1332 |
|
|
GDB Command
|
1333 |
|
|
...........
|
1334 |
|
|
|
1335 |
|
|
The corresponding GDB commands are `watch', `awatch', and `rwatch'.
|
1336 |
|
|
|
1337 |
|
|
Example
|
1338 |
|
|
.......
|
1339 |
|
|
|
1340 |
|
|
Setting a watchpoint on a variable in the `main' function:
|
1341 |
|
|
|
1342 |
|
|
(gdb)
|
1343 |
|
|
-break-watch x
|
1344 |
|
|
^done,wpt={number="2",exp="x"}
|
1345 |
|
|
(gdb)
|
1346 |
|
|
-exec-continue
|
1347 |
|
|
^running
|
1348 |
|
|
^done,reason="watchpoint-trigger",wpt={number="2",exp="x"},
|
1349 |
|
|
value={old="-268439212",new="55"},
|
1350 |
|
|
frame={func="main",args=[],file="recursive2.c",line="5"}
|
1351 |
|
|
(gdb)
|
1352 |
|
|
|
1353 |
|
|
Setting a watchpoint on a variable local to a function. GDB will
|
1354 |
|
|
stop the program execution twice: first for the variable changing
|
1355 |
|
|
value, then for the watchpoint going out of scope.
|
1356 |
|
|
|
1357 |
|
|
(gdb)
|
1358 |
|
|
-break-watch C
|
1359 |
|
|
^done,wpt={number="5",exp="C"}
|
1360 |
|
|
(gdb)
|
1361 |
|
|
-exec-continue
|
1362 |
|
|
^running
|
1363 |
|
|
^done,reason="watchpoint-trigger",
|
1364 |
|
|
wpt={number="5",exp="C"},value={old="-276895068",new="3"},
|
1365 |
|
|
frame={func="callee4",args=[],
|
1366 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
|
1367 |
|
|
(gdb)
|
1368 |
|
|
-exec-continue
|
1369 |
|
|
^running
|
1370 |
|
|
^done,reason="watchpoint-scope",wpnum="5",
|
1371 |
|
|
frame={func="callee3",args=[{name="strarg",
|
1372 |
|
|
value="0x11940 \"A string argument.\""}],
|
1373 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
|
1374 |
|
|
(gdb)
|
1375 |
|
|
|
1376 |
|
|
Listing breakpoints and watchpoints, at different points in the
|
1377 |
|
|
program execution. Note that once the watchpoint goes out of scope, it
|
1378 |
|
|
is deleted.
|
1379 |
|
|
|
1380 |
|
|
(gdb)
|
1381 |
|
|
-break-watch C
|
1382 |
|
|
^done,wpt={number="2",exp="C"}
|
1383 |
|
|
(gdb)
|
1384 |
|
|
-break-list
|
1385 |
|
|
^done,BreakpointTable={nr_rows="2",nr_cols="6",
|
1386 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1387 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1388 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1389 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1390 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1391 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1392 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1393 |
|
|
addr="0x00010734",func="callee4",
|
1394 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
|
1395 |
|
|
bkpt={number="2",type="watchpoint",disp="keep",
|
1396 |
|
|
enabled="y",addr="",what="C",times="0"}]}
|
1397 |
|
|
(gdb)
|
1398 |
|
|
-exec-continue
|
1399 |
|
|
^running
|
1400 |
|
|
^done,reason="watchpoint-trigger",wpt={number="2",exp="C"},
|
1401 |
|
|
value={old="-276895068",new="3"},
|
1402 |
|
|
frame={func="callee4",args=[],
|
1403 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
|
1404 |
|
|
(gdb)
|
1405 |
|
|
-break-list
|
1406 |
|
|
^done,BreakpointTable={nr_rows="2",nr_cols="6",
|
1407 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1408 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1409 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1410 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1411 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1412 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1413 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1414 |
|
|
addr="0x00010734",func="callee4",
|
1415 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
|
1416 |
|
|
bkpt={number="2",type="watchpoint",disp="keep",
|
1417 |
|
|
enabled="y",addr="",what="C",times="-5"}]}
|
1418 |
|
|
(gdb)
|
1419 |
|
|
-exec-continue
|
1420 |
|
|
^running
|
1421 |
|
|
^done,reason="watchpoint-scope",wpnum="2",
|
1422 |
|
|
frame={func="callee3",args=[{name="strarg",
|
1423 |
|
|
value="0x11940 \"A string argument.\""}],
|
1424 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
|
1425 |
|
|
(gdb)
|
1426 |
|
|
-break-list
|
1427 |
|
|
^done,BreakpointTable={nr_rows="1",nr_cols="6",
|
1428 |
|
|
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
|
1429 |
|
|
{width="14",alignment="-1",col_name="type",colhdr="Type"},
|
1430 |
|
|
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
|
1431 |
|
|
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
|
1432 |
|
|
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
|
1433 |
|
|
{width="40",alignment="2",col_name="what",colhdr="What"}],
|
1434 |
|
|
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
|
1435 |
|
|
addr="0x00010734",func="callee4",
|
1436 |
|
|
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"}]}
|
1437 |
|
|
(gdb)
|
1438 |
|
|
|