Change GDB over to GNU General Public License version 2.
[deliverable/binutils-gdb.git] / gdb / README
CommitLineData
bd5635a1
RP
1This is GDB, the GNU source-level debugger, presently running under
2un*x. This is a pre-alpha version of GDB version 4, and has NOT been
3extensively tested. It surely has some bugs, both bugs that were
4present in version 3 and new bugs. I have filed all the bug reports
5and fixes mailed to bug-gdb, and the fixes in particular will move
6into these sources as I find the time.
7
361cc81a 8 => THIS VERSION IS FRAGILE! <=
bd5635a1 9
361cc81a
JG
10 It depends on preliminary versions of a new "binary file
11 descriptor" library, a new global "include" directory,
12 and separate libraries for "readline" and "libiberty", which
bd5635a1 13 are packaged separately from GDB. You must obtain, configure
361cc81a 14 and build these libraries manually, then configure and build gdb.
bd5635a1 15 When building gdb's for multiple platforms, you must manually
361cc81a 16 rebuild the libraries separately for each platform. Yes, of
bd5635a1
RP
17 course, we are working on this! FIXME!
18
361cc81a 19 Configure and build the libraries for your host system by:
bd5635a1
RP
20
21 cd ../bfd
361cc81a
JG
22 ./configure HOSTNAME
23 make
24
25 cd ../libiberty
26 ./configure HOSTNAME
27 make
28
29 cd ../readline
30 [edit Makefile as appropriate]
bd5635a1
RP
31 make
32
33 Then you can cd ../gdb-whatever, and config and build gdb.
34
361cc81a
JG
35This release moves the generic GNU include files, the BFD library, the
36getopt routines, obstacks, and the readline library into the parent
37directory of gdb. The idea is that a variety of GNU tools can share a
38common copy of these things.
bd5635a1
RP
39
40A summary of features new since gdb-3.5 is in the file `WHATS.NEW'.
41
42The best way to build GDB, in my opinion, is in a subdirectory. I use
43a naming convention "=XXX" where XXX is the machine type I'm building
44for. Nothing depends on this, it's just how I remember which
45subdirectories are what. So, once you have the BFD library built for
46that machine, you can do:
47
48 cd gdb-x.yy (the directory where this README is)
49 mkdir =XXX (e.g. mkdir =vax)
50 cd =XXX
51 ../config.gdb machine
52 make
53
54Machine is like "vax" or "sun4". For more information type `../config.gdb'.
55
56Once you have done that, just `make' will do everything, producing an
57executable `gdb' in this directory.
58
59You can also build gdb binaries in a completely different directory from its
60sources, by specifying "srcdir=YYY" to config.gdb, giving it an absolute
61or relative path to the source directory.
62
63GDB can be used as a cross-debugger, running on a machine of one type
64while debugging a program running on a machine of another type. You
65configure it this way by specifying `config.gdb host target' where host
66is where GDB runs, and target is where your program runs.
67
68If you want a new (current to this release) version of the manual, you
361cc81a
JG
69will have to use the gdb.texinfo and texinfo.tex files provided with
70this distribution. For details see the texinfo manual (distributed
71with emacs and as a printed manual).
bd5635a1
RP
72
73About languages other than C...
74
75C++ support has been integrated into gdb. GDB should work with FORTRAN
361cc81a 76programs. (If you have problem, please send a bug report; note that you
bd5635a1 77may have to refer to some FORTRAN variables with a trailing
361cc81a 78underscore). I am not aware of anyone who is working on getting it
bd5635a1
RP
79to use the syntax of any language other than C or C++. Pascal programs
80which use sets, subranges, file variables, or nested functions will not
81currently work.
82
83About kernel debugging...
84
85I have't done this myself so I can't really offer any advice.
86Remote debugging over serial lines is more like to be in a currently
87functioning state than the standalone gdb (kdb). FIXME.
88
89About remote debugging...
90
91[This section seems to be out of date, I have never seen the "rapp"
92program, though I would like to. FIXME.]
361cc81a 93`rapp' runs under unix and acts as a remote stub (like rem-multi.shar
bd5635a1
RP
94distributed with GDB version 3). Currently it just works over UDP
95(network), not over a serial line. To get it running
96* Compile GDB on the host machine as usual
97* Compile rapp on the target machine, giving for both host and target
98 the type of the target machine
99* Install "gdb" in /etc/services on both machines.
100
101This will get reworked before the initial release of 4.x. FIXME.
102
361cc81a
JG
103The files m68k-stub.c and i386-stub.c contain two examples of remote
104stubs to be used with remote.c. They are designeded to run standalone
105on a 68k or 386 cpu and communicate properly with the remote.c stub
106over a serial line.
107
108The file rem-multi.shar contains a general stub that can probably be
109running on various different flavors of unix to allow debugging over a
110serial line from one machine to another.
bd5635a1
RP
111
112The files remote-eb.c and remote-nindy.c are two examples of remote
113interfaces for talking to existing ROM monitors (for the AMD 29000 and the
114Intel 960 repsectively). There is also a remote interface for the
115VxWorks realtime kernel, which communicates over TCP/IP, in remote-vx.c
116and the vx-share subdirectory.
117
118About reporting bugs...
119
120The correct address for reporting bugs found with gdb is
121"bug-gdb@prep.ai.mit.edu". Please email all bugs to that address.
122
123About xgdb...
124
361cc81a 125xgdb is obsolete. We are not doing any development or support of it.
bd5635a1 126
361cc81a 127There is an "xxgdb", which shows more promise.
bd5635a1
RP
128
129For those intersted in auto display of source and the availability of
130an editor while debugging I suggest trying gdb-mode in gnu-emacs
131(Try typing M-x gdb RETURN). Comments on this mode are welcome.
132
133About the machine-dependent files...
134
135tconfig/<machine>
136This contains Makefile stuff for when the target system is <machine>.
137It also specifies the name of the tm-XXX.h file for this machine.
138
139xconfig/<machine>
140This contains Makefile stuff for when the host system is <machine>.
141It also specifies the name of the xm-XXX.h file for this machine.
142
143tm-XXX.h (tm.h is a link to this file, created by config.gdb).
144This file contains macro definitions that express information
145about the target machine's registers, stack frame format and instructions.
146
147xm-XXX.h (xm.h is a link to this file, created by config.gdb).
148This contains macro definitions describing the host system environment,
149such as byte order, host C compiler and library, ptrace support,
150and core file structure.
151
152<machine>-opcode.h
153<machine>-pinsn.c
154These files contain the information necessary to print instructions
155for your cpu type. <machine>-opcode.h includes some large initialized
156data structures, which is strange for a ".h" file, but it's OK since
157it is only included in one place. <machine>-opcode.h is shared
158between the debugger and the assembler (if the GNU assembler has been
159ported to that machine), whereas <machine>-pinsn.c is specific to GDB.
160
161<machine>-tdep.c
162This file contains any miscellaneous code required for this machine
163as a target. On some machines it doesn't exist at all. Its existence
164is specified in the tconfig/XXX file.
165
166<machine>-xdep.c
167This file contains any miscellaneous code required for this machine
168as a host. On some machines it doesn't exist at all. Its existence
169is specified in the xconfig/XXX file.
170
171infptrace.c
172This is the low level interface to inferior processes for systems
173using the Unix ptrace call in a vanilla way. Some systems have their
174own routines in <machine>-xdep.c. Whether or not it is used
175is specified in the xconfig/XXX file.
176
177coredep.c
178Machine and system-dependent aspects of reading core files. Some
179machines use coredep.c; some have the routines in <machine>-xdep.c.
180Whether or not it is used is specified in the xconfig/XXX file.
181Now that BFD is used to read core files, virtually all machines should
182use coredep.c and should just provide fetch_core_registers in
183<machine>-xdep.c.
184
185exec.c
186Machine and system-dependent aspects of reading executable files.
187Some machines use exec.c; some have the routines in <machine>-tdep.c
188Since BFD, virtually all machines should use exec.c.
189
190About writing code for GDB...
191
192We appreciate having users contribute code that is of general use, but
193for it to be included in future GDB releases it must be cleanly
194written. We do not want to include changes that will needlessly make
195future maintainance difficult. It is not much harder to do things
196right, and in the long term it is worth it to the GNU project, and
197probably to you individually as well.
198
199Please code according to the GNU coding standards. If you do not have
200a copy, you can request one by sending mail to gnu@prep.ai.mit.edu.
201
202If you make substantial changes, you'll have to file a copyright
203assignment with the Free Software Foundation before we can produce a
204release that includes your changes. Send mail requesting the copyright
205assignment to gnu@prep.ai.mit.edu. Do this early, like before the
206changes actually work, or even before you start them, because a manager
207or lawyer on your end will probably make this a slow process.
208
209Please try to avoid making machine-specific changes to
210machine-independent files. If this is unavoidable, put a hook in the
211machine-independent file which calls a (possibly) machine-dependent
212macro (for example, the IGNORE_SYMBOL macro can be used for any
213symbols which need to be ignored on a specific machine. Calling
214IGNORE_SYMBOL in dbxread.c is a lot cleaner than a maze of #if
215defined's). The machine-independent code should do whatever "most"
216machines want if the macro is not defined in param.h. Using #if
361cc81a 217defined can sometimes be OK (e.g. SET_STACK_LIMIT_HUGE) but should be
bd5635a1
RP
218conditionalized on a specific feature of an operating system (set in
219tm.h or xm.h) rather than something like #if defined(vax) or #if
220defined(SYSV). If you use an #ifdef on some symbol that is defined
221in a header file (e.g. #ifdef TIOCSETP), *please* make sure that you
222have #include'd the relevant header file in that module!
223
224It is better to replace entire routines which may be system-specific,
225rather than put in a whole bunch of hooks which are probably not going
226to be helpful for any purpose other than your changes. For example,
227if you want to modify dbxread.c to deal with DBX debugging symbols
228which are in COFF files rather than BSD a.out files, do something
229along the lines of a macro GET_NEXT_SYMBOL, which could have
230different definitions for COFF and a.out, rather than trying to put
231the necessary changes throughout all the code in dbxread.c that
232currently assumes BSD format.
233
234Please avoid duplicating code. For example, in GDB 3.x all the stuff
235in infptrace.c was duplicated in *-dep.c, and so changing something
236was very painful. Thus in GDB 4.x these have all been consolidated
237into infptrace.c. infptrace.c can deal with variations between
238systems the same way any system-independent file would (hooks, #if
239defined, etc.), and machines which are radically different don't need
240to use infptrace.c at all. The same was true of core_file_command
241and exec_file_command.
242
243About debugging gdb with itself...
244
245You probably want to do a "make TAGS" after you configure your
246distribution; this will put the machine dependent routines for your
247local machine where they will be accessed first by a M-period .
248
249Also, make sure that you've compiled gdb with your local cc or taken
250appropriate precautions regarding ansification of include files. See
251the Makefile for more information.
252
253When you run gdb in this directory, it will read a ".gdbinit" file that
254sets up some simple things to make debugging gdb easier. The "info"
255command, when executed without a subcommand in a gdb being debugged by
256gdb, will pop you back up to the top level gdb. See .gdbinit for details.
257\f
258(this is for editing this file with GNU emacs)
259Local Variables:
260mode: text
261End:
This page took 0.036683 seconds and 4 git commands to generate.