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