Commit | Line | Data |
---|---|---|
16d6b4b7 | 1 | README for GDB release |
c906108c SS |
2 | |
3 | This is GDB, the GNU source-level debugger. | |
c906108c | 4 | |
129188f6 | 5 | A summary of new features is in the file `gdb/NEWS'. |
c906108c | 6 | |
1bfdc549 AC |
7 | Check the GDB home page at http://www.gnu.org/software/gdb/ for up to |
8 | date release information, mailing list links and archives, etc. | |
129188f6 AC |
9 | |
10 | The file `gdb/PROBLEMS' contains information on problems identified | |
11 | late in the release cycle. GDB's bug tracking data base at | |
12 | http://www.gnu.org/software/gdb/bugs/ contains a more complete list of | |
13 | bugs. | |
6b325864 | 14 | |
c906108c SS |
15 | |
16 | Unpacking and Installation -- quick overview | |
17 | ========================== | |
18 | ||
16d6b4b7 NS |
19 | The release is provided as a gzipped tar file called |
20 | 'gdb-VERSION.tar.gz', where VERSION is the version of GDB. | |
21 | ||
22 | The GDB debugger sources, the generic GNU include | |
c906108c SS |
23 | files, the BFD ("binary file description") library, the readline |
24 | library, and other libraries all have directories of their own | |
16d6b4b7 | 25 | underneath the gdb-VERSION directory. The idea is that a variety of GNU |
c906108c | 26 | tools can share a common copy of these things. Be aware of variation |
1915ef4f PA |
27 | over time--for example don't try to build GDB with a copy of bfd from |
28 | a release other than the GDB release (such as a binutils release), | |
34f47bc4 | 29 | especially if the releases are more than a few weeks apart. |
c906108c SS |
30 | Configuration scripts and makefiles exist to cruise up and down this |
31 | directory tree and automatically build all the pieces in the right | |
32 | order. | |
33 | ||
16d6b4b7 NS |
34 | When you unpack the gdb-VERSION.tar.gz file, it will create a |
35 | source directory called `gdb-VERSION'. | |
c906108c | 36 | |
bec71058 | 37 | You can build GDB right in the source directory: |
c906108c | 38 | |
16d6b4b7 | 39 | cd gdb-VERSION |
34f47bc4 AC |
40 | ./configure |
41 | make | |
42 | cp gdb/gdb /usr/local/bin/gdb (or wherever you want) | |
c906108c | 43 | |
bec71058 FN |
44 | However, we recommend that an empty directory be used instead. |
45 | This way you do not clutter your source tree with binary files | |
46 | and will be able to create different builds with different | |
47 | configuration options. | |
48 | ||
49 | You can build GDB in any empty build directory: | |
50 | ||
34f47bc4 AC |
51 | mkdir build |
52 | cd build | |
16d6b4b7 | 53 | <full path to your sources>/gdb-VERSION/configure |
34f47bc4 AC |
54 | make |
55 | cp gdb/gdb /usr/local/bin/gdb (or wherever you want) | |
bec71058 | 56 | |
c63ce875 | 57 | (Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly |
16d6b4b7 | 58 | different; see the file gdb-VERSION/gdb/config/djgpp/README for details.) |
c63ce875 | 59 | |
aba7b4b6 AC |
60 | This will configure and build all the libraries as well as GDB. If |
61 | `configure' can't determine your system type, specify one as its | |
62 | argument, e.g., `./configure sun4' or `./configure decstation'. | |
c906108c | 63 | |
16d6b4b7 | 64 | Make sure that your 'configure' line ends in 'gdb-VERSION/configure': |
eaec4d85 | 65 | |
16d6b4b7 NS |
66 | /berman/migchain/source/gdb-VERSION/configure # RIGHT |
67 | /berman/migchain/source/gdb-VERSION/gdb/configure # WRONG | |
eaec4d85 | 68 | |
1915ef4f | 69 | The GDB package contains several subdirectories, such as 'gdb', |
eaec4d85 | 70 | 'bfd', and 'readline'. If your 'configure' line ends in |
16d6b4b7 | 71 | 'gdb-VERSION/gdb/configure', then you are configuring only the gdb |
1915ef4f | 72 | subdirectory, not the whole GDB package. This leads to build errors |
eaec4d85 MC |
73 | such as: |
74 | ||
75 | make: *** No rule to make target `../bfd/bfd.h', needed by `gdb.o'. Stop. | |
76 | ||
77 | If you get other compiler errors during this stage, see the `Reporting | |
aba7b4b6 | 78 | Bugs' section below; there are a few known problems. |
c906108c | 79 | |
34f47bc4 AC |
80 | GDB requires an ISO C (ANSI C) compiler. If you do not have an ISO |
81 | C compiler for your system, you may be able to download and install | |
82 | the GNU CC compiler. It is available via anonymous FTP from the | |
30b50213 | 83 | directory `ftp://ftp.gnu.org/pub/gnu/gcc'. GDB also requires an ISO |
1915ef4f | 84 | C standard library. The GDB remote server, GDBserver, builds with some |
30b50213 | 85 | non-ISO standard libraries - e.g. for Windows CE. |
c906108c | 86 | |
7fa2210b DJ |
87 | GDB uses Expat, an XML parsing library, to implement some target-specific |
88 | features. Expat will be linked in if it is available at build time, or | |
89 | those features will be disabled. The latest version of Expat should be | |
90 | available from `http://expat.sourceforge.net'. | |
91 | ||
aba7b4b6 AC |
92 | GDB can be used as a cross-debugger, running on a machine of one |
93 | type while debugging a program running on a machine of another type. | |
94 | See below. | |
c906108c SS |
95 | |
96 | ||
97 | More Documentation | |
98 | ****************** | |
99 | ||
100 | All the documentation for GDB comes as part of the machine-readable | |
aba7b4b6 AC |
101 | distribution. The documentation is written in Texinfo format, which |
102 | is a documentation system that uses a single source file to produce | |
103 | both on-line information and a printed manual. You can use one of the | |
104 | Info formatting commands to create the on-line version of the | |
105 | documentation and TeX (or `texi2roff') to typeset the printed version. | |
106 | ||
107 | GDB includes an already formatted copy of the on-line Info version | |
108 | of this manual in the `gdb/doc' subdirectory. The main Info file is | |
16d6b4b7 | 109 | `gdb-VERSION/gdb/doc/gdb.info', and it refers to subordinate files |
aba7b4b6 AC |
110 | matching `gdb.info*' in the same directory. If necessary, you can |
111 | print out these files, or read them with any editor; but they are | |
112 | easier to read using the `info' subsystem in GNU Emacs or the | |
113 | standalone `info' program, available as part of the GNU Texinfo | |
114 | distribution. | |
c906108c SS |
115 | |
116 | If you want to format these Info files yourself, you need one of the | |
117 | Info formatting programs, such as `texinfo-format-buffer' or | |
118 | `makeinfo'. | |
119 | ||
120 | If you have `makeinfo' installed, and are in the top level GDB | |
16d6b4b7 NS |
121 | source directory (`gdb-VERSION'), you can make the Info file by |
122 | typing: | |
c906108c | 123 | |
34f47bc4 AC |
124 | cd gdb/doc |
125 | make info | |
c906108c SS |
126 | |
127 | If you want to typeset and print copies of this manual, you need | |
128 | TeX, a program to print its DVI output files, and `texinfo.tex', the | |
129 | Texinfo definitions file. This file is included in the GDB | |
16d6b4b7 | 130 | distribution, in the directory `gdb-VERSION/texinfo'. |
c906108c SS |
131 | |
132 | TeX is a typesetting program; it does not print files directly, but | |
133 | produces output files called DVI files. To print a typeset document, | |
134 | you need a program to print DVI files. If your system has TeX | |
135 | installed, chances are it has such a program. The precise command to | |
136 | use depends on your system; `lpr -d' is common; another (for PostScript | |
137 | devices) is `dvips'. The DVI print command may require a file name | |
138 | without any extension or a `.dvi' extension. | |
139 | ||
140 | TeX also requires a macro definitions file called `texinfo.tex'. | |
141 | This file tells TeX how to typeset a document written in Texinfo | |
142 | format. On its own, TeX cannot read, much less typeset a Texinfo file. | |
143 | `texinfo.tex' is distributed with GDB and is located in the | |
16d6b4b7 | 144 | `gdb-VERSION/texinfo' directory. |
c906108c SS |
145 | |
146 | If you have TeX and a DVI printer program installed, you can typeset | |
7a9dd1b2 | 147 | and print this manual. First switch to the `gdb' subdirectory of |
16d6b4b7 | 148 | the main source directory (for example, to `gdb-VERSION/gdb') and then type: |
c906108c | 149 | |
34f47bc4 | 150 | make doc/gdb.dvi |
966beb0f EZ |
151 | |
152 | If you prefer to have the manual in PDF format, type this from the | |
153 | `gdb/doc' subdirectory of the main source directory: | |
154 | ||
34f47bc4 | 155 | make gdb.pdf |
966beb0f EZ |
156 | |
157 | For this to work, you will need the PDFTeX package to be installed. | |
c906108c SS |
158 | |
159 | ||
160 | Installing GDB | |
161 | ************** | |
162 | ||
163 | GDB comes with a `configure' script that automates the process of | |
164 | preparing GDB for installation; you can then use `make' to build the | |
165 | `gdb' program. | |
166 | ||
167 | The GDB distribution includes all the source code you need for GDB in | |
16d6b4b7 | 168 | a single directory. That directory contains: |
c906108c | 169 | |
16d6b4b7 | 170 | `gdb-VERSION/{COPYING,COPYING.LIB}' |
c906108c SS |
171 | Standard GNU license files. Please read them. |
172 | ||
16d6b4b7 | 173 | `gdb-VERSION/bfd' |
c906108c SS |
174 | source for the Binary File Descriptor library |
175 | ||
16d6b4b7 | 176 | `gdb-VERSION/config*' |
c906108c SS |
177 | script for configuring GDB, along with other support files |
178 | ||
16d6b4b7 | 179 | `gdb-VERSION/gdb' |
c906108c SS |
180 | the source specific to GDB itself |
181 | ||
16d6b4b7 | 182 | `gdb-VERSION/include' |
c906108c SS |
183 | GNU include files |
184 | ||
16d6b4b7 | 185 | `gdb-VERSION/libiberty' |
c906108c SS |
186 | source for the `-liberty' free software library |
187 | ||
16d6b4b7 | 188 | `gdb-VERSION/opcodes' |
c906108c SS |
189 | source for the library of opcode tables and disassemblers |
190 | ||
16d6b4b7 | 191 | `gdb-VERSION/readline' |
c906108c | 192 | source for the GNU command-line interface |
7a292a7a SS |
193 | NOTE: The readline library is compiled for use by GDB, but will |
194 | not be installed on your system when "make install" is issued. | |
c906108c | 195 | |
16d6b4b7 | 196 | `gdb-VERSION/sim' |
c906108c SS |
197 | source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc) |
198 | ||
16d6b4b7 | 199 | `gdb-VERSION/texinfo' |
c906108c SS |
200 | The `texinfo.tex' file, which you need in order to make a printed |
201 | manual using TeX. | |
202 | ||
16d6b4b7 | 203 | `gdb-VERSION/etc' |
c906108c SS |
204 | Coding standards, useful files for editing GDB, and other |
205 | miscellanea. | |
206 | ||
c63ce875 EZ |
207 | Note: the following instructions are for building GDB on Unix or |
208 | Unix-like systems. Instructions for building with DJGPP for | |
209 | MS-DOS/MS-Windows are in the file gdb/config/djgpp/README. | |
c906108c SS |
210 | |
211 | The simplest way to configure and build GDB is to run `configure' | |
16d6b4b7 | 212 | from the `gdb-VERSION' directory. |
c906108c | 213 | |
16d6b4b7 | 214 | First switch to the `gdb-VERSION' source directory if you are |
c906108c SS |
215 | not already in it; then run `configure'. |
216 | ||
217 | For example: | |
218 | ||
16d6b4b7 | 219 | cd gdb-VERSION |
34f47bc4 AC |
220 | ./configure |
221 | make | |
c906108c SS |
222 | |
223 | Running `configure' followed by `make' builds the `bfd', | |
224 | `readline', `mmalloc', and `libiberty' libraries, then `gdb' itself. | |
225 | The configured source files, and the binaries, are left in the | |
226 | corresponding source directories. | |
227 | ||
228 | `configure' is a Bourne-shell (`/bin/sh') script; if your system | |
229 | does not recognize this automatically when you run a different shell, | |
230 | you may need to run `sh' on it explicitly: | |
231 | ||
34f47bc4 | 232 | sh configure |
c906108c SS |
233 | |
234 | If you run `configure' from a directory that contains source | |
16d6b4b7 NS |
235 | directories for multiple libraries or programs, `configure' creates |
236 | configuration files for every directory level underneath (unless | |
237 | you tell it not to, with the `--norecursion' option). | |
c906108c SS |
238 | |
239 | You can install `gdb' anywhere; it has no hardwired paths. However, | |
240 | you should make sure that the shell on your path (named by the `SHELL' | |
241 | environment variable) is publicly readable. Remember that GDB uses the | |
242 | shell to start your program--some systems refuse to let GDB debug child | |
243 | processes whose programs are not readable. | |
244 | ||
245 | ||
246 | Compiling GDB in another directory | |
247 | ================================== | |
248 | ||
249 | If you want to run GDB versions for several host or target machines, | |
250 | you need a different `gdb' compiled for each combination of host and | |
251 | target. `configure' is designed to make this easy by allowing you to | |
252 | generate each configuration in a separate subdirectory, rather than in | |
253 | the source directory. If your `make' program handles the `VPATH' | |
254 | feature correctly (GNU `make' and SunOS 'make' are two that should), | |
255 | running `make' in each of these directories builds the `gdb' program | |
256 | specified there. | |
257 | ||
258 | To build `gdb' in a separate directory, run `configure' with the | |
259 | `--srcdir' option to specify where to find the source. (You also need | |
260 | to specify a path to find `configure' itself from your working | |
261 | directory. If the path to `configure' would be the same as the | |
262 | argument to `--srcdir', you can leave out the `--srcdir' option; it | |
263 | will be assumed.) | |
264 | ||
16d6b4b7 | 265 | For example, you can build GDB in a separate |
c906108c SS |
266 | directory for a Sun 4 like this: |
267 | ||
16d6b4b7 | 268 | cd gdb-VERSION |
c906108c SS |
269 | mkdir ../gdb-sun4 |
270 | cd ../gdb-sun4 | |
16d6b4b7 | 271 | ../gdb-VERSION/configure |
c906108c SS |
272 | make |
273 | ||
274 | When `configure' builds a configuration using a remote source | |
275 | directory, it creates a tree for the binaries with the same structure | |
276 | (and using the same names) as the tree under the source directory. In | |
277 | the example, you'd find the Sun 4 library `libiberty.a' in the | |
278 | directory `gdb-sun4/libiberty', and GDB itself in `gdb-sun4/gdb'. | |
279 | ||
280 | One popular reason to build several GDB configurations in separate | |
281 | directories is to configure GDB for cross-compiling (where GDB runs on | |
282 | one machine--the host--while debugging programs that run on another | |
283 | machine--the target). You specify a cross-debugging target by giving | |
284 | the `--target=TARGET' option to `configure'. | |
285 | ||
286 | When you run `make' to build a program or library, you must run it | |
287 | in a configured directory--whatever directory you were in when you | |
288 | called `configure' (or one of its subdirectories). | |
289 | ||
290 | The `Makefile' that `configure' generates in each source directory | |
291 | also runs recursively. If you type `make' in a source directory such | |
16d6b4b7 NS |
292 | as `gdb-VERSION' (or in a separate configured directory configured with |
293 | `--srcdir=PATH/gdb-VERSION'), you will build all the required libraries, | |
c906108c SS |
294 | and then build GDB. |
295 | ||
296 | When you have multiple hosts or targets configured in separate | |
297 | directories, you can run `make' on them in parallel (for example, if | |
298 | they are NFS-mounted on each of the hosts); they will not interfere | |
299 | with each other. | |
300 | ||
301 | ||
302 | Specifying names for hosts and targets | |
303 | ====================================== | |
304 | ||
305 | The specifications used for hosts and targets in the `configure' | |
306 | script are based on a three-part naming scheme, but some short | |
307 | predefined aliases are also supported. The full naming scheme encodes | |
308 | three pieces of information in the following pattern: | |
309 | ||
310 | ARCHITECTURE-VENDOR-OS | |
311 | ||
312 | For example, you can use the alias `sun4' as a HOST argument or in a | |
313 | `--target=TARGET' option. The equivalent full name is | |
314 | `sparc-sun-sunos4'. | |
315 | ||
316 | The `configure' script accompanying GDB does not provide any query | |
317 | facility to list all supported host and target names or aliases. | |
318 | `configure' calls the Bourne shell script `config.sub' to map | |
319 | abbreviations to full names; you can read the script, if you wish, or | |
320 | you can use it to test your guesses on abbreviations--for example: | |
321 | ||
322 | % sh config.sub sun4 | |
323 | sparc-sun-sunos4.1.1 | |
324 | % sh config.sub sun3 | |
325 | m68k-sun-sunos4.1.1 | |
326 | % sh config.sub decstation | |
327 | mips-dec-ultrix4.2 | |
328 | % sh config.sub hp300bsd | |
329 | m68k-hp-bsd | |
330 | % sh config.sub i386v | |
331 | i386-pc-sysv | |
332 | % sh config.sub i786v | |
333 | Invalid configuration `i786v': machine `i786v' not recognized | |
334 | ||
16d6b4b7 | 335 | `config.sub' is also distributed in the GDB source directory. |
c906108c SS |
336 | |
337 | ||
338 | `configure' options | |
339 | =================== | |
340 | ||
341 | Here is a summary of the `configure' options and arguments that are | |
342 | most often useful for building GDB. `configure' also has several other | |
343 | options not listed here. *note : (configure.info)What Configure Does, | |
344 | for a full explanation of `configure'. | |
345 | ||
346 | configure [--help] | |
347 | [--prefix=DIR] | |
348 | [--srcdir=PATH] | |
349 | [--norecursion] [--rm] | |
350 | [--enable-build-warnings] | |
351 | [--target=TARGET] | |
352 | [--host=HOST] | |
353 | [HOST] | |
354 | ||
355 | You may introduce options with a single `-' rather than `--' if you | |
356 | prefer; but you may abbreviate option names if you use `--'. | |
357 | ||
358 | `--help' | |
359 | Display a quick summary of how to invoke `configure'. | |
360 | ||
361 | `-prefix=DIR' | |
362 | Configure the source to install programs and files under directory | |
363 | `DIR'. | |
364 | ||
365 | `--srcdir=PATH' | |
366 | *Warning: using this option requires GNU `make', or another `make' | |
367 | that compatibly implements the `VPATH' feature.* | |
368 | Use this option to make configurations in directories separate | |
369 | from the GDB source directories. Among other things, you can use | |
370 | this to build (or maintain) several configurations simultaneously, | |
371 | in separate directories. `configure' writes configuration | |
372 | specific files in the current directory, but arranges for them to | |
373 | use the source in the directory PATH. `configure' will create | |
374 | directories under the working directory in parallel to the source | |
375 | directories below PATH. | |
376 | ||
70926f63 EZ |
377 | `--host=HOST' |
378 | Configure GDB to run on the specified HOST. | |
379 | ||
380 | There is no convenient way to generate a list of all available | |
381 | hosts. | |
382 | ||
383 | `HOST ...' | |
384 | Same as `--host=HOST'. If you omit this, GDB will guess; it's | |
385 | quite accurate. | |
386 | ||
c906108c SS |
387 | `--norecursion' |
388 | Configure only the directory level where `configure' is executed; | |
389 | do not propagate configuration to subdirectories. | |
390 | ||
391 | `--rm' | |
392 | Remove the configuration that the other arguments specify. | |
393 | ||
394 | `--enable-build-warnings' | |
395 | When building the GDB sources, ask the compiler to warn about any | |
396 | code which looks even vaguely suspicious. You should only using | |
397 | this feature if you're compiling with GNU CC. It passes the | |
398 | following flags: | |
aba7b4b6 AC |
399 | -Wimplicit |
400 | -Wreturn-type | |
401 | -Wcomment | |
402 | -Wtrigraphs | |
403 | -Wformat | |
404 | -Wparentheses | |
c906108c | 405 | -Wpointer-arith |
c906108c | 406 | |
70926f63 EZ |
407 | `--enable-werror' |
408 | Treat compiler warnings as werrors. Use this only with GCC. It | |
409 | adds the -Werror flag to the compiler, which will fail the | |
410 | compilation if the compiler outputs any warning messages. | |
411 | ||
c906108c SS |
412 | `--target=TARGET' |
413 | Configure GDB for cross-debugging programs running on the specified | |
414 | TARGET. Without this option, GDB is configured to debug programs | |
415 | that run on the same machine (HOST) as GDB itself. | |
416 | ||
417 | There is no convenient way to generate a list of all available | |
418 | targets. | |
419 | ||
b14b1491 TT |
420 | `--with-gdb-datadir=PATH' |
421 | Set the GDB-specific data directory. GDB will look here for | |
422 | certain supporting files or scripts. This defaults to the `gdb' | |
423 | subdirectory of `datadir' (which can be set using `--datadir'). | |
424 | ||
70926f63 EZ |
425 | `--with-relocated-sources=DIR' |
426 | Sets up the default source path substitution rule so that | |
427 | directory names recorded in debug information will be | |
428 | automatically adjusted for any directory under DIR. DIR should | |
429 | be a subdirectory of GDB's configured prefix, the one mentioned | |
430 | in the `--prefix' or `--exec-prefix' options to configure. This | |
431 | option is useful if GDB is supposed to be moved to a different | |
432 | place after it is built. | |
433 | ||
434 | `--enable-64-bit-bfd' | |
435 | Enable 64-bit support in BFD on 32-bit hosts. | |
436 | ||
437 | `--disable-gdbmi' | |
438 | Build GDB without the GDB/MI machine interface. | |
439 | ||
440 | `--enable-tui' | |
441 | Build GDB with the text-mode full-screen user interface (TUI). | |
442 | Requires a curses library (ncurses and cursesX are also | |
443 | supported). | |
444 | ||
445 | `--enable-gdbtk' | |
446 | Build GDB with the gdbtk GUI interface. Requires TCL/Tk to be | |
447 | installed. | |
448 | ||
05e7c244 JK |
449 | `--with-libunwind-ia64' |
450 | Use the libunwind library for unwinding function call stack on ia64 | |
451 | target platforms. | |
452 | See http://www.nongnu.org/libunwind/index.html for details. | |
70926f63 EZ |
453 | |
454 | `--with-curses' | |
455 | Use the curses library instead of the termcap library, for | |
456 | text-mode terminal operations. | |
457 | ||
458 | `--enable-profiling' Enable profiling of GDB itself. Necessary if you | |
459 | want to use the "maint set profile" command for profiling GDB. | |
460 | Requires the functions `monstartup' and `_mcleanup' to be present | |
461 | in the standard C library used to build GDB, and also requires a | |
462 | compiler that supports the `-pg' option. | |
463 | ||
464 | `--with-system-readline' | |
465 | Use the readline library installed on the host, rather than the | |
466 | library supplied as part of GDB tarball. | |
467 | ||
468 | `--with-expat' | |
469 | Build GDB with the libexpat library. (Done by default if | |
470 | libexpat is installed and found at configure time.) This library | |
471 | is used to read XML files supplied with GDB. If it is | |
472 | unavailable, some features, such as remote protocol memory maps, | |
473 | target descriptions, and shared library lists, that are based on | |
474 | XML files, will not be available in GDB. If your host does not | |
475 | have libexpat installed, you can get the latest version from | |
476 | http://expat.sourceforge.net. | |
477 | ||
478 | `--with-python[=PATH]' | |
479 | Build GDB with Python scripting support. (Done by default if | |
480 | libpython is present and found at configure time.) Python makes | |
481 | GDB scripting much more powerful than the restricted CLI | |
482 | scripting language. If your host does not have Python installed, | |
483 | you can find it on http://www.python.org/download/. The oldest | |
484 | version of Python supported by GDB is 2.4. The optional argument | |
485 | PATH says where to find the Python headers and libraries; the | |
486 | configure script will look in PATH/include for headers and in | |
487 | PATH/lib for the libraries. | |
488 | ||
489 | `--without-included-regex' | |
490 | Don't use the regex library included with GDB (as part of the | |
491 | libiberty library). This is the default on hosts with version 2 | |
492 | of the GNU C library. | |
493 | ||
494 | `--with-sysroot=DIR' | |
495 | Use DIR as the default system root directory for libraries whose | |
496 | file names begin with `/lib' or `/usr/lib'. (The value of DIR | |
497 | can be modified at run time by using the "set sysroot" command.) | |
498 | If DIR is under the GDB configured prefix (set with `--prefix' or | |
499 | `--exec-prefix' options), the default system root will be | |
500 | automatically adjusted if and when GDB is moved to a different | |
501 | location. | |
502 | ||
503 | `--with-system-gdbinit=FILE' | |
504 | Configure GDB to automatically load a system-wide init file. | |
505 | FILE should be an absolute file name. If FILE is in a directory | |
506 | under the configured prefix, and GDB is moved to another location | |
507 | after being built, the location of the system-wide init file will | |
508 | be adjusted accordingly. | |
509 | ||
c906108c SS |
510 | `configure' accepts other options, for compatibility with configuring |
511 | other GNU tools recursively; but these are the only options that affect | |
512 | GDB or its supporting libraries. | |
513 | ||
514 | ||
c906108c SS |
515 | Remote debugging |
516 | ================= | |
517 | ||
aba7b4b6 AC |
518 | The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples |
519 | of remote stubs to be used with remote.c. They are designed to run | |
520 | standalone on an m68k, i386, or SPARC cpu and communicate properly | |
521 | with the remote.c stub over a serial line. | |
c906108c | 522 | |
aba7b4b6 | 523 | The directory gdb/gdbserver/ contains `gdbserver', a program that |
1915ef4f | 524 | allows remote debugging for Unix applications. GDBserver is only |
aba7b4b6 AC |
525 | supported for some native configurations, including Sun 3, Sun 4, and |
526 | Linux. | |
1915ef4f PA |
527 | The file gdb/gdbserver/README includes further notes on GDBserver; in |
528 | particular, it explains how to build GDBserver for cross-debugging | |
529 | (where GDBserver runs on the target machine, which is of a different | |
92726479 | 530 | architecture than the host machine running GDB). |
c906108c | 531 | |
aba7b4b6 | 532 | There are a number of remote interfaces for talking to existing ROM |
c906108c SS |
533 | monitors and other hardware: |
534 | ||
c906108c | 535 | remote-mips.c MIPS remote debugging protocol |
c906108c SS |
536 | remote-sds.c PowerPC SDS monitor |
537 | remote-sim.c Generalized simulator protocol | |
c906108c | 538 | |
c906108c | 539 | |
129188f6 AC |
540 | Reporting Bugs in GDB |
541 | ===================== | |
542 | ||
543 | There are several ways of reporting bugs in GDB. The prefered | |
544 | method is to use the World Wide Web: | |
545 | ||
546 | http://www.gnu.org/software/gdb/bugs/ | |
547 | ||
548 | As an alternative, the bug report can be submitted, via e-mail, to the | |
549 | address "bug-gdb@gnu.org". | |
c906108c | 550 | |
16d6b4b7 NS |
551 | When submitting a bug, please include the GDB version number, and |
552 | how you configured it (e.g., "sun4" or "mach386 host, | |
129188f6 | 553 | i586-intel-synopsys target"). Since GDB now supports so many |
aba7b4b6 | 554 | different configurations, it is important that you be precise about |
16d6b4b7 NS |
555 | this. If at all possible, you should include the actual banner |
556 | that GDB prints when it starts up, or failing that, the actual | |
557 | configure command that you used when configuring GDB. | |
c906108c | 558 | |
129188f6 AC |
559 | For more information on how/whether to report bugs, see the |
560 | Reporting Bugs chapter of the GDB manual (gdb/doc/gdb.texinfo). | |
c906108c | 561 | |
aba7b4b6 AC |
562 | |
563 | Graphical interface to GDB -- X Windows, MS Windows | |
564 | ========================== | |
c906108c | 565 | |
aba7b4b6 AC |
566 | Several graphical interfaces to GDB are available. You should |
567 | check: | |
c906108c | 568 | |
d99ba314 | 569 | http://www.gnu.org/software/gdb/links/ |
c906108c | 570 | |
aba7b4b6 | 571 | for an up-to-date list. |
c906108c | 572 | |
aba7b4b6 | 573 | Emacs users will very likely enjoy the Grand Unified Debugger mode; |
f032fb6e | 574 | try typing `M-x gdb RET'. |
c906108c SS |
575 | |
576 | ||
577 | Writing Code for GDB | |
578 | ===================== | |
579 | ||
aba7b4b6 | 580 | There is a lot of information about writing code for GDB in the |
c906108c SS |
581 | internals manual, distributed with GDB in gdb/doc/gdbint.texinfo. You |
582 | can read it by hand, print it by using TeX and texinfo, or process it | |
583 | into an `info' file for use with Emacs' info mode or the standalone | |
584 | `info' program. | |
585 | ||
aba7b4b6 | 586 | If you are pondering writing anything but a short patch, especially |
c906108c SS |
587 | take note of the information about copyrights in the node Submitting |
588 | Patches. It can take quite a while to get all the paperwork done, so | |
589 | we encourage you to start that process as soon as you decide you are | |
590 | planning to work on something, or at least well ahead of when you | |
591 | think you will be ready to submit the patches. | |
592 | ||
593 | ||
594 | GDB Testsuite | |
595 | ============= | |
596 | ||
aba7b4b6 AC |
597 | Included with the GDB distribution is a DejaGNU based testsuite |
598 | that can either be used to test your newly built GDB, or for | |
599 | regression testing a GDB with local modifications. | |
600 | ||
601 | Running the testsuite requires the prior installation of DejaGNU, | |
602 | which is generally available via ftp. The directory | |
47b95330 AC |
603 | ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot. |
604 | Once DejaGNU is installed, you can run the tests in one of the | |
605 | following ways: | |
c906108c | 606 | |
16d6b4b7 | 607 | (1) cd gdb-VERSION |
aba7b4b6 AC |
608 | make check-gdb |
609 | ||
610 | or | |
c906108c | 611 | |
16d6b4b7 | 612 | (2) cd gdb-VERSION/gdb |
c906108c SS |
613 | make check |
614 | ||
615 | or | |
616 | ||
16d6b4b7 | 617 | (3) cd gdb-VERSION/gdb/testsuite |
c906108c SS |
618 | make site.exp (builds the site specific file) |
619 | runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate) | |
620 | ||
6bc80edc TT |
621 | When using a `make'-based method, you can use the Makefile variable |
622 | `RUNTESTFLAGS' to pass flags to `runtest', e.g.: | |
623 | ||
624 | make RUNTESTFLAGS=--directory=gdb.cp check | |
625 | ||
626 | If you use GNU make, you can use its `-j' option to run the testsuite | |
627 | in parallel. This can greatly reduce the amount of time it takes for | |
628 | the testsuite to run. In this case, if you set `RUNTESTFLAGS' then, | |
629 | by default, the tests will be run serially even under `-j'. You can | |
630 | override this and force a parallel run by setting the `make' variable | |
631 | `FORCE_PARALLEL' to any non-empty value. Note that the parallel `make | |
632 | check' assumes that you want to run the entire testsuite, so it is not | |
633 | compatible with some dejagnu options, like `--directory'. | |
634 | ||
aba7b4b6 AC |
635 | The last method gives you slightly more control in case of problems |
636 | with building one or more test executables or if you are using the | |
637 | testsuite `standalone', without it being part of the GDB source tree. | |
c906108c SS |
638 | |
639 | See the DejaGNU documentation for further details. | |
640 | ||
3c36c0af JB |
641 | |
642 | Copyright and License Notices | |
643 | ============================= | |
644 | ||
645 | Most files maintained by the GDB Project contain a copyright notice | |
646 | as well as a license notice, usually at the start of the file. | |
647 | ||
648 | To reduce the length of copyright notices, consecutive years in the | |
649 | copyright notice can be combined into a single range. For instance, | |
650 | the following list of copyright years... | |
651 | ||
652 | 1986, 1988, 1989, 1991-1993, 1999, 2000, 2007, 2008, 2009, 2010, 2011 | |
653 | ||
654 | ... is abbreviated into: | |
655 | ||
656 | 1986, 1988-1989, 1991-1993, 1999-2000, 2007-2011 | |
657 | ||
658 | Every year of each range, inclusive, is a copyrightable year that | |
659 | could be listed individually. | |
660 | ||
c906108c SS |
661 | \f |
662 | (this is for editing this file with GNU emacs) | |
663 | Local Variables: | |
664 | mode: text | |
665 | End: |