OLD | NEW |
1 This is gdb.info, produced by makeinfo version 4.8 from ./gdb.texinfo. | 1 This is gdb.info, produced by makeinfo version 4.8 from ./gdb.texinfo. |
2 | 2 |
3 INFO-DIR-SECTION Software development | 3 INFO-DIR-SECTION Software development |
4 START-INFO-DIR-ENTRY | 4 START-INFO-DIR-ENTRY |
5 * Gdb: (gdb). The GNU debugger. | 5 * Gdb: (gdb). The GNU debugger. |
6 END-INFO-DIR-ENTRY | 6 END-INFO-DIR-ENTRY |
7 | 7 |
8 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, | 8 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, |
9 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, | 9 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, |
10 2010 Free Software Foundation, Inc. | 10 2010 2011, 2012 Free Software Foundation, Inc. |
11 | 11 |
12 Permission is granted to copy, distribute and/or modify this document | 12 Permission is granted to copy, distribute and/or modify this document |
13 under the terms of the GNU Free Documentation License, Version 1.3 or | 13 under the terms of the GNU Free Documentation License, Version 1.3 or |
14 any later version published by the Free Software Foundation; with the | 14 any later version published by the Free Software Foundation; with the |
15 Invariant Sections being "Free Software" and "Free Software Needs Free | 15 Invariant Sections being "Free Software" and "Free Software Needs Free |
16 Documentation", with the Front-Cover Texts being "A GNU Manual," and | 16 Documentation", with the Front-Cover Texts being "A GNU Manual," and |
17 with the Back-Cover Texts as in (a) below. | 17 with the Back-Cover Texts as in (a) below. |
18 | 18 |
19 (a) The FSF's Back-Cover Text is: "You are free to copy and modify | 19 (a) The FSF's Back-Cover Text is: "You are free to copy and modify |
20 this GNU Manual. Buying copies from GNU Press supports the FSF in | 20 this GNU Manual. Buying copies from GNU Press supports the FSF in |
21 developing GNU and promoting software freedom." | 21 developing GNU and promoting software freedom." |
22 | 22 |
23 This file documents the GNU debugger GDB. | 23 This file documents the GNU debugger GDB. |
24 | 24 |
25 This is the Tenth Edition, of `Debugging with GDB: the GNU | 25 This is the Tenth Edition, of `Debugging with GDB: the GNU |
26 Source-Level Debugger' for GDB (GDB) Version 7.4.1. | 26 Source-Level Debugger' for GDB (GDB) Version 7.5.1. |
27 | 27 |
28 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, | 28 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, |
29 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, | 29 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, |
30 2010 Free Software Foundation, Inc. | 30 2010 2011, 2012 Free Software Foundation, Inc. |
31 | 31 |
32 Permission is granted to copy, distribute and/or modify this document | 32 Permission is granted to copy, distribute and/or modify this document |
33 under the terms of the GNU Free Documentation License, Version 1.3 or | 33 under the terms of the GNU Free Documentation License, Version 1.3 or |
34 any later version published by the Free Software Foundation; with the | 34 any later version published by the Free Software Foundation; with the |
35 Invariant Sections being "Free Software" and "Free Software Needs Free | 35 Invariant Sections being "Free Software" and "Free Software Needs Free |
36 Documentation", with the Front-Cover Texts being "A GNU Manual," and | 36 Documentation", with the Front-Cover Texts being "A GNU Manual," and |
37 with the Back-Cover Texts as in (a) below. | 37 with the Back-Cover Texts as in (a) below. |
38 | 38 |
39 (a) The FSF's Back-Cover Text is: "You are free to copy and modify | 39 (a) The FSF's Back-Cover Text is: "You are free to copy and modify |
40 this GNU Manual. Buying copies from GNU Press supports the FSF in | 40 this GNU Manual. Buying copies from GNU Press supports the FSF in |
41 developing GNU and promoting software freedom." | 41 developing GNU and promoting software freedom." |
42 | 42 |
43 | 43 |
| 44 File: gdb.info, Node: Running Configure, Next: Separate Objdir, Prev: Require
ments, Up: Installing GDB |
| 45 |
| 46 C.2 Invoking the GDB `configure' Script |
| 47 ======================================= |
| 48 |
| 49 GDB comes with a `configure' script that automates the process of |
| 50 preparing GDB for installation; you can then use `make' to build the |
| 51 `gdb' program. |
| 52 |
| 53 The GDB distribution includes all the source code you need for GDB |
| 54 in a single directory, whose name is usually composed by appending the |
| 55 version number to `gdb'. |
| 56 |
| 57 For example, the GDB version 7.5.1 distribution is in the |
| 58 `gdb-7.5.1' directory. That directory contains: |
| 59 |
| 60 `gdb-7.5.1/configure (and supporting files)' |
| 61 script for configuring GDB and all its supporting libraries |
| 62 |
| 63 `gdb-7.5.1/gdb' |
| 64 the source specific to GDB itself |
| 65 |
| 66 `gdb-7.5.1/bfd' |
| 67 source for the Binary File Descriptor library |
| 68 |
| 69 `gdb-7.5.1/include' |
| 70 GNU include files |
| 71 |
| 72 `gdb-7.5.1/libiberty' |
| 73 source for the `-liberty' free software library |
| 74 |
| 75 `gdb-7.5.1/opcodes' |
| 76 source for the library of opcode tables and disassemblers |
| 77 |
| 78 `gdb-7.5.1/readline' |
| 79 source for the GNU command-line interface |
| 80 |
| 81 `gdb-7.5.1/glob' |
| 82 source for the GNU filename pattern-matching subroutine |
| 83 |
| 84 `gdb-7.5.1/mmalloc' |
| 85 source for the GNU memory-mapped malloc package |
| 86 |
| 87 The simplest way to configure and build GDB is to run `configure' |
| 88 from the `gdb-VERSION-NUMBER' source directory, which in this example |
| 89 is the `gdb-7.5.1' directory. |
| 90 |
| 91 First switch to the `gdb-VERSION-NUMBER' source directory if you are |
| 92 not already in it; then run `configure'. Pass the identifier for the |
| 93 platform on which GDB will run as an argument. |
| 94 |
| 95 For example: |
| 96 |
| 97 cd gdb-7.5.1 |
| 98 ./configure HOST |
| 99 make |
| 100 |
| 101 where HOST is an identifier such as `sun4' or `decstation', that |
| 102 identifies the platform where GDB will run. (You can often leave off |
| 103 HOST; `configure' tries to guess the correct value by examining your |
| 104 system.) |
| 105 |
| 106 Running `configure HOST' and then running `make' builds the `bfd', |
| 107 `readline', `mmalloc', and `libiberty' libraries, then `gdb' itself. |
| 108 The configured source files, and the binaries, are left in the |
| 109 corresponding source directories. |
| 110 |
| 111 `configure' is a Bourne-shell (`/bin/sh') script; if your system |
| 112 does not recognize this automatically when you run a different shell, |
| 113 you may need to run `sh' on it explicitly: |
| 114 |
| 115 sh configure HOST |
| 116 |
| 117 If you run `configure' from a directory that contains source |
| 118 directories for multiple libraries or programs, such as the `gdb-7.5.1' |
| 119 source directory for version 7.5.1, `configure' creates configuration |
| 120 files for every directory level underneath (unless you tell it not to, |
| 121 with the `--norecursion' option). |
| 122 |
| 123 You should run the `configure' script from the top directory in the |
| 124 source tree, the `gdb-VERSION-NUMBER' directory. If you run |
| 125 `configure' from one of the subdirectories, you will configure only |
| 126 that subdirectory. That is usually not what you want. In particular, |
| 127 if you run the first `configure' from the `gdb' subdirectory of the |
| 128 `gdb-VERSION-NUMBER' directory, you will omit the configuration of |
| 129 `bfd', `readline', and other sibling directories of the `gdb' |
| 130 subdirectory. This leads to build errors about missing include files |
| 131 such as `bfd/bfd.h'. |
| 132 |
| 133 You can install `gdb' anywhere; it has no hardwired paths. However, |
| 134 you should make sure that the shell on your path (named by the `SHELL' |
| 135 environment variable) is publicly readable. Remember that GDB uses the |
| 136 shell to start your program--some systems refuse to let GDB debug child |
| 137 processes whose programs are not readable. |
| 138 |
| 139 |
| 140 File: gdb.info, Node: Separate Objdir, Next: Config Names, Prev: Running Conf
igure, Up: Installing GDB |
| 141 |
| 142 C.3 Compiling GDB in Another Directory |
| 143 ====================================== |
| 144 |
| 145 If you want to run GDB versions for several host or target machines, |
| 146 you need a different `gdb' compiled for each combination of host and |
| 147 target. `configure' is designed to make this easy by allowing you to |
| 148 generate each configuration in a separate subdirectory, rather than in |
| 149 the source directory. If your `make' program handles the `VPATH' |
| 150 feature (GNU `make' does), running `make' in each of these directories |
| 151 builds the `gdb' program specified there. |
| 152 |
| 153 To build `gdb' in a separate directory, run `configure' with the |
| 154 `--srcdir' option to specify where to find the source. (You also need |
| 155 to specify a path to find `configure' itself from your working |
| 156 directory. If the path to `configure' would be the same as the |
| 157 argument to `--srcdir', you can leave out the `--srcdir' option; it is |
| 158 assumed.) |
| 159 |
| 160 For example, with version 7.5.1, you can build GDB in a separate |
| 161 directory for a Sun 4 like this: |
| 162 |
| 163 cd gdb-7.5.1 |
| 164 mkdir ../gdb-sun4 |
| 165 cd ../gdb-sun4 |
| 166 ../gdb-7.5.1/configure sun4 |
| 167 make |
| 168 |
| 169 When `configure' builds a configuration using a remote source |
| 170 directory, it creates a tree for the binaries with the same structure |
| 171 (and using the same names) as the tree under the source directory. In |
| 172 the example, you'd find the Sun 4 library `libiberty.a' in the |
| 173 directory `gdb-sun4/libiberty', and GDB itself in `gdb-sun4/gdb'. |
| 174 |
| 175 Make sure that your path to the `configure' script has just one |
| 176 instance of `gdb' in it. If your path to `configure' looks like |
| 177 `../gdb-7.5.1/gdb/configure', you are configuring only one subdirectory |
| 178 of GDB, not the whole package. This leads to build errors about |
| 179 missing include files such as `bfd/bfd.h'. |
| 180 |
| 181 One popular reason to build several GDB configurations in separate |
| 182 directories is to configure GDB for cross-compiling (where GDB runs on |
| 183 one machine--the "host"--while debugging programs that run on another |
| 184 machine--the "target"). You specify a cross-debugging target by giving |
| 185 the `--target=TARGET' option to `configure'. |
| 186 |
| 187 When you run `make' to build a program or library, you must run it |
| 188 in a configured directory--whatever directory you were in when you |
| 189 called `configure' (or one of its subdirectories). |
| 190 |
| 191 The `Makefile' that `configure' generates in each source directory |
| 192 also runs recursively. If you type `make' in a source directory such |
| 193 as `gdb-7.5.1' (or in a separate configured directory configured with |
| 194 `--srcdir=DIRNAME/gdb-7.5.1'), you will build all the required |
| 195 libraries, and then build GDB. |
| 196 |
| 197 When you have multiple hosts or targets configured in separate |
| 198 directories, you can run `make' on them in parallel (for example, if |
| 199 they are NFS-mounted on each of the hosts); they will not interfere |
| 200 with each other. |
| 201 |
| 202 |
| 203 File: gdb.info, Node: Config Names, Next: Configure Options, Prev: Separate O
bjdir, Up: Installing GDB |
| 204 |
| 205 C.4 Specifying Names for Hosts and Targets |
| 206 ========================================== |
| 207 |
| 208 The specifications used for hosts and targets in the `configure' script |
| 209 are based on a three-part naming scheme, but some short predefined |
| 210 aliases are also supported. The full naming scheme encodes three pieces |
| 211 of information in the following pattern: |
| 212 |
| 213 ARCHITECTURE-VENDOR-OS |
| 214 |
| 215 For example, you can use the alias `sun4' as a HOST argument, or as |
| 216 the value for TARGET in a `--target=TARGET' option. The equivalent |
| 217 full name is `sparc-sun-sunos4'. |
| 218 |
| 219 The `configure' script accompanying GDB does not provide any query |
| 220 facility to list all supported host and target names or aliases. |
| 221 `configure' calls the Bourne shell script `config.sub' to map |
| 222 abbreviations to full names; you can read the script, if you wish, or |
| 223 you can use it to test your guesses on abbreviations--for example: |
| 224 |
| 225 % sh config.sub i386-linux |
| 226 i386-pc-linux-gnu |
| 227 % sh config.sub alpha-linux |
| 228 alpha-unknown-linux-gnu |
| 229 % sh config.sub hp9k700 |
| 230 hppa1.1-hp-hpux |
| 231 % sh config.sub sun4 |
| 232 sparc-sun-sunos4.1.1 |
| 233 % sh config.sub sun3 |
| 234 m68k-sun-sunos4.1.1 |
| 235 % sh config.sub i986v |
| 236 Invalid configuration `i986v': machine `i986v' not recognized |
| 237 |
| 238 `config.sub' is also distributed in the GDB source directory |
| 239 (`gdb-7.5.1', for version 7.5.1). |
| 240 |
| 241 |
| 242 File: gdb.info, Node: Configure Options, Next: System-wide configuration, Pre
v: Config Names, Up: Installing GDB |
| 243 |
| 244 C.5 `configure' Options |
| 245 ======================= |
| 246 |
| 247 Here is a summary of the `configure' options and arguments that are |
| 248 most often useful for building GDB. `configure' also has several other |
| 249 options not listed here. *note (configure.info)What Configure Does::, |
| 250 for a full explanation of `configure'. |
| 251 |
| 252 configure [--help] |
| 253 [--prefix=DIR] |
| 254 [--exec-prefix=DIR] |
| 255 [--srcdir=DIRNAME] |
| 256 [--norecursion] [--rm] |
| 257 [--target=TARGET] |
| 258 HOST |
| 259 |
| 260 You may introduce options with a single `-' rather than `--' if you |
| 261 prefer; but you may abbreviate option names if you use `--'. |
| 262 |
| 263 `--help' |
| 264 Display a quick summary of how to invoke `configure'. |
| 265 |
| 266 `--prefix=DIR' |
| 267 Configure the source to install programs and files under directory |
| 268 `DIR'. |
| 269 |
| 270 `--exec-prefix=DIR' |
| 271 Configure the source to install programs under directory `DIR'. |
| 272 |
| 273 `--srcdir=DIRNAME' |
| 274 *Warning: using this option requires GNU `make', or another `make' |
| 275 that implements the `VPATH' feature.* |
| 276 Use this option to make configurations in directories separate |
| 277 from the GDB source directories. Among other things, you can use |
| 278 this to build (or maintain) several configurations simultaneously, |
| 279 in separate directories. `configure' writes |
| 280 configuration-specific files in the current directory, but |
| 281 arranges for them to use the source in the directory DIRNAME. |
| 282 `configure' creates directories under the working directory in |
| 283 parallel to the source directories below DIRNAME. |
| 284 |
| 285 `--norecursion' |
| 286 Configure only the directory level where `configure' is executed; |
| 287 do not propagate configuration to subdirectories. |
| 288 |
| 289 `--target=TARGET' |
| 290 Configure GDB for cross-debugging programs running on the specified |
| 291 TARGET. Without this option, GDB is configured to debug programs |
| 292 that run on the same machine (HOST) as GDB itself. |
| 293 |
| 294 There is no convenient way to generate a list of all available |
| 295 targets. |
| 296 |
| 297 `HOST ...' |
| 298 Configure GDB to run on the specified HOST. |
| 299 |
| 300 There is no convenient way to generate a list of all available |
| 301 hosts. |
| 302 |
| 303 There are many other options available as well, but they are |
| 304 generally needed for special purposes only. |
| 305 |
| 306 |
| 307 File: gdb.info, Node: System-wide configuration, Prev: Configure Options, Up:
Installing GDB |
| 308 |
| 309 C.6 System-wide configuration and settings |
| 310 ========================================== |
| 311 |
| 312 GDB can be configured to have a system-wide init file; this file will |
| 313 be read and executed at startup (*note What GDB does during startup: |
| 314 Startup.). |
| 315 |
| 316 Here is the corresponding configure option: |
| 317 |
| 318 `--with-system-gdbinit=FILE' |
| 319 Specify that the default location of the system-wide init file is |
| 320 FILE. |
| 321 |
| 322 If GDB has been configured with the option `--prefix=$prefix', it |
| 323 may be subject to relocation. Two possible cases: |
| 324 |
| 325 * If the default location of this init file contains `$prefix', it |
| 326 will be subject to relocation. Suppose that the configure options |
| 327 are `--prefix=$prefix --with-system-gdbinit=$prefix/etc/gdbinit'; |
| 328 if GDB is moved from `$prefix' to `$install', the system init file |
| 329 is looked for as `$install/etc/gdbinit' instead of |
| 330 `$prefix/etc/gdbinit'. |
| 331 |
| 332 * By contrast, if the default location does not contain the prefix, |
| 333 it will not be relocated. E.g. if GDB has been configured with |
| 334 `--prefix=/usr/local --with-system-gdbinit=/usr/share/gdb/gdbinit', |
| 335 then GDB will always look for `/usr/share/gdb/gdbinit', wherever |
| 336 GDB is installed. |
| 337 |
| 338 |
| 339 File: gdb.info, Node: Maintenance Commands, Next: Remote Protocol, Prev: Inst
alling GDB, Up: Top |
| 340 |
| 341 Appendix D Maintenance Commands |
| 342 ******************************* |
| 343 |
| 344 In addition to commands intended for GDB users, GDB includes a number |
| 345 of commands intended for GDB developers, that are not documented |
| 346 elsewhere in this manual. These commands are provided here for |
| 347 reference. (For commands that turn on debugging messages, see *Note |
| 348 Debugging Output::.) |
| 349 |
| 350 `maint agent [-at LOCATION,] EXPRESSION' |
| 351 `maint agent-eval [-at LOCATION,] EXPRESSION' |
| 352 Translate the given EXPRESSION into remote agent bytecodes. This |
| 353 command is useful for debugging the Agent Expression mechanism |
| 354 (*note Agent Expressions::). The `agent' version produces an |
| 355 expression useful for data collection, such as by tracepoints, |
| 356 while `maint agent-eval' produces an expression that evaluates |
| 357 directly to a result. For instance, a collection expression for |
| 358 `globa + globb' will include bytecodes to record four bytes of |
| 359 memory at each of the addresses of `globa' and `globb', while |
| 360 discarding the result of the addition, while an evaluation |
| 361 expression will do the addition and return the sum. If `-at' is |
| 362 given, generate remote agent bytecode for LOCATION. If not, |
| 363 generate remote agent bytecode for current frame PC address. |
| 364 |
| 365 `maint agent-printf FORMAT,EXPR,...' |
| 366 Translate the given format string and list of argument expressions |
| 367 into remote agent bytecodes and display them as a disassembled |
| 368 list. This command is useful for debugging the agent version of |
| 369 dynamic printf (*note Dynamic Printf::. |
| 370 |
| 371 `maint info breakpoints' |
| 372 Using the same format as `info breakpoints', display both the |
| 373 breakpoints you've set explicitly, and those GDB is using for |
| 374 internal purposes. Internal breakpoints are shown with negative |
| 375 breakpoint numbers. The type column identifies what kind of |
| 376 breakpoint is shown: |
| 377 |
| 378 `breakpoint' |
| 379 Normal, explicitly set breakpoint. |
| 380 |
| 381 `watchpoint' |
| 382 Normal, explicitly set watchpoint. |
| 383 |
| 384 `longjmp' |
| 385 Internal breakpoint, used to handle correctly stepping through |
| 386 `longjmp' calls. |
| 387 |
| 388 `longjmp resume' |
| 389 Internal breakpoint at the target of a `longjmp'. |
| 390 |
| 391 `until' |
| 392 Temporary internal breakpoint used by the GDB `until' command. |
| 393 |
| 394 `finish' |
| 395 Temporary internal breakpoint used by the GDB `finish' |
| 396 command. |
| 397 |
| 398 `shlib events' |
| 399 Shared library events. |
| 400 |
| 401 |
| 402 `set displaced-stepping' |
| 403 `show displaced-stepping' |
| 404 Control whether or not GDB will do "displaced stepping" if the |
| 405 target supports it. Displaced stepping is a way to single-step |
| 406 over breakpoints without removing them from the inferior, by |
| 407 executing an out-of-line copy of the instruction that was |
| 408 originally at the breakpoint location. It is also known as |
| 409 out-of-line single-stepping. |
| 410 |
| 411 `set displaced-stepping on' |
| 412 If the target architecture supports it, GDB will use |
| 413 displaced stepping to step over breakpoints. |
| 414 |
| 415 `set displaced-stepping off' |
| 416 GDB will not use displaced stepping to step over breakpoints, |
| 417 even if such is supported by the target architecture. |
| 418 |
| 419 `set displaced-stepping auto' |
| 420 This is the default mode. GDB will use displaced stepping |
| 421 only if non-stop mode is active (*note Non-Stop Mode::) and |
| 422 the target architecture supports displaced stepping. |
| 423 |
| 424 `maint check-symtabs' |
| 425 Check the consistency of psymtabs and symtabs. |
| 426 |
| 427 `maint cplus first_component NAME' |
| 428 Print the first C++ class/namespace component of NAME. |
| 429 |
| 430 `maint cplus namespace' |
| 431 Print the list of possible C++ namespaces. |
| 432 |
| 433 `maint demangle NAME' |
| 434 Demangle a C++ or Objective-C mangled NAME. |
| 435 |
| 436 `maint deprecate COMMAND [REPLACEMENT]' |
| 437 `maint undeprecate COMMAND' |
| 438 Deprecate or undeprecate the named COMMAND. Deprecated commands |
| 439 cause GDB to issue a warning when you use them. The optional |
| 440 argument REPLACEMENT says which newer command should be used in |
| 441 favor of the deprecated one; if it is given, GDB will mention the |
| 442 replacement as part of the warning. |
| 443 |
| 444 `maint dump-me' |
| 445 Cause a fatal signal in the debugger and force it to dump its core. |
| 446 This is supported only on systems which support aborting a program |
| 447 with the `SIGQUIT' signal. |
| 448 |
| 449 `maint internal-error [MESSAGE-TEXT]' |
| 450 `maint internal-warning [MESSAGE-TEXT]' |
| 451 Cause GDB to call the internal function `internal_error' or |
| 452 `internal_warning' and hence behave as though an internal error or |
| 453 internal warning has been detected. In addition to reporting the |
| 454 internal problem, these functions give the user the opportunity to |
| 455 either quit GDB or create a core file of the current GDB session. |
| 456 |
| 457 These commands take an optional parameter MESSAGE-TEXT that is |
| 458 used as the text of the error or warning message. |
| 459 |
| 460 Here's an example of using `internal-error': |
| 461 |
| 462 (gdb) maint internal-error testing, 1, 2 |
| 463 .../maint.c:121: internal-error: testing, 1, 2 |
| 464 A problem internal to GDB has been detected. Further |
| 465 debugging may prove unreliable. |
| 466 Quit this debugging session? (y or n) n |
| 467 Create a core file? (y or n) n |
| 468 (gdb) |
| 469 |
| 470 `maint set internal-error ACTION [ask|yes|no]' |
| 471 `maint show internal-error ACTION' |
| 472 `maint set internal-warning ACTION [ask|yes|no]' |
| 473 `maint show internal-warning ACTION' |
| 474 When GDB reports an internal problem (error or warning) it gives |
| 475 the user the opportunity to both quit GDB and create a core file |
| 476 of the current GDB session. These commands let you override the |
| 477 default behaviour for each particular ACTION, described in the |
| 478 table below. |
| 479 |
| 480 `quit' |
| 481 You can specify that GDB should always (yes) or never (no) |
| 482 quit. The default is to ask the user what to do. |
| 483 |
| 484 `corefile' |
| 485 You can specify that GDB should always (yes) or never (no) |
| 486 create a core file. The default is to ask the user what to |
| 487 do. |
| 488 |
| 489 `maint packet TEXT' |
| 490 If GDB is talking to an inferior via the serial protocol, then |
| 491 this command sends the string TEXT to the inferior, and displays |
| 492 the response packet. GDB supplies the initial `$' character, the |
| 493 terminating `#' character, and the checksum. |
| 494 |
| 495 `maint print architecture [FILE]' |
| 496 Print the entire architecture configuration. The optional argument |
| 497 FILE names the file where the output goes. |
| 498 |
| 499 `maint print c-tdesc' |
| 500 Print the current target description (*note Target Descriptions::) |
| 501 as a C source file. The created source file can be used in GDB |
| 502 when an XML parser is not available to parse the description. |
| 503 |
| 504 `maint print dummy-frames' |
| 505 Prints the contents of GDB's internal dummy-frame stack. |
| 506 |
| 507 (gdb) b add |
| 508 ... |
| 509 (gdb) print add(2,3) |
| 510 Breakpoint 2, add (a=2, b=3) at ... |
| 511 58 return (a + b); |
| 512 The program being debugged stopped while in a function called from GDB
. |
| 513 ... |
| 514 (gdb) maint print dummy-frames |
| 515 0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6 |
| 516 top=0x0200bdd4 id={stack=0x200bddc,code=0x101405c} |
| 517 call_lo=0x01014000 call_hi=0x01014001 |
| 518 (gdb) |
| 519 |
| 520 Takes an optional file parameter. |
| 521 |
| 522 `maint print registers [FILE]' |
| 523 `maint print raw-registers [FILE]' |
| 524 `maint print cooked-registers [FILE]' |
| 525 `maint print register-groups [FILE]' |
| 526 `maint print remote-registers [FILE]' |
| 527 Print GDB's internal register data structures. |
| 528 |
| 529 The command `maint print raw-registers' includes the contents of |
| 530 the raw register cache; the command `maint print cooked-registers' |
| 531 includes the (cooked) value of all registers, including registers |
| 532 which aren't available on the target nor visible to user; the |
| 533 command `maint print register-groups' includes the groups that |
| 534 each register is a member of; and the command `maint print |
| 535 remote-registers' includes the remote target's register numbers |
| 536 and offsets in the `G' packets. *Note Registers: |
| 537 (gdbint)Registers. |
| 538 |
| 539 These commands take an optional parameter, a file name to which to |
| 540 write the information. |
| 541 |
| 542 `maint print reggroups [FILE]' |
| 543 Print GDB's internal register group data structures. The optional |
| 544 argument FILE tells to what file to write the information. |
| 545 |
| 546 The register groups info looks like this: |
| 547 |
| 548 (gdb) maint print reggroups |
| 549 Group Type |
| 550 general user |
| 551 float user |
| 552 all user |
| 553 vector user |
| 554 system user |
| 555 save internal |
| 556 restore internal |
| 557 |
| 558 `flushregs' |
| 559 This command forces GDB to flush its internal register cache. |
| 560 |
| 561 `maint print objfiles' |
| 562 Print a dump of all known object files. For each object file, this |
| 563 command prints its name, address in memory, and all of its psymtabs |
| 564 and symtabs. |
| 565 |
| 566 `maint print section-scripts [REGEXP]' |
| 567 Print a dump of scripts specified in the `.debug_gdb_section' |
| 568 section. If REGEXP is specified, only print scripts loaded by |
| 569 object files matching REGEXP. For each script, this command |
| 570 prints its name as specified in the objfile, and the full path if |
| 571 known. *Note dotdebug_gdb_scripts section::. |
| 572 |
| 573 `maint print statistics' |
| 574 This command prints, for each object file in the program, various |
| 575 data about that object file followed by the byte cache ("bcache") |
| 576 statistics for the object file. The objfile data includes the |
| 577 number of minimal, partial, full, and stabs symbols, the number of |
| 578 types defined by the objfile, the number of as yet unexpanded psym |
| 579 tables, the number of line tables and string tables, and the |
| 580 amount of memory used by the various tables. The bcache |
| 581 statistics include the counts, sizes, and counts of duplicates of |
| 582 all and unique objects, max, average, and median entry size, total |
| 583 memory used and its overhead and savings, and various measures of |
| 584 the hash table size and chain lengths. |
| 585 |
| 586 `maint print target-stack' |
| 587 A "target" is an interface between the debugger and a particular |
| 588 kind of file or process. Targets can be stacked in "strata", so |
| 589 that more than one target can potentially respond to a request. |
| 590 In particular, memory accesses will walk down the stack of targets |
| 591 until they find a target that is interested in handling that |
| 592 particular address. |
| 593 |
| 594 This command prints a short description of each layer that was |
| 595 pushed on the "target stack", starting from the top layer down to |
| 596 the bottom one. |
| 597 |
| 598 `maint print type EXPR' |
| 599 Print the type chain for a type specified by EXPR. The argument |
| 600 can be either a type name or a symbol. If it is a symbol, the |
| 601 type of that symbol is described. The type chain produced by this |
| 602 command is a recursive definition of the data type as stored in |
| 603 GDB's data structures, including its flags and contained types. |
| 604 |
| 605 `maint set dwarf2 always-disassemble' |
| 606 |
| 607 `maint show dwarf2 always-disassemble' |
| 608 Control the behavior of `info address' when using DWARF debugging |
| 609 information. |
| 610 |
| 611 The default is `off', which means that GDB should try to describe |
| 612 a variable's location in an easily readable format. When `on', |
| 613 GDB will instead display the DWARF location expression in an |
| 614 assembly-like format. Note that some locations are too complex |
| 615 for GDB to describe simply; in this case you will always see the |
| 616 disassembly form. |
| 617 |
| 618 Here is an example of the resulting disassembly: |
| 619 |
| 620 (gdb) info addr argc |
| 621 Symbol "argc" is a complex DWARF expression: |
| 622 1: DW_OP_fbreg 0 |
| 623 |
| 624 For more information on these expressions, see the DWARF standard |
| 625 (http://www.dwarfstd.org/). |
| 626 |
| 627 `maint set dwarf2 max-cache-age' |
| 628 `maint show dwarf2 max-cache-age' |
| 629 Control the DWARF 2 compilation unit cache. |
| 630 |
| 631 In object files with inter-compilation-unit references, such as |
| 632 those produced by the GCC option `-feliminate-dwarf2-dups', the |
| 633 DWARF 2 reader needs to frequently refer to previously read |
| 634 compilation units. This setting controls how long a compilation |
| 635 unit will remain in the cache if it is not referenced. A higher |
| 636 limit means that cached compilation units will be stored in memory |
| 637 longer, and more total memory will be used. Setting it to zero |
| 638 disables caching, which will slow down GDB startup, but reduce |
| 639 memory consumption. |
| 640 |
| 641 `maint set profile' |
| 642 `maint show profile' |
| 643 Control profiling of GDB. |
| 644 |
| 645 Profiling will be disabled until you use the `maint set profile' |
| 646 command to enable it. When you enable profiling, the system will |
| 647 begin collecting timing and execution count data; when you disable |
| 648 profiling or exit GDB, the results will be written to a log file. |
| 649 Remember that if you use profiling, GDB will overwrite the |
| 650 profiling log file (often called `gmon.out'). If you have a |
| 651 record of important profiling data in a `gmon.out' file, be sure |
| 652 to move it to a safe location. |
| 653 |
| 654 Configuring with `--enable-profiling' arranges for GDB to be |
| 655 compiled with the `-pg' compiler option. |
| 656 |
| 657 `maint set show-debug-regs' |
| 658 `maint show show-debug-regs' |
| 659 Control whether to show variables that mirror the hardware debug |
| 660 registers. Use `ON' to enable, `OFF' to disable. If enabled, the |
| 661 debug registers values are shown when GDB inserts or removes a |
| 662 hardware breakpoint or watchpoint, and when the inferior triggers |
| 663 a hardware-assisted breakpoint or watchpoint. |
| 664 |
| 665 `maint set show-all-tib' |
| 666 `maint show show-all-tib' |
| 667 Control whether to show all non zero areas within a 1k block |
| 668 starting at thread local base, when using the `info w32 |
| 669 thread-information-block' command. |
| 670 |
| 671 `maint space' |
| 672 Control whether to display memory usage for each command. If set |
| 673 to a nonzero value, GDB will display how much memory each command |
| 674 took, following the command's own output. This can also be |
| 675 requested by invoking GDB with the `--statistics' command-line |
| 676 switch (*note Mode Options::). |
| 677 |
| 678 `maint time' |
| 679 Control whether to display the execution time of GDB for each |
| 680 command. If set to a nonzero value, GDB will display how much |
| 681 time it took to execute each command, following the command's own |
| 682 output. Both CPU time and wallclock time are printed. Printing |
| 683 both is useful when trying to determine whether the cost is CPU |
| 684 or, e.g., disk/network, latency. Note that the CPU time printed |
| 685 is for GDB only, it does not include the execution time of the |
| 686 inferior because there's no mechanism currently to compute how |
| 687 much time was spent by GDB and how much time was spent by the |
| 688 program been debugged. This can also be requested by invoking GDB |
| 689 with the `--statistics' command-line switch (*note Mode Options::). |
| 690 |
| 691 `maint translate-address [SECTION] ADDR' |
| 692 Find the symbol stored at the location specified by the address |
| 693 ADDR and an optional section name SECTION. If found, GDB prints |
| 694 the name of the closest symbol and an offset from the symbol's |
| 695 location to the specified address. This is similar to the `info |
| 696 address' command (*note Symbols::), except that this command also |
| 697 allows to find symbols in other sections. |
| 698 |
| 699 If section was not specified, the section in which the symbol was |
| 700 found is also printed. For dynamically linked executables, the |
| 701 name of executable or shared library containing the symbol is |
| 702 printed as well. |
| 703 |
| 704 |
| 705 The following command is useful for non-interactive invocations of |
| 706 GDB, such as in the test suite. |
| 707 |
| 708 `set watchdog NSEC' |
| 709 Set the maximum number of seconds GDB will wait for the target |
| 710 operation to finish. If this time expires, GDB reports and error |
| 711 and the command is aborted. |
| 712 |
| 713 `show watchdog' |
| 714 Show the current setting of the target wait timeout. |
| 715 |
| 716 |
| 717 File: gdb.info, Node: Remote Protocol, Next: Agent Expressions, Prev: Mainten
ance Commands, Up: Top |
| 718 |
| 719 Appendix E GDB Remote Serial Protocol |
| 720 ************************************* |
| 721 |
| 722 * Menu: |
| 723 |
| 724 * Overview:: |
| 725 * Packets:: |
| 726 * Stop Reply Packets:: |
| 727 * General Query Packets:: |
| 728 * Architecture-Specific Protocol Details:: |
| 729 * Tracepoint Packets:: |
| 730 * Host I/O Packets:: |
| 731 * Interrupts:: |
| 732 * Notification Packets:: |
| 733 * Remote Non-Stop:: |
| 734 * Packet Acknowledgment:: |
| 735 * Examples:: |
| 736 * File-I/O Remote Protocol Extension:: |
| 737 * Library List Format:: |
| 738 * Library List Format for SVR4 Targets:: |
| 739 * Memory Map Format:: |
| 740 * Thread List Format:: |
| 741 * Traceframe Info Format:: |
| 742 |
| 743 |
| 744 File: gdb.info, Node: Overview, Next: Packets, Up: Remote Protocol |
| 745 |
| 746 E.1 Overview |
| 747 ============ |
| 748 |
| 749 There may be occasions when you need to know something about the |
| 750 protocol--for example, if there is only one serial port to your target |
| 751 machine, you might want your program to do something special if it |
| 752 recognizes a packet meant for GDB. |
| 753 |
| 754 In the examples below, `->' and `<-' are used to indicate |
| 755 transmitted and received data, respectively. |
| 756 |
| 757 All GDB commands and responses (other than acknowledgments and |
| 758 notifications, see *Note Notification Packets::) are sent as a PACKET. |
| 759 A PACKET is introduced with the character `$', the actual PACKET-DATA, |
| 760 and the terminating character `#' followed by a two-digit CHECKSUM: |
| 761 |
| 762 `$'PACKET-DATA`#'CHECKSUM |
| 763 The two-digit CHECKSUM is computed as the modulo 256 sum of all |
| 764 characters between the leading `$' and the trailing `#' (an eight bit |
| 765 unsigned checksum). |
| 766 |
| 767 Implementors should note that prior to GDB 5.0 the protocol |
| 768 specification also included an optional two-digit SEQUENCE-ID: |
| 769 |
| 770 `$'SEQUENCE-ID`:'PACKET-DATA`#'CHECKSUM |
| 771 |
| 772 That SEQUENCE-ID was appended to the acknowledgment. GDB has never |
| 773 output SEQUENCE-IDs. Stubs that handle packets added since GDB 5.0 |
| 774 must not accept SEQUENCE-ID. |
| 775 |
| 776 When either the host or the target machine receives a packet, the |
| 777 first response expected is an acknowledgment: either `+' (to indicate |
| 778 the package was received correctly) or `-' (to request retransmission): |
| 779 |
| 780 -> `$'PACKET-DATA`#'CHECKSUM |
| 781 <- `+' |
| 782 The `+'/`-' acknowledgments can be disabled once a connection is |
| 783 established. *Note Packet Acknowledgment::, for details. |
| 784 |
| 785 The host (GDB) sends COMMANDs, and the target (the debugging stub |
| 786 incorporated in your program) sends a RESPONSE. In the case of step |
| 787 and continue COMMANDs, the response is only sent when the operation has |
| 788 completed, and the target has again stopped all threads in all attached |
| 789 processes. This is the default all-stop mode behavior, but the remote |
| 790 protocol also supports GDB's non-stop execution mode; see *Note Remote |
| 791 Non-Stop::, for details. |
| 792 |
| 793 PACKET-DATA consists of a sequence of characters with the exception |
| 794 of `#' and `$' (see `X' packet for additional exceptions). |
| 795 |
| 796 Fields within the packet should be separated using `,' `;' or `:'. |
| 797 Except where otherwise noted all numbers are represented in HEX with |
| 798 leading zeros suppressed. |
| 799 |
| 800 Implementors should note that prior to GDB 5.0, the character `:' |
| 801 could not appear as the third character in a packet (as it would |
| 802 potentially conflict with the SEQUENCE-ID). |
| 803 |
| 804 Binary data in most packets is encoded either as two hexadecimal |
| 805 digits per byte of binary data. This allowed the traditional remote |
| 806 protocol to work over connections which were only seven-bit clean. |
| 807 Some packets designed more recently assume an eight-bit clean |
| 808 connection, and use a more efficient encoding to send and receive |
| 809 binary data. |
| 810 |
| 811 The binary data representation uses `7d' (ASCII `}') as an escape |
| 812 character. Any escaped byte is transmitted as the escape character |
| 813 followed by the original character XORed with `0x20'. For example, the |
| 814 byte `0x7d' would be transmitted as the two bytes `0x7d 0x5d'. The |
| 815 bytes `0x23' (ASCII `#'), `0x24' (ASCII `$'), and `0x7d' (ASCII `}') |
| 816 must always be escaped. Responses sent by the stub must also escape |
| 817 `0x2a' (ASCII `*'), so that it is not interpreted as the start of a |
| 818 run-length encoded sequence (described next). |
| 819 |
| 820 Response DATA can be run-length encoded to save space. Run-length |
| 821 encoding replaces runs of identical characters with one instance of the |
| 822 repeated character, followed by a `*' and a repeat count. The repeat |
| 823 count is itself sent encoded, to avoid binary characters in DATA: a |
| 824 value of N is sent as `N+29'. For a repeat count greater or equal to |
| 825 3, this produces a printable ASCII character, e.g. a space (ASCII code |
| 826 32) for a repeat count of 3. (This is because run-length encoding |
| 827 starts to win for counts 3 or more.) Thus, for example, `0* ' is a |
| 828 run-length encoding of "0000": the space character after `*' means |
| 829 repeat the leading `0' `32 - 29 = 3' more times. |
| 830 |
| 831 The printable characters `#' and `$' or with a numeric value greater |
| 832 than 126 must not be used. Runs of six repeats (`#') or seven repeats |
| 833 (`$') can be expanded using a repeat count of only five (`"'). For |
| 834 example, `00000000' can be encoded as `0*"00'. |
| 835 |
| 836 The error response returned for some packets includes a two character |
| 837 error number. That number is not well defined. |
| 838 |
| 839 For any COMMAND not supported by the stub, an empty response |
| 840 (`$#00') should be returned. That way it is possible to extend the |
| 841 protocol. A newer GDB can tell if a packet is supported based on that |
| 842 response. |
| 843 |
| 844 At a minimum, a stub is required to support the `g' and `G' commands |
| 845 for register access, and the `m' and `M' commands for memory access. |
| 846 Stubs that only control single-threaded targets can implement run |
| 847 control with the `c' (continue), and `s' (step) commands. Stubs that |
| 848 support multi-threading targets should support the `vCont' command. |
| 849 All other commands are optional. |
| 850 |
| 851 |
| 852 File: gdb.info, Node: Packets, Next: Stop Reply Packets, Prev: Overview, Up:
Remote Protocol |
| 853 |
| 854 E.2 Packets |
| 855 =========== |
| 856 |
| 857 The following table provides a complete list of all currently defined |
| 858 COMMANDs and their corresponding response DATA. *Note File-I/O Remote |
| 859 Protocol Extension::, for details about the File I/O extension of the |
| 860 remote protocol. |
| 861 |
| 862 Each packet's description has a template showing the packet's overall |
| 863 syntax, followed by an explanation of the packet's meaning. We include |
| 864 spaces in some of the templates for clarity; these are not part of the |
| 865 packet's syntax. No GDB packet uses spaces to separate its components. |
| 866 For example, a template like `foo BAR BAZ' describes a packet |
| 867 beginning with the three ASCII bytes `foo', followed by a BAR, followed |
| 868 directly by a BAZ. GDB does not transmit a space character between the |
| 869 `foo' and the BAR, or between the BAR and the BAZ. |
| 870 |
| 871 Several packets and replies include a THREAD-ID field to identify a |
| 872 thread. Normally these are positive numbers with a target-specific |
| 873 interpretation, formatted as big-endian hex strings. A THREAD-ID can |
| 874 also be a literal `-1' to indicate all threads, or `0' to pick any |
| 875 thread. |
| 876 |
| 877 In addition, the remote protocol supports a multiprocess feature in |
| 878 which the THREAD-ID syntax is extended to optionally include both |
| 879 process and thread ID fields, as `pPID.TID'. The PID (process) and TID |
| 880 (thread) components each have the format described above: a positive |
| 881 number with target-specific interpretation formatted as a big-endian |
| 882 hex string, literal `-1' to indicate all processes or threads |
| 883 (respectively), or `0' to indicate an arbitrary process or thread. |
| 884 Specifying just a process, as `pPID', is equivalent to `pPID.-1'. It |
| 885 is an error to specify all processes but a specific thread, such as |
| 886 `p-1.TID'. Note that the `p' prefix is _not_ used for those packets |
| 887 and replies explicitly documented to include a process ID, rather than |
| 888 a THREAD-ID. |
| 889 |
| 890 The multiprocess THREAD-ID syntax extensions are only used if both |
| 891 GDB and the stub report support for the `multiprocess' feature using |
| 892 `qSupported'. *Note multiprocess extensions::, for more information. |
| 893 |
| 894 Note that all packet forms beginning with an upper- or lower-case |
| 895 letter, other than those described here, are reserved for future use. |
| 896 |
| 897 Here are the packet descriptions. |
| 898 |
| 899 `!' |
| 900 Enable extended mode. In extended mode, the remote server is made |
| 901 persistent. The `R' packet is used to restart the program being |
| 902 debugged. |
| 903 |
| 904 Reply: |
| 905 `OK' |
| 906 The remote target both supports and has enabled extended mode. |
| 907 |
| 908 `?' |
| 909 Indicate the reason the target halted. The reply is the same as |
| 910 for step and continue. This packet has a special interpretation |
| 911 when the target is in non-stop mode; see *Note Remote Non-Stop::. |
| 912 |
| 913 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 914 |
| 915 `A ARGLEN,ARGNUM,ARG,...' |
| 916 Initialized `argv[]' array passed into program. ARGLEN specifies |
| 917 the number of bytes in the hex encoded byte stream ARG. See |
| 918 `gdbserver' for more details. |
| 919 |
| 920 Reply: |
| 921 `OK' |
| 922 The arguments were set. |
| 923 |
| 924 `E NN' |
| 925 An error occurred. |
| 926 |
| 927 `b BAUD' |
| 928 (Don't use this packet; its behavior is not well-defined.) Change |
| 929 the serial line speed to BAUD. |
| 930 |
| 931 JTC: _When does the transport layer state change? When it's |
| 932 received, or after the ACK is transmitted. In either case, there |
| 933 are problems if the command or the acknowledgment packet is |
| 934 dropped._ |
| 935 |
| 936 Stan: _If people really wanted to add something like this, and get |
| 937 it working for the first time, they ought to modify ser-unix.c to |
| 938 send some kind of out-of-band message to a specially-setup stub |
| 939 and have the switch happen "in between" packets, so that from |
| 940 remote protocol's point of view, nothing actually happened._ |
| 941 |
| 942 `B ADDR,MODE' |
| 943 Set (MODE is `S') or clear (MODE is `C') a breakpoint at ADDR. |
| 944 |
| 945 Don't use this packet. Use the `Z' and `z' packets instead (*note |
| 946 insert breakpoint or watchpoint packet::). |
| 947 |
| 948 `bc' |
| 949 Backward continue. Execute the target system in reverse. No |
| 950 parameter. *Note Reverse Execution::, for more information. |
| 951 |
| 952 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 953 |
| 954 `bs' |
| 955 Backward single step. Execute one instruction in reverse. No |
| 956 parameter. *Note Reverse Execution::, for more information. |
| 957 |
| 958 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 959 |
| 960 `c [ADDR]' |
| 961 Continue. ADDR is address to resume. If ADDR is omitted, resume |
| 962 at current address. |
| 963 |
| 964 This packet is deprecated for multi-threading support. *Note |
| 965 vCont packet::. |
| 966 |
| 967 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 968 |
| 969 `C SIG[;ADDR]' |
| 970 Continue with signal SIG (hex signal number). If `;ADDR' is |
| 971 omitted, resume at same address. |
| 972 |
| 973 This packet is deprecated for multi-threading support. *Note |
| 974 vCont packet::. |
| 975 |
| 976 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 977 |
| 978 `d' |
| 979 Toggle debug flag. |
| 980 |
| 981 Don't use this packet; instead, define a general set packet (*note |
| 982 General Query Packets::). |
| 983 |
| 984 `D' |
| 985 `D;PID' |
| 986 The first form of the packet is used to detach GDB from the remote |
| 987 system. It is sent to the remote target before GDB disconnects |
| 988 via the `detach' command. |
| 989 |
| 990 The second form, including a process ID, is used when multiprocess |
| 991 protocol extensions are enabled (*note multiprocess extensions::), |
| 992 to detach only a specific process. The PID is specified as a |
| 993 big-endian hex string. |
| 994 |
| 995 Reply: |
| 996 `OK' |
| 997 for success |
| 998 |
| 999 `E NN' |
| 1000 for an error |
| 1001 |
| 1002 `F RC,EE,CF;XX' |
| 1003 A reply from GDB to an `F' packet sent by the target. This is |
| 1004 part of the File-I/O protocol extension. *Note File-I/O Remote |
| 1005 Protocol Extension::, for the specification. |
| 1006 |
| 1007 `g' |
| 1008 Read general registers. |
| 1009 |
| 1010 Reply: |
| 1011 `XX...' |
| 1012 Each byte of register data is described by two hex digits. |
| 1013 The bytes with the register are transmitted in target byte |
| 1014 order. The size of each register and their position within |
| 1015 the `g' packet are determined by the GDB internal gdbarch |
| 1016 functions `DEPRECATED_REGISTER_RAW_SIZE' and |
| 1017 `gdbarch_register_name'. The specification of several |
| 1018 standard `g' packets is specified below. |
| 1019 |
| 1020 When reading registers from a trace frame (*note Using the |
| 1021 Collected Data: Analyze Collected Data.), the stub may also |
| 1022 return a string of literal `x''s in place of the register |
| 1023 data digits, to indicate that the corresponding register has |
| 1024 not been collected, thus its value is unavailable. For |
| 1025 example, for an architecture with 4 registers of 4 bytes |
| 1026 each, the following reply indicates to GDB that registers 0 |
| 1027 and 2 have not been collected, while registers 1 and 3 have |
| 1028 been collected, and both have zero value: |
| 1029 |
| 1030 -> `g' |
| 1031 <- `xxxxxxxx00000000xxxxxxxx00000000' |
| 1032 |
| 1033 `E NN' |
| 1034 for an error. |
| 1035 |
| 1036 `G XX...' |
| 1037 Write general registers. *Note read registers packet::, for a |
| 1038 description of the XX... data. |
| 1039 |
| 1040 Reply: |
| 1041 `OK' |
| 1042 for success |
| 1043 |
| 1044 `E NN' |
| 1045 for an error |
| 1046 |
| 1047 `H OP THREAD-ID' |
| 1048 Set thread for subsequent operations (`m', `M', `g', `G', et.al.). |
| 1049 OP depends on the operation to be performed: it should be `c' for |
| 1050 step and continue operations (note that this is deprecated, |
| 1051 supporting the `vCont' command is a better option), `g' for other |
| 1052 operations. The thread designator THREAD-ID has the format and |
| 1053 interpretation described in *Note thread-id syntax::. |
| 1054 |
| 1055 Reply: |
| 1056 `OK' |
| 1057 for success |
| 1058 |
| 1059 `E NN' |
| 1060 for an error |
| 1061 |
| 1062 `i [ADDR[,NNN]]' |
| 1063 Step the remote target by a single clock cycle. If `,NNN' is |
| 1064 present, cycle step NNN cycles. If ADDR is present, cycle step |
| 1065 starting at that address. |
| 1066 |
| 1067 `I' |
| 1068 Signal, then cycle step. *Note step with signal packet::. *Note |
| 1069 cycle step packet::. |
| 1070 |
| 1071 `k' |
| 1072 Kill request. |
| 1073 |
| 1074 FIXME: _There is no description of how to operate when a specific |
| 1075 thread context has been selected (i.e. does 'k' kill only that |
| 1076 thread?)_. |
| 1077 |
| 1078 `m ADDR,LENGTH' |
| 1079 Read LENGTH bytes of memory starting at address ADDR. Note that |
| 1080 ADDR may not be aligned to any particular boundary. |
| 1081 |
| 1082 The stub need not use any particular size or alignment when |
| 1083 gathering data from memory for the response; even if ADDR is |
| 1084 word-aligned and LENGTH is a multiple of the word size, the stub |
| 1085 is free to use byte accesses, or not. For this reason, this |
| 1086 packet may not be suitable for accessing memory-mapped I/O devices. |
| 1087 |
| 1088 Reply: |
| 1089 `XX...' |
| 1090 Memory contents; each byte is transmitted as a two-digit |
| 1091 hexadecimal number. The reply may contain fewer bytes than |
| 1092 requested if the server was able to read only part of the |
| 1093 region of memory. |
| 1094 |
| 1095 `E NN' |
| 1096 NN is errno |
| 1097 |
| 1098 `M ADDR,LENGTH:XX...' |
| 1099 Write LENGTH bytes of memory starting at address ADDR. XX... is |
| 1100 the data; each byte is transmitted as a two-digit hexadecimal |
| 1101 number. |
| 1102 |
| 1103 Reply: |
| 1104 `OK' |
| 1105 for success |
| 1106 |
| 1107 `E NN' |
| 1108 for an error (this includes the case where only part of the |
| 1109 data was written). |
| 1110 |
| 1111 `p N' |
| 1112 Read the value of register N; N is in hex. *Note read registers |
| 1113 packet::, for a description of how the returned register value is |
| 1114 encoded. |
| 1115 |
| 1116 Reply: |
| 1117 `XX...' |
| 1118 the register's value |
| 1119 |
| 1120 `E NN' |
| 1121 for an error |
| 1122 |
| 1123 `' |
| 1124 Indicating an unrecognized QUERY. |
| 1125 |
| 1126 `P N...=R...' |
| 1127 Write register N... with value R.... The register number N is in |
| 1128 hexadecimal, and R... contains two hex digits for each byte in the |
| 1129 register (target byte order). |
| 1130 |
| 1131 Reply: |
| 1132 `OK' |
| 1133 for success |
| 1134 |
| 1135 `E NN' |
| 1136 for an error |
| 1137 |
| 1138 `q NAME PARAMS...' |
| 1139 `Q NAME PARAMS...' |
| 1140 General query (`q') and set (`Q'). These packets are described |
| 1141 fully in *Note General Query Packets::. |
| 1142 |
| 1143 `r' |
| 1144 Reset the entire system. |
| 1145 |
| 1146 Don't use this packet; use the `R' packet instead. |
| 1147 |
| 1148 `R XX' |
| 1149 Restart the program being debugged. XX, while needed, is ignored. |
| 1150 This packet is only available in extended mode (*note extended |
| 1151 mode::). |
| 1152 |
| 1153 The `R' packet has no reply. |
| 1154 |
| 1155 `s [ADDR]' |
| 1156 Single step. ADDR is the address at which to resume. If ADDR is |
| 1157 omitted, resume at same address. |
| 1158 |
| 1159 This packet is deprecated for multi-threading support. *Note |
| 1160 vCont packet::. |
| 1161 |
| 1162 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 1163 |
| 1164 `S SIG[;ADDR]' |
| 1165 Step with signal. This is analogous to the `C' packet, but |
| 1166 requests a single-step, rather than a normal resumption of |
| 1167 execution. |
| 1168 |
| 1169 This packet is deprecated for multi-threading support. *Note |
| 1170 vCont packet::. |
| 1171 |
| 1172 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 1173 |
| 1174 `t ADDR:PP,MM' |
| 1175 Search backwards starting at address ADDR for a match with pattern |
| 1176 PP and mask MM. PP and MM are 4 bytes. ADDR must be at least 3 |
| 1177 digits. |
| 1178 |
| 1179 `T THREAD-ID' |
| 1180 Find out if the thread THREAD-ID is alive. *Note thread-id |
| 1181 syntax::. |
| 1182 |
| 1183 Reply: |
| 1184 `OK' |
| 1185 thread is still alive |
| 1186 |
| 1187 `E NN' |
| 1188 thread is dead |
| 1189 |
| 1190 `v' |
| 1191 Packets starting with `v' are identified by a multi-letter name, |
| 1192 up to the first `;' or `?' (or the end of the packet). |
| 1193 |
| 1194 `vAttach;PID' |
| 1195 Attach to a new process with the specified process ID PID. The |
| 1196 process ID is a hexadecimal integer identifying the process. In |
| 1197 all-stop mode, all threads in the attached process are stopped; in |
| 1198 non-stop mode, it may be attached without being stopped if that is |
| 1199 supported by the target. |
| 1200 |
| 1201 This packet is only available in extended mode (*note extended |
| 1202 mode::). |
| 1203 |
| 1204 Reply: |
| 1205 `E NN' |
| 1206 for an error |
| 1207 |
| 1208 `Any stop packet' |
| 1209 for success in all-stop mode (*note Stop Reply Packets::) |
| 1210 |
| 1211 `OK' |
| 1212 for success in non-stop mode (*note Remote Non-Stop::) |
| 1213 |
| 1214 `vCont[;ACTION[:THREAD-ID]]...' |
| 1215 Resume the inferior, specifying different actions for each thread. |
| 1216 If an action is specified with no THREAD-ID, then it is applied to |
| 1217 any threads that don't have a specific action specified; if no |
| 1218 default action is specified then other threads should remain |
| 1219 stopped in all-stop mode and in their current state in non-stop |
| 1220 mode. Specifying multiple default actions is an error; specifying |
| 1221 no actions is also an error. Thread IDs are specified using the |
| 1222 syntax described in *Note thread-id syntax::. |
| 1223 |
| 1224 Currently supported actions are: |
| 1225 |
| 1226 `c' |
| 1227 Continue. |
| 1228 |
| 1229 `C SIG' |
| 1230 Continue with signal SIG. The signal SIG should be two hex |
| 1231 digits. |
| 1232 |
| 1233 `s' |
| 1234 Step. |
| 1235 |
| 1236 `S SIG' |
| 1237 Step with signal SIG. The signal SIG should be two hex |
| 1238 digits. |
| 1239 |
| 1240 `t' |
| 1241 Stop. |
| 1242 |
| 1243 The optional argument ADDR normally associated with the `c', `C', |
| 1244 `s', and `S' packets is not supported in `vCont'. |
| 1245 |
| 1246 The `t' action is only relevant in non-stop mode (*note Remote |
| 1247 Non-Stop::) and may be ignored by the stub otherwise. A stop |
| 1248 reply should be generated for any affected thread not already |
| 1249 stopped. When a thread is stopped by means of a `t' action, the |
| 1250 corresponding stop reply should indicate that the thread has |
| 1251 stopped with signal `0', regardless of whether the target uses |
| 1252 some other signal as an implementation detail. |
| 1253 |
| 1254 The stub must support `vCont' if it reports support for |
| 1255 multiprocess extensions (*note multiprocess extensions::). Note |
| 1256 that in this case `vCont' actions can be specified to apply to all |
| 1257 threads in a process by using the `pPID.-1' form of the THREAD-ID. |
| 1258 |
| 1259 Reply: *Note Stop Reply Packets::, for the reply specifications. |
| 1260 |
| 1261 `vCont?' |
| 1262 Request a list of actions supported by the `vCont' packet. |
| 1263 |
| 1264 Reply: |
| 1265 `vCont[;ACTION...]' |
| 1266 The `vCont' packet is supported. Each ACTION is a supported |
| 1267 command in the `vCont' packet. |
| 1268 |
| 1269 `' |
| 1270 The `vCont' packet is not supported. |
| 1271 |
| 1272 `vFile:OPERATION:PARAMETER...' |
| 1273 Perform a file operation on the target system. For details, see |
| 1274 *Note Host I/O Packets::. |
| 1275 |
| 1276 `vFlashErase:ADDR,LENGTH' |
| 1277 Direct the stub to erase LENGTH bytes of flash starting at ADDR. |
| 1278 The region may enclose any number of flash blocks, but its start |
| 1279 and end must fall on block boundaries, as indicated by the flash |
| 1280 block size appearing in the memory map (*note Memory Map |
| 1281 Format::). GDB groups flash memory programming operations |
| 1282 together, and sends a `vFlashDone' request after each group; the |
| 1283 stub is allowed to delay erase operation until the `vFlashDone' |
| 1284 packet is received. |
| 1285 |
| 1286 Reply: |
| 1287 `OK' |
| 1288 for success |
| 1289 |
| 1290 `E NN' |
| 1291 for an error |
| 1292 |
| 1293 `vFlashWrite:ADDR:XX...' |
| 1294 Direct the stub to write data to flash address ADDR. The data is |
| 1295 passed in binary form using the same encoding as for the `X' |
| 1296 packet (*note Binary Data::). The memory ranges specified by |
| 1297 `vFlashWrite' packets preceding a `vFlashDone' packet must not |
| 1298 overlap, and must appear in order of increasing addresses |
| 1299 (although `vFlashErase' packets for higher addresses may already |
| 1300 have been received; the ordering is guaranteed only between |
| 1301 `vFlashWrite' packets). If a packet writes to an address that was |
| 1302 neither erased by a preceding `vFlashErase' packet nor by some |
| 1303 other target-specific method, the results are unpredictable. |
| 1304 |
| 1305 Reply: |
| 1306 `OK' |
| 1307 for success |
| 1308 |
| 1309 `E.memtype' |
| 1310 for vFlashWrite addressing non-flash memory |
| 1311 |
| 1312 `E NN' |
| 1313 for an error |
| 1314 |
| 1315 `vFlashDone' |
| 1316 Indicate to the stub that flash programming operation is finished. |
| 1317 The stub is permitted to delay or batch the effects of a group of |
| 1318 `vFlashErase' and `vFlashWrite' packets until a `vFlashDone' |
| 1319 packet is received. The contents of the affected regions of flash |
| 1320 memory are unpredictable until the `vFlashDone' request is |
| 1321 completed. |
| 1322 |
| 1323 `vKill;PID' |
| 1324 Kill the process with the specified process ID. PID is a |
| 1325 hexadecimal integer identifying the process. This packet is used |
| 1326 in preference to `k' when multiprocess protocol extensions are |
| 1327 supported; see *Note multiprocess extensions::. |
| 1328 |
| 1329 Reply: |
| 1330 `E NN' |
| 1331 for an error |
| 1332 |
| 1333 `OK' |
| 1334 for success |
| 1335 |
| 1336 `vRun;FILENAME[;ARGUMENT]...' |
| 1337 Run the program FILENAME, passing it each ARGUMENT on its command |
| 1338 line. The file and arguments are hex-encoded strings. If |
| 1339 FILENAME is an empty string, the stub may use a default program |
| 1340 (e.g. the last program run). The program is created in the stopped |
| 1341 state. |
| 1342 |
| 1343 This packet is only available in extended mode (*note extended |
| 1344 mode::). |
| 1345 |
| 1346 Reply: |
| 1347 `E NN' |
| 1348 for an error |
| 1349 |
| 1350 `Any stop packet' |
| 1351 for success (*note Stop Reply Packets::) |
| 1352 |
| 1353 `vStopped' |
| 1354 In non-stop mode (*note Remote Non-Stop::), acknowledge a previous |
| 1355 stop reply and prompt for the stub to report another one. |
| 1356 |
| 1357 Reply: |
| 1358 `Any stop packet' |
| 1359 if there is another unreported stop event (*note Stop Reply |
| 1360 Packets::) |
| 1361 |
| 1362 `OK' |
| 1363 if there are no unreported stop events |
| 1364 |
| 1365 `X ADDR,LENGTH:XX...' |
| 1366 Write data to memory, where the data is transmitted in binary. |
| 1367 ADDR is address, LENGTH is number of bytes, `XX...' is binary data |
| 1368 (*note Binary Data::). |
| 1369 |
| 1370 Reply: |
| 1371 `OK' |
| 1372 for success |
| 1373 |
| 1374 `E NN' |
| 1375 for an error |
| 1376 |
| 1377 `z TYPE,ADDR,KIND' |
| 1378 `Z TYPE,ADDR,KIND' |
| 1379 Insert (`Z') or remove (`z') a TYPE breakpoint or watchpoint |
| 1380 starting at address ADDRESS of kind KIND. |
| 1381 |
| 1382 Each breakpoint and watchpoint packet TYPE is documented |
| 1383 separately. |
| 1384 |
| 1385 _Implementation notes: A remote target shall return an empty string |
| 1386 for an unrecognized breakpoint or watchpoint packet TYPE. A |
| 1387 remote target shall support either both or neither of a given |
| 1388 `ZTYPE...' and `zTYPE...' packet pair. To avoid potential |
| 1389 problems with duplicate packets, the operations should be |
| 1390 implemented in an idempotent way._ |
| 1391 |
| 1392 `z0,ADDR,KIND' |
| 1393 `Z0,ADDR,KIND[;COND_LIST...][;cmds:PERSIST,CMD_LIST...]' |
| 1394 Insert (`Z0') or remove (`z0') a memory breakpoint at address ADDR |
| 1395 of type KIND. |
| 1396 |
| 1397 A memory breakpoint is implemented by replacing the instruction at |
| 1398 ADDR with a software breakpoint or trap instruction. The KIND is |
| 1399 target-specific and typically indicates the size of the breakpoint |
| 1400 in bytes that should be inserted. E.g., the ARM and MIPS can |
| 1401 insert either a 2 or 4 byte breakpoint. Some architectures have |
| 1402 additional meanings for KIND; COND_LIST is an optional list of |
| 1403 conditional expressions in bytecode form that should be evaluated |
| 1404 on the target's side. These are the conditions that should be |
| 1405 taken into consideration when deciding if the breakpoint trigger |
| 1406 should be reported back to GDBN. |
| 1407 |
| 1408 The COND_LIST parameter is comprised of a series of expressions, |
| 1409 concatenated without separators. Each expression has the following |
| 1410 form: |
| 1411 |
| 1412 `X LEN,EXPR' |
| 1413 LEN is the length of the bytecode expression and EXPR is the |
| 1414 actual conditional expression in bytecode form. |
| 1415 |
| 1416 |
| 1417 The optional CMD_LIST parameter introduces commands that may be |
| 1418 run on the target, rather than being reported back to GDB. The |
| 1419 parameter starts with a numeric flag PERSIST; if the flag is |
| 1420 nonzero, then the breakpoint may remain active and the commands |
| 1421 continue to be run even when GDB disconnects from the target. |
| 1422 Following this flag is a series of expressions concatenated with no |
| 1423 separators. Each expression has the following form: |
| 1424 |
| 1425 `X LEN,EXPR' |
| 1426 LEN is the length of the bytecode expression and EXPR is the |
| 1427 actual conditional expression in bytecode form. |
| 1428 |
| 1429 |
| 1430 see *Note Architecture-Specific Protocol Details::. |
| 1431 |
| 1432 _Implementation note: It is possible for a target to copy or move |
| 1433 code that contains memory breakpoints (e.g., when implementing |
| 1434 overlays). The behavior of this packet, in the presence of such a |
| 1435 target, is not defined._ |
| 1436 |
| 1437 Reply: |
| 1438 `OK' |
| 1439 success |
| 1440 |
| 1441 `' |
| 1442 not supported |
| 1443 |
| 1444 `E NN' |
| 1445 for an error |
| 1446 |
| 1447 `z1,ADDR,KIND' |
| 1448 `Z1,ADDR,KIND[;COND_LIST...]' |
| 1449 Insert (`Z1') or remove (`z1') a hardware breakpoint at address |
| 1450 ADDR. |
| 1451 |
| 1452 A hardware breakpoint is implemented using a mechanism that is not |
| 1453 dependant on being able to modify the target's memory. KIND and |
| 1454 COND_LIST have the same meaning as in `Z0' packets. |
| 1455 |
| 1456 _Implementation note: A hardware breakpoint is not affected by code |
| 1457 movement._ |
| 1458 |
| 1459 Reply: |
| 1460 `OK' |
| 1461 success |
| 1462 |
| 1463 `' |
| 1464 not supported |
| 1465 |
| 1466 `E NN' |
| 1467 for an error |
| 1468 |
| 1469 `z2,ADDR,KIND' |
| 1470 `Z2,ADDR,KIND' |
| 1471 Insert (`Z2') or remove (`z2') a write watchpoint at ADDR. KIND |
| 1472 is interpreted as the number of bytes to watch. |
| 1473 |
| 1474 Reply: |
| 1475 `OK' |
| 1476 success |
| 1477 |
| 1478 `' |
| 1479 not supported |
| 1480 |
| 1481 `E NN' |
| 1482 for an error |
| 1483 |
| 1484 `z3,ADDR,KIND' |
| 1485 `Z3,ADDR,KIND' |
| 1486 Insert (`Z3') or remove (`z3') a read watchpoint at ADDR. KIND is |
| 1487 interpreted as the number of bytes to watch. |
| 1488 |
| 1489 Reply: |
| 1490 `OK' |
| 1491 success |
| 1492 |
| 1493 `' |
| 1494 not supported |
| 1495 |
| 1496 `E NN' |
| 1497 for an error |
| 1498 |
| 1499 `z4,ADDR,KIND' |
| 1500 `Z4,ADDR,KIND' |
| 1501 Insert (`Z4') or remove (`z4') an access watchpoint at ADDR. KIND |
| 1502 is interpreted as the number of bytes to watch. |
| 1503 |
| 1504 Reply: |
| 1505 `OK' |
| 1506 success |
| 1507 |
| 1508 `' |
| 1509 not supported |
| 1510 |
| 1511 `E NN' |
| 1512 for an error |
| 1513 |
| 1514 |
| 1515 |
| 1516 File: gdb.info, Node: Stop Reply Packets, Next: General Query Packets, Prev:
Packets, Up: Remote Protocol |
| 1517 |
| 1518 E.3 Stop Reply Packets |
| 1519 ====================== |
| 1520 |
| 1521 The `C', `c', `S', `s', `vCont', `vAttach', `vRun', `vStopped', and `?' |
| 1522 packets can receive any of the below as a reply. Except for `?' and |
| 1523 `vStopped', that reply is only returned when the target halts. In the |
| 1524 below the exact meaning of "signal number" is defined by the header |
| 1525 `include/gdb/signals.h' in the GDB source code. |
| 1526 |
| 1527 As in the description of request packets, we include spaces in the |
| 1528 reply templates for clarity; these are not part of the reply packet's |
| 1529 syntax. No GDB stop reply packet uses spaces to separate its |
| 1530 components. |
| 1531 |
| 1532 `S AA' |
| 1533 The program received signal number AA (a two-digit hexadecimal |
| 1534 number). This is equivalent to a `T' response with no N:R pairs. |
| 1535 |
| 1536 `T AA N1:R1;N2:R2;...' |
| 1537 The program received signal number AA (a two-digit hexadecimal |
| 1538 number). This is equivalent to an `S' response, except that the |
| 1539 `N:R' pairs can carry values of important registers and other |
| 1540 information directly in the stop reply packet, reducing round-trip |
| 1541 latency. Single-step and breakpoint traps are reported this way. |
| 1542 Each `N:R' pair is interpreted as follows: |
| 1543 |
| 1544 * If N is a hexadecimal number, it is a register number, and the |
| 1545 corresponding R gives that register's value. R is a series |
| 1546 of bytes in target byte order, with each byte given by a |
| 1547 two-digit hex number. |
| 1548 |
| 1549 * If N is `thread', then R is the THREAD-ID of the stopped |
| 1550 thread, as specified in *Note thread-id syntax::. |
| 1551 |
| 1552 * If N is `core', then R is the hexadecimal number of the core |
| 1553 on which the stop event was detected. |
| 1554 |
| 1555 * If N is a recognized "stop reason", it describes a more |
| 1556 specific event that stopped the target. The currently |
| 1557 defined stop reasons are listed below. AA should be `05', |
| 1558 the trap signal. At most one stop reason should be present. |
| 1559 |
| 1560 * Otherwise, GDB should ignore this `N:R' pair and go on to the |
| 1561 next; this allows us to extend the protocol in the future. |
| 1562 |
| 1563 The currently defined stop reasons are: |
| 1564 |
| 1565 `watch' |
| 1566 `rwatch' |
| 1567 `awatch' |
| 1568 The packet indicates a watchpoint hit, and R is the data |
| 1569 address, in hex. |
| 1570 |
| 1571 `library' |
| 1572 The packet indicates that the loaded libraries have changed. |
| 1573 GDB should use `qXfer:libraries:read' to fetch a new list of |
| 1574 loaded libraries. R is ignored. |
| 1575 |
| 1576 `replaylog' |
| 1577 The packet indicates that the target cannot continue replaying |
| 1578 logged execution events, because it has reached the end (or |
| 1579 the beginning when executing backward) of the log. The value |
| 1580 of R will be either `begin' or `end'. *Note Reverse |
| 1581 Execution::, for more information. |
| 1582 |
| 1583 `W AA' |
| 1584 `W AA ; process:PID' |
| 1585 The process exited, and AA is the exit status. This is only |
| 1586 applicable to certain targets. |
| 1587 |
| 1588 The second form of the response, including the process ID of the |
| 1589 exited process, can be used only when GDB has reported support for |
| 1590 multiprocess protocol extensions; see *Note multiprocess |
| 1591 extensions::. The PID is formatted as a big-endian hex string. |
| 1592 |
| 1593 `X AA' |
| 1594 `X AA ; process:PID' |
| 1595 The process terminated with signal AA. |
| 1596 |
| 1597 The second form of the response, including the process ID of the |
| 1598 terminated process, can be used only when GDB has reported support |
| 1599 for multiprocess protocol extensions; see *Note multiprocess |
| 1600 extensions::. The PID is formatted as a big-endian hex string. |
| 1601 |
| 1602 `O XX...' |
| 1603 `XX...' is hex encoding of ASCII data, to be written as the |
| 1604 program's console output. This can happen at any time while the |
| 1605 program is running and the debugger should continue to wait for |
| 1606 `W', `T', etc. This reply is not permitted in non-stop mode. |
| 1607 |
| 1608 `F CALL-ID,PARAMETER...' |
| 1609 CALL-ID is the identifier which says which host system call should |
| 1610 be called. This is just the name of the function. Translation |
| 1611 into the correct system call is only applicable as it's defined in |
| 1612 GDB. *Note File-I/O Remote Protocol Extension::, for a list of |
| 1613 implemented system calls. |
| 1614 |
| 1615 `PARAMETER...' is a list of parameters as defined for this very |
| 1616 system call. |
| 1617 |
| 1618 The target replies with this packet when it expects GDB to call a |
| 1619 host system call on behalf of the target. GDB replies with an |
| 1620 appropriate `F' packet and keeps up waiting for the next reply |
| 1621 packet from the target. The latest `C', `c', `S' or `s' action is |
| 1622 expected to be continued. *Note File-I/O Remote Protocol |
| 1623 Extension::, for more details. |
| 1624 |
| 1625 |
| 1626 |
44 File: gdb.info, Node: General Query Packets, Next: Architecture-Specific Proto
col Details, Prev: Stop Reply Packets, Up: Remote Protocol | 1627 File: gdb.info, Node: General Query Packets, Next: Architecture-Specific Proto
col Details, Prev: Stop Reply Packets, Up: Remote Protocol |
45 | 1628 |
46 E.4 General Query Packets | 1629 E.4 General Query Packets |
47 ========================= | 1630 ========================= |
48 | 1631 |
49 Packets starting with `q' are "general query packets"; packets starting | 1632 Packets starting with `q' are "general query packets"; packets starting |
50 with `Q' are "general set packets". General query and set packets are | 1633 with `Q' are "general set packets". General query and set packets are |
51 a semi-unified form for retrieving and sending information to and from | 1634 a semi-unified form for retrieving and sending information to and from |
52 the stub. | 1635 the stub. |
53 | 1636 |
(...skipping 19 matching lines...) Expand all Loading... |
73 `qP', or `qL'(1). | 1656 `qP', or `qL'(1). |
74 | 1657 |
75 Like the descriptions of the other packets, each description here | 1658 Like the descriptions of the other packets, each description here |
76 has a template showing the packet's overall syntax, followed by an | 1659 has a template showing the packet's overall syntax, followed by an |
77 explanation of the packet's meaning. We include spaces in some of the | 1660 explanation of the packet's meaning. We include spaces in some of the |
78 templates for clarity; these are not part of the packet's syntax. No | 1661 templates for clarity; these are not part of the packet's syntax. No |
79 GDB packet uses spaces to separate its components. | 1662 GDB packet uses spaces to separate its components. |
80 | 1663 |
81 Here are the currently defined query and set packets: | 1664 Here are the currently defined query and set packets: |
82 | 1665 |
| 1666 `QAgent:1' |
| 1667 |
| 1668 `QAgent:0' |
| 1669 Turn on or off the agent as a helper to perform some debugging |
| 1670 operations delegated from GDB (*note Control Agent::). |
| 1671 |
83 `QAllow:OP:VAL...' | 1672 `QAllow:OP:VAL...' |
84 Specify which operations GDB expects to request of the target, as | 1673 Specify which operations GDB expects to request of the target, as |
85 a semicolon-separated list of operation name and value pairs. | 1674 a semicolon-separated list of operation name and value pairs. |
86 Possible values for OP include `WriteReg', `WriteMem', | 1675 Possible values for OP include `WriteReg', `WriteMem', |
87 `InsertBreak', `InsertTrace', `InsertFastTrace', and `Stop'. VAL | 1676 `InsertBreak', `InsertTrace', `InsertFastTrace', and `Stop'. VAL |
88 is either 0, indicating that GDB will not request the operation, | 1677 is either 0, indicating that GDB will not request the operation, |
89 or 1, indicating that it may. (The target can then use this to | 1678 or 1, indicating that it may. (The target can then use this to |
90 set up its own internals optimally, for instance if the debugger | 1679 set up its own internals optimally, for instance if the debugger |
91 never expects to insert breakpoints, it may not need to install | 1680 never expects to insert breakpoints, it may not need to install |
92 its own trap handler.) | 1681 its own trap handler.) |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 `' | 1918 `' |
330 An empty reply indicates that `QPassSignals' is not supported | 1919 An empty reply indicates that `QPassSignals' is not supported |
331 by the stub. | 1920 by the stub. |
332 | 1921 |
333 Use of this packet is controlled by the `set remote pass-signals' | 1922 Use of this packet is controlled by the `set remote pass-signals' |
334 command (*note set remote pass-signals: Remote Configuration.). | 1923 command (*note set remote pass-signals: Remote Configuration.). |
335 This packet is not probed by default; the remote stub must request | 1924 This packet is not probed by default; the remote stub must request |
336 it, by supplying an appropriate `qSupported' response (*note | 1925 it, by supplying an appropriate `qSupported' response (*note |
337 qSupported::). | 1926 qSupported::). |
338 | 1927 |
| 1928 `QProgramSignals: SIGNAL [;SIGNAL]...' |
| 1929 Each listed SIGNAL may be delivered to the inferior process. |
| 1930 Others should be silently discarded. |
| 1931 |
| 1932 In some cases, the remote stub may need to decide whether to |
| 1933 deliver a signal to the program or not without GDB involvement. |
| 1934 One example of that is while detaching -- the program's threads |
| 1935 may have stopped for signals that haven't yet had a chance of |
| 1936 being reported to GDB, and so the remote stub can use the signal |
| 1937 list specified by this packet to know whether to deliver or ignore |
| 1938 those pending signals. |
| 1939 |
| 1940 This does not influence whether to deliver a signal as requested |
| 1941 by a resumption packet (*note vCont packet::). |
| 1942 |
| 1943 Signals are numbered identically to continue packets and stop |
| 1944 replies (*note Stop Reply Packets::). Each SIGNAL list item |
| 1945 should be strictly greater than the previous item. Multiple |
| 1946 `QProgramSignals' packets do not combine; any earlier |
| 1947 `QProgramSignals' list is completely replaced by the new list. |
| 1948 |
| 1949 Reply: |
| 1950 `OK' |
| 1951 The request succeeded. |
| 1952 |
| 1953 `E NN' |
| 1954 An error occurred. NN are hex digits. |
| 1955 |
| 1956 `' |
| 1957 An empty reply indicates that `QProgramSignals' is not |
| 1958 supported by the stub. |
| 1959 |
| 1960 Use of this packet is controlled by the `set remote |
| 1961 program-signals' command (*note set remote program-signals: Remote |
| 1962 Configuration.). This packet is not probed by default; the remote |
| 1963 stub must request it, by supplying an appropriate `qSupported' |
| 1964 response (*note qSupported::). |
| 1965 |
339 `qRcmd,COMMAND' | 1966 `qRcmd,COMMAND' |
340 COMMAND (hex encoded) is passed to the local interpreter for | 1967 COMMAND (hex encoded) is passed to the local interpreter for |
341 execution. Invalid commands should be reported using the output | 1968 execution. Invalid commands should be reported using the output |
342 string. Before the final result packet, the target may also | 1969 string. Before the final result packet, the target may also |
343 respond with a number of intermediate `OOUTPUT' console output | 1970 respond with a number of intermediate `OOUTPUT' console output |
344 packets. _Implementors should note that providing access to a | 1971 packets. _Implementors should note that providing access to a |
345 stubs's interpreter may have security implications_. | 1972 stubs's interpreter may have security implications_. |
346 | 1973 |
347 Reply: | 1974 Reply: |
348 `OK' | 1975 `OK' |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 `qXfer:features:read' No `-' Yes | 2135 `qXfer:features:read' No `-' Yes |
509 `qXfer:libraries:read' No `-' Yes | 2136 `qXfer:libraries:read' No `-' Yes |
510 `qXfer:memory-map:read' No `-' Yes | 2137 `qXfer:memory-map:read' No `-' Yes |
511 `qXfer:sdata:read' No `-' Yes | 2138 `qXfer:sdata:read' No `-' Yes |
512 `qXfer:spu:read' No `-' Yes | 2139 `qXfer:spu:read' No `-' Yes |
513 `qXfer:spu:write' No `-' Yes | 2140 `qXfer:spu:write' No `-' Yes |
514 `qXfer:siginfo:read' No `-' Yes | 2141 `qXfer:siginfo:read' No `-' Yes |
515 `qXfer:siginfo:write' No `-' Yes | 2142 `qXfer:siginfo:write' No `-' Yes |
516 `qXfer:threads:read' No `-' Yes | 2143 `qXfer:threads:read' No `-' Yes |
517 `qXfer:traceframe-info:read'No `-' Yes | 2144 `qXfer:traceframe-info:read'No `-' Yes |
| 2145 `qXfer:uib:read' No `-' Yes |
518 `qXfer:fdpic:read' No `-' Yes | 2146 `qXfer:fdpic:read' No `-' Yes |
519 `QNonStop' No `-' Yes | 2147 `QNonStop' No `-' Yes |
520 `QPassSignals' No `-' Yes | 2148 `QPassSignals' No `-' Yes |
521 `QStartNoAckMode' No `-' Yes | 2149 `QStartNoAckMode' No `-' Yes |
522 `multiprocess' No `-' No | 2150 `multiprocess' No `-' No |
| 2151 `ConditionalBreakpoints'No `-' No |
523 `ConditionalTracepoints'No `-' No | 2152 `ConditionalTracepoints'No `-' No |
524 `ReverseContinue' No `-' No | 2153 `ReverseContinue' No `-' No |
525 `ReverseStep' No `-' No | 2154 `ReverseStep' No `-' No |
526 `TracepointSource' No `-' No | 2155 `TracepointSource' No `-' No |
| 2156 `QAgent' No `-' No |
527 `QAllow' No `-' No | 2157 `QAllow' No `-' No |
528 `QDisableRandomization' No `-' No | 2158 `QDisableRandomization' No `-' No |
529 `EnableDisableTracepoints'No `-' No | 2159 `EnableDisableTracepoints'No `-' No |
530 `tracenz' No `-' No | 2160 `tracenz' No `-' No |
| 2161 `BreakpointCommands' No `-' No |
531 | 2162 |
532 These are the currently defined stub features, in more detail: | 2163 These are the currently defined stub features, in more detail: |
533 | 2164 |
534 `PacketSize=BYTES' | 2165 `PacketSize=BYTES' |
535 The remote stub can accept packets up to at least BYTES in | 2166 The remote stub can accept packets up to at least BYTES in |
536 length. GDB will send packets up to this size for bulk | 2167 length. GDB will send packets up to this size for bulk |
537 transfers, and will never send larger packets. This is a | 2168 transfers, and will never send larger packets. This is a |
538 limit on the data characters in the packet, including the | 2169 limit on the data characters in the packet, including the |
539 frame and checksum. There is no trailing NUL byte in a | 2170 frame and checksum. There is no trailing NUL byte in a |
540 remote protocol packet; if the stub stores packets in a | 2171 remote protocol packet; if the stub stores packets in a |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 (*note qXfer siginfo write::). | 2214 (*note qXfer siginfo write::). |
584 | 2215 |
585 `qXfer:threads:read' | 2216 `qXfer:threads:read' |
586 The remote stub understands the `qXfer:threads:read' packet | 2217 The remote stub understands the `qXfer:threads:read' packet |
587 (*note qXfer threads read::). | 2218 (*note qXfer threads read::). |
588 | 2219 |
589 `qXfer:traceframe-info:read' | 2220 `qXfer:traceframe-info:read' |
590 The remote stub understands the `qXfer:traceframe-info:read' | 2221 The remote stub understands the `qXfer:traceframe-info:read' |
591 packet (*note qXfer traceframe info read::). | 2222 packet (*note qXfer traceframe info read::). |
592 | 2223 |
| 2224 `qXfer:uib:read' |
| 2225 The remote stub understands the `qXfer:uib:read' packet |
| 2226 (*note qXfer unwind info block::). |
| 2227 |
593 `qXfer:fdpic:read' | 2228 `qXfer:fdpic:read' |
594 The remote stub understands the `qXfer:fdpic:read' packet | 2229 The remote stub understands the `qXfer:fdpic:read' packet |
595 (*note qXfer fdpic loadmap read::). | 2230 (*note qXfer fdpic loadmap read::). |
596 | 2231 |
597 `QNonStop' | 2232 `QNonStop' |
598 The remote stub understands the `QNonStop' packet (*note | 2233 The remote stub understands the `QNonStop' packet (*note |
599 QNonStop::). | 2234 QNonStop::). |
600 | 2235 |
601 `QPassSignals' | 2236 `QPassSignals' |
602 The remote stub understands the `QPassSignals' packet (*note | 2237 The remote stub understands the `QPassSignals' packet (*note |
(...skipping 13 matching lines...) Expand all Loading... |
616 feature indicates support for the syntactic extensions only, | 2251 feature indicates support for the syntactic extensions only, |
617 not that the stub necessarily supports debugging of more than | 2252 not that the stub necessarily supports debugging of more than |
618 one process at a time. The stub must not use multiprocess | 2253 one process at a time. The stub must not use multiprocess |
619 extensions in packet replies unless GDB has also indicated it | 2254 extensions in packet replies unless GDB has also indicated it |
620 supports them in its `qSupported' request. | 2255 supports them in its `qSupported' request. |
621 | 2256 |
622 `qXfer:osdata:read' | 2257 `qXfer:osdata:read' |
623 The remote stub understands the `qXfer:osdata:read' packet | 2258 The remote stub understands the `qXfer:osdata:read' packet |
624 ((*note qXfer osdata read::). | 2259 ((*note qXfer osdata read::). |
625 | 2260 |
| 2261 `ConditionalBreakpoints' |
| 2262 The target accepts and implements evaluation of conditional |
| 2263 expressions defined for breakpoints. The target will only |
| 2264 report breakpoint triggers when such conditions are true |
| 2265 (*note Break Conditions: Conditions.). |
| 2266 |
626 `ConditionalTracepoints' | 2267 `ConditionalTracepoints' |
627 The remote stub accepts and implements conditional | 2268 The remote stub accepts and implements conditional |
628 expressions defined for tracepoints (*note Tracepoint | 2269 expressions defined for tracepoints (*note Tracepoint |
629 Conditions::). | 2270 Conditions::). |
630 | 2271 |
631 `ReverseContinue' | 2272 `ReverseContinue' |
632 The remote stub accepts and implements the reverse continue | 2273 The remote stub accepts and implements the reverse continue |
633 packet (*note bc::). | 2274 packet (*note bc::). |
634 | 2275 |
635 `ReverseStep' | 2276 `ReverseStep' |
636 The remote stub accepts and implements the reverse step packet | 2277 The remote stub accepts and implements the reverse step packet |
637 (*note bs::). | 2278 (*note bs::). |
638 | 2279 |
639 `TracepointSource' | 2280 `TracepointSource' |
640 The remote stub understands the `QTDPsrc' packet that supplies | 2281 The remote stub understands the `QTDPsrc' packet that supplies |
641 the source form of tracepoint definitions. | 2282 the source form of tracepoint definitions. |
642 | 2283 |
| 2284 `QAgent' |
| 2285 The remote stub understands the `QAgent' packet. |
| 2286 |
643 `QAllow' | 2287 `QAllow' |
644 The remote stub understands the `QAllow' packet. | 2288 The remote stub understands the `QAllow' packet. |
645 | 2289 |
646 `QDisableRandomization' | 2290 `QDisableRandomization' |
647 The remote stub understands the `QDisableRandomization' | 2291 The remote stub understands the `QDisableRandomization' |
648 packet. | 2292 packet. |
649 | 2293 |
650 `StaticTracepoint' | 2294 `StaticTracepoint' |
651 The remote stub supports static tracepoints. | 2295 The remote stub supports static tracepoints. |
652 | 2296 |
653 `InstallInTrace' | 2297 `InstallInTrace' |
654 The remote stub supports installing tracepoint in tracing. | 2298 The remote stub supports installing tracepoint in tracing. |
655 | 2299 |
656 `EnableDisableTracepoints' | 2300 `EnableDisableTracepoints' |
657 The remote stub supports the `QTEnable' (*note QTEnable::) and | 2301 The remote stub supports the `QTEnable' (*note QTEnable::) and |
658 `QTDisable' (*note QTDisable::) packets that allow tracepoints | 2302 `QTDisable' (*note QTDisable::) packets that allow tracepoints |
659 to be enabled and disabled while a trace experiment is | 2303 to be enabled and disabled while a trace experiment is |
660 running. | 2304 running. |
661 | 2305 |
662 `tracenz' | 2306 `tracenz' |
663 The remote stub supports the `tracenz' bytecode for | 2307 The remote stub supports the `tracenz' bytecode for |
664 collecting strings. See *Note Bytecode Descriptions:: for | 2308 collecting strings. See *Note Bytecode Descriptions:: for |
665 details about the bytecode. | 2309 details about the bytecode. |
666 | 2310 |
| 2311 `BreakpointCommands' |
| 2312 The remote stub supports running a breakpoint's command list |
| 2313 itself, rather than reporting the hit to GDB. |
| 2314 |
667 | 2315 |
668 `qSymbol::' | 2316 `qSymbol::' |
669 Notify the target that GDB is prepared to serve symbol lookup | 2317 Notify the target that GDB is prepared to serve symbol lookup |
670 requests. Accept requests from the target for the values of | 2318 requests. Accept requests from the target for the values of |
671 symbols. | 2319 symbols. |
672 | 2320 |
673 Reply: | 2321 Reply: |
674 `OK' | 2322 `OK' |
675 The target does not need to look up any (more) symbols. | 2323 The target does not need to look up any (more) symbols. |
676 | 2324 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 2508 |
861 `qXfer:traceframe-info:read::OFFSET,LENGTH' | 2509 `qXfer:traceframe-info:read::OFFSET,LENGTH' |
862 Return a description of the current traceframe's contents. | 2510 Return a description of the current traceframe's contents. |
863 *Note Traceframe Info Format::. The annex part of the generic | 2511 *Note Traceframe Info Format::. The annex part of the generic |
864 `qXfer' packet must be empty (*note qXfer read::). | 2512 `qXfer' packet must be empty (*note qXfer read::). |
865 | 2513 |
866 This packet is not probed by default; the remote stub must | 2514 This packet is not probed by default; the remote stub must |
867 request it, by supplying an appropriate `qSupported' response | 2515 request it, by supplying an appropriate `qSupported' response |
868 (*note qSupported::). | 2516 (*note qSupported::). |
869 | 2517 |
| 2518 `qXfer:uib:read:PC:OFFSET,LENGTH' |
| 2519 Return the unwind information block for PC. This packet is |
| 2520 used on OpenVMS/ia64 to ask the kernel unwind information. |
| 2521 |
| 2522 This packet is not probed by default. |
| 2523 |
870 `qXfer:fdpic:read:ANNEX:OFFSET,LENGTH' | 2524 `qXfer:fdpic:read:ANNEX:OFFSET,LENGTH' |
871 Read contents of `loadmap's on the target system. The annex, | 2525 Read contents of `loadmap's on the target system. The annex, |
872 either `exec' or `interp', specifies which `loadmap', | 2526 either `exec' or `interp', specifies which `loadmap', |
873 executable `loadmap' or interpreter `loadmap' to read. | 2527 executable `loadmap' or interpreter `loadmap' to read. |
874 | 2528 |
875 This packet is not probed by default; the remote stub must | 2529 This packet is not probed by default; the remote stub must |
876 request it, by supplying an appropriate `qSupported' response | 2530 request it, by supplying an appropriate `qSupported' response |
877 (*note qSupported::). | 2531 (*note qSupported::). |
878 | 2532 |
879 `qXfer:osdata:read::OFFSET,LENGTH' | 2533 `qXfer:osdata:read::OFFSET,LENGTH' |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 | 2651 |
998 File: gdb.info, Node: Architecture-Specific Protocol Details, Next: Tracepoint
Packets, Prev: General Query Packets, Up: Remote Protocol | 2652 File: gdb.info, Node: Architecture-Specific Protocol Details, Next: Tracepoint
Packets, Prev: General Query Packets, Up: Remote Protocol |
999 | 2653 |
1000 E.5 Architecture-Specific Protocol Details | 2654 E.5 Architecture-Specific Protocol Details |
1001 ========================================== | 2655 ========================================== |
1002 | 2656 |
1003 This section describes how the remote protocol is applied to specific | 2657 This section describes how the remote protocol is applied to specific |
1004 target architectures. Also see *Note Standard Target Features::, for | 2658 target architectures. Also see *Note Standard Target Features::, for |
1005 details of XML target descriptions for each architecture. | 2659 details of XML target descriptions for each architecture. |
1006 | 2660 |
1007 E.5.1 ARM | 2661 * Menu: |
1008 --------- | |
1009 | 2662 |
1010 E.5.1.1 Breakpoint Kinds | 2663 * ARM-Specific Protocol Details:: |
1011 ........................ | 2664 * MIPS-Specific Protocol Details:: |
| 2665 |
| 2666 |
| 2667 File: gdb.info, Node: ARM-Specific Protocol Details, Next: MIPS-Specific Proto
col Details, Up: Architecture-Specific Protocol Details |
| 2668 |
| 2669 E.5.1 ARM-specific Protocol Details |
| 2670 ----------------------------------- |
| 2671 |
| 2672 * Menu: |
| 2673 |
| 2674 * ARM Breakpoint Kinds:: |
| 2675 |
| 2676 |
| 2677 File: gdb.info, Node: ARM Breakpoint Kinds, Up: ARM-Specific Protocol Details |
| 2678 |
| 2679 E.5.1.1 ARM Breakpoint Kinds |
| 2680 ............................ |
1012 | 2681 |
1013 These breakpoint kinds are defined for the `Z0' and `Z1' packets. | 2682 These breakpoint kinds are defined for the `Z0' and `Z1' packets. |
1014 | 2683 |
1015 2 | 2684 2 |
1016 16-bit Thumb mode breakpoint. | 2685 16-bit Thumb mode breakpoint. |
1017 | 2686 |
1018 3 | 2687 3 |
1019 32-bit Thumb mode (Thumb-2) breakpoint. | 2688 32-bit Thumb mode (Thumb-2) breakpoint. |
1020 | 2689 |
1021 4 | 2690 4 |
1022 32-bit ARM mode breakpoint. | 2691 32-bit ARM mode breakpoint. |
1023 | 2692 |
1024 | 2693 |
1025 E.5.2 MIPS | 2694 |
1026 ---------- | 2695 File: gdb.info, Node: MIPS-Specific Protocol Details, Prev: ARM-Specific Proto
col Details, Up: Architecture-Specific Protocol Details |
1027 | 2696 |
1028 E.5.2.1 Register Packet Format | 2697 E.5.2 MIPS-specific Protocol Details |
1029 .............................. | 2698 ------------------------------------ |
| 2699 |
| 2700 * Menu: |
| 2701 |
| 2702 * MIPS Register packet Format:: |
| 2703 * MIPS Breakpoint Kinds:: |
| 2704 |
| 2705 |
| 2706 File: gdb.info, Node: MIPS Register packet Format, Next: MIPS Breakpoint Kinds
, Up: MIPS-Specific Protocol Details |
| 2707 |
| 2708 E.5.2.1 MIPS Register Packet Format |
| 2709 ................................... |
1030 | 2710 |
1031 The following `g'/`G' packets have previously been defined. In the | 2711 The following `g'/`G' packets have previously been defined. In the |
1032 below, some thirty-two bit registers are transferred as sixty-four | 2712 below, some thirty-two bit registers are transferred as sixty-four |
1033 bits. Those registers should be zero/sign extended (which?) to fill | 2713 bits. Those registers should be zero/sign extended (which?) to fill |
1034 the space allocated. Register bytes are transferred in target byte | 2714 the space allocated. Register bytes are transferred in target byte |
1035 order. The two nibbles within a register byte are transferred | 2715 order. The two nibbles within a register byte are transferred |
1036 most-significant - least-significant. | 2716 most-significant - least-significant. |
1037 | 2717 |
1038 MIPS32 | 2718 MIPS32 |
1039 All registers are transferred as thirty-two bit quantities in the | 2719 All registers are transferred as thirty-two bit quantities in the |
1040 order: 32 general-purpose; sr; lo; hi; bad; cause; pc; 32 | 2720 order: 32 general-purpose; sr; lo; hi; bad; cause; pc; 32 |
1041 floating-point registers; fsr; fir; fp. | 2721 floating-point registers; fsr; fir; fp. |
1042 | 2722 |
1043 MIPS64 | 2723 MIPS64 |
1044 All registers are transferred as sixty-four bit quantities | 2724 All registers are transferred as sixty-four bit quantities |
1045 (including thirty-two bit registers such as `sr'). The ordering | 2725 (including thirty-two bit registers such as `sr'). The ordering |
1046 is the same as `MIPS32'. | 2726 is the same as `MIPS32'. |
1047 | 2727 |
1048 | 2728 |
1049 | 2729 |
| 2730 File: gdb.info, Node: MIPS Breakpoint Kinds, Prev: MIPS Register packet Format
, Up: MIPS-Specific Protocol Details |
| 2731 |
| 2732 E.5.2.2 MIPS Breakpoint Kinds |
| 2733 ............................. |
| 2734 |
| 2735 These breakpoint kinds are defined for the `Z0' and `Z1' packets. |
| 2736 |
| 2737 2 |
| 2738 16-bit MIPS16 mode breakpoint. |
| 2739 |
| 2740 3 |
| 2741 16-bit microMIPS mode breakpoint. |
| 2742 |
| 2743 4 |
| 2744 32-bit standard MIPS mode breakpoint. |
| 2745 |
| 2746 5 |
| 2747 32-bit microMIPS mode breakpoint. |
| 2748 |
| 2749 |
| 2750 |
1050 File: gdb.info, Node: Tracepoint Packets, Next: Host I/O Packets, Prev: Archi
tecture-Specific Protocol Details, Up: Remote Protocol | 2751 File: gdb.info, Node: Tracepoint Packets, Next: Host I/O Packets, Prev: Archi
tecture-Specific Protocol Details, Up: Remote Protocol |
1051 | 2752 |
1052 E.6 Tracepoint Packets | 2753 E.6 Tracepoint Packets |
1053 ====================== | 2754 ====================== |
1054 | 2755 |
1055 Here we describe the packets GDB uses to implement tracepoints (*note | 2756 Here we describe the packets GDB uses to implement tracepoints (*note |
1056 Tracepoints::). | 2757 Tracepoints::). |
1057 | 2758 |
1058 `QTDP:N:ADDR:ENA:STEP:PASS[:FFLEN][:XLEN,BYTES][-]' | 2759 `QTDP:N:ADDR:ENA:STEP:PASS[:FFLEN][:XLEN,BYTES][-]' |
1059 Create a new tracepoint, number N, at ADDR. If ENA is `E', then | 2760 Create a new tracepoint, number N, at ADDR. If ENA is `E', then |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 Start the write at OFFSET from the start of the file. Unlike | 3286 Start the write at OFFSET from the start of the file. Unlike |
1586 many `write' system calls, there is no separate COUNT argument; | 3287 many `write' system calls, there is no separate COUNT argument; |
1587 the length of DATA in the packet is used. `vFile:write' returns | 3288 the length of DATA in the packet is used. `vFile:write' returns |
1588 the number of bytes written, which may be shorter than the length | 3289 the number of bytes written, which may be shorter than the length |
1589 of DATA, or -1 if an error occurred. | 3290 of DATA, or -1 if an error occurred. |
1590 | 3291 |
1591 `vFile:unlink: PATHNAME' | 3292 `vFile:unlink: PATHNAME' |
1592 Delete the file at PATHNAME on the target. Return 0, or -1 if an | 3293 Delete the file at PATHNAME on the target. Return 0, or -1 if an |
1593 error occurs. PATHNAME is a string. | 3294 error occurs. PATHNAME is a string. |
1594 | 3295 |
| 3296 `vFile:readlink: FILENAME' |
| 3297 Read value of symbolic link FILENAME on the target. Return the |
| 3298 number of bytes read, or -1 if an error occurs. |
| 3299 |
| 3300 The data read should be returned as a binary attachment on success. |
| 3301 If zero bytes were read, the response should include an empty |
| 3302 binary attachment (i.e. a trailing semicolon). The return value |
| 3303 is the number of target bytes read; the binary attachment may be |
| 3304 longer if some characters were escaped. |
| 3305 |
1595 | 3306 |
1596 | 3307 |
1597 File: gdb.info, Node: Interrupts, Next: Notification Packets, Prev: Host I/O
Packets, Up: Remote Protocol | 3308 File: gdb.info, Node: Interrupts, Next: Notification Packets, Prev: Host I/O
Packets, Up: Remote Protocol |
1598 | 3309 |
1599 E.8 Interrupts | 3310 E.8 Interrupts |
1600 ============== | 3311 ============== |
1601 | 3312 |
1602 When a program on the remote target is running, GDB may attempt to | 3313 When a program on the remote target is running, GDB may attempt to |
1603 interrupt it by sending a `Ctrl-C', `BREAK' or a `BREAK' followed by | 3314 interrupt it by sending a `Ctrl-C', `BREAK' or a `BREAK' followed by |
1604 `g', control of which is specified via GDB's `interrupt-sequence'. | 3315 `g', control of which is specified via GDB's `interrupt-sequence'. |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3594 | 5305 |
3595 `tracev' (0x2e) N: => A | 5306 `tracev' (0x2e) N: => A |
3596 Record the value of trace state variable number N in the trace | 5307 Record the value of trace state variable number N in the trace |
3597 buffer. The handling of N is as described for `getv'. | 5308 buffer. The handling of N is as described for `getv'. |
3598 | 5309 |
3599 `tracenz' (0x2f) ADDR SIZE => | 5310 `tracenz' (0x2f) ADDR SIZE => |
3600 Record the bytes at ADDR in a trace buffer, for later retrieval by | 5311 Record the bytes at ADDR in a trace buffer, for later retrieval by |
3601 GDB. Stop at either the first zero byte, or when SIZE bytes have | 5312 GDB. Stop at either the first zero byte, or when SIZE bytes have |
3602 been recorded, whichever occurs first. | 5313 been recorded, whichever occurs first. |
3603 | 5314 |
| 5315 `printf' (0x34) NUMARGS STRING => |
| 5316 Do a formatted print, in the style of the C function `printf'). |
| 5317 The value of NUMARGS is the number of arguments to expect on the |
| 5318 stack, while STRING is the format string, prefixed with a two-byte |
| 5319 length. The last byte of the string must be zero, and is included |
| 5320 in the length. The format string includes escaped sequences just |
| 5321 as it appears in C source, so for instance the format string |
| 5322 `"\t%d\n"' is six characters long, and the output will consist of |
| 5323 a tab character, a decimal number, and a newline. At the top of |
| 5324 the stack, above the values to be printed, this bytecode will pop a |
| 5325 "function" and "channel". If the function is nonzero, then the |
| 5326 target may treat it as a function and call it, passing the channel |
| 5327 as a first argument, as with the C function `fprintf'. If the |
| 5328 function is zero, then the target may simply call a standard |
| 5329 formatted print function of its choice. In all, this bytecode |
| 5330 pops 2 + NUMARGS stack elements, and pushes nothing. |
| 5331 |
3604 `end' (0x27): => | 5332 `end' (0x27): => |
3605 Stop executing bytecode; the result should be the top element of | 5333 Stop executing bytecode; the result should be the top element of |
3606 the stack. If the purpose of the expression was to compute an | 5334 the stack. If the purpose of the expression was to compute an |
3607 lvalue or a range of memory, then the next-to-top of the stack is | 5335 lvalue or a range of memory, then the next-to-top of the stack is |
3608 the lvalue's address, and the top of the stack is the lvalue's | 5336 the lvalue's address, and the top of the stack is the lvalue's |
3609 size, in bytes. | 5337 size, in bytes. |
3610 | 5338 |
3611 | 5339 |
3612 | 5340 |
3613 File: gdb.info, Node: Using Agent Expressions, Next: Varying Target Capabiliti
es, Prev: Bytecode Descriptions, Up: Agent Expressions | 5341 File: gdb.info, Node: Using Agent Expressions, Next: Varying Target Capabiliti
es, Prev: Bytecode Descriptions, Up: Agent Expressions |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4340 | 6068 |
4341 The `org.gnu.gdb.mips.cp0' feature is also required. It should | 6069 The `org.gnu.gdb.mips.cp0' feature is also required. It should |
4342 contain at least the `status', `badvaddr', and `cause' registers. They | 6070 contain at least the `status', `badvaddr', and `cause' registers. They |
4343 may be 32-bit or 64-bit depending on the target. | 6071 may be 32-bit or 64-bit depending on the target. |
4344 | 6072 |
4345 The `org.gnu.gdb.mips.fpu' feature is currently required, though it | 6073 The `org.gnu.gdb.mips.fpu' feature is currently required, though it |
4346 may be optional in a future version of GDB. It should contain | 6074 may be optional in a future version of GDB. It should contain |
4347 registers `f0' through `f31', `fcsr', and `fir'. They may be 32-bit or | 6075 registers `f0' through `f31', `fcsr', and `fir'. They may be 32-bit or |
4348 64-bit depending on the target. | 6076 64-bit depending on the target. |
4349 | 6077 |
| 6078 The `org.gnu.gdb.mips.dsp' feature is optional. It should contain |
| 6079 registers `hi1' through `hi3', `lo1' through `lo3', and `dspctl'. The |
| 6080 `dspctl' register should be 32-bit and the rest may be 32-bit or 64-bit |
| 6081 depending on the target. |
| 6082 |
4350 The `org.gnu.gdb.mips.linux' feature is optional. It should contain | 6083 The `org.gnu.gdb.mips.linux' feature is optional. It should contain |
4351 a single register, `restart', which is used by the Linux kernel to | 6084 a single register, `restart', which is used by the Linux kernel to |
4352 control restartable syscalls. | 6085 control restartable syscalls. |
4353 | 6086 |
4354 | 6087 |
4355 File: gdb.info, Node: M68K Features, Next: PowerPC Features, Prev: MIPS Featu
res, Up: Standard Target Features | 6088 File: gdb.info, Node: M68K Features, Next: PowerPC Features, Prev: MIPS Featu
res, Up: Standard Target Features |
4356 | 6089 |
4357 G.4.4 M68K Features | 6090 G.4.4 M68K Features |
4358 ------------------- | 6091 ------------------- |
4359 | 6092 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4529 little-endian 32-bit integer value, called an `offset_type'. Big | 6262 little-endian 32-bit integer value, called an `offset_type'. Big |
4530 endian machines must byte-swap the values before using them. | 6263 endian machines must byte-swap the values before using them. |
4531 Exceptions to this rule are noted. The data is laid out such that | 6264 Exceptions to this rule are noted. The data is laid out such that |
4532 alignment is always respected. | 6265 alignment is always respected. |
4533 | 6266 |
4534 A mapped index consists of several areas, laid out in order. | 6267 A mapped index consists of several areas, laid out in order. |
4535 | 6268 |
4536 1. The file header. This is a sequence of values, of `offset_type' | 6269 1. The file header. This is a sequence of values, of `offset_type' |
4537 unless otherwise noted: | 6270 unless otherwise noted: |
4538 | 6271 |
4539 1. The version number, currently 5. Versions 1, 2 and 3 are | 6272 1. The version number, currently 7. Versions 1, 2 and 3 are |
4540 obsolete. Version 4 differs by its hashing function. | 6273 obsolete. Version 4 uses a different hashing function from |
| 6274 versions 5 and 6. Version 6 includes symbols for inlined |
| 6275 functions, whereas versions 4 and 5 do not. Version 7 adds |
| 6276 attributes to the CU indices in the symbol table. GDB will |
| 6277 only read version 4, 5, or 6 indices by specifying `set |
| 6278 use-deprecated-index-sections on'. |
4541 | 6279 |
4542 2. The offset, from the start of the file, of the CU list. | 6280 2. The offset, from the start of the file, of the CU list. |
4543 | 6281 |
4544 3. The offset, from the start of the file, of the types CU list. | 6282 3. The offset, from the start of the file, of the types CU list. |
4545 Note that this area can be empty, in which case this offset | 6283 Note that this area can be empty, in which case this offset |
4546 will be equal to the next offset. | 6284 will be equal to the next offset. |
4547 | 6285 |
4548 4. The offset, from the start of the file, of the address area. | 6286 4. The offset, from the start of the file, of the address area. |
4549 | 6287 |
4550 5. The offset, from the start of the file, of the symbol table. | 6288 5. The offset, from the start of the file, of the symbol table. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4590 | 6328 |
4591 The hash value for a table entry is computed by applying an | 6329 The hash value for a table entry is computed by applying an |
4592 iterative hash function to the symbol's name. Starting with an | 6330 iterative hash function to the symbol's name. Starting with an |
4593 initial value of `r = 0', each (unsigned) character `c' in the | 6331 initial value of `r = 0', each (unsigned) character `c' in the |
4594 string is incorporated into the hash using the formula depending | 6332 string is incorporated into the hash using the formula depending |
4595 on the index version: | 6333 on the index version: |
4596 | 6334 |
4597 Version 4 | 6335 Version 4 |
4598 The formula is `r = r * 67 + c - 113'. | 6336 The formula is `r = r * 67 + c - 113'. |
4599 | 6337 |
4600 Version 5 | 6338 Versions 5 to 7 |
4601 The formula is `r = r * 67 + tolower (c) - 113'. | 6339 The formula is `r = r * 67 + tolower (c) - 113'. |
4602 | 6340 |
4603 The terminating `\0' is not incorporated into the hash. | 6341 The terminating `\0' is not incorporated into the hash. |
4604 | 6342 |
4605 The step size used in the hash table is computed via `((hash * 17) | 6343 The step size used in the hash table is computed via `((hash * 17) |
4606 & (size - 1)) | 1', where `hash' is the hash value, and `size' is | 6344 & (size - 1)) | 1', where `hash' is the hash value, and `size' is |
4607 the size of the hash table. The step size is used to find the | 6345 the size of the hash table. The step size is used to find the |
4608 next candidate slot when handling a hash collision. | 6346 next candidate slot when handling a hash collision. |
4609 | 6347 |
4610 The names of C++ symbols in the hash table are canonicalized. We | 6348 The names of C++ symbols in the hash table are canonicalized. We |
4611 don't currently have a simple description of the canonicalization | 6349 don't currently have a simple description of the canonicalization |
4612 algorithm; if you intend to create new index sections, you must | 6350 algorithm; if you intend to create new index sections, you must |
4613 read the code. | 6351 read the code. |
4614 | 6352 |
4615 6. The constant pool. This is simply a bunch of bytes. It is | 6353 6. The constant pool. This is simply a bunch of bytes. It is |
4616 organized so that alignment is correct: CU vectors are stored | 6354 organized so that alignment is correct: CU vectors are stored |
4617 first, followed by strings. | 6355 first, followed by strings. |
4618 | 6356 |
4619 A CU vector in the constant pool is a sequence of `offset_type' | 6357 A CU vector in the constant pool is a sequence of `offset_type' |
4620 values. The first value is the number of CU indices in the vector. | 6358 values. The first value is the number of CU indices in the vector. |
4621 Each subsequent value is the index of a CU in the CU list. This | 6359 Each subsequent value is the index and symbol attributes of a CU in |
4622 element in the hash table is used to indicate which CUs define the | 6360 the CU list. This element in the hash table is used to indicate |
4623 symbol. | 6361 which CUs define the symbol and how the symbol is used. See below |
| 6362 for the format of each CU index+attributes entry. |
4624 | 6363 |
4625 A string in the constant pool is zero-terminated. | 6364 A string in the constant pool is zero-terminated. |
4626 | 6365 |
| 6366 Attributes were added to CU index values in `.gdb_index' version 7. |
| 6367 If a symbol has multiple uses within a CU then there is one CU |
| 6368 index+attributes value for each use. |
| 6369 |
| 6370 The format of each CU index+attributes entry is as follows (bit 0 = |
| 6371 LSB): |
| 6372 |
| 6373 Bits 0-23 |
| 6374 This is the index of the CU in the CU list. |
| 6375 |
| 6376 Bits 24-27 |
| 6377 These bits are reserved for future purposes and must be zero. |
| 6378 |
| 6379 Bits 28-30 |
| 6380 The kind of the symbol in the CU. |
| 6381 |
| 6382 0 |
| 6383 This value is reserved and should not be used. By reserving |
| 6384 zero the full `offset_type' value is backwards compatible |
| 6385 with previous versions of the index. |
| 6386 |
| 6387 1 |
| 6388 The symbol is a type. |
| 6389 |
| 6390 2 |
| 6391 The symbol is a variable or an enum value. |
| 6392 |
| 6393 3 |
| 6394 The symbol is a function. |
| 6395 |
| 6396 4 |
| 6397 Any other kind of symbol. |
| 6398 |
| 6399 5,6,7 |
| 6400 These values are reserved. |
| 6401 |
| 6402 Bit 31 |
| 6403 This bit is zero if the value is global and one if it is static. |
| 6404 |
| 6405 The determination of whether a symbol is global or static is |
| 6406 complicated. The authorative reference is the file `dwarf2read.c' |
| 6407 in GDB sources. |
| 6408 |
| 6409 |
| 6410 This pseudo-code describes the computation of a symbol's kind and |
| 6411 global/static attributes in the index. |
| 6412 |
| 6413 is_external = get_attribute (die, DW_AT_external); |
| 6414 language = get_attribute (cu_die, DW_AT_language); |
| 6415 switch (die->tag) |
| 6416 { |
| 6417 case DW_TAG_typedef: |
| 6418 case DW_TAG_base_type: |
| 6419 case DW_TAG_subrange_type: |
| 6420 kind = TYPE; |
| 6421 is_static = 1; |
| 6422 break; |
| 6423 case DW_TAG_enumerator: |
| 6424 kind = VARIABLE; |
| 6425 is_static = (language != CPLUS && language != JAVA); |
| 6426 break; |
| 6427 case DW_TAG_subprogram: |
| 6428 kind = FUNCTION; |
| 6429 is_static = ! (is_external || language == ADA); |
| 6430 break; |
| 6431 case DW_TAG_constant: |
| 6432 kind = VARIABLE; |
| 6433 is_static = ! is_external; |
| 6434 break; |
| 6435 case DW_TAG_variable: |
| 6436 kind = VARIABLE; |
| 6437 is_static = ! is_external; |
| 6438 break; |
| 6439 case DW_TAG_namespace: |
| 6440 kind = TYPE; |
| 6441 is_static = 0; |
| 6442 break; |
| 6443 case DW_TAG_class_type: |
| 6444 case DW_TAG_interface_type: |
| 6445 case DW_TAG_structure_type: |
| 6446 case DW_TAG_union_type: |
| 6447 case DW_TAG_enumeration_type: |
| 6448 kind = TYPE; |
| 6449 is_static = (language != CPLUS && language != JAVA); |
| 6450 break; |
| 6451 default: |
| 6452 assert (0); |
| 6453 } |
| 6454 |
4627 | 6455 |
4628 File: gdb.info, Node: Copying, Next: GNU Free Documentation License, Prev: In
dex Section Format, Up: Top | 6456 File: gdb.info, Node: Copying, Next: GNU Free Documentation License, Prev: In
dex Section Format, Up: Top |
4629 | 6457 |
4630 Appendix K GNU GENERAL PUBLIC LICENSE | 6458 Appendix K GNU GENERAL PUBLIC LICENSE |
4631 ************************************* | 6459 ************************************* |
4632 | 6460 |
4633 Version 3, 29 June 2007 | 6461 Version 3, 29 June 2007 |
4634 | 6462 |
4635 Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/' | 6463 Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/' |
4636 | 6464 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5340 necessary. For more information on this, and how to apply and follow | 7168 necessary. For more information on this, and how to apply and follow |
5341 the GNU GPL, see `http://www.gnu.org/licenses/'. | 7169 the GNU GPL, see `http://www.gnu.org/licenses/'. |
5342 | 7170 |
5343 The GNU General Public License does not permit incorporating your | 7171 The GNU General Public License does not permit incorporating your |
5344 program into proprietary programs. If your program is a subroutine | 7172 program into proprietary programs. If your program is a subroutine |
5345 library, you may consider it more useful to permit linking proprietary | 7173 library, you may consider it more useful to permit linking proprietary |
5346 applications with the library. If this is what you want to do, use the | 7174 applications with the library. If this is what you want to do, use the |
5347 GNU Lesser General Public License instead of this License. But first, | 7175 GNU Lesser General Public License instead of this License. But first, |
5348 please read `http://www.gnu.org/philosophy/why-not-lgpl.html'. | 7176 please read `http://www.gnu.org/philosophy/why-not-lgpl.html'. |
5349 | 7177 |
5350 | |
5351 File: gdb.info, Node: GNU Free Documentation License, Next: Index, Prev: Copy
ing, Up: Top | |
5352 | |
5353 Appendix L GNU Free Documentation License | |
5354 ***************************************** | |
5355 | |
5356 Version 1.3, 3 November 2008 | |
5357 | |
5358 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. | |
5359 `http://fsf.org/' | |
5360 | |
5361 Everyone is permitted to copy and distribute verbatim copies | |
5362 of this license document, but changing it is not allowed. | |
5363 | |
5364 0. PREAMBLE | |
5365 | |
5366 The purpose of this License is to make a manual, textbook, or other | |
5367 functional and useful document "free" in the sense of freedom: to | |
5368 assure everyone the effective freedom to copy and redistribute it, | |
5369 with or without modifying it, either commercially or | |
5370 noncommercially. Secondarily, this License preserves for the | |
5371 author and publisher a way to get credit for their work, while not | |
5372 being considered responsible for modifications made by others. | |
5373 | |
5374 This License is a kind of "copyleft", which means that derivative | |
5375 works of the document must themselves be free in the same sense. | |
5376 It complements the GNU General Public License, which is a copyleft | |
5377 license designed for free software. | |
5378 | |
5379 We have designed this License in order to use it for manuals for | |
5380 free software, because free software needs free documentation: a | |
5381 free program should come with manuals providing the same freedoms | |
5382 that the software does. But this License is not limited to | |
5383 software manuals; it can be used for any textual work, regardless | |
5384 of subject matter or whether it is published as a printed book. | |
5385 We recommend this License principally for works whose purpose is | |
5386 instruction or reference. | |
5387 | |
5388 1. APPLICABILITY AND DEFINITIONS | |
5389 | |
5390 This License applies to any manual or other work, in any medium, | |
5391 that contains a notice placed by the copyright holder saying it | |
5392 can be distributed under the terms of this License. Such a notice | |
5393 grants a world-wide, royalty-free license, unlimited in duration, | |
5394 to use that work under the conditions stated herein. The | |
5395 "Document", below, refers to any such manual or work. Any member | |
5396 of the public is a licensee, and is addressed as "you". You | |
5397 accept the license if you copy, modify or distribute the work in a | |
5398 way requiring permission under copyright law. | |
5399 | |
5400 A "Modified Version" of the Document means any work containing the | |
5401 Document or a portion of it, either copied verbatim, or with | |
5402 modifications and/or translated into another language. | |
5403 | |
5404 A "Secondary Section" is a named appendix or a front-matter section | |
5405 of the Document that deals exclusively with the relationship of the | |
5406 publishers or authors of the Document to the Document's overall | |
5407 subject (or to related matters) and contains nothing that could | |
5408 fall directly within that overall subject. (Thus, if the Document | |
5409 is in part a textbook of mathematics, a Secondary Section may not | |
5410 explain any mathematics.) The relationship could be a matter of | |
5411 historical connection with the subject or with related matters, or | |
5412 of legal, commercial, philosophical, ethical or political position | |
5413 regarding them. | |
5414 | |
5415 The "Invariant Sections" are certain Secondary Sections whose | |
5416 titles are designated, as being those of Invariant Sections, in | |
5417 the notice that says that the Document is released under this | |
5418 License. If a section does not fit the above definition of | |
5419 Secondary then it is not allowed to be designated as Invariant. | |
5420 The Document may contain zero Invariant Sections. If the Document | |
5421 does not identify any Invariant Sections then there are none. | |
5422 | |
5423 The "Cover Texts" are certain short passages of text that are | |
5424 listed, as Front-Cover Texts or Back-Cover Texts, in the notice | |
5425 that says that the Document is released under this License. A | |
5426 Front-Cover Text may be at most 5 words, and a Back-Cover Text may | |
5427 be at most 25 words. | |
5428 | |
5429 A "Transparent" copy of the Document means a machine-readable copy, | |
5430 represented in a format whose specification is available to the | |
5431 general public, that is suitable for revising the document | |
5432 straightforwardly with generic text editors or (for images | |
5433 composed of pixels) generic paint programs or (for drawings) some | |
5434 widely available drawing editor, and that is suitable for input to | |
5435 text formatters or for automatic translation to a variety of | |
5436 formats suitable for input to text formatters. A copy made in an | |
5437 otherwise Transparent file format whose markup, or absence of | |
5438 markup, has been arranged to thwart or discourage subsequent | |
5439 modification by readers is not Transparent. An image format is | |
5440 not Transparent if used for any substantial amount of text. A | |
5441 copy that is not "Transparent" is called "Opaque". | |
5442 | |
5443 Examples of suitable formats for Transparent copies include plain | |
5444 ASCII without markup, Texinfo input format, LaTeX input format, | |
5445 SGML or XML using a publicly available DTD, and | |
5446 standard-conforming simple HTML, PostScript or PDF designed for | |
5447 human modification. Examples of transparent image formats include | |
5448 PNG, XCF and JPG. Opaque formats include proprietary formats that | |
5449 can be read and edited only by proprietary word processors, SGML or | |
5450 XML for which the DTD and/or processing tools are not generally | |
5451 available, and the machine-generated HTML, PostScript or PDF | |
5452 produced by some word processors for output purposes only. | |
5453 | |
5454 The "Title Page" means, for a printed book, the title page itself, | |
5455 plus such following pages as are needed to hold, legibly, the | |
5456 material this License requires to appear in the title page. For | |
5457 works in formats which do not have any title page as such, "Title | |
5458 Page" means the text near the most prominent appearance of the | |
5459 work's title, preceding the beginning of the body of the text. | |
5460 | |
5461 The "publisher" means any person or entity that distributes copies | |
5462 of the Document to the public. | |
5463 | |
5464 A section "Entitled XYZ" means a named subunit of the Document | |
5465 whose title either is precisely XYZ or contains XYZ in parentheses | |
5466 following text that translates XYZ in another language. (Here XYZ | |
5467 stands for a specific section name mentioned below, such as | |
5468 "Acknowledgements", "Dedications", "Endorsements", or "History".) | |
5469 To "Preserve the Title" of such a section when you modify the | |
5470 Document means that it remains a section "Entitled XYZ" according | |
5471 to this definition. | |
5472 | |
5473 The Document may include Warranty Disclaimers next to the notice | |
5474 which states that this License applies to the Document. These | |
5475 Warranty Disclaimers are considered to be included by reference in | |
5476 this License, but only as regards disclaiming warranties: any other | |
5477 implication that these Warranty Disclaimers may have is void and | |
5478 has no effect on the meaning of this License. | |
5479 | |
5480 2. VERBATIM COPYING | |
5481 | |
5482 You may copy and distribute the Document in any medium, either | |
5483 commercially or noncommercially, provided that this License, the | |
5484 copyright notices, and the license notice saying this License | |
5485 applies to the Document are reproduced in all copies, and that you | |
5486 add no other conditions whatsoever to those of this License. You | |
5487 may not use technical measures to obstruct or control the reading | |
5488 or further copying of the copies you make or distribute. However, | |
5489 you may accept compensation in exchange for copies. If you | |
5490 distribute a large enough number of copies you must also follow | |
5491 the conditions in section 3. | |
5492 | |
5493 You may also lend copies, under the same conditions stated above, | |
5494 and you may publicly display copies. | |
5495 | |
5496 3. COPYING IN QUANTITY | |
5497 | |
5498 If you publish printed copies (or copies in media that commonly | |
5499 have printed covers) of the Document, numbering more than 100, and | |
5500 the Document's license notice requires Cover Texts, you must | |
5501 enclose the copies in covers that carry, clearly and legibly, all | |
5502 these Cover Texts: Front-Cover Texts on the front cover, and | |
5503 Back-Cover Texts on the back cover. Both covers must also clearly | |
5504 and legibly identify you as the publisher of these copies. The | |
5505 front cover must present the full title with all words of the | |
5506 title equally prominent and visible. You may add other material | |
5507 on the covers in addition. Copying with changes limited to the | |
5508 covers, as long as they preserve the title of the Document and | |
5509 satisfy these conditions, can be treated as verbatim copying in | |
5510 other respects. | |
5511 | |
5512 If the required texts for either cover are too voluminous to fit | |
5513 legibly, you should put the first ones listed (as many as fit | |
5514 reasonably) on the actual cover, and continue the rest onto | |
5515 adjacent pages. | |
5516 | |
5517 If you publish or distribute Opaque copies of the Document | |
5518 numbering more than 100, you must either include a | |
5519 machine-readable Transparent copy along with each Opaque copy, or | |
5520 state in or with each Opaque copy a computer-network location from | |
5521 which the general network-using public has access to download | |
5522 using public-standard network protocols a complete Transparent | |
5523 copy of the Document, free of added material. If you use the | |
5524 latter option, you must take reasonably prudent steps, when you | |
5525 begin distribution of Opaque copies in quantity, to ensure that | |
5526 this Transparent copy will remain thus accessible at the stated | |
5527 location until at least one year after the last time you | |
5528 distribute an Opaque copy (directly or through your agents or | |
5529 retailers) of that edition to the public. | |
5530 | |
5531 It is requested, but not required, that you contact the authors of | |
5532 the Document well before redistributing any large number of | |
5533 copies, to give them a chance to provide you with an updated | |
5534 version of the Document. | |
5535 | |
5536 4. MODIFICATIONS | |
5537 | |
5538 You may copy and distribute a Modified Version of the Document | |
5539 under the conditions of sections 2 and 3 above, provided that you | |
5540 release the Modified Version under precisely this License, with | |
5541 the Modified Version filling the role of the Document, thus | |
5542 licensing distribution and modification of the Modified Version to | |
5543 whoever possesses a copy of it. In addition, you must do these | |
5544 things in the Modified Version: | |
5545 | |
5546 A. Use in the Title Page (and on the covers, if any) a title | |
5547 distinct from that of the Document, and from those of | |
5548 previous versions (which should, if there were any, be listed | |
5549 in the History section of the Document). You may use the | |
5550 same title as a previous version if the original publisher of | |
5551 that version gives permission. | |
5552 | |
5553 B. List on the Title Page, as authors, one or more persons or | |
5554 entities responsible for authorship of the modifications in | |
5555 the Modified Version, together with at least five of the | |
5556 principal authors of the Document (all of its principal | |
5557 authors, if it has fewer than five), unless they release you | |
5558 from this requirement. | |
5559 | |
5560 C. State on the Title page the name of the publisher of the | |
5561 Modified Version, as the publisher. | |
5562 | |
5563 D. Preserve all the copyright notices of the Document. | |
5564 | |
5565 E. Add an appropriate copyright notice for your modifications | |
5566 adjacent to the other copyright notices. | |
5567 | |
5568 F. Include, immediately after the copyright notices, a license | |
5569 notice giving the public permission to use the Modified | |
5570 Version under the terms of this License, in the form shown in | |
5571 the Addendum below. | |
5572 | |
5573 G. Preserve in that license notice the full lists of Invariant | |
5574 Sections and required Cover Texts given in the Document's | |
5575 license notice. | |
5576 | |
5577 H. Include an unaltered copy of this License. | |
5578 | |
5579 I. Preserve the section Entitled "History", Preserve its Title, | |
5580 and add to it an item stating at least the title, year, new | |
5581 authors, and publisher of the Modified Version as given on | |
5582 the Title Page. If there is no section Entitled "History" in | |
5583 the Document, create one stating the title, year, authors, | |
5584 and publisher of the Document as given on its Title Page, | |
5585 then add an item describing the Modified Version as stated in | |
5586 the previous sentence. | |
5587 | |
5588 J. Preserve the network location, if any, given in the Document | |
5589 for public access to a Transparent copy of the Document, and | |
5590 likewise the network locations given in the Document for | |
5591 previous versions it was based on. These may be placed in | |
5592 the "History" section. You may omit a network location for a | |
5593 work that was published at least four years before the | |
5594 Document itself, or if the original publisher of the version | |
5595 it refers to gives permission. | |
5596 | |
5597 K. For any section Entitled "Acknowledgements" or "Dedications", | |
5598 Preserve the Title of the section, and preserve in the | |
5599 section all the substance and tone of each of the contributor | |
5600 acknowledgements and/or dedications given therein. | |
5601 | |
5602 L. Preserve all the Invariant Sections of the Document, | |
5603 unaltered in their text and in their titles. Section numbers | |
5604 or the equivalent are not considered part of the section | |
5605 titles. | |
5606 | |
5607 M. Delete any section Entitled "Endorsements". Such a section | |
5608 may not be included in the Modified Version. | |
5609 | |
5610 N. Do not retitle any existing section to be Entitled | |
5611 "Endorsements" or to conflict in title with any Invariant | |
5612 Section. | |
5613 | |
5614 O. Preserve any Warranty Disclaimers. | |
5615 | |
5616 If the Modified Version includes new front-matter sections or | |
5617 appendices that qualify as Secondary Sections and contain no | |
5618 material copied from the Document, you may at your option | |
5619 designate some or all of these sections as invariant. To do this, | |
5620 add their titles to the list of Invariant Sections in the Modified | |
5621 Version's license notice. These titles must be distinct from any | |
5622 other section titles. | |
5623 | |
5624 You may add a section Entitled "Endorsements", provided it contains | |
5625 nothing but endorsements of your Modified Version by various | |
5626 parties--for example, statements of peer review or that the text | |
5627 has been approved by an organization as the authoritative | |
5628 definition of a standard. | |
5629 | |
5630 You may add a passage of up to five words as a Front-Cover Text, | |
5631 and a passage of up to 25 words as a Back-Cover Text, to the end | |
5632 of the list of Cover Texts in the Modified Version. Only one | |
5633 passage of Front-Cover Text and one of Back-Cover Text may be | |
5634 added by (or through arrangements made by) any one entity. If the | |
5635 Document already includes a cover text for the same cover, | |
5636 previously added by you or by arrangement made by the same entity | |
5637 you are acting on behalf of, you may not add another; but you may | |
5638 replace the old one, on explicit permission from the previous | |
5639 publisher that added the old one. | |
5640 | |
5641 The author(s) and publisher(s) of the Document do not by this | |
5642 License give permission to use their names for publicity for or to | |
5643 assert or imply endorsement of any Modified Version. | |
5644 | |
5645 5. COMBINING DOCUMENTS | |
5646 | |
5647 You may combine the Document with other documents released under | |
5648 this License, under the terms defined in section 4 above for | |
5649 modified versions, provided that you include in the combination | |
5650 all of the Invariant Sections of all of the original documents, | |
5651 unmodified, and list them all as Invariant Sections of your | |
5652 combined work in its license notice, and that you preserve all | |
5653 their Warranty Disclaimers. | |
5654 | |
5655 The combined work need only contain one copy of this License, and | |
5656 multiple identical Invariant Sections may be replaced with a single | |
5657 copy. If there are multiple Invariant Sections with the same name | |
5658 but different contents, make the title of each such section unique | |
5659 by adding at the end of it, in parentheses, the name of the | |
5660 original author or publisher of that section if known, or else a | |
5661 unique number. Make the same adjustment to the section titles in | |
5662 the list of Invariant Sections in the license notice of the | |
5663 combined work. | |
5664 | |
5665 In the combination, you must combine any sections Entitled | |
5666 "History" in the various original documents, forming one section | |
5667 Entitled "History"; likewise combine any sections Entitled | |
5668 "Acknowledgements", and any sections Entitled "Dedications". You | |
5669 must delete all sections Entitled "Endorsements." | |
5670 | |
5671 6. COLLECTIONS OF DOCUMENTS | |
5672 | |
5673 You may make a collection consisting of the Document and other | |
5674 documents released under this License, and replace the individual | |
5675 copies of this License in the various documents with a single copy | |
5676 that is included in the collection, provided that you follow the | |
5677 rules of this License for verbatim copying of each of the | |
5678 documents in all other respects. | |
5679 | |
5680 You may extract a single document from such a collection, and | |
5681 distribute it individually under this License, provided you insert | |
5682 a copy of this License into the extracted document, and follow | |
5683 this License in all other respects regarding verbatim copying of | |
5684 that document. | |
5685 | |
5686 7. AGGREGATION WITH INDEPENDENT WORKS | |
5687 | |
5688 A compilation of the Document or its derivatives with other | |
5689 separate and independent documents or works, in or on a volume of | |
5690 a storage or distribution medium, is called an "aggregate" if the | |
5691 copyright resulting from the compilation is not used to limit the | |
5692 legal rights of the compilation's users beyond what the individual | |
5693 works permit. When the Document is included in an aggregate, this | |
5694 License does not apply to the other works in the aggregate which | |
5695 are not themselves derivative works of the Document. | |
5696 | |
5697 If the Cover Text requirement of section 3 is applicable to these | |
5698 copies of the Document, then if the Document is less than one half | |
5699 of the entire aggregate, the Document's Cover Texts may be placed | |
5700 on covers that bracket the Document within the aggregate, or the | |
5701 electronic equivalent of covers if the Document is in electronic | |
5702 form. Otherwise they must appear on printed covers that bracket | |
5703 the whole aggregate. | |
5704 | |
5705 8. TRANSLATION | |
5706 | |
5707 Translation is considered a kind of modification, so you may | |
5708 distribute translations of the Document under the terms of section | |
5709 4. Replacing Invariant Sections with translations requires special | |
5710 permission from their copyright holders, but you may include | |
5711 translations of some or all Invariant Sections in addition to the | |
5712 original versions of these Invariant Sections. You may include a | |
5713 translation of this License, and all the license notices in the | |
5714 Document, and any Warranty Disclaimers, provided that you also | |
5715 include the original English version of this License and the | |
5716 original versions of those notices and disclaimers. In case of a | |
5717 disagreement between the translation and the original version of | |
5718 this License or a notice or disclaimer, the original version will | |
5719 prevail. | |
5720 | |
5721 If a section in the Document is Entitled "Acknowledgements", | |
5722 "Dedications", or "History", the requirement (section 4) to | |
5723 Preserve its Title (section 1) will typically require changing the | |
5724 actual title. | |
5725 | |
5726 9. TERMINATION | |
5727 | |
5728 You may not copy, modify, sublicense, or distribute the Document | |
5729 except as expressly provided under this License. Any attempt | |
5730 otherwise to copy, modify, sublicense, or distribute it is void, | |
5731 and will automatically terminate your rights under this License. | |
5732 | |
5733 However, if you cease all violation of this License, then your | |
5734 license from a particular copyright holder is reinstated (a) | |
5735 provisionally, unless and until the copyright holder explicitly | |
5736 and finally terminates your license, and (b) permanently, if the | |
5737 copyright holder fails to notify you of the violation by some | |
5738 reasonable means prior to 60 days after the cessation. | |
5739 | |
5740 Moreover, your license from a particular copyright holder is | |
5741 reinstated permanently if the copyright holder notifies you of the | |
5742 violation by some reasonable means, this is the first time you have | |
5743 received notice of violation of this License (for any work) from | |
5744 that copyright holder, and you cure the violation prior to 30 days | |
5745 after your receipt of the notice. | |
5746 | |
5747 Termination of your rights under this section does not terminate | |
5748 the licenses of parties who have received copies or rights from | |
5749 you under this License. If your rights have been terminated and | |
5750 not permanently reinstated, receipt of a copy of some or all of | |
5751 the same material does not give you any rights to use it. | |
5752 | |
5753 10. FUTURE REVISIONS OF THIS LICENSE | |
5754 | |
5755 The Free Software Foundation may publish new, revised versions of | |
5756 the GNU Free Documentation License from time to time. Such new | |
5757 versions will be similar in spirit to the present version, but may | |
5758 differ in detail to address new problems or concerns. See | |
5759 `http://www.gnu.org/copyleft/'. | |
5760 | |
5761 Each version of the License is given a distinguishing version | |
5762 number. If the Document specifies that a particular numbered | |
5763 version of this License "or any later version" applies to it, you | |
5764 have the option of following the terms and conditions either of | |
5765 that specified version or of any later version that has been | |
5766 published (not as a draft) by the Free Software Foundation. If | |
5767 the Document does not specify a version number of this License, | |
5768 you may choose any version ever published (not as a draft) by the | |
5769 Free Software Foundation. If the Document specifies that a proxy | |
5770 can decide which future versions of this License can be used, that | |
5771 proxy's public statement of acceptance of a version permanently | |
5772 authorizes you to choose that version for the Document. | |
5773 | |
5774 11. RELICENSING | |
5775 | |
5776 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any | |
5777 World Wide Web server that publishes copyrightable works and also | |
5778 provides prominent facilities for anybody to edit those works. A | |
5779 public wiki that anybody can edit is an example of such a server. | |
5780 A "Massive Multiauthor Collaboration" (or "MMC") contained in the | |
5781 site means any set of copyrightable works thus published on the MMC | |
5782 site. | |
5783 | |
5784 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 | |
5785 license published by Creative Commons Corporation, a not-for-profit | |
5786 corporation with a principal place of business in San Francisco, | |
5787 California, as well as future copyleft versions of that license | |
5788 published by that same organization. | |
5789 | |
5790 "Incorporate" means to publish or republish a Document, in whole or | |
5791 in part, as part of another Document. | |
5792 | |
5793 An MMC is "eligible for relicensing" if it is licensed under this | |
5794 License, and if all works that were first published under this | |
5795 License somewhere other than this MMC, and subsequently | |
5796 incorporated in whole or in part into the MMC, (1) had no cover | |
5797 texts or invariant sections, and (2) were thus incorporated prior | |
5798 to November 1, 2008. | |
5799 | |
5800 The operator of an MMC Site may republish an MMC contained in the | |
5801 site under CC-BY-SA on the same site at any time before August 1, | |
5802 2009, provided the MMC is eligible for relicensing. | |
5803 | |
5804 | |
5805 ADDENDUM: How to use this License for your documents | |
5806 ==================================================== | |
5807 | |
5808 To use this License in a document you have written, include a copy of | |
5809 the License in the document and put the following copyright and license | |
5810 notices just after the title page: | |
5811 | |
5812 Copyright (C) YEAR YOUR NAME. | |
5813 Permission is granted to copy, distribute and/or modify this document | |
5814 under the terms of the GNU Free Documentation License, Version 1.3 | |
5815 or any later version published by the Free Software Foundation; | |
5816 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover | |
5817 Texts. A copy of the license is included in the section entitled ``GNU | |
5818 Free Documentation License''. | |
5819 | |
5820 If you have Invariant Sections, Front-Cover Texts and Back-Cover | |
5821 Texts, replace the "with...Texts." line with this: | |
5822 | |
5823 with the Invariant Sections being LIST THEIR TITLES, with | |
5824 the Front-Cover Texts being LIST, and with the Back-Cover Texts | |
5825 being LIST. | |
5826 | |
5827 If you have Invariant Sections without Cover Texts, or some other | |
5828 combination of the three, merge those two alternatives to suit the | |
5829 situation. | |
5830 | |
5831 If your document contains nontrivial examples of program code, we | |
5832 recommend releasing these examples in parallel under your choice of | |
5833 free software license, such as the GNU General Public License, to | |
5834 permit their use in free software. | |
5835 | |
OLD | NEW |