OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [gdb-5.3/] [gdb/] [doc/] [gdb.info-13] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
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: Commands For History,  Next: Commands For Text,  Prev: Commands For Moving,  Up: Bindable Readline Commands
31
 
32
Commands For Manipulating The History
33
-------------------------------------
34
 
35
`accept-line (Newline, Return)'
36
     Accept the line regardless of where the cursor is.  If this line is
37
     non-empty, add it to the history list.  If this line was a history
38
     line, then restore the history line to its original state.
39
 
40
`previous-history (C-p)'
41
     Move `up' through the history list.
42
 
43
`next-history (C-n)'
44
     Move `down' through the history list.
45
 
46
`beginning-of-history (M-<)'
47
     Move to the first line in the history.
48
 
49
`end-of-history (M->)'
50
     Move to the end of the input history, i.e., the line currently
51
     being entered.
52
 
53
`reverse-search-history (C-r)'
54
     Search backward starting at the current line and moving `up'
55
     through the history as necessary.  This is an incremental search.
56
 
57
`forward-search-history (C-s)'
58
     Search forward starting at the current line and moving `down'
59
     through the the history as necessary.  This is an incremental
60
     search.
61
 
62
`non-incremental-reverse-search-history (M-p)'
63
     Search backward starting at the current line and moving `up'
64
     through the history as necessary using a non-incremental search
65
     for a string supplied by the user.
66
 
67
`non-incremental-forward-search-history (M-n)'
68
     Search forward starting at the current line and moving `down'
69
     through the the history as necessary using a non-incremental search
70
     for a string supplied by the user.
71
 
72
`history-search-forward ()'
73
     Search forward through the history for the string of characters
74
     between the start of the current line and the point.  This is a
75
     non-incremental search.  By default, this command is unbound.
76
 
77
`history-search-backward ()'
78
     Search backward through the history for the string of characters
79
     between the start of the current line and the point.  This is a
80
     non-incremental search.  By default, this command is unbound.
81
 
82
`yank-nth-arg (M-C-y)'
83
     Insert the first argument to the previous command (usually the
84
     second word on the previous line).  With an argument N, insert the
85
     Nth word from the previous command (the words in the previous
86
     command begin with word 0).  A negative argument inserts the Nth
87
     word from the end of the previous command.
88
 
89
`yank-last-arg (M-., M-_)'
90
     Insert last argument to the previous command (the last word of the
91
     previous history entry).  With an argument, behave exactly like
92
     `yank-nth-arg'.  Successive calls to `yank-last-arg' move back
93
     through the history list, inserting the last argument of each line
94
     in turn.
95
 
96

97
File: gdb.info,  Node: Commands For Text,  Next: Commands For Killing,  Prev: Commands For History,  Up: Bindable Readline Commands
98
 
99
Commands For Changing Text
100
--------------------------
101
 
102
`delete-char (C-d)'
103
     Delete the character under the cursor.  If the cursor is at the
104
     beginning of the line, there are no characters in the line, and
105
     the last character typed was not bound to `delete-char', then
106
     return `EOF'.
107
 
108
`backward-delete-char (Rubout)'
109
     Delete the character behind the cursor.  A numeric argument means
110
     to kill the characters instead of deleting them.
111
 
112
`forward-backward-delete-char ()'
113
     Delete the character under the cursor, unless the cursor is at the
114
     end of the line, in which case the character behind the cursor is
115
     deleted.  By default, this is not bound to a key.
116
 
117
`quoted-insert (C-q, C-v)'
118
     Add the next character typed to the line verbatim.  This is how to
119
     insert key sequences like , for example.
120
 
121
`tab-insert (M-TAB)'
122
     Insert a tab character.
123
 
124
`self-insert (a, b, A, 1, !, ...)'
125
     Insert yourself.
126
 
127
`transpose-chars (C-t)'
128
     Drag the character before the cursor forward over the character at
129
     the cursor, moving the cursor forward as well.  If the insertion
130
     point is at the end of the line, then this transposes the last two
131
     characters of the line.  Negative arguments have no effect.
132
 
133
`transpose-words (M-t)'
134
     Drag the word before point past the word after point, moving point
135
     past that word as well.
136
 
137
`upcase-word (M-u)'
138
     Uppercase the current (or following) word.  With a negative
139
     argument, uppercase the previous word, but do not move the cursor.
140
 
141
`downcase-word (M-l)'
142
     Lowercase the current (or following) word.  With a negative
143
     argument, lowercase the previous word, but do not move the cursor.
144
 
145
`capitalize-word (M-c)'
146
     Capitalize the current (or following) word.  With a negative
147
     argument, capitalize the previous word, but do not move the cursor.
148
 
149

150
File: gdb.info,  Node: Commands For Killing,  Next: Numeric Arguments,  Prev: Commands For Text,  Up: Bindable Readline Commands
151
 
152
Killing And Yanking
153
-------------------
154
 
155
`kill-line (C-k)'
156
     Kill the text from point to the end of the line.
157
 
158
`backward-kill-line (C-x Rubout)'
159
     Kill backward to the beginning of the line.
160
 
161
`unix-line-discard (C-u)'
162
     Kill backward from the cursor to the beginning of the current line.
163
 
164
`kill-whole-line ()'
165
     Kill all characters on the current line, no matter point is.  By
166
     default, this is unbound.
167
 
168
`kill-word (M-d)'
169
     Kill from point to the end of the current word, or if between
170
     words, to the end of the next word.  Word boundaries are the same
171
     as `forward-word'.
172
 
173
`backward-kill-word (M-DEL)'
174
     Kill the word behind point.  Word boundaries are the same as
175
     `backward-word'.
176
 
177
`unix-word-rubout (C-w)'
178
     Kill the word behind point, using white space as a word boundary.
179
     The killed text is saved on the kill-ring.
180
 
181
`delete-horizontal-space ()'
182
     Delete all spaces and tabs around point.  By default, this is
183
     unbound.
184
 
185
`kill-region ()'
186
     Kill the text in the current region.  By default, this command is
187
     unbound.
188
 
189
`copy-region-as-kill ()'
190
     Copy the text in the region to the kill buffer, so it can be yanked
191
     right away.  By default, this command is unbound.
192
 
193
`copy-backward-word ()'
194
     Copy the word before point to the kill buffer.  The word
195
     boundaries are the same as `backward-word'.  By default, this
196
     command is unbound.
197
 
198
`copy-forward-word ()'
199
     Copy the word following point to the kill buffer.  The word
200
     boundaries are the same as `forward-word'.  By default, this
201
     command is unbound.
202
 
203
`yank (C-y)'
204
     Yank the top of the kill ring into the buffer at the current
205
     cursor position.
206
 
207
`yank-pop (M-y)'
208
     Rotate the kill-ring, and yank the new top.  You can only do this
209
     if the prior command is yank or yank-pop.
210
 
211

212
File: gdb.info,  Node: Numeric Arguments,  Next: Commands For Completion,  Prev: Commands For Killing,  Up: Bindable Readline Commands
213
 
214
Specifying Numeric Arguments
215
----------------------------
216
 
217
`digit-argument (M-0, M-1, ... M--)'
218
     Add this digit to the argument already accumulating, or start a new
219
     argument.   starts a negative argument.
220
 
221
`universal-argument ()'
222
     This is another way to specify an argument.  If this command is
223
     followed by one or more digits, optionally with a leading minus
224
     sign, those digits define the argument.  If the command is
225
     followed by digits, executing `universal-argument' again ends the
226
     numeric argument, but is otherwise ignored.  As a special case, if
227
     this command is immediately followed by a character that is
228
     neither a digit or minus sign, the argument count for the next
229
     command is multiplied by four.  The argument count is initially
230
     one, so executing this function the first time makes the argument
231
     count four, a second time makes the argument count sixteen, and so
232
     on.  By default, this is not bound to a key.
233
 
234

235
File: gdb.info,  Node: Commands For Completion,  Next: Keyboard Macros,  Prev: Numeric Arguments,  Up: Bindable Readline Commands
236
 
237
Letting Readline Type For You
238
-----------------------------
239
 
240
`complete (TAB)'
241
     Attempt to do completion on the text before the cursor.  This is
242
     application-specific.  Generally, if you are typing a filename
243
     argument, you can do filename completion; if you are typing a
244
     command, you can do command completion; if you are typing in a
245
     symbol to GDB, you can do symbol name completion; if you are
246
     typing in a variable to Bash, you can do variable name completion,
247
     and so on.
248
 
249
`possible-completions (M-?)'
250
     List the possible completions of the text before the cursor.
251
 
252
`insert-completions (M-*)'
253
     Insert all completions of the text before point that would have
254
     been generated by `possible-completions'.
255
 
256
`menu-complete ()'
257
     Similar to `complete', but replaces the word to be completed with
258
     a single match from the list of possible completions.  Repeated
259
     execution of `menu-complete' steps through the list of possible
260
     completions, inserting each match in turn.  At the end of the list
261
     of completions, the bell is rung and the original text is restored.
262
     An argument of N moves N positions forward in the list of matches;
263
     a negative argument may be used to move backward through the list.
264
     This command is intended to be bound to `TAB', but is unbound by
265
     default.
266
 
267
`delete-char-or-list ()'
268
     Deletes the character under the cursor if not at the beginning or
269
     end of the line (like `delete-char').  If at the end of the line,
270
     behaves identically to `possible-completions'.  This command is
271
     unbound by default.
272
 
273

274
File: gdb.info,  Node: Keyboard Macros,  Next: Miscellaneous Commands,  Prev: Commands For Completion,  Up: Bindable Readline Commands
275
 
276
Keyboard Macros
277
---------------
278
 
279
`start-kbd-macro (C-x ()'
280
     Begin saving the characters typed into the current keyboard macro.
281
 
282
`end-kbd-macro (C-x ))'
283
     Stop saving the characters typed into the current keyboard macro
284
     and save the definition.
285
 
286
`call-last-kbd-macro (C-x e)'
287
     Re-execute the last keyboard macro defined, by making the
288
     characters in the macro appear as if typed at the keyboard.
289
 
290

291
File: gdb.info,  Node: Miscellaneous Commands,  Prev: Keyboard Macros,  Up: Bindable Readline Commands
292
 
293
Some Miscellaneous Commands
294
---------------------------
295
 
296
`re-read-init-file (C-x C-r)'
297
     Read in the contents of the INPUTRC file, and incorporate any
298
     bindings or variable assignments found there.
299
 
300
`abort (C-g)'
301
     Abort the current editing command and ring the terminal's bell
302
     (subject to the setting of `bell-style').
303
 
304
`do-uppercase-version (M-a, M-b, M-X, ...)'
305
     If the metafied character X is lowercase, run the command that is
306
     bound to the corresponding uppercase character.
307
 
308
`prefix-meta (ESC)'
309
     Make the next character typed be metafied.  This is for keyboards
310
     without a meta key.  Typing `ESC f' is equivalent to typing `M-f'.
311
 
312
`undo (C-_, C-x C-u)'
313
     Incremental undo, separately remembered for each line.
314
 
315
`revert-line (M-r)'
316
     Undo all changes made to this line.  This is like executing the
317
     `undo' command enough times to get back to the beginning.
318
 
319
`tilde-expand (M-~)'
320
     Perform tilde expansion on the current word.
321
 
322
`set-mark (C-@)'
323
     Set the mark to the current point.  If a numeric argument is
324
     supplied, the mark is set to that position.
325
 
326
`exchange-point-and-mark (C-x C-x)'
327
     Swap the point with the mark.  The current cursor position is set
328
     to the saved position, and the old cursor position is saved as the
329
     mark.
330
 
331
`character-search (C-])'
332
     A character is read and point is moved to the next occurrence of
333
     that character.  A negative count searches for previous
334
     occurrences.
335
 
336
`character-search-backward (M-C-])'
337
     A character is read and point is moved to the previous occurrence
338
     of that character.  A negative count searches for subsequent
339
     occurrences.
340
 
341
`insert-comment (M-#)'
342
     The value of the `comment-begin' variable is inserted at the
343
     beginning of the current line, and the line is accepted as if a
344
     newline had been typed.
345
 
346
`dump-functions ()'
347
     Print all of the functions and their key bindings to the Readline
348
     output stream.  If a numeric argument is supplied, the output is
349
     formatted in such a way that it can be made part of an INPUTRC
350
     file.  This command is unbound by default.
351
 
352
`dump-variables ()'
353
     Print all of the settable variables and their values to the
354
     Readline output stream.  If a numeric argument is supplied, the
355
     output is formatted in such a way that it can be made part of an
356
     INPUTRC file.  This command is unbound by default.
357
 
358
`dump-macros ()'
359
     Print all of the Readline key sequences bound to macros and the
360
     strings they ouput.  If a numeric argument is supplied, the output
361
     is formatted in such a way that it can be made part of an INPUTRC
362
     file.  This command is unbound by default.
363
 
364

365
File: gdb.info,  Node: Readline vi Mode,  Prev: Bindable Readline Commands,  Up: Command Line Editing
366
 
367
Readline vi Mode
368
================
369
 
370
   While the Readline library does not have a full set of `vi' editing
371
functions, it does contain enough to allow simple editing of the line.
372
The Readline `vi' mode behaves as specified in the POSIX 1003.2
373
standard.
374
 
375
   In order to switch interactively between `emacs' and `vi' editing
376
modes, use the command M-C-j (toggle-editing-mode).  The Readline
377
default is `emacs' mode.
378
 
379
   When you enter a line in `vi' mode, you are already placed in
380
`insertion' mode, as if you had typed an `i'.  Pressing  switches
381
you into `command' mode, where you can edit the text of the line with
382
the standard `vi' movement keys, move to previous history lines with
383
`k' and subsequent lines with `j', and so forth.
384
 
385

386
File: gdb.info,  Node: Using History Interactively,  Next: Installing GDB,  Prev: Command Line Editing,  Up: Top
387
 
388
Using History Interactively
389
***************************
390
 
391
   This chapter describes how to use the GNU History Library
392
interactively, from a user's standpoint.  It should be considered a
393
user's guide.
394
 
395
* Menu:
396
 
397
* History Interaction::         What it feels like using History as a user.
398
 
399

400
File: gdb.info,  Node: History Interaction,  Up: Using History Interactively
401
 
402
History Expansion
403
=================
404
 
405
   The History library provides a history expansion feature that is
406
similar to the history expansion provided by `csh'.  This section
407
describes the syntax used to manipulate the history information.
408
 
409
   History expansions introduce words from the history list into the
410
input stream, making it easy to repeat commands, insert the arguments
411
to a previous command into the current input line, or fix errors in
412
previous commands quickly.
413
 
414
   History expansion takes place in two parts.  The first is to
415
determine which line from the history list should be used during
416
substitution.  The second is to select portions of that line for
417
inclusion into the current one.  The line selected from the history is
418
called the "event", and the portions of that line that are acted upon
419
are called "words".  Various "modifiers" are available to manipulate
420
the selected words.  The line is broken into words in the same fashion
421
that Bash does, so that several words surrounded by quotes are
422
considered one word.  History expansions are introduced by the
423
appearance of the history expansion character, which is `!' by default.
424
 
425
* Menu:
426
 
427
* Event Designators::   How to specify which history line to use.
428
* Word Designators::    Specifying which words are of interest.
429
* Modifiers::           Modifying the results of substitution.
430
 
431

432
File: gdb.info,  Node: Event Designators,  Next: Word Designators,  Up: History Interaction
433
 
434
Event Designators
435
-----------------
436
 
437
   An event designator is a reference to a command line entry in the
438
history list.
439
 
440
`!'
441
     Start a history substitution, except when followed by a space, tab,
442
     the end of the line, `=' or `('.
443
 
444
`!N'
445
     Refer to command line N.
446
 
447
`!-N'
448
     Refer to the command N lines back.
449
 
450
`!!'
451
     Refer to the previous command.  This is a synonym for `!-1'.
452
 
453
`!STRING'
454
     Refer to the most recent command starting with STRING.
455
 
456
`!?STRING[?]'
457
     Refer to the most recent command containing STRING.  The trailing
458
     `?' may be omitted if the STRING is followed immediately by a
459
     newline.
460
 
461
`^STRING1^STRING2^'
462
     Quick Substitution.  Repeat the last command, replacing STRING1
463
     with STRING2.  Equivalent to `!!:s/STRING1/STRING2/'.
464
 
465
`!#'
466
     The entire command line typed so far.
467
 
468

469
File: gdb.info,  Node: Word Designators,  Next: Modifiers,  Prev: Event Designators,  Up: History Interaction
470
 
471
Word Designators
472
----------------
473
 
474
   Word designators are used to select desired words from the event.  A
475
`:' separates the event specification from the word designator.  It may
476
be omitted if the word designator begins with a `^', `$', `*', `-', or
477
`%'.  Words are numbered from the beginning of the line, with the first
478
word being denoted by 0 (zero).  Words are inserted into the current
479
line separated by single spaces.
480
 
481
   For example,
482
 
483
`!!'
484
     designates the preceding command.  When you type this, the
485
     preceding command is repeated in toto.
486
 
487
`!!:$'
488
     designates the last argument of the preceding command.  This may be
489
     shortened to `!$'.
490
 
491
`!fi:2'
492
     designates the second argument of the most recent command starting
493
     with the letters `fi'.
494
 
495
   Here are the word designators:
496
 
497
`0 (zero)'
498
     The `0'th word.  For many applications, this is the command word.
499
 
500
`N'
501
     The Nth word.
502
 
503
`^'
504
     The first argument; that is, word 1.
505
 
506
`$'
507
     The last argument.
508
 
509
`%'
510
     The word matched by the most recent `?STRING?' search.
511
 
512
`X-Y'
513
     A range of words; `-Y' abbreviates `0-Y'.
514
 
515
`*'
516
     All of the words, except the `0'th.  This is a synonym for `1-$'.
517
     It is not an error to use `*' if there is just one word in the
518
     event; the empty string is returned in that case.
519
 
520
`X*'
521
     Abbreviates `X-$'
522
 
523
`X-'
524
     Abbreviates `X-$' like `X*', but omits the last word.
525
 
526
   If a word designator is supplied without an event specification, the
527
previous command is used as the event.
528
 
529

530
File: gdb.info,  Node: Modifiers,  Prev: Word Designators,  Up: History Interaction
531
 
532
Modifiers
533
---------
534
 
535
   After the optional word designator, you can add a sequence of one or
536
more of the following modifiers, each preceded by a `:'.
537
 
538
`h'
539
     Remove a trailing pathname component, leaving only the head.
540
 
541
`t'
542
     Remove all leading  pathname  components, leaving the tail.
543
 
544
`r'
545
     Remove a trailing suffix of the form `.SUFFIX', leaving the
546
     basename.
547
 
548
`e'
549
     Remove all but the trailing suffix.
550
 
551
`p'
552
     Print the new command but do not execute it.
553
 
554
`s/OLD/NEW/'
555
     Substitute NEW for the first occurrence of OLD in the event line.
556
     Any delimiter may be used in place of `/'.  The delimiter may be
557
     quoted in OLD and NEW with a single backslash.  If `&' appears in
558
     NEW, it is replaced by OLD.  A single backslash will quote the
559
     `&'.  The final delimiter is optional if it is the last character
560
     on the input line.
561
 
562
`&'
563
     Repeat the previous substitution.
564
 
565
`g'
566
     Cause changes to be applied over the entire event line.  Used in
567
     conjunction with `s', as in `gs/OLD/NEW/', or with `&'.
568
 
569

570
File: gdb.info,  Node: Formatting Documentation,  Next: Command Line Editing,  Prev: GDB Bugs,  Up: Top
571
 
572
Formatting Documentation
573
************************
574
 
575
   The GDB 4 release includes an already-formatted reference card, ready
576
for printing with PostScript or Ghostscript, in the `gdb' subdirectory
577
of the main source directory(1).  If you can use PostScript or
578
Ghostscript with your printer, you can print the reference card
579
immediately with `refcard.ps'.
580
 
581
   The release also includes the source for the reference card.  You
582
can format it, using TeX, by typing:
583
 
584
     make refcard.dvi
585
 
586
   The GDB reference card is designed to print in "landscape" mode on
587
US "letter" size paper; that is, on a sheet 11 inches wide by 8.5 inches
588
high.  You will need to specify this form of printing as an option to
589
your DVI output program.
590
 
591
   All the documentation for GDB comes as part of the machine-readable
592
distribution.  The documentation is written in Texinfo format, which is
593
a documentation system that uses a single source file to produce both
594
on-line information and a printed manual.  You can use one of the Info
595
formatting commands to create the on-line version of the documentation
596
and TeX (or `texi2roff') to typeset the printed version.
597
 
598
   GDB includes an already formatted copy of the on-line Info version
599
of this manual in the `gdb' subdirectory.  The main Info file is
600
`gdb-5.3/gdb/gdb.info', and it refers to subordinate files matching
601
`gdb.info*' in the same directory.  If necessary, you can print out
602
these files, or read them with any editor; but they are easier to read
603
using the `info' subsystem in GNU Emacs or the standalone `info'
604
program, available as part of the GNU Texinfo distribution.
605
 
606
   If you want to format these Info files yourself, you need one of the
607
Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'.
608
 
609
   If you have `makeinfo' installed, and are in the top level GDB
610
source directory (`gdb-5.3', in the case of version 5.3), you can make
611
the Info file by typing:
612
 
613
     cd gdb
614
     make gdb.info
615
 
616
   If you want to typeset and print copies of this manual, you need TeX,
617
a program to print its DVI output files, and `texinfo.tex', the Texinfo
618
definitions file.
619
 
620
   TeX is a typesetting program; it does not print files directly, but
621
produces output files called DVI files.  To print a typeset document,
622
you need a program to print DVI files.  If your system has TeX
623
installed, chances are it has such a program.  The precise command to
624
use depends on your system; `lpr -d' is common; another (for PostScript
625
devices) is `dvips'.  The DVI print command may require a file name
626
without any extension or a `.dvi' extension.
627
 
628
   TeX also requires a macro definitions file called `texinfo.tex'.
629
This file tells TeX how to typeset a document written in Texinfo
630
format.  On its own, TeX cannot either read or typeset a Texinfo file.
631
`texinfo.tex' is distributed with GDB and is located in the
632
`gdb-VERSION-NUMBER/texinfo' directory.
633
 
634
   If you have TeX and a DVI printer program installed, you can typeset
635
and print this manual.  First switch to the the `gdb' subdirectory of
636
the main source directory (for example, to `gdb-5.3/gdb') and type:
637
 
638
     make gdb.dvi
639
 
640
   Then give `gdb.dvi' to your DVI printing program.
641
 
642
   ---------- Footnotes ----------
643
 
644
   (1) In `gdb-5.3/gdb/refcard.ps' of the version 5.3 release.
645
 
646

647
File: gdb.info,  Node: Installing GDB,  Next: Maintenance Commands,  Prev: Using History Interactively,  Up: Top
648
 
649
Installing GDB
650
**************
651
 
652
   GDB comes with a `configure' script that automates the process of
653
preparing GDB for installation; you can then use `make' to build the
654
`gdb' program.
655
 
656
   The GDB distribution includes all the source code you need for GDB
657
in a single directory, whose name is usually composed by appending the
658
version number to `gdb'.
659
 
660
   For example, the GDB version 5.3 distribution is in the `gdb-5.3'
661
directory.  That directory contains:
662
 
663
`gdb-5.3/configure (and supporting files)'
664
     script for configuring GDB and all its supporting libraries
665
 
666
`gdb-5.3/gdb'
667
     the source specific to GDB itself
668
 
669
`gdb-5.3/bfd'
670
     source for the Binary File Descriptor library
671
 
672
`gdb-5.3/include'
673
     GNU include files
674
 
675
`gdb-5.3/libiberty'
676
     source for the `-liberty' free software library
677
 
678
`gdb-5.3/opcodes'
679
     source for the library of opcode tables and disassemblers
680
 
681
`gdb-5.3/readline'
682
     source for the GNU command-line interface
683
 
684
`gdb-5.3/glob'
685
     source for the GNU filename pattern-matching subroutine
686
 
687
`gdb-5.3/mmalloc'
688
     source for the GNU memory-mapped malloc package
689
 
690
   The simplest way to configure and build GDB is to run `configure'
691
from the `gdb-VERSION-NUMBER' source directory, which in this example
692
is the `gdb-5.3' directory.
693
 
694
   First switch to the `gdb-VERSION-NUMBER' source directory if you are
695
not already in it; then run `configure'.  Pass the identifier for the
696
platform on which GDB will run as an argument.
697
 
698
   For example:
699
 
700
     cd gdb-5.3
701
     ./configure HOST
702
     make
703
 
704
where HOST is an identifier such as `sun4' or `decstation', that
705
identifies the platform where GDB will run.  (You can often leave off
706
HOST; `configure' tries to guess the correct value by examining your
707
system.)
708
 
709
   Running `configure HOST' and then running `make' builds the `bfd',
710
`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself.
711
The configured source files, and the binaries, are left in the
712
corresponding source directories.
713
 
714
   `configure' is a Bourne-shell (`/bin/sh') script; if your system
715
does not recognize this automatically when you run a different shell,
716
you may need to run `sh' on it explicitly:
717
 
718
     sh configure HOST
719
 
720
   If you run `configure' from a directory that contains source
721
directories for multiple libraries or programs, such as the `gdb-5.3'
722
source directory for version 5.3, `configure' creates configuration
723
files for every directory level underneath (unless you tell it not to,
724
with the `--norecursion' option).
725
 
726
   You can run the `configure' script from any of the subordinate
727
directories in the GDB distribution if you only want to configure that
728
subdirectory, but be sure to specify a path to it.
729
 
730
   For example, with version 5.3, type the following to configure only
731
the `bfd' subdirectory:
732
 
733
     cd gdb-5.3/bfd
734
     ../configure HOST
735
 
736
   You can install `gdb' anywhere; it has no hardwired paths.  However,
737
you should make sure that the shell on your path (named by the `SHELL'
738
environment variable) is publicly readable.  Remember that GDB uses the
739
shell to start your program--some systems refuse to let GDB debug child
740
processes whose programs are not readable.
741
 
742
* Menu:
743
 
744
* Separate Objdir::             Compiling GDB in another directory
745
* Config Names::                Specifying names for hosts and targets
746
* Configure Options::           Summary of options for configure
747
 
748

749
File: gdb.info,  Node: Separate Objdir,  Next: Config Names,  Up: Installing GDB
750
 
751
Compiling GDB in another directory
752
==================================
753
 
754
   If you want to run GDB versions for several host or target machines,
755
you need a different `gdb' compiled for each combination of host and
756
target.  `configure' is designed to make this easy by allowing you to
757
generate each configuration in a separate subdirectory, rather than in
758
the source directory.  If your `make' program handles the `VPATH'
759
feature (GNU `make' does), running `make' in each of these directories
760
builds the `gdb' program specified there.
761
 
762
   To build `gdb' in a separate directory, run `configure' with the
763
`--srcdir' option to specify where to find the source.  (You also need
764
to specify a path to find `configure' itself from your working
765
directory.  If the path to `configure' would be the same as the
766
argument to `--srcdir', you can leave out the `--srcdir' option; it is
767
assumed.)
768
 
769
   For example, with version 5.3, you can build GDB in a separate
770
directory for a Sun 4 like this:
771
 
772
     cd gdb-5.3
773
     mkdir ../gdb-sun4
774
     cd ../gdb-sun4
775
     ../gdb-5.3/configure sun4
776
     make
777
 
778
   When `configure' builds a configuration using a remote source
779
directory, it creates a tree for the binaries with the same structure
780
(and using the same names) as the tree under the source directory.  In
781
the example, you'd find the Sun 4 library `libiberty.a' in the
782
directory `gdb-sun4/libiberty', and GDB itself in `gdb-sun4/gdb'.
783
 
784
   One popular reason to build several GDB configurations in separate
785
directories is to configure GDB for cross-compiling (where GDB runs on
786
one machine--the "host"--while debugging programs that run on another
787
machine--the "target").  You specify a cross-debugging target by giving
788
the `--target=TARGET' option to `configure'.
789
 
790
   When you run `make' to build a program or library, you must run it
791
in a configured directory--whatever directory you were in when you
792
called `configure' (or one of its subdirectories).
793
 
794
   The `Makefile' that `configure' generates in each source directory
795
also runs recursively.  If you type `make' in a source directory such
796
as `gdb-5.3' (or in a separate configured directory configured with
797
`--srcdir=DIRNAME/gdb-5.3'), you will build all the required libraries,
798
and then build GDB.
799
 
800
   When you have multiple hosts or targets configured in separate
801
directories, you can run `make' on them in parallel (for example, if
802
they are NFS-mounted on each of the hosts); they will not interfere
803
with each other.
804
 
805

806
File: gdb.info,  Node: Config Names,  Next: Configure Options,  Prev: Separate Objdir,  Up: Installing GDB
807
 
808
Specifying names for hosts and targets
809
======================================
810
 
811
   The specifications used for hosts and targets in the `configure'
812
script are based on a three-part naming scheme, but some short
813
predefined aliases are also supported.  The full naming scheme encodes
814
three pieces of information in the following pattern:
815
 
816
     ARCHITECTURE-VENDOR-OS
817
 
818
   For example, you can use the alias `sun4' as a HOST argument, or as
819
the value for TARGET in a `--target=TARGET' option.  The equivalent
820
full name is `sparc-sun-sunos4'.
821
 
822
   The `configure' script accompanying GDB does not provide any query
823
facility to list all supported host and target names or aliases.
824
`configure' calls the Bourne shell script `config.sub' to map
825
abbreviations to full names; you can read the script, if you wish, or
826
you can use it to test your guesses on abbreviations--for example:
827
 
828
     % sh config.sub i386-linux
829
     i386-pc-linux-gnu
830
     % sh config.sub alpha-linux
831
     alpha-unknown-linux-gnu
832
     % sh config.sub hp9k700
833
     hppa1.1-hp-hpux
834
     % sh config.sub sun4
835
     sparc-sun-sunos4.1.1
836
     % sh config.sub sun3
837
     m68k-sun-sunos4.1.1
838
     % sh config.sub i986v
839
     Invalid configuration `i986v': machine `i986v' not recognized
840
 
841
`config.sub' is also distributed in the GDB source directory
842
(`gdb-5.3', for version 5.3).
843
 
844

845
File: gdb.info,  Node: Configure Options,  Prev: Config Names,  Up: Installing GDB
846
 
847
`configure' options
848
===================
849
 
850
   Here is a summary of the `configure' options and arguments that are
851
most often useful for building GDB.  `configure' also has several other
852
options not listed here.  *note (configure.info)What Configure Does::,
853
for a full explanation of `configure'.
854
 
855
     configure [--help]
856
               [--prefix=DIR]
857
               [--exec-prefix=DIR]
858
               [--srcdir=DIRNAME]
859
               [--norecursion] [--rm]
860
               [--target=TARGET]
861
               HOST
862
 
863
You may introduce options with a single `-' rather than `--' if you
864
prefer; but you may abbreviate option names if you use `--'.
865
 
866
`--help'
867
     Display a quick summary of how to invoke `configure'.
868
 
869
`--prefix=DIR'
870
     Configure the source to install programs and files under directory
871
     `DIR'.
872
 
873
`--exec-prefix=DIR'
874
     Configure the source to install programs under directory `DIR'.
875
 
876
`--srcdir=DIRNAME'
877
     *Warning: using this option requires GNU `make', or another `make'
878
     that implements the `VPATH' feature.*
879
     Use this option to make configurations in directories separate
880
     from the GDB source directories.  Among other things, you can use
881
     this to build (or maintain) several configurations simultaneously,
882
     in separate directories.  `configure' writes configuration
883
     specific files in the current directory, but arranges for them to
884
     use the source in the directory DIRNAME.  `configure' creates
885
     directories under the working directory in parallel to the source
886
     directories below DIRNAME.
887
 
888
`--norecursion'
889
     Configure only the directory level where `configure' is executed;
890
     do not propagate configuration to subdirectories.
891
 
892
`--target=TARGET'
893
     Configure GDB for cross-debugging programs running on the specified
894
     TARGET.  Without this option, GDB is configured to debug programs
895
     that run on the same machine (HOST) as GDB itself.
896
 
897
     There is no convenient way to generate a list of all available
898
     targets.
899
 
900
`HOST ...'
901
     Configure GDB to run on the specified HOST.
902
 
903
     There is no convenient way to generate a list of all available
904
     hosts.
905
 
906
   There are many other options available as well, but they are
907
generally needed for special purposes only.
908
 
909

910
File: gdb.info,  Node: Maintenance Commands,  Next: Remote Protocol,  Prev: Installing GDB,  Up: Top
911
 
912
Maintenance Commands
913
********************
914
 
915
   In addition to commands intended for GDB users, GDB includes a
916
number of commands intended for GDB developers.  These commands are
917
provided here for reference.
918
 
919
`maint info breakpoints'
920
     Using the same format as `info breakpoints', display both the
921
     breakpoints you've set explicitly, and those GDB is using for
922
     internal purposes.  Internal breakpoints are shown with negative
923
     breakpoint numbers.  The type column identifies what kind of
924
     breakpoint is shown:
925
 
926
    `breakpoint'
927
          Normal, explicitly set breakpoint.
928
 
929
    `watchpoint'
930
          Normal, explicitly set watchpoint.
931
 
932
    `longjmp'
933
          Internal breakpoint, used to handle correctly stepping through
934
          `longjmp' calls.
935
 
936
    `longjmp resume'
937
          Internal breakpoint at the target of a `longjmp'.
938
 
939
    `until'
940
          Temporary internal breakpoint used by the GDB `until' command.
941
 
942
    `finish'
943
          Temporary internal breakpoint used by the GDB `finish'
944
          command.
945
 
946
    `shlib events'
947
          Shared library events.
948
 
949
`maint print registers'
950
`maint print raw-registers'
951
`maint print cooked-registers'
952
     Print GDB's internal register data structures.
953
 
954
     The command `maint print raw-registers' includes the contents of
955
     the raw register cache; and the command `maint print
956
     cooked-registers' includes the (cooked) value of all registers.
957
     *Note Registers: (gdbint)Registers.
958
 
959
     Takes an optional file parameter.
960
 
961

962
File: gdb.info,  Node: Remote Protocol,  Next: Copying,  Prev: Maintenance Commands,  Up: Top
963
 
964
GDB Remote Serial Protocol
965
**************************
966
 
967
* Menu:
968
 
969
* Overview::
970
* Packets::
971
* Stop Reply Packets::
972
* General Query Packets::
973
* Register Packet Format::
974
* Examples::
975
 
976

977
File: gdb.info,  Node: Overview,  Next: Packets,  Up: Remote Protocol
978
 
979
Overview
980
========
981
 
982
   There may be occasions when you need to know something about the
983
protocol--for example, if there is only one serial port to your target
984
machine, you might want your program to do something special if it
985
recognizes a packet meant for GDB.
986
 
987
   In the examples below, `->' and `<-' are used to indicate
988
transmitted and received data respectfully.
989
 
990
   All GDB commands and responses (other than acknowledgments) are sent
991
as a PACKET.  A PACKET is introduced with the character `$', the actual
992
PACKET-DATA, and the terminating character `#' followed by a two-digit
993
CHECKSUM:
994
 
995
     `$'PACKET-DATA`#'CHECKSUM
996
 
997
The two-digit CHECKSUM is computed as the modulo 256 sum of all
998
characters between the leading `$' and the trailing `#' (an eight bit
999
unsigned checksum).
1000
 
1001
   Implementors should note that prior to GDB 5.0 the protocol
1002
specification also included an optional two-digit SEQUENCE-ID:
1003
 
1004
     `$'SEQUENCE-ID`:'PACKET-DATA`#'CHECKSUM
1005
 
1006
That SEQUENCE-ID was appended to the acknowledgment.  GDB has never
1007
output SEQUENCE-IDs.  Stubs that handle packets added since GDB 5.0
1008
must not accept SEQUENCE-ID.
1009
 
1010
   When either the host or the target machine receives a packet, the
1011
first response expected is an acknowledgment: either `+' (to indicate
1012
the package was received correctly) or `-' (to request retransmission):
1013
 
1014
     -> `$'PACKET-DATA`#'CHECKSUM
1015
     <- `+'
1016
 
1017
The host (GDB) sends COMMANDs, and the target (the debugging stub
1018
incorporated in your program) sends a RESPONSE.  In the case of step
1019
and continue COMMANDs, the response is only sent when the operation has
1020
completed (the target has again stopped).
1021
 
1022
   PACKET-DATA consists of a sequence of characters with the exception
1023
of `#' and `$' (see `X' packet for additional exceptions).
1024
 
1025
   Fields within the packet should be separated using `,' `;' or `:'.
1026
Except where otherwise noted all numbers are represented in HEX with
1027
leading zeros suppressed.
1028
 
1029
   Implementors should note that prior to GDB 5.0, the character `:'
1030
could not appear as the third character in a packet (as it would
1031
potentially conflict with the SEQUENCE-ID).
1032
 
1033
   Response DATA can be run-length encoded to save space.  A `*' means
1034
that the next character is an ASCII encoding giving a repeat count
1035
which stands for that many repetitions of the character preceding the
1036
`*'.  The encoding is `n+29', yielding a printable character where `n
1037
>=3' (which is where rle starts to win).  The printable characters `$',
1038
`#', `+' and `-' or with a numeric value greater than 126 should not be
1039
used.
1040
 
1041
   Some remote systems have used a different run-length encoding
1042
mechanism loosely refered to as the cisco encoding.  Following the `*'
1043
character are two hex digits that indicate the size of the packet.
1044
 
1045
   So:
1046
     "`0* '"
1047
 
1048
means the same as "0000".
1049
 
1050
   The error response returned for some packets includes a two character
1051
error number.  That number is not well defined.
1052
 
1053
   For any COMMAND not supported by the stub, an empty response
1054
(`$#00') should be returned.  That way it is possible to extend the
1055
protocol.  A newer GDB can tell if a packet is supported based on that
1056
response.
1057
 
1058
   A stub is required to support the `g', `G', `m', `M', `c', and `s'
1059
COMMANDs.  All other COMMANDs are optional.
1060
 
1061

1062
File: gdb.info,  Node: Packets,  Next: Stop Reply Packets,  Prev: Overview,  Up: Remote Protocol
1063
 
1064
Packets
1065
=======
1066
 
1067
   The following table provides a complete list of all currently defined
1068
COMMANDs and their corresponding response DATA.
1069
 
1070
`!' -- extended mode
1071
     Enable extended mode.  In extended mode, the remote server is made
1072
     persistent.  The `R' packet is used to restart the program being
1073
     debugged.
1074
 
1075
     Reply:
1076
    `OK'
1077
          The remote target both supports and has enabled extended mode.
1078
 
1079
`?' -- last signal
1080
     Indicate the reason the target halted.  The reply is the same as
1081
     for step and continue.
1082
 
1083
     Reply: *Note Stop Reply Packets::, for the reply specifications.
1084
 
1085
`a' -- reserved
1086
     Reserved for future use.
1087
 
1088
`A'ARGLEN`,'ARGNUM`,'ARG`,...' --  set program arguments *(reserved)*
1089
     Initialized `argv[]' array passed into program. ARGLEN specifies
1090
     the number of bytes in the hex encoded byte stream ARG.  See
1091
     `gdbserver' for more details.
1092
 
1093
     Reply:
1094
    `OK'
1095
 
1096
    `ENN'
1097
 
1098
`b'BAUD -- set baud *(deprecated)*
1099
     Change the serial line speed to BAUD.
1100
 
1101
     JTC: _When does the transport layer state change?  When it's
1102
     received, or after the ACK is transmitted.  In either case, there
1103
     are problems if the command or the acknowledgment packet is
1104
     dropped._
1105
 
1106
     Stan: _If people really wanted to add something like this, and get
1107
     it working for the first time, they ought to modify ser-unix.c to
1108
     send some kind of out-of-band message to a specially-setup stub
1109
     and have the switch happen "in between" packets, so that from
1110
     remote protocol's point of view, nothing actually happened._
1111
 
1112
`B'ADDR,MODE -- set breakpoint *(deprecated)*
1113
     Set (MODE is `S') or clear (MODE is `C') a breakpoint at ADDR.
1114
     _This has been replaced by the `Z' and `z' packets._
1115
 
1116
`c'ADDR -- continue
1117
     ADDR is address to resume.  If ADDR is omitted, resume at current
1118
     address.
1119
 
1120
     Reply: *Note Stop Reply Packets::, for the reply specifications.
1121
 
1122
`C'SIG`;'ADDR -- continue with signal
1123
     Continue with signal SIG (hex signal number).  If `;'ADDR is
1124
     omitted, resume at same address.
1125
 
1126
     Reply: *Note Stop Reply Packets::, for the reply specifications.
1127
 
1128
`d' -- toggle debug *(deprecated)*
1129
     Toggle debug flag.
1130
 
1131
`D' -- detach
1132
     Detach GDB from the remote system.  Sent to the remote target
1133
     before GDB disconnects.
1134
 
1135
     Reply:
1136
    `_no response_'
1137
          GDB does not check for any response after sending this packet.
1138
 
1139
`e' -- reserved
1140
     Reserved for future use.
1141
 
1142
`E' -- reserved
1143
     Reserved for future use.
1144
 
1145
`f' -- reserved
1146
     Reserved for future use.
1147
 
1148
`F' -- reserved
1149
     Reserved for future use.
1150
 
1151
`g' -- read registers
1152
     Read general registers.
1153
 
1154
     Reply:
1155
    `XX...'
1156
          Each byte of register data is described by two hex digits.
1157
          The bytes with the register are transmitted in target byte
1158
          order.  The size of each register and their position within
1159
          the `g' PACKET are determined by the GDB internal macros
1160
          REGISTER_RAW_SIZE and REGISTER_NAME macros.  The
1161
          specification of several standard `g' packets is specified
1162
          below.
1163
 
1164
    `ENN'
1165
          for an error.
1166
 
1167
`G'XX... -- write regs
1168
     *Note read registers packet::, for a description of the XX...
1169
     data.
1170
 
1171
     Reply:
1172
    `OK'
1173
          for success
1174
 
1175
    `ENN'
1176
          for an error
1177
 
1178
`h' -- reserved
1179
     Reserved for future use.
1180
 
1181
`H'CT... -- set thread
1182
     Set thread for subsequent operations (`m', `M', `g', `G', et.al.).
1183
     C depends on the operation to be performed: it should be `c' for
1184
     step and continue operations, `g' for other operations.  The
1185
     thread designator T... may be -1, meaning all the threads, a
1186
     thread number, or zero which means pick any thread.
1187
 
1188
     Reply:
1189
    `OK'
1190
          for success
1191
 
1192
    `ENN'
1193
          for an error
1194
 
1195
`i'ADDR`,'NNN -- cycle step *(draft)*
1196
     Step the remote target by a single clock cycle.  If `,'NNN is
1197
     present, cycle step NNN cycles.  If ADDR is present, cycle step
1198
     starting at that address.
1199
 
1200
`I' -- signal then cycle step *(reserved)*
1201
     *Note step with signal packet::.  *Note cycle step packet::.
1202
 
1203
`j' -- reserved
1204
     Reserved for future use.
1205
 
1206
`J' -- reserved
1207
     Reserved for future use.
1208
 
1209
`k' -- kill request
1210
     FIXME: _There is no description of how to operate when a specific
1211
     thread context has been selected (i.e. does 'k' kill only that
1212
     thread?)_.
1213
 
1214
`K' -- reserved
1215
     Reserved for future use.
1216
 
1217
`l' -- reserved
1218
     Reserved for future use.
1219
 
1220
`L' -- reserved
1221
     Reserved for future use.
1222
 
1223
`m'ADDR`,'LENGTH -- read memory
1224
     Read LENGTH bytes of memory starting at address ADDR.  Neither GDB
1225
     nor the stub assume that sized memory transfers are assumed using
1226
     word alligned accesses. FIXME: _A word aligned memory transfer
1227
     mechanism is needed._
1228
 
1229
     Reply:
1230
    `XX...'
1231
          XX... is mem contents. Can be fewer bytes than requested if
1232
          able to read only part of the data.  Neither GDB nor the stub
1233
          assume that sized memory transfers are assumed using word
1234
          alligned accesses. FIXME: _A word aligned memory transfer
1235
          mechanism is needed._
1236
 
1237
    `ENN'
1238
          NN is errno
1239
 
1240
`M'ADDR,LENGTH`:'XX... -- write mem
1241
     Write LENGTH bytes of memory starting at address ADDR.  XX... is
1242
     the data.
1243
 
1244
     Reply:
1245
    `OK'
1246
          for success
1247
 
1248
    `ENN'
1249
          for an error (this includes the case where only part of the
1250
          data was written).
1251
 
1252
`n' -- reserved
1253
     Reserved for future use.
1254
 
1255
`N' -- reserved
1256
     Reserved for future use.
1257
 
1258
`o' -- reserved
1259
     Reserved for future use.
1260
 
1261
`O' -- reserved
1262
     Reserved for future use.
1263
 
1264
`p'N... -- read reg *(reserved)*
1265
     *Note write register packet::.
1266
 
1267
     Reply:
1268
    `R....'
1269
          The hex encoded value of the register in target byte order.
1270
 
1271
`P'N...`='R... -- write register
1272
     Write register N... with value R..., which contains two hex digits
1273
     for each byte in the register (target byte order).
1274
 
1275
     Reply:
1276
    `OK'
1277
          for success
1278
 
1279
    `ENN'
1280
          for an error
1281
 
1282
`q'QUERY -- general query
1283
     Request info about QUERY.  In general GDB queries have a leading
1284
     upper case letter.  Custom vendor queries should use a company
1285
     prefix (in lower case) ex: `qfsf.var'.  QUERY may optionally be
1286
     followed by a `,' or `;' separated list.  Stubs must ensure that
1287
     they match the full QUERY name.
1288
 
1289
     Reply:
1290
    `XX...'
1291
          Hex encoded data from query.  The reply can not be empty.
1292
 
1293
    `ENN'
1294
          error reply
1295
 
1296
    `'
1297
          Indicating an unrecognized QUERY.
1298
 
1299
`Q'VAR`='VAL -- general set
1300
     Set value of VAR to VAL.
1301
 
1302
     *Note general query packet::, for a discussion of naming
1303
     conventions.
1304
 
1305
`r' -- reset *(deprecated)*
1306
     Reset the entire system.
1307
 
1308
`R'XX -- remote restart
1309
     Restart the program being debugged.  XX, while needed, is ignored.
1310
     This packet is only available in extended mode.
1311
 
1312
     Reply:
1313
    `_no reply_'
1314
          The `R' packet has no reply.
1315
 
1316
`s'ADDR -- step
1317
     ADDR is address to resume.  If ADDR is omitted, resume at same
1318
     address.
1319
 
1320
     Reply: *Note Stop Reply Packets::, for the reply specifications.
1321
 
1322
`S'SIG`;'ADDR -- step with signal
1323
     Like `C' but step not continue.
1324
 
1325
     Reply: *Note Stop Reply Packets::, for the reply specifications.
1326
 
1327
`t'ADDR`:'PP`,'MM -- search
1328
     Search backwards starting at address ADDR for a match with pattern
1329
     PP and mask MM.  PP and MM are 4 bytes.  ADDR must be at least 3
1330
     digits.
1331
 
1332
`T'XX -- thread alive
1333
     Find out if the thread XX is alive.
1334
 
1335
     Reply:
1336
    `OK'
1337
          thread is still alive
1338
 
1339
    `ENN'
1340
          thread is dead
1341
 
1342
`u' -- reserved
1343
     Reserved for future use.
1344
 
1345
`U' -- reserved
1346
     Reserved for future use.
1347
 
1348
`v' -- reserved
1349
     Reserved for future use.
1350
 
1351
`V' -- reserved
1352
     Reserved for future use.
1353
 
1354
`w' -- reserved
1355
     Reserved for future use.
1356
 
1357
`W' -- reserved
1358
     Reserved for future use.
1359
 
1360
`x' -- reserved
1361
     Reserved for future use.
1362
 
1363
`X'ADDR`,'LENGTH:XX... -- write mem (binary)
1364
     ADDR is address, LENGTH is number of bytes, XX...  is binary data.
1365
     The characters `$', `#', and `0x7d' are escaped using `0x7d'.
1366
 
1367
     Reply:
1368
    `OK'
1369
          for success
1370
 
1371
    `ENN'
1372
          for an error
1373
 
1374
`y' -- reserved
1375
     Reserved for future use.
1376
 
1377
`Y' reserved
1378
     Reserved for future use.
1379
 
1380
`z'T`,'ADDR`,'LENGTH -- remove break or watchpoint *(draft)*
1381
     *Note insert breakpoint or watchpoint packet::.
1382
 
1383
`Z'T`,'ADDR`,'LENGTH -- insert break or watchpoint *(draft)*
1384
     T is type: `0' - software breakpoint, `1' - hardware breakpoint,
1385
     `2' -- write watchpoint, `3' - read watchpoint, `4' - access
1386
     watchpoint; ADDR is address; LENGTH is in bytes.  For a software
1387
     breakpoint, LENGTH specifies the size of the instruction to be
1388
     patched.  For hardware breakpoints and watchpoints LENGTH
1389
     specifies the memory region to be monitored.  To avoid potential
1390
     problems with duplicate packets, the operations should be
1391
     implemented in an idempotent way.
1392
 
1393
     Reply:
1394
    `ENN'
1395
          for an error
1396
 
1397
    `OK'
1398
          for success
1399
 
1400
    ``''
1401
          If not supported.
1402
 
1403

1404
File: gdb.info,  Node: Stop Reply Packets,  Next: General Query Packets,  Prev: Packets,  Up: Remote Protocol
1405
 
1406
Stop Reply Packets
1407
==================
1408
 
1409
   The `C', `c', `S', `s' and `?' packets can receive any of the below
1410
as a reply.  In the case of the `C', `c', `S' and `s' packets, that
1411
reply is only returned when the target halts.  In the below the exact
1412
meaning of `signal number' is poorly defined.  In general one of the
1413
UNIX signal numbering conventions is used.
1414
 
1415
`SAA'
1416
     AA is the signal number
1417
 
1418
``T'AAN...`:'R...`;'N...`:'R...`;'N...`:'R...`;''
1419
     AA = two hex digit signal number; N... = register number (hex),
1420
     R...  = target byte ordered register contents, size defined by
1421
     `REGISTER_RAW_SIZE'; N... = `thread', R... = thread process ID,
1422
     this is a hex integer; N... = (`watch' | `rwatch' | `awatch', R...
1423
     = data address, this is a hex integer; N... = other string not
1424
     starting with valid hex digit.  GDB should ignore this N..., R...
1425
     pair and go on to the next.  This way we can extend the protocol.
1426
 
1427
`WAA'
1428
     The process exited, and AA is the exit status.  This is only
1429
     applicable to certain targets.
1430
 
1431
`XAA'
1432
     The process terminated with signal AA.
1433
 
1434
`NAA;T...;D...;B... *(obsolete)*'
1435
     AA = signal number; T... = address of symbol `_start'; D... = base
1436
     of data section; B... = base of bss section.  _Note: only used by
1437
     Cisco Systems targets.  The difference between this reply and the
1438
     `qOffsets' query is that the `N' packet may arrive spontaneously
1439
     whereas the `qOffsets' is a query initiated by the host debugger._
1440
 
1441
`OXX...'
1442
     XX... is hex encoding of ASCII data.  This can happen at any time
1443
     while the program is running and the debugger should continue to
1444
     wait for `W', `T', etc.
1445
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.