]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/doc/gdbint.texinfo
* mipsread.c (UNSAFE_DATA_ADDR): Remove MIPS-host-specific
[thirdparty/binutils-gdb.git] / gdb / doc / gdbint.texinfo
CommitLineData
ca714d03 1\input texinfo
7f09f15f 2@setfilename gdbint.info
d98259f8 3@c $Id$
b7becc8f
RP
4
5@ifinfo
6@format
7START-INFO-DIR-ENTRY
b517f124 8* Gdb-Internals: (gdbint). The GNU debugger's internals.
b7becc8f
RP
9END-INFO-DIR-ENTRY
10@end format
11@end ifinfo
12
ca714d03
RP
13@ifinfo
14This file documents the internals of the GNU debugger GDB.
f222d23d 15
b517f124 16Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
ca714d03 17Contributed by Cygnus Support. Written by John Gilmore.
cfddbd02 18
ca714d03
RP
19Permission is granted to make and distribute verbatim copies of
20this manual provided the copyright notice and this permission notice
21are preserved on all copies.
22
23@ignore
24Permission is granted to process this file through Tex and print the
25results, provided the printed document carries copying permission
26notice identical to this one except for the removal of this paragraph
27(this paragraph not being relevant to the printed manual).
28
29@end ignore
30Permission is granted to copy or distribute modified versions of this
31manual under the terms of the GPL (for which purpose this text may be
32regarded as a program in the language TeX).
33@end ifinfo
34
7f09f15f 35@setchapternewpage off
ca714d03
RP
36@settitle GDB Internals
37@titlepage
38@title{Working in GDB}
39@subtitle{A guide to the internals of the GNU debugger}
40@author John Gilmore
41@author Cygnus Support
42@page
43@tex
44\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
45\xdef\manvers{\$Revision$} % For use in headers, footers too
46{\parskip=0pt
47\hfill Cygnus Support\par
48\hfill \manvers\par
49\hfill \TeX{}info \texinfoversion\par
50}
51@end tex
52
53@vskip 0pt plus 1filll
493cf018 54Copyright @copyright{} 1990, 1991, 1992 Free Software Foundation, Inc.
ca714d03
RP
55
56Permission is granted to make and distribute verbatim copies of
57this manual provided the copyright notice and this permission notice
58are preserved on all copies.
59
60@end titlepage
61
b517f124
JG
62@node Top
63@top
64This documents the internals of the GNU debugger, GDB. It is a
493cf018
JG
65collection of miscellaneous information with little form at this point.
66Mostly, it is a repository into which you can put information about
67GDB as you discover it (or as you design changes to GDB).
68
ca714d03 69@menu
97f3cb72
RP
70* README:: The README File
71* New Architectures:: Defining a New Host or Target Architecture
72* Config:: Adding a New Configuration
7f09f15f
JG
73* Host:: Adding a New Host
74* Target:: Adding a New Target
97f3cb72
RP
75* Languages:: Defining New Source Languages
76* Releases:: Configuring GDB for Release
493cf018 77* Partial Symbol Tables:: How GDB reads symbols quickly at startup
d98259f8 78* BFD support for GDB:: How BFD and GDB interface
97f3cb72
RP
79* Symbol Reading:: Defining New Symbol Readers
80* Cleanups:: Cleanups
81* Wrapping:: Wrapping Output Lines
968720bf
RP
82* Frames:: Keeping track of function calls
83* Coding Style:: Strunk and White for GDB maintainers
b517f124
JG
84* Host Conditionals:: What features exist in the host
85* Target Conditionals:: What features exist in the target
86* Native Conditionals:: Conditionals for when host and target are same
87* Obsolete Conditionals:: Conditionals that don't exist any more
7f09f15f 88
ca714d03
RP
89@end menu
90
b517f124 91@node README
97f3cb72 92@chapter The @file{README} File
cfddbd02 93
97f3cb72
RP
94Check the @file{README} file, it often has useful information that does not
95appear anywhere else in the directory.
cfddbd02 96
cfddbd02 97
b517f124 98@node New Architectures
97f3cb72 99@chapter Defining a New Host or Target Architecture
cfddbd02 100
97f3cb72
RP
101When building support for a new host and/or target, much of the work you
102need to do is handled by specifying configuration files;
103@pxref{Config,,Adding a New Configuration}. Further work can be
104divided into ``host-dependent'' (@pxref{Host,,Adding a New Host}) and
aeb62c7b 105``target-dependent'' (@pxref{Target,,Adding a New Target}). The
97f3cb72
RP
106following discussion is meant to explain the difference between hosts
107and targets.
d98259f8 108
97f3cb72 109@heading What is considered ``host-dependent'' versus ``target-dependent''?
d98259f8 110
b7becc8f
RP
111@dfn{Host} refers to attributes of the system where GDB runs.
112@dfn{Target} refers to the system where the program being debugged
113executes. In most cases they are the same machine; unfortunately, that
114means you must add @emph{both} host and target support for new machines
115in this category.
116
8cc1c08f
JG
117The @file{config/mh-*}, @file{xm-*.h} and @file{*-xdep.c} files are for
118host support. Similarly, the @file{config/mt-*}, @file{tm-*.h} and
97f3cb72
RP
119@file{*-tdep.c} files are for target support. The question is, what
120features or aspects of a debugging or cross-debugging environment are
121considered to be ``host'' support?
cfddbd02 122
97f3cb72
RP
123Defines and include files needed to build on the host are host support.
124Examples are tty support, system defined types, host byte order, host
125float format.
cfddbd02 126
97f3cb72
RP
127Unix child process support is considered an aspect of the host. Since
128when you fork on the host you are still on the host, the various macros
129needed for finding the registers in the upage, running @code{ptrace}, and such
130are all in the host-dependent files.
7f27984e 131
97f3cb72 132@c FIXME so what kinds of things are target support?
7f27984e 133
97f3cb72
RP
134This is still somewhat of a grey area; I (John Gilmore) didn't do the
135@file{xm-*} and @file{tm-*} split for gdb (it was done by Jim Kingdon)
136so I have had to figure out the grounds on which it was split, and make
137my own choices as I evolve it. I have moved many things out of the xdep
138files actually, partly as a result of BFD and partly by removing
139duplicated code.
bbb5013f 140
bbb5013f 141
b517f124 142@node Config
97f3cb72 143@chapter Adding a New Configuration
bbb5013f 144
97f3cb72
RP
145Most of the work in making GDB compile on a new machine is in specifying
146the configuration of the machine. This is done in a dizzying variety of
147header files and configuration scripts, which we hope to make more
148sensible soon. Let's say your new host is called an @var{xxx} (e.g.
149@samp{sun4}), and its full three-part configuration name is
150@code{@var{xarch}-@var{xvend}-@var{xos}} (e.g. @samp{sparc-sun-sunos4}). In
151particular:
152
b7becc8f 153In the top level directory, edit @file{config.sub} and add @var{xarch},
97f3cb72
RP
154@var{xvend}, and @var{xos} to the lists of supported architectures,
155vendors, and operating systems near the bottom of the file. Also, add
156@var{xxx} as an alias that maps to
157@code{@var{xarch}-@var{xvend}-@var{xos}}. You can test your changes by
158running
bbb5013f 159
97f3cb72
RP
160@example
161./config.sub @var{xxx}
162@end example
163@noindent
164and
165@example
166./config.sub @code{@var{xarch}-@var{xvend}-@var{xos}}
167@end example
168@noindent
169which should both respond with @code{@var{xarch}-@var{xvend}-@var{xos}}
170and no error messages.
bbb5013f 171
b7becc8f
RP
172Now, go to the @file{bfd} directory and
173create a new file @file{bfd/hosts/h-@var{xxx}.h}. Examine the
97f3cb72
RP
174other @file{h-*.h} files as templates, and create one that brings in the
175right include files for your system, and defines any host-specific
176macros needed by GDB.
7f27984e 177
b7becc8f 178Then edit @file{bfd/configure.in}. Add shell script code to recognize your
97f3cb72 179@code{@var{xarch}-@var{xvend}-@var{xos}} configuration, and set
b7becc8f
RP
180@code{my_host} to @var{xxx} when you recognize it. This will cause your
181file @file{h-@var{xxx}.h} to be linked to @file{sysdep.h} at configuration
182time.
7f27984e 183
b7becc8f 184Also, if this host requires any changes to the Makefile, create a file
8cc1c08f 185@file{bfd/config/mh-@var{xxx}}, which includes the required lines.
7f27984e 186
b7becc8f
RP
187(If you have the binary utilities and/or GNU ld in the same tree,
188you'll also have to edit @file{binutils/configure.in} or
189@file{ld/configure.in} to match what you've done in the @file{bfd}
190directory.)
97f3cb72 191
8cc1c08f 192It's possible that the @file{libiberty} and @file{readline} directories
97f3cb72
RP
193won't need any changes for your configuration, but if they do, you can
194change the @file{configure.in} file there to recognize your system and
8cc1c08f 195map to an @file{mh-@var{xxx}} file. Then add @file{mh-@var{xxx}}
97f3cb72
RP
196to the @file{config/} subdirectory, to set any makefile variables you
197need. The only current options in there are things like @samp{-DSYSV}.
198
b7becc8f 199Aha! Now to configure GDB itself! Edit
97f3cb72
RP
200@file{gdb/configure.in} to recognize your system and set @code{gdb_host}
201to @var{xxx}, and (unless your desired target is already available) also
202set @code{gdb_target} to something appropriate (for instance,
203@var{xxx}). To handle new hosts, modify the segment after the comment
204@samp{# per-host}; to handle new targets, modify after @samp{#
205per-target}.
206@c Would it be simpler to just use different per-host and per-target
207@c *scripts*, and call them from {configure} ?
7f27984e 208
b7becc8f 209Finally, you'll need to specify and define GDB's host- and
8cc1c08f
JG
210target-dependent @file{.h} and @file{.c} files used for your
211configuration; the next two chapters discuss those.
7f27984e 212
7f27984e 213
b517f124 214@node Host
97f3cb72 215@chapter Adding a New Host
7f27984e 216
97f3cb72
RP
217Once you have specified a new configuration for your host
218(@pxref{Config,,Adding a New Configuration}), there are two remaining
219pieces to making GDB work on a new machine. First, you have to make it
220host on the new machine (compile there, handle that machine's terminals
221properly, etc). If you will be cross-debugging to some other kind of
222system that's already supported, you are done.
46bc46eb 223
97f3cb72
RP
224If you want to use GDB to debug programs that run on the new machine,
225you have to get it to understand the machine's object files, symbol
b7becc8f 226files, and interfaces to processes. @pxref{Target,,Adding a New Target}
46bc46eb 227
aeb62c7b
JG
228Several files control GDB's configuration for host systems:
229
230@table @file
8cc1c08f
JG
231@item gdb/config/mh-@var{xxx}
232Specifies Makefile fragments needed when hosting on machine @var{xxx}.
233In particular, this lists the required machine-dependent object files,
234by defining @samp{XDEPFILES=@dots{}}. Also
235specifies the header file which describes host @var{xxx}, by defining
97f3cb72
RP
236@samp{XM_FILE= xm-@var{xxx}.h}. You can also define @samp{CC},
237@samp{REGEX} and @samp{REGEX1}, @samp{SYSV_DEFINE}, @samp{XM_CFLAGS},
aeb62c7b
JG
238@samp{XM_ADD_FILES}, @samp{XM_CLIBS}, @samp{XM_CDEPS},
239etc.; see @file{Makefile.in}.
240
241@item gdb/xm-@var{xxx}.h
242(@file{xm.h} is a link to this file, created by configure).
243Contains C macro definitions describing the host system environment,
244such as byte order, host C compiler and library, ptrace support,
245and core file structure. Crib from existing @file{xm-*.h} files
246to create a new one.
247
248@item gdb/@var{xxx}-xdep.c
249Contains any miscellaneous C code required for this machine
250as a host. On some machines it doesn't exist at all.
251@end table
46bc46eb 252
97f3cb72
RP
253There are some ``generic'' versions of routines that can be used by
254various host systems. These can be customized in various ways by macros
255defined in your @file{xm-@var{xxx}.h} file. If these routines work for
256the @var{xxx} host, you can just include the generic file's name (with
257@samp{.o}, not @samp{.c}) in @code{XDEPFILES}.
46bc46eb 258
97f3cb72
RP
259Otherwise, if your machine needs custom support routines, you will need
260to write routines that perform the same functions as the generic file.
261Put them into @code{@var{xxx}-xdep.c}, and put @code{@var{xxx}-xdep.o}
262into @code{XDEPFILES}.
46bc46eb 263
97f3cb72 264@subheading Generic Host Support Files
46bc46eb 265
aeb62c7b 266@table @file
46bc46eb 267
97f3cb72 268@item infptrace.c
aeb62c7b
JG
269This is the low level interface to inferior processes for systems
270using the Unix @code{ptrace} call in a vanilla way.
46bc46eb 271
aeb62c7b 272@item coredep.c::fetch_core_registers()
46bc46eb 273Support for reading registers out of a core file. This routine calls
aeb62c7b
JG
274@code{register_addr()}, see below.
275Now that BFD is used to read core files, virtually all machines should
276use @code{coredep.c}, and should just provide @code{fetch_core_registers} in
493cf018 277@code{@var{xxx}-xdep.c} (or @code{REGISTER_U_ADDR} in @code{xm-@var{xxx}.h}).
ca714d03 278
aeb62c7b 279@item coredep.c::register_addr()
97f3cb72 280If your @code{xm-@var{xxx}.h} file defines the macro
493cf018
JG
281@code{REGISTER_U_ADDR(addr, blockend, regno)}, it should be defined to
282set @code{addr} to the offset within the @samp{user}
283struct of GDB register number @code{regno}. @code{blockend} is the
284offset within the ``upage'' of @code{u.u_ar0}.
285If @code{REGISTER_U_ADDR} is defined,
d98259f8
RP
286@file{coredep.c} will define the @code{register_addr()} function and use
287the macro in it. If you do not define @code{REGISTER_U_ADDR}, but you
97f3cb72
RP
288are using the standard @code{fetch_core_registers()}, you will need to
289define your own version of @code{register_addr()}, put it into your
290@code{@var{xxx}-xdep.c} file, and be sure @code{@var{xxx}-xdep.o} is in
291the @code{XDEPFILES} list. If you have your own
292@code{fetch_core_registers()}, you may not need a separate
293@code{register_addr()}. Many custom @code{fetch_core_registers()}
294implementations simply locate the registers themselves.@refill
ca714d03 295@end table
46bc46eb 296
97f3cb72 297Object files needed when the target system is an @var{xxx} are listed
8cc1c08f 298in the file @file{config/mt-@var{xxx}}, in the makefile macro
97f3cb72
RP
299@samp{TDEPFILES = }@dots{}. The header file that defines the target
300system should be called @file{tm-@var{xxx}.h}, and should be specified
8cc1c08f 301as the value of @samp{TM_FILE} in @file{config/mt-@var{xxx}}. You can
97f3cb72
RP
302also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, and @samp{TM_CDEPS} in
303there; see @file{Makefile.in}.
1dbe1ef7 304
b7becc8f
RP
305Now, you are now ready to try configuring GDB to compile for your system.
306From the top level (above @file{bfd}, @file{gdb}, etc), do:
1dbe1ef7 307
7f09f15f 308@example
97f3cb72 309./configure @var{xxx} +target=vxworks960
7f09f15f 310@end example
1dbe1ef7
JG
311
312This will configure your system to cross-compile for VxWorks on
313the Intel 960, which is probably not what you really want, but it's
314a test case that works at this stage. (You haven't set up to be
97f3cb72 315able to debug programs that run @emph{on} @var{xxx} yet.)
1dbe1ef7
JG
316
317If this succeeds, you can try building it all with:
318
7f09f15f
JG
319@example
320make
321@end example
1dbe1ef7
JG
322
323Good luck! Comments and suggestions about this section are particularly
97f3cb72
RP
324welcome; send them to @samp{bug-gdb@@prep.ai.mit.edu}.
325
326When hosting GDB on a new operating system, to make it possible to debug
327core files, you will need to either write specific code for parsing your
328OS's core files, or customize @file{bfd/trad-core.c}. First, use
329whatever @code{#include} files your machine uses to define the struct of
330registers that is accessible (possibly in the u-area) in a core file
331(rather than @file{machine/reg.h}), and an include file that defines whatever
332header exists on a core file (e.g. the u-area or a @samp{struct core}). Then
333modify @code{trad_unix_core_file_p()} to use these values to set up the
334section information for the data segment, stack segment, any other
335segments in the core file (perhaps shared library contents or control
336information), ``registers'' segment, and if there are two discontiguous
337sets of registers (e.g. integer and float), the ``reg2'' segment. This
338section information basically delimits areas in the core file in a
339standard way, which the section-reading routines in BFD know how to seek
340around in.
341
b7becc8f
RP
342Then back in GDB, you need a matching routine called
343@code{fetch_core_registers()}. If you can use the generic one, it's in
344@file{core-dep.c}; if not, it's in your @file{@var{xxx}-xdep.c} file.
345It will be passed a char pointer to the entire ``registers'' segment,
346its length, and a zero; or a char pointer to the entire ``regs2''
347segment, its length, and a 2. The routine should suck out the supplied
348register values and install them into GDB's ``registers'' array.
349(@xref{New Architectures,,Defining a New Host or Target Architecture},
1dbe1ef7
JG
350for more info about this.)
351
97f3cb72 352
b517f124 353@node Target
7f09f15f 354@chapter Adding a New Target
d98259f8 355
97f3cb72
RP
356For a new target called @var{ttt}, first specify the configuration as
357described in @ref{Config,,Adding a New Configuration}. If your new
358target is the same as your new host, you've probably already done that.
359
8cc1c08f 360A variety of files specify attributes of the GDB target environment:
1dbe1ef7 361
aeb62c7b 362@table @file
8cc1c08f
JG
363@item gdb/config/mt-@var{ttt}
364Contains a Makefile fragment specific to this target.
aeb62c7b 365Specifies what object files are needed for target @var{ttt}, by
8cc1c08f 366defining @samp{TDEPFILES=@dots{}}.
aeb62c7b 367Also specifies the header file which describes @var{ttt}, by defining
8cc1c08f 368@samp{TM_FILE= tm-@var{ttt}.h}. You can also define @samp{TM_CFLAGS},
aeb62c7b
JG
369and other Makefile variables here; see @file{Makefile.in}.
370
371@item gdb/tm-@var{ttt}.h
372(@file{tm.h} is a link to this file, created by configure).
373Contains macro definitions about the target machine's
374registers, stack frame format and instructions.
375Crib from existing @file{tm-*.h} files when building a new one.
376
377@item gdb/@var{ttt}-tdep.c
378Contains any miscellaneous code required for this target machine.
379On some machines it doesn't exist at all. Sometimes the macros
380in @file{tm-@var{ttt}.h} become very complicated, so they are
381implemented as functions here instead, and the macro is simply
382defined to call the function.
383
384@item gdb/exec.c
385Defines functions for accessing files that are
97f3cb72
RP
386executable on the target system. These functions open and examine an
387exec file, extract data from one, write data to one, print information
388about one, etc. Now that executable files are handled with BFD, every
389target should be able to use the generic exec.c rather than its
390own custom code.
391
aeb62c7b
JG
392@item gdb/@var{arch}-pinsn.c
393Prints (disassembles) the target machine's instructions.
394This file is usually shared with other target machines which use the
395same processor, which is why it is @file{@var{arch}-pinsn.c} rather
396than @file{@var{ttt}-pinsn.c}.
397
398@item gdb/@var{arch}-opcode.h
399Contains some large initialized
400data structures describing the target machine's instructions.
401This is a bit strange for a @file{.h} file, but it's OK since
402it is only included in one place. @file{@var{arch}-opcode.h} is shared
403between the debugger and the assembler, if the GNU assembler has been
404ported to the target machine.
405
406@item gdb/tm-@var{arch}.h
407This often exists to describe the basic layout of the target machine's
408processor chip (registers, stack, etc).
409If used, it is included by @file{tm-@var{xxx}.h}. It can
410be shared among many targets that use the same processor.
411
412@item gdb/@var{arch}-tdep.c
413Similarly, there are often common subroutines that are shared by all
414target machines that use this particular architecture.
415@end table
416
417When adding support for a new target machine, there are various areas
418of support that might need change, or might be OK.
419
1dbe1ef7
JG
420If you are using an existing object file format (a.out or COFF),
421there is probably little to be done. See @file{bfd/doc/bfd.texinfo}
422for more information on writing new a.out or COFF versions.
423
424If you need to add a new object file format, you are beyond the scope
425of this document right now. Look at the structure of the a.out
97f3cb72 426and COFF support, build a transfer vector (@code{xvec}) for your new format,
aeb62c7b 427and start populating it with routines. Add it to the list in
1dbe1ef7
JG
428@file{bfd/targets.c}.
429
97f3cb72
RP
430If you are adding a new operating system for an existing CPU chip, add a
431@file{tm-@var{xos}.h} file that describes the operating system
432facilities that are unusual (extra symbol table info; the breakpoint
433instruction needed; etc). Then write a
434@file{tm-@var{xarch}-@var{xos}.h} that just @code{#include}s
435@file{tm-@var{xarch}.h} and @file{tm-@var{xos}.h}. (Now that we have
1dbe1ef7 436three-part configuration names, this will probably get revised to
97f3cb72
RP
437separate the @var{xos} configuration from the @var{xarch}
438configuration.)
439
440
b517f124 441@node Languages
97f3cb72
RP
442@chapter Adding a Source Language to GDB
443
444To add other languages to GDB's expression parser, follow the following steps:
445
446@table @emph
447@item Create the expression parser.
448
449This should reside in a file @file{@var{lang}-exp.y}. Routines for building
450parsed expressions into a @samp{union exp_element} list are in @file{parse.c}.
451
aeb62c7b
JG
452Since we can't depend upon everyone having Bison, and YACC produces
453parsers that define a bunch of global names, the following lines
454@emph{must} be included at the top of the YACC parser, to prevent
455the various parsers from defining the same global names:
d98259f8 456
d98259f8 457@example
97f3cb72 458#define yyparse @var{lang}_parse
aeb62c7b 459#define yylex @var{lang}_lex
97f3cb72
RP
460#define yyerror @var{lang}_error
461#define yylval @var{lang}_lval
462#define yychar @var{lang}_char
463#define yydebug @var{lang}_debug
464#define yypact @var{lang}_pact
465#define yyr1 @var{lang}_r1
466#define yyr2 @var{lang}_r2
467#define yydef @var{lang}_def
468#define yychk @var{lang}_chk
469#define yypgo @var{lang}_pgo
470#define yyact @var{lang}_act
471#define yyexca @var{lang}_exca
aeb62c7b
JG
472#define yyerrflag @var{lang}_errflag
473#define yynerrs @var{lang}_nerrs
d98259f8 474@end example
d98259f8 475
b7becc8f
RP
476At the bottom of your parser, define a @code{struct language_defn} and
477initialize it with the right values for your language. Define an
478@code{initialize_@var{lang}} routine and have it call
479@samp{add_language(@var{lang}_language_defn)} to tell the rest of GDB
480that your language exists. You'll need some other supporting variables
481and functions, which will be used via pointers from your
482@code{@var{lang}_language_defn}. See the declaration of @code{struct
483language_defn} in @file{language.h}, and the other @file{*-exp.y} files,
484for more information.
485
97f3cb72
RP
486@item Add any evaluation routines, if necessary
487
488If you need new opcodes (that represent the operations of the language),
489add them to the enumerated type in @file{expression.h}. Add support
490code for these operations in @code{eval.c:evaluate_subexp()}. Add cases
491for new opcodes in two functions from @file{parse.c}:
492@code{prefixify_subexp()} and @code{length_of_subexp()}. These compute
493the number of @code{exp_element}s that a given operation takes up.
494
495@item Update some existing code
496
497Add an enumerated identifier for your language to the enumerated type
498@code{enum language} in @file{defs.h}.
499
500Update the routines in @file{language.c} so your language is included. These
501routines include type predicates and such, which (in some cases) are
502language dependent. If your language does not appear in the switch
503statement, an error is reported.
504
505Also included in @file{language.c} is the code that updates the variable
506@code{current_language}, and the routines that translate the
507@code{language_@var{lang}} enumerated identifier into a printable
508string.
509
510Update the function @code{_initialize_language} to include your language. This
511function picks the default language upon startup, so is dependent upon
512which languages that GDB is built for.
513
b7becc8f
RP
514Update @code{allocate_symtab} in @file{symfile.c} and/or symbol-reading
515code so that the language of each symtab (source file) is set properly.
516This is used to determine the language to use at each stack frame level.
517Currently, the language is set based upon the extension of the source
518file. If the language can be better inferred from the symbol
519information, please set the language of the symtab in the symbol-reading
520code.
97f3cb72
RP
521
522Add helper code to @code{expprint.c:print_subexp()} to handle any new
523expression opcodes you have added to @file{expression.h}. Also, add the
524printed representations of your operators to @code{op_print_tab}.
525
526@item Add a place of call
527
528Add a call to @code{@var{lang}_parse()} and @code{@var{lang}_error} in
529@code{parse.c:parse_exp_1()}.
530
531@item Use macros to trim code
532
533The user has the option of building GDB for some or all of the
534languages. If the user decides to build GDB for the language
535@var{lang}, then every file dependent on @file{language.h} will have the
536macro @code{_LANG_@var{lang}} defined in it. Use @code{#ifdef}s to
537leave out large routines that the user won't need if he or she is not
538using your language.
539
540Note that you do not need to do this in your YACC parser, since if GDB
541is not build for @var{lang}, then @file{@var{lang}-exp.tab.o} (the
542compiled form of your parser) is not linked into GDB at all.
543
544See the file @file{configure.in} for how GDB is configured for different
545languages.
546
547@item Edit @file{Makefile.in}
548
549Add dependencies in @file{Makefile.in}. Make sure you update the macro
550variables such as @code{HFILES} and @code{OBJS}, otherwise your code may
551not get linked in, or, worse yet, it may not get @code{tar}red into the
552distribution!
553@end table
554
555
b517f124 556@node Releases
97f3cb72
RP
557@chapter Configuring GDB for Release
558
b7becc8f
RP
559From the top level directory (containing @file{gdb}, @file{bfd},
560@file{libiberty}, and so on):
561@example
ca25cb3b 562make -f Makefile.in gdb.tar.Z
b7becc8f 563@end example
97f3cb72 564
b7becc8f
RP
565This will properly configure, clean, rebuild any files that are
566distributed pre-built (e.g. @file{c-exp.tab.c} or @file{refcard.ps}),
ca25cb3b
JG
567and will then make a tarfile. (If the top level directory has already
568beenn configured, you can just do @code{make gdb.tar.Z} instead.)
b7becc8f
RP
569
570This procedure requires:
571@itemize @bullet
572@item symbolic links
573@item @code{makeinfo} (texinfo2 level)
574@item @TeX{}
575@item @code{dvips}
576@item @code{yacc} or @code{bison}
577@end itemize
578@noindent
579@dots{} and the usual slew of utilities (@code{sed}, @code{tar}, etc.).
97f3cb72
RP
580
581@subheading TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION
582
583@file{gdb.texinfo} is currently marked up using the texinfo-2 macros,
584which are not yet a default for anything (but we have to start using
585them sometime).
586
587For making paper, the only thing this implies is the right generation of
588@file{texinfo.tex} needs to be included in the distribution.
589
590For making info files, however, rather than duplicating the texinfo2
591distribution, generate @file{gdb-all.texinfo} locally, and include the files
592@file{gdb.info*} in the distribution. Note the plural; @code{makeinfo} will
593split the document into one overall file and five or so included files.
594
595
b517f124 596@node Partial Symbol Tables
493cf018
JG
597@chapter Partial Symbol Tables
598
599GDB has three types of symbol tables.
600
601@itemize @bullet
602@item full symbol tables (symtabs). These contain the main
603information about symbols and addresses.
604@item partial symbol tables (psymtabs). These contain enough
605information to know when to read the corresponding
606part of the full symbol table.
607@item minimal symbol tables (msymtabs). These contain information
608gleaned from non-debugging symbols.
609@end itemize
610
611This section describes partial symbol tables.
612
613A psymtab is constructed by doing a very quick pass over an executable
614file's debugging information. Small amounts of information are
615extracted -- enough to identify which parts of the symbol table will
616need to be re-read and fully digested later, when the user needs the
617information. The speed of this pass causes GDB to start up very
618quickly. Later, as the detailed rereading occurs, it occurs in small
619pieces, at various times, and the delay therefrom is mostly invisible to
620the user. (@xref{Symbol Reading}.)
621
622The symbols that show up in a file's psymtab should be, roughly, those
623visible to the debugger's user when the program is not running code from
624that file. These include external symbols and types, static
625symbols and types, and enum values declared at file scope.
626
627The psymtab also contains the range of instruction addresses that the
628full symbol table would represent.
629
630The idea is that there are only two ways for the user (or much of
631the code in the debugger) to reference a symbol:
632
633@itemize @bullet
634
635@item by its address
636(e.g. execution stops at some address which is inside a function
637in this file). The address will be noticed to be in the
638range of this psymtab, and the full symtab will be read in.
639@code{find_pc_function}, @code{find_pc_line}, and other @code{find_pc_@dots{}}
640functions handle this.
641
642@item by its name
643(e.g. the user asks to print a variable, or set a breakpoint on a
644function). Global names and file-scope names will be found in the
645psymtab, which will cause the symtab to be pulled in. Local names will
646have to be qualified by a global name, or a file-scope name, in which
647case we will have already read in the symtab as we evaluated the
648qualifier. Or, a local symbol can be referenced when
649we are "in" a local scope, in which case the first case applies.
650@code{lookup_symbol} does most of the work here.
651
652@end itemize
653
654The only reason that psymtabs exist is to cause a symtab to be read in
655at the right moment. Any symbol that can be elided from a psymtab,
656while still causing that to happen, should not appear in it. Since
657psymtabs don't have the idea of scope, you can't put local symbols in
658them anyway. Psymtabs don't have the idea of the type of a symbol,
659either, so types need not appear, unless they will be referenced by
660name.
661
662It is a bug for GDB to behave one way when only a psymtab has been read,
663and another way if the corresponding symtab has been read in. Such
664bugs are typically caused by a psymtab that does not contain all the
665visible symbols, or which has the wrong instruction address ranges.
666
667The psymtab for a particular section of a symbol-file (objfile)
668could be thrown away after the symtab has been read in. The symtab
669should always be searched before the psymtab, so the psymtab will
670never be used (in a bug-free environment). Currently,
671psymtabs are allocated on an obstack, and all the psymbols themselves
672are allocated in a pair of large arrays on an obstack, so there is
673little to be gained by trying to free them unless you want to do a lot
674more work.
675
b517f124 676@node BFD support for GDB
97f3cb72 677@chapter Binary File Descriptor Library Support for GDB
7f09f15f
JG
678
679BFD provides support for GDB in several ways:
680
681@table @emph
682@item identifying executable and core files
683BFD will identify a variety of file types, including a.out, coff, and
684several variants thereof, as well as several kinds of core files.
685
686@item access to sections of files
687BFD parses the file headers to determine the names, virtual addresses,
688sizes, and file locations of all the various named sections in files
689(such as the text section or the data section). GDB simply calls
690BFD to read or write section X at byte offset Y for length Z.
691
692@item specialized core file support
693BFD provides routines to determine the failing command name stored
694in a core file, the signal with which the program failed, and whether
695a core file matches (i.e. could be a core dump of) a particular executable
696file.
697
698@item locating the symbol information
699GDB uses an internal interface of BFD to determine where to find the
700symbol information in an executable file or symbol-file. GDB itself
701handles the reading of symbols, since BFD does not ``understand'' debug
702symbols, but GDB uses BFD's cached information to find the symbols,
703string table, etc.
704@end table
705
b7becc8f
RP
706@c The interface for symbol reading is described in @ref{Symbol
707@c Reading,,Symbol Reading}.
7f09f15f 708
7f09f15f 709
b517f124 710@node Symbol Reading
eb752e4e
JG
711@chapter Symbol Reading
712
713GDB reads symbols from "symbol files". The usual symbol file is the
714file containing the program which gdb is debugging. GDB can be directed
715to use a different file for symbols (with the ``symbol-file''
716command), and it can also read more symbols via the ``add-file'' and ``load''
717commands, or while reading symbols from shared libraries.
718
719Symbol files are initially opened by @file{symfile.c} using the BFD
720library. BFD identifies the type of the file by examining its header.
721@code{symfile_init} then uses this identification to locate a
722set of symbol-reading functions.
723
724Symbol reading modules identify themselves to GDB by calling
725@code{add_symtab_fns} during their module initialization. The argument
726to @code{add_symtab_fns} is a @code{struct sym_fns} which contains
727the name (or name prefix) of the symbol format, the length of the prefix,
728and pointers to four functions. These functions are called at various
729times to process symbol-files whose identification matches the specified
730prefix.
731
732The functions supplied by each module are:
733
734@table @code
97f3cb72 735@item @var{xxx}_symfile_init(struct sym_fns *sf)
eb752e4e
JG
736
737Called from @code{symbol_file_add} when we are about to read a new
738symbol file. This function should clean up any internal state
739(possibly resulting from half-read previous files, for example)
740and prepare to read a new symbol file. Note that the symbol file
741which we are reading might be a new "main" symbol file, or might
742be a secondary symbol file whose symbols are being added to the
743existing symbol table.
744
97f3cb72 745The argument to @code{@var{xxx}_symfile_init} is a newly allocated
eb752e4e
JG
746@code{struct sym_fns} whose @code{bfd} field contains the BFD
747for the new symbol file being read. Its @code{private} field
748has been zeroed, and can be modified as desired. Typically,
749a struct of private information will be @code{malloc}'d, and
750a pointer to it will be placed in the @code{private} field.
751
97f3cb72 752There is no result from @code{@var{xxx}_symfile_init}, but it can call
eb752e4e
JG
753@code{error} if it detects an unavoidable problem.
754
97f3cb72 755@item @var{xxx}_new_init()
eb752e4e
JG
756
757Called from @code{symbol_file_add} when discarding existing symbols.
758This function need only handle
759the symbol-reading module's internal state; the symbol table data
760structures visible to the rest of GDB will be discarded by
761@code{symbol_file_add}. It has no arguments and no result.
97f3cb72 762It may be called after @code{@var{xxx}_symfile_init}, if a new symbol
eb752e4e
JG
763table is being read, or may be called alone if all symbols are
764simply being discarded.
765
97f3cb72 766@item @var{xxx}_symfile_read(struct sym_fns *sf, CORE_ADDR addr, int mainline)
eb752e4e
JG
767
768Called from @code{symbol_file_add} to actually read the symbols from a
769symbol-file into a set of psymtabs or symtabs.
770
d98259f8 771@code{sf} points to the struct sym_fns originally passed to
97f3cb72 772@code{@var{xxx}_sym_init} for possible initialization. @code{addr} is the
d98259f8
RP
773offset between the file's specified start address and its true address
774in memory. @code{mainline} is 1 if this is the main symbol table being
775read, and 0 if a secondary symbol file (e.g. shared library or
776dynamically loaded file) is being read.@refill
eb752e4e
JG
777@end table
778
779In addition, if a symbol-reading module creates psymtabs when
97f3cb72
RP
780@var{xxx}_symfile_read is called, these psymtabs will contain a pointer to
781a function @code{@var{xxx}_psymtab_to_symtab}, which can be called from
eb752e4e
JG
782any point in the GDB symbol-handling code.
783
784@table @code
97f3cb72 785@item @var{xxx}_psymtab_to_symtab (struct partial_symtab *pst)
eb752e4e
JG
786
787Called from @code{psymtab_to_symtab} (or the PSYMTAB_TO_SYMTAB
788macro) if the psymtab has not already been read in and had its
789@code{pst->symtab} pointer set. The argument is the psymtab
790to be fleshed-out into a symtab. Upon return, pst->readin
791should have been set to 1, and pst->symtab should contain a
792pointer to the new corresponding symtab, or zero if there
793were no symbols in that part of the symbol file.
794@end table
795
7f09f15f 796
b517f124 797@node Cleanups
97f3cb72 798@chapter Cleanups
7f09f15f 799
97f3cb72
RP
800Cleanups are a structured way to deal with things that need to be done
801later. When your code does something (like @code{malloc} some memory, or open
802a file) that needs to be undone later (e.g. free the memory or close
803the file), it can make a cleanup. The cleanup will be done at some
804future point: when the command is finished, when an error occurs, or
805when your code decides it's time to do cleanups.
7f09f15f 806
97f3cb72
RP
807You can also discard cleanups, that is, throw them away without doing
808what they say. This is only done if you ask that it be done.
7f09f15f 809
97f3cb72 810Syntax:
7f09f15f 811
97f3cb72
RP
812@table @code
813@item @var{old_chain} = make_cleanup (@var{function}, @var{arg});
814Make a cleanup which will cause @var{function} to be called with @var{arg}
815(a @code{char *}) later. The result, @var{old_chain}, is a handle that can be
816passed to @code{do_cleanups} or @code{discard_cleanups} later. Unless you are
817going to call @code{do_cleanups} or @code{discard_cleanups} yourself,
818you can ignore the result from @code{make_cleanup}.
7f09f15f 819
7f09f15f 820
97f3cb72
RP
821@item do_cleanups (@var{old_chain});
822Perform all cleanups done since @code{make_cleanup} returned @var{old_chain}.
823E.g.:
824@example
825make_cleanup (a, 0);
826old = make_cleanup (b, 0);
827do_cleanups (old);
828@end example
829@noindent
830will call @code{b()} but will not call @code{a()}. The cleanup that calls @code{a()} will remain
831in the cleanup chain, and will be done later unless otherwise discarded.@refill
7f09f15f 832
97f3cb72
RP
833@item discard_cleanups (@var{old_chain});
834Same as @code{do_cleanups} except that it just removes the cleanups from the
835chain and does not call the specified functions.
7f09f15f 836
97f3cb72 837@end table
7f09f15f 838
97f3cb72
RP
839Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify that they
840``should not be called when cleanups are not in place''. This means
841that any actions you need to reverse in the case of an error or
842interruption must be on the cleanup chain before you call these functions,
843since they might never return to your code (they @samp{longjmp} instead).
7f09f15f 844
7f09f15f 845
b517f124 846@node Wrapping
97f3cb72 847@chapter Wrapping Output Lines
7f09f15f 848
97f3cb72
RP
849Output that goes through @code{printf_filtered} or @code{fputs_filtered} or
850@code{fputs_demangled} needs only to have calls to @code{wrap_here} added
851in places that would be good breaking points. The utility routines
852will take care of actually wrapping if the line width is exceeded.
7f09f15f 853
97f3cb72
RP
854The argument to @code{wrap_here} is an indentation string which is printed
855@emph{only} if the line breaks there. This argument is saved away and used
856later. It must remain valid until the next call to @code{wrap_here} or
857until a newline has been printed through the @code{*_filtered} functions.
858Don't pass in a local variable and then return!
7f09f15f 859
97f3cb72
RP
860It is usually best to call @code{wrap_here()} after printing a comma or space.
861If you call it before printing a space, make sure that your indentation
862properly accounts for the leading space that will print if the line wraps
863there.
7f09f15f 864
97f3cb72
RP
865Any function or set of functions that produce filtered output must finish
866by printing a newline, to flush the wrap buffer, before switching to
867unfiltered (``@code{printf}'') output. Symbol reading routines that print
868warnings are a good example.
7f09f15f 869
7f09f15f 870
b517f124 871@node Frames
edbf28ce
JG
872@chapter Frames
873
874A frame is a construct that GDB uses to keep track of calling and called
875functions.
876
8cc1c08f
JG
877@table @code
878@item FRAME_FP
879in the machine description has no meaning to the machine-independent
edbf28ce
JG
880part of GDB, except that it is used when setting up a new frame from
881scratch, as follows:
882
883@example
884 create_new_frame (read_register (FP_REGNUM), read_pc ()));
885@end example
886
8cc1c08f
JG
887Other than that, all the meaning imparted to @code{FP_REGNUM} is imparted by
888the machine-dependent code. So, @code{FP_REGNUM} can have any value that
889is convenient for the code that creates new frames. (@code{create_new_frame}
890calls @code{INIT_EXTRA_FRAME_INFO} if it is defined; that is where you should
891use the @code{FP_REGNUM} value, if your frames are nonstandard.)
892
893@item FRAME_CHAIN
894Given a GDB frame, determine the address of the calling function's
895frame. This will be used to create a new GDB frame struct, and then
896@code{INIT_EXTRA_FRAME_INFO} and @code{INIT_FRAME_PC} will be called for
897the new frame.
898@end table
edbf28ce 899
b517f124 900@node Coding Style
968720bf
RP
901@chapter Coding Style
902
903GDB is generally written using the GNU coding standards, as described in
904@file{standards.texi}, which you can get from the Free Software
905Foundation. There are some additional considerations for GDB maintainers
906that reflect the unique environment and style of GDB maintenance.
907If you follow these guidelines, GDB will be more consistent and easier
908to maintain.
909
910GDB's policy on the use of prototypes is that prototypes are used
911to @emph{declare} functions but never to @emph{define} them. Simple
912macros are used in the declarations, so that a non-ANSI compiler can
913compile GDB without trouble. The simple macro calls are used like
914this:
915
916@example @code
917extern int
918memory_remove_breakpoint PARAMS ((CORE_ADDR, char *));
919@end example
920
921Note the double parentheses around the parameter types. This allows
922an arbitrary number of parameters to be described, without freaking
923out the C preprocessor. When the function has no parameters, it
924should be described like:
925
926@example @code
927void
928noprocess PARAMS ((void));
929@end example
930
931The @code{PARAMS} macro expands to its argument in ANSI C, or to a simple
932@code{()} in traditional C.
933
934All external functions should have a @code{PARAMS} declaration in a
935header file that callers include. All static functions should have such
936a declaration near the top of their source file.
937
938We don't have a gcc option that will properly check that these rules
939have been followed, but it's GDB policy, and we periodically check it
940using the tools available (plus manual labor), and clean up any remnants.
941
b517f124 942@node Host Conditionals
493cf018
JG
943@chapter Host Conditionals
944
945When GDB is configured and compiled, various macros are defined or left
946undefined, to control compilation based on the attributes of the host
947system. These macros and their meanings are:
948
949@emph{NOTE: For now, both host and target conditionals are here.
950Eliminate target conditionals from this list as they are identified.}
951
952@table @code
953@item ALIGN_SIZE
954alloca.c
955@item BLOCK_ADDRESS_FUNCTION_RELATIVE
956dbxread.c
957@item GDBINIT_FILENAME
958main.c
959@item KERNELDEBUG
960tm-hppa.h
961@item MEM_FNS_DECLARED
962defs.h
963@item NO_SYS_FILE
964dbxread.c
493cf018
JG
965@item PYRAMID_CONTROL_FRAME_DEBUGGING
966pyr-xdep.c
967@item SIGWINCH_HANDLER_BODY
968utils.c
969@item 1
970buildsym.c
971@item 1
972dbxread.c
973@item 1
974dbxread.c
975@item 1
976buildsym.c
977@item 1
978dwarfread.c
979@item 1
980valops.c
981@item 1
982valops.c
983@item 1
984pyr-xdep.c
985@item ADDITIONAL_OPTIONS
986main.c
987@item ADDITIONAL_OPTION_CASES
988main.c
989@item ADDITIONAL_OPTION_HANDLER
990main.c
991@item ADDITIONAL_OPTION_HELP
992main.c
993@item ADDR_BITS_REMOVE
994defs.h
995@item AIX_BUGGY_PTRACE_CONTINUE
996infptrace.c
997@item ALIGN_STACK_ON_STARTUP
998main.c
999@item ALTOS
1000altos-xdep.c
1001@item ALTOS_AS
1002xm-altos.h
1003@item ASCII_COFF
1004remote-adapt.c
493cf018
JG
1005@item BADMAG
1006coffread.c
1007@item BCS
1008tm-delta88.h
1009@item BEFORE_MAIN_LOOP_HOOK
1010main.c
1011@item BELIEVE_PCC_PROMOTION
1012coffread.c
1013@item BELIEVE_PCC_PROMOTION_TYPE
1014stabsread.c
1015@item BIG_ENDIAN
1016defs.h
1017@item BITS_BIG_ENDIAN
1018defs.h
1019@item BKPT_AT_MAIN
1020solib.c
1021@item BLOCK_ADDRESS_ABSOLUTE
1022dbxread.c
1023@item BPT_VECTOR
1024tm-68k.h
1025@item BREAKPOINT
1026tm-68k.h
1027@item BREAKPOINT_DEBUG
1028breakpoint.c
1029@item BROKEN_LARGE_ALLOCA
968720bf
RP
1030Avoid large @code{alloca}'s. For example, on sun's, Large alloca's fail
1031because the attempt to increase the stack limit in main() fails because
1032shared libraries are allocated just below the initial stack limit. The
1033SunOS kernel will not allow the stack to grow into the area occupied by
1034the shared libraries.
493cf018
JG
1035@item BSTRING
1036regex.c
1037@item CALL_DUMMY
1038valops.c
1039@item CALL_DUMMY_LOCATION
1040inferior.h
1041@item CALL_DUMMY_STACK_ADJUST
1042valops.c
1043@item CANNOT_FETCH_REGISTER
1044hppabsd-xdep.c
1045@item CANNOT_STORE_REGISTER
1046findvar.c
1047@item CFRONT_PRODUCER
1048dwarfread.c
1049@item CHILD_PREPARE_TO_STORE
1050inftarg.c
1051@item CLEAR_DEFERRED_STORES
1052inflow.c
1053@item CLEAR_SOLIB
1054objfiles.c
1055@item COFF_ENCAPSULATE
1056hppabsd-tdep.c
1057@item COFF_FORMAT
1058symm-tdep.c
1059@item COFF_NO_LONG_FILE_NAMES
1060coffread.c
1061@item CORE_NEEDS_RELOCATION
1062stack.c
1063@item CPLUS_MARKER
1064cplus-dem.c
1065@item CREATE_INFERIOR_HOOK
1066infrun.c
1067@item C_ALLOCA
1068regex.c
1069@item C_GLBLREG
1070coffread.c
1071@item DAMON
1072xcoffexec.c
1073@item DBXREAD_ONLY
1074partial-stab.h
1075@item DBX_PARM_SYMBOL_CLASS
1076stabsread.c
1077@item DEBUG
1078remote-adapt.c
1079@item DEBUG_INFO
1080partial-stab.h
1081@item DEBUG_PTRACE
1082hppabsd-xdep.c
1083@item DECR_PC_AFTER_BREAK
1084breakpoint.c
1085@item DEFAULT_PROMPT
1086main.c
1087@item DELTA88
1088m88k-xdep.c
1089@item DEV_TTY
1090symmisc.c
1091@item DGUX
1092m88k-xdep.c
1093@item DISABLE_UNSETTABLE_BREAK
1094breakpoint.c
1095@item DONT_USE_REMOTE
1096remote.c
1097@item DO_DEFERRED_STORES
1098infrun.c
1099@item DO_REGISTERS_INFO
1100infcmd.c
1101@item END_OF_TEXT_DEFAULT
1102dbxread.c
1103@item EXTERN
1104buildsym.h
1105@item EXTRACT_RETURN_VALUE
1106tm-68k.h
1107@item EXTRACT_STRUCT_VALUE_ADDRESS
1108values.c
1109@item EXTRA_FRAME_INFO
1110frame.h
1111@item EXTRA_SYMTAB_INFO
1112symtab.h
493cf018
JG
1113@item FILES_INFO_HOOK
1114target.c
1115@item FIXME
1116coffread.c
1117@item FLOAT_INFO
1118infcmd.c
1119@item FOPEN_RB
1120defs.h
1121@item FP0_REGNUM
1122a68v-xdep.c
1123@item FPC_REGNUM
1124mach386-xdep.c
1125@item FP_REGNUM
1126parse.c
1127@item FRAMELESS_FUNCTION_INVOCATION
1128blockframe.c
1129@item FRAME_ARGS_ADDRESS_CORRECT
1130stack.c
1131@item FRAME_CHAIN_COMBINE
1132blockframe.c
1133@item FRAME_CHAIN_VALID
1134frame.h
1135@item FRAME_CHAIN_VALID_ALTERNATE
1136frame.h
1137@item FRAME_FIND_SAVED_REGS
1138stack.c
1139@item FRAME_GET_BASEREG_VALUE
1140frame.h
1141@item FRAME_NUM_ARGS
1142tm-68k.h
1143@item FRAME_SPECIFICATION_DYADIC
1144stack.c
1145@item FUNCTION_EPILOGUE_SIZE
1146coffread.c
1147@item F_OK
1148xm-ultra3.h
1149@item GCC2_COMPILED_FLAG_SYMBOL
1150dbxread.c
1151@item GCC_COMPILED_FLAG_SYMBOL
1152dbxread.c
1153@item GCC_MANGLE_BUG
1154symtab.c
1155@item GCC_PRODUCER
1156dwarfread.c
493cf018
JG
1157@item GET_SAVED_REGISTER
1158findvar.c
1159@item GPLUS_PRODUCER
1160dwarfread.c
1161@item GR64_REGNUM
1162remote-adapt.c
1163@item GR64_REGNUM
1164remote-mm.c
1165@item HANDLE_RBRAC
1166partial-stab.h
1167@item HAVE_68881
1168m68k-tdep.c
1169@item HAVE_MMAP
968720bf
RP
1170In some cases, use the system call @code{mmap} for reading symbol
1171tables. For some machines this allows for sharing and quick updates.
493cf018
JG
1172@item HAVE_REGISTER_WINDOWS
1173findvar.c
1174@item HAVE_SIGSETMASK
1175main.c
1176@item HAVE_TERMIO
1177inflow.c
1178@item HEADER_SEEK_FD
1179arm-tdep.c
1180@item HOSTING_ONLY
1181xm-rtbsd.h
1182@item HOST_BYTE_ORDER
1183ieee-float.c
1184@item HPUX_ASM
1185xm-hp300hpux.h
1186@item HPUX_VERSION_5
1187hp300ux-xdep.c
1188@item HP_OS_BUG
1189infrun.c
1190@item I80960
1191remote-vx.c
1192@item IBM6000_HOST
1193breakpoint.c
1194@item IBM6000_TARGET
1195buildsym.c
1196@item IEEE_DEBUG
1197ieee-float.c
1198@item IEEE_FLOAT
1199valprint.c
1200@item IGNORE_SYMBOL
1201dbxread.c
1202@item INIT_EXTRA_FRAME_INFO
1203blockframe.c
1204@item INIT_EXTRA_SYMTAB_INFO
1205symfile.c
1206@item INIT_FRAME_PC
1207blockframe.c
1208@item INNER_THAN
1209valops.c
1210@item INT_MAX
1211defs.h
1212@item INT_MIN
1213defs.h
1214@item IN_GDB
1215i960-pinsn.c
1216@item IN_SIGTRAMP
1217infrun.c
1218@item IN_SOLIB_TRAMPOLINE
1219infrun.c
1220@item ISATTY
1221main.c
1222@item IS_TRAPPED_INTERNALVAR
1223values.c
1224@item KERNELDEBUG
1225dbxread.c
1226@item KERNEL_DEBUGGING
1227tm-ultra3.h
1228@item KERNEL_U_ADDR
1229Define this to the address of the @code{u} structure (the ``user struct'',
1230also known as the ``u-page'') in kernel virtual memory. GDB needs to know
1231this so that it can subtract this address from absolute addresses in
1232the upage, that are obtained via ptrace or from core files. On systems
1233that don't need this value, set it to zero.
1234@item KERNEL_U_ADDR_BSD
1235Define this to cause GDB to determine the address of @code{u} at runtime,
1236by using Berkeley-style @code{nlist} on the kernel's image in the root
1237directory.
1238@item KERNEL_U_ADDR_HPUX
1239Define this to cause GDB to determine the address of @code{u} at runtime,
1240by using HP-style @code{nlist} on the kernel's image in the root
1241directory.
1242@item LCC_PRODUCER
1243dwarfread.c
1244@item LITTLE_ENDIAN
1245defs.h
1246@item LOG_FILE
1247remote-adapt.c
1248@item LONGERNAMES
1249cplus-dem.c
1250@item LONGEST
1251defs.h
1252@item LONG_LONG
1253defs.h
1254@item LONG_MAX
1255defs.h
1256@item LSEEK_NOT_LINEAR
1257source.c
1258@item L_LNNO32
1259coffread.c
1260@item L_SET
c3bbca3a
JG
1261This macro is used as the argument to lseek (or, most commonly, bfd_seek).
1262FIXME, it should be replaced by SEEK_SET instead, which is the POSIX equivalent.
493cf018
JG
1263@item MACHKERNELDEBUG
1264hppabsd-tdep.c
1265@item MAIN
1266cplus-dem.c
1267@item MAINTENANCE
1268dwarfread.c
1269@item MAINTENANCE_CMDS
1270breakpoint.c
1271@item MAINTENANCE_CMDS
1272maint.c
1273@item MALLOC_INCOMPATIBLE
968720bf
RP
1274Define this if the system's prototype for @code{malloc} differs from the
1275@sc{ANSI} definition.
493cf018
JG
1276@item MIPSEL
1277mips-tdep.c
1278@item MMAP_BASE_ADDRESS
968720bf
RP
1279When using HAVE_MMAP, the first mapping should go at this address.
1280@item MMAP_INCREMENT
1281when using HAVE_MMAP, this is the increment between mappings.
493cf018
JG
1282@item MONO
1283ser-go32.c
1284@item MOTOROLA
1285xm-altos.h
1286@item NAMES_HAVE_UNDERSCORE
1287coffread.c
1288@item NBPG
1289altos-xdep.c
1290@item NEED_POSIX_SETPGID
1291infrun.c
1292@item NEED_TEXT_START_END
1293exec.c
1294@item NFAILURES
1295regex.c
1296@item NNPC_REGNUM
1297infrun.c
1298@item NORETURN
1299defs.h
1300@item NOTDEF
1301regex.c
1302@item NOTDEF
1303remote-adapt.c
1304@item NOTDEF
1305remote-mm.c
1306@item NOTICE_SIGNAL_HANDLING_CHANGE
1307infrun.c
1308@item NO_DEFINE_SYMBOL
1309xcoffread.c
1310@item NO_HIF_SUPPORT
1311remote-mm.c
1312@item NO_JOB_CONTROL
1313signals.h
1314@item NO_MALLOC_CHECK
1315utils.c
1316@item NO_MMALLOC
1317utils.c
1318@item NO_MMALLOC
1319objfiles.c
1320@item NO_MMALLOC
1321utils.c
1322@item NO_SIGINTERRUPT
1323remote-adapt.c
1324@item NO_SINGLE_STEP
1325infptrace.c
1326@item NO_TYPEDEFS
1327xcoffread.c
1328@item NO_TYPEDEFS
1329xcoffread.c
1330@item NPC_REGNUM
1331infcmd.c
1332@item NS32K_SVC_IMMED_OPERANDS
1333ns32k-opcode.h
1334@item NUMERIC_REG_NAMES
1335mips-tdep.c
1336@item N_SETV
1337dbxread.c
1338@item N_SET_MAGIC
1339hppabsd-tdep.c
1340@item NaN
1341tm-umax.h
1342@item ONE_PROCESS_WRITETEXT
1343breakpoint.c
1344@item O_BINARY
1345exec.c
1346@item O_RDONLY
1347xm-ultra3.h
1348@item PC
1349convx-opcode.h
1350@item PCC_SOL_BROKEN
1351dbxread.c
1352@item PC_IN_CALL_DUMMY
1353inferior.h
1354@item PC_LOAD_SEGMENT
1355stack.c
1356@item PC_REGNUM
1357parse.c
1358@item PRINT_RANDOM_SIGNAL
1359infcmd.c
1360@item PRINT_REGISTER_HOOK
1361infcmd.c
1362@item PRINT_TYPELESS_INTEGER
1363valprint.c
1364@item PROCESS_LINENUMBER_HOOK
1365buildsym.c
1366@item PROLOGUE_FIRSTLINE_OVERLAP
1367infrun.c
1368@item PSIGNAL_IN_SIGNAL_H
1369defs.h
1370@item PS_REGNUM
1371parse.c
1372@item PTRACE_ARG3_TYPE
1373inferior.h
1374@item PTRACE_FP_BUG
1375mach386-xdep.c
1376@item PT_ATTACH
1377hppabsd-xdep.c
1378@item PT_DETACH
1379hppabsd-xdep.c
1380@item PT_KILL
1381infptrace.c
1382@item PUSH_ARGUMENTS
1383valops.c
1384@item PYRAMID_CONTROL_FRAME_DEBUGGING
1385pyr-xdep.c
1386@item PYRAMID_CORE
1387pyr-xdep.c
1388@item PYRAMID_PTRACE
1389pyr-xdep.c
1390@item REGISTER_BYTES
1391remote.c
1392@item REGISTER_NAMES
1393tm-29k.h
493cf018
JG
1394@item REG_STACK_SEGMENT
1395exec.c
1396@item REG_STRUCT_HAS_ADDR
1397findvar.c
1398@item RE_NREGS
1399regex.h
1400@item R_FP
1401dwarfread.c
1402@item R_OK
1403xm-altos.h
1404@item SDB_REG_TO_REGNUM
1405coffread.c
1406@item SEEK_END
1407state.c
1408@item SEEK_SET
1409state.c
1410@item SEM
1411coffread.c
1412@item SET_STACK_LIMIT_HUGE
968720bf
RP
1413When defined, stack limits will be raised to their maximum. Use this
1414if your host supports @code{setrlimit} and you have trouble with
1415@code{stringtab} in @file{dbxread.c}.
1416
1417Also used in @file{fork-child.c} to return stack limits before child
1418processes are forked.
493cf018
JG
1419@item SHELL_COMMAND_CONCAT
1420infrun.c
1421@item SHELL_FILE
1422infrun.c
1423@item SHIFT_INST_REGS
1424breakpoint.c
1425@item SIGN_EXTEND_CHAR
1426regex.c
1427@item SIGTRAP_STOP_AFTER_LOAD
1428infrun.c
1429@item SKIP_PROLOGUE
1430tm-68k.h
1431@item SKIP_PROLOGUE_FRAMELESS_P
1432blockframe.c
1433@item SKIP_TRAMPOLINE_CODE
1434infrun.c
1435@item SOLIB_ADD
1436core.c
1437@item SOLIB_CREATE_INFERIOR_HOOK
1438infrun.c
1439@item SOME_NAMES_HAVE_DOT
1440minsyms.c
1441@item SP_REGNUM
1442parse.c
1443@item STAB_REG_TO_REGNUM
1444stabsread.h
1445@item STACK_ALIGN
1446valops.c
1447@item STACK_DIRECTION
1448alloca.c
1449@item START_INFERIOR_TRAPS_EXPECTED
1450infrun.c
1451@item STOP_SIGNAL
1452main.c
1453@item STORE_RETURN_VALUE
1454tm-68k.h
1455@item SUN4_COMPILER_FEATURE
1456infrun.c
1457@item SUN_FIXED_LBRAC_BUG
1458dbxread.c
1459@item SVR4_SHARED_LIBS
1460solib.c
1461@item SWITCH_ENUM_BUG
1462regex.c
1463@item SYM1
1464tm-ultra3.h
1465@item SYMBOL_RELOADING_DEFAULT
1466symfile.c
1467@item SYNTAX_TABLE
1468regex.c
1469@item Sword
1470regex.c
1471@item TDESC
1472infrun.c
1473@item TIOCGETC
1474inflow.c
1475@item TIOCGLTC
1476inflow.c
1477@item TIOCGPGRP
1478inflow.c
1479@item TIOCLGET
1480inflow.c
1481@item TIOCLSET
1482inflow.c
1483@item TIOCNOTTY
1484inflow.c
1485@item TM_FILE_OVERRIDE
1486defs.h
1487@item T_ARG
1488coffread.c
1489@item T_VOID
1490coffread.c
1491@item UINT_MAX
1492defs.h
1493@item UPAGES
1494altos-xdep.c
1495@item USER
1496m88k-tdep.c
1497@item USE_GAS
1498xm-news.h
1499@item USE_O_NOCTTY
1500inflow.c
493cf018
JG
1501@item USE_STRUCT_CONVENTION
1502values.c
1503@item USG
1504Means that System V (prior to SVR4) include files are in use.
1505(FIXME: This symbol is abused in @file{infrun.c}, @file{regex.c},
1506@file{remote-nindy.c}, and @file{utils.c} for other things, at the moment.)
1507@item USIZE
1508xm-m88k.h
1509@item U_FPSTATE
1510i386-xdep.c
493cf018
JG
1511@item VARIABLES_INSIDE_BLOCK
1512dbxread.c
1513@item WRS_ORIG
1514remote-vx.c
1515@item _LANG_c
1516language.c
1517@item _LANG_m2
1518language.c
1519@item __GNUC__
1520news-xdep.c
1521@item __GO32__
1522inflow.c
1523@item __HAVE_68881__
1524m68k-stub.c
1525@item __HPUX_ASM__
1526xm-hp300hpux.h
1527@item __INT_VARARGS_H
1528printcmd.c
1529@item __not_on_pyr_yet
1530pyr-xdep.c
1531@item alloca
1532defs.h
1533@item const
1534defs.h
1535@item GOULD_PN
1536gould-pinsn.c
1537@item emacs
1538alloca.c
1539@item hp800
1540xm-hppabsd.h
493cf018
JG
1541@item hpux
1542hppabsd-core.c
1543@item lint
1544valarith.c
1545@item longest_to_int
1546defs.h
1547@item mc68020
1548m68k-stub.c
1549@item notdef
1550gould-pinsn.c
1551@item ns32k_opcodeT
1552ns32k-opcode.h
1553@item sgi
1554mips-tdep.c
1555@item sparc
1556regex.c
1557@item static
1558alloca.c
1559@item sun
1560m68k-tdep.c
1561@item sun386
1562tm-sun386.h
1563@item test
1564regex.c
1565@item ultrix
1566xm-mips.h
1567@item volatile
1568defs.h
1569@item x_name
1570coffread.c
1571@item x_zeroes
1572coffread.c
1573@end table
1574
b517f124 1575@node Target Conditionals
493cf018
JG
1576@chapter Target Conditionals
1577
1578When GDB is configured and compiled, various macros are defined or left
1579undefined, to control compilation based on the attributes of the target
1580system. These macros and their meanings are:
1581
1582@emph{NOTE: For now, both host and target conditionals are here.
1583Eliminate host conditionals from this list as they are identified.}
1584
1585@table @code
ca048722
RP
1586@item PUSH_DUMMY_FRAME
1587Used in @samp{call_function_by_hand} to create an artificial stack frame.
1588@item POP_FRAME
1589Used in @samp{call_function_by_hand} to remove an artificial stack frame.
493cf018
JG
1590@item ALIGN_SIZE
1591alloca.c
1592@item BLOCK_ADDRESS_FUNCTION_RELATIVE
1593dbxread.c
1594@item GDBINIT_FILENAME
1595main.c
1596@item KERNELDEBUG
1597tm-hppa.h
1598@item MEM_FNS_DECLARED
1599defs.h
1600@item NO_SYS_FILE
1601dbxread.c
493cf018
JG
1602@item PYRAMID_CONTROL_FRAME_DEBUGGING
1603pyr-xdep.c
1604@item SIGWINCH_HANDLER_BODY
1605utils.c
1606@item ADDITIONAL_OPTIONS
1607main.c
1608@item ADDITIONAL_OPTION_CASES
1609main.c
1610@item ADDITIONAL_OPTION_HANDLER
1611main.c
1612@item ADDITIONAL_OPTION_HELP
1613main.c
1614@item ADDR_BITS_REMOVE
1615defs.h
1616@item ALIGN_STACK_ON_STARTUP
1617main.c
1618@item ALTOS
1619altos-xdep.c
1620@item ALTOS_AS
1621xm-altos.h
1622@item ASCII_COFF
1623remote-adapt.c
493cf018
JG
1624@item BADMAG
1625coffread.c
1626@item BCS
1627tm-delta88.h
1628@item BEFORE_MAIN_LOOP_HOOK
1629main.c
1630@item BELIEVE_PCC_PROMOTION
1631coffread.c
1632@item BELIEVE_PCC_PROMOTION_TYPE
1633stabsread.c
1634@item BIG_ENDIAN
1635defs.h
1636@item BITS_BIG_ENDIAN
1637defs.h
1638@item BKPT_AT_MAIN
1639solib.c
1640@item BLOCK_ADDRESS_ABSOLUTE
1641dbxread.c
1642@item BPT_VECTOR
1643tm-68k.h
1644@item BREAKPOINT
1645tm-68k.h
1646@item BREAKPOINT_DEBUG
1647breakpoint.c
493cf018
JG
1648@item BSTRING
1649regex.c
1650@item CALL_DUMMY
1651valops.c
1652@item CALL_DUMMY_LOCATION
1653inferior.h
1654@item CALL_DUMMY_STACK_ADJUST
1655valops.c
1656@item CANNOT_FETCH_REGISTER
1657hppabsd-xdep.c
1658@item CANNOT_STORE_REGISTER
1659findvar.c
1660@item CFRONT_PRODUCER
1661dwarfread.c
1662@item CHILD_PREPARE_TO_STORE
1663inftarg.c
1664@item CLEAR_DEFERRED_STORES
1665inflow.c
1666@item CLEAR_SOLIB
1667objfiles.c
1668@item COFF_ENCAPSULATE
1669hppabsd-tdep.c
1670@item COFF_FORMAT
1671symm-tdep.c
1672@item COFF_NO_LONG_FILE_NAMES
1673coffread.c
1674@item CORE_NEEDS_RELOCATION
1675stack.c
1676@item CPLUS_MARKER
1677cplus-dem.c
1678@item CREATE_INFERIOR_HOOK
1679infrun.c
1680@item C_ALLOCA
1681regex.c
1682@item C_GLBLREG
1683coffread.c
1684@item DAMON
1685xcoffexec.c
1686@item DBXREAD_ONLY
1687partial-stab.h
1688@item DBX_PARM_SYMBOL_CLASS
1689stabsread.c
1690@item DEBUG
1691remote-adapt.c
1692@item DEBUG_INFO
1693partial-stab.h
1694@item DEBUG_PTRACE
1695hppabsd-xdep.c
1696@item DECR_PC_AFTER_BREAK
1697breakpoint.c
1698@item DEFAULT_PROMPT
1699main.c
1700@item DELTA88
1701m88k-xdep.c
1702@item DEV_TTY
1703symmisc.c
1704@item DGUX
1705m88k-xdep.c
1706@item DISABLE_UNSETTABLE_BREAK
1707breakpoint.c
1708@item DONT_USE_REMOTE
1709remote.c
1710@item DO_DEFERRED_STORES
1711infrun.c
1712@item DO_REGISTERS_INFO
1713infcmd.c
1714@item END_OF_TEXT_DEFAULT
1715dbxread.c
1716@item EXTERN
1717buildsym.h
1718@item EXTRACT_RETURN_VALUE
1719tm-68k.h
1720@item EXTRACT_STRUCT_VALUE_ADDRESS
1721values.c
1722@item EXTRA_FRAME_INFO
1723frame.h
1724@item EXTRA_SYMTAB_INFO
1725symtab.h
1726@item FILES_INFO_HOOK
1727target.c
1728@item FIXME
1729coffread.c
1730@item FLOAT_INFO
1731infcmd.c
1732@item FOPEN_RB
1733defs.h
1734@item FP0_REGNUM
1735a68v-xdep.c
1736@item FPC_REGNUM
1737mach386-xdep.c
1738@item FP_REGNUM
1739parse.c
968720bf 1740@item FPU
1b87a1b2 1741Unused? 6-oct-92 rich@@cygnus.com. FIXME.
493cf018
JG
1742@item FRAMELESS_FUNCTION_INVOCATION
1743blockframe.c
1744@item FRAME_ARGS_ADDRESS_CORRECT
1745stack.c
1746@item FRAME_CHAIN_COMBINE
1747blockframe.c
1748@item FRAME_CHAIN_VALID
1749frame.h
1750@item FRAME_CHAIN_VALID_ALTERNATE
1751frame.h
1752@item FRAME_FIND_SAVED_REGS
1753stack.c
1754@item FRAME_GET_BASEREG_VALUE
1755frame.h
1756@item FRAME_NUM_ARGS
1757tm-68k.h
1758@item FRAME_SPECIFICATION_DYADIC
1759stack.c
1760@item FUNCTION_EPILOGUE_SIZE
1761coffread.c
1762@item F_OK
1763xm-ultra3.h
1764@item GCC2_COMPILED_FLAG_SYMBOL
1765dbxread.c
1766@item GCC_COMPILED_FLAG_SYMBOL
1767dbxread.c
1768@item GCC_MANGLE_BUG
1769symtab.c
1770@item GCC_PRODUCER
1771dwarfread.c
968720bf
RP
1772@item GDB_TARGET_IS_HPPA
1773This determines whether horrible kludge code in dbxread.c and partial-stab.h
1774is used to mangle multiple-symbol-table files from HPPA's. This should all
1775be ripped out, and a scheme like elfread.c used.
493cf018
JG
1776@item GDB_TARGET_IS_MACH386
1777mach386-xdep.c
1778@item GDB_TARGET_IS_SUN3
1779a68v-xdep.c
1780@item GDB_TARGET_IS_SUN386
1781sun386-xdep.c
1782@item GET_LONGJMP_TARGET
c3bbca3a
JG
1783For most machines, this is a target-dependent parameter. On the DECstation
1784and the Iris, this is a native-dependent parameter, since <setjmp.h> is
1785needed to define it.
1786
1787This macro determines the target PC address that longjmp() will jump
1788to, assuming that we have just stopped at a longjmp breakpoint. It
1789takes a CORE_ADDR * as argument, and stores the target PC value through
1790this pointer. It examines the current state of the machine as needed.
493cf018
JG
1791@item GET_SAVED_REGISTER
1792findvar.c
1793@item GPLUS_PRODUCER
1794dwarfread.c
1795@item GR64_REGNUM
1796remote-adapt.c
1797@item GR64_REGNUM
1798remote-mm.c
1799@item HANDLE_RBRAC
1800partial-stab.h
1801@item HAVE_68881
1802m68k-tdep.c
493cf018
JG
1803@item HAVE_REGISTER_WINDOWS
1804findvar.c
1805@item HAVE_SIGSETMASK
1806main.c
1807@item HAVE_TERMIO
1808inflow.c
1809@item HEADER_SEEK_FD
1810arm-tdep.c
1811@item HOSTING_ONLY
1812xm-rtbsd.h
1813@item HOST_BYTE_ORDER
1814ieee-float.c
1815@item HPUX_ASM
1816xm-hp300hpux.h
1817@item HPUX_VERSION_5
1818hp300ux-xdep.c
1819@item HP_OS_BUG
1820infrun.c
1821@item I80960
1822remote-vx.c
1823@item IBM6000_HOST
1824breakpoint.c
1825@item IBM6000_TARGET
1826buildsym.c
1827@item IEEE_DEBUG
1828ieee-float.c
1829@item IEEE_FLOAT
1830valprint.c
1831@item IGNORE_SYMBOL
1832dbxread.c
1833@item INIT_EXTRA_FRAME_INFO
1834blockframe.c
1835@item INIT_EXTRA_SYMTAB_INFO
1836symfile.c
1837@item INIT_FRAME_PC
1838blockframe.c
1839@item INNER_THAN
1840valops.c
1841@item INT_MAX
1842defs.h
1843@item INT_MIN
1844defs.h
1845@item IN_GDB
1846i960-pinsn.c
1847@item IN_SIGTRAMP
1848infrun.c
1849@item IN_SOLIB_TRAMPOLINE
1850infrun.c
1851@item ISATTY
1852main.c
1853@item IS_TRAPPED_INTERNALVAR
1854values.c
1855@item KERNELDEBUG
1856dbxread.c
1857@item KERNEL_DEBUGGING
1858tm-ultra3.h
1859@item LCC_PRODUCER
1860dwarfread.c
1861@item LITTLE_ENDIAN
1862defs.h
1863@item LOG_FILE
1864remote-adapt.c
1865@item LONGERNAMES
1866cplus-dem.c
1867@item LONGEST
1868defs.h
1869@item LONG_LONG
1870defs.h
1871@item LONG_MAX
1872defs.h
493cf018
JG
1873@item L_LNNO32
1874coffread.c
493cf018
JG
1875@item MACHKERNELDEBUG
1876hppabsd-tdep.c
1877@item MAIN
1878cplus-dem.c
1879@item MAINTENANCE
1880dwarfread.c
1881@item MAINTENANCE_CMDS
1882breakpoint.c
1883@item MAINTENANCE_CMDS
1884maint.c
1885@item MIPSEL
1886mips-tdep.c
493cf018
JG
1887@item MOTOROLA
1888xm-altos.h
1889@item NAMES_HAVE_UNDERSCORE
1890coffread.c
1891@item NBPG
1892altos-xdep.c
1893@item NEED_POSIX_SETPGID
1894infrun.c
1895@item NEED_TEXT_START_END
1896exec.c
1897@item NFAILURES
1898regex.c
1899@item NNPC_REGNUM
1900infrun.c
1901@item NORETURN
1902defs.h
1903@item NOTDEF
1904regex.c
1905@item NOTDEF
1906remote-adapt.c
1907@item NOTDEF
1908remote-mm.c
1909@item NOTICE_SIGNAL_HANDLING_CHANGE
1910infrun.c
1911@item NO_DEFINE_SYMBOL
1912xcoffread.c
1913@item NO_HIF_SUPPORT
1914remote-mm.c
1915@item NO_JOB_CONTROL
1916signals.h
1917@item NO_MALLOC_CHECK
1918utils.c
1919@item NO_MMALLOC
1920utils.c
1921@item NO_MMALLOC
1922objfiles.c
1923@item NO_MMALLOC
1924utils.c
1925@item NO_SIGINTERRUPT
1926remote-adapt.c
1927@item NO_SINGLE_STEP
1928infptrace.c
1929@item NO_TYPEDEFS
1930xcoffread.c
1931@item NO_TYPEDEFS
1932xcoffread.c
1933@item NPC_REGNUM
1934infcmd.c
1935@item NS32K_SVC_IMMED_OPERANDS
1936ns32k-opcode.h
1937@item NUMERIC_REG_NAMES
1938mips-tdep.c
1939@item N_SETV
1940dbxread.c
1941@item N_SET_MAGIC
1942hppabsd-tdep.c
1943@item NaN
1944tm-umax.h
1945@item ONE_PROCESS_WRITETEXT
1946breakpoint.c
1947@item PC
1948convx-opcode.h
1949@item PCC_SOL_BROKEN
1950dbxread.c
1951@item PC_IN_CALL_DUMMY
1952inferior.h
1953@item PC_LOAD_SEGMENT
1954stack.c
1955@item PC_REGNUM
1956parse.c
1957@item PRINT_RANDOM_SIGNAL
1958infcmd.c
1959@item PRINT_REGISTER_HOOK
1960infcmd.c
1961@item PRINT_TYPELESS_INTEGER
1962valprint.c
1963@item PROCESS_LINENUMBER_HOOK
1964buildsym.c
1965@item PROLOGUE_FIRSTLINE_OVERLAP
1966infrun.c
1967@item PSIGNAL_IN_SIGNAL_H
1968defs.h
1969@item PS_REGNUM
1970parse.c
1971@item PTRACE_ARG3_TYPE
1972inferior.h
1973@item PTRACE_FP_BUG
1974mach386-xdep.c
1975@item PUSH_ARGUMENTS
1976valops.c
1977@item REGISTER_BYTES
1978remote.c
1979@item REGISTER_NAMES
1980tm-29k.h
1981@item REG_STACK_SEGMENT
1982exec.c
1983@item REG_STRUCT_HAS_ADDR
1984findvar.c
1985@item RE_NREGS
1986regex.h
1987@item R_FP
1988dwarfread.c
1989@item R_OK
1990xm-altos.h
1991@item SDB_REG_TO_REGNUM
1992coffread.c
1993@item SEEK_END
1994state.c
1995@item SEEK_SET
1996state.c
1997@item SEM
1998coffread.c
1999@item SET_STACK_LIMIT_HUGE
2000infrun.c
2001@item SHELL_COMMAND_CONCAT
2002infrun.c
2003@item SHELL_FILE
2004infrun.c
2005@item SHIFT_INST_REGS
2006breakpoint.c
2007@item SIGN_EXTEND_CHAR
2008regex.c
2009@item SIGTRAP_STOP_AFTER_LOAD
2010infrun.c
2011@item SKIP_PROLOGUE
2012tm-68k.h
2013@item SKIP_PROLOGUE_FRAMELESS_P
2014blockframe.c
2015@item SKIP_TRAMPOLINE_CODE
2016infrun.c
2017@item SOLIB_ADD
2018core.c
2019@item SOLIB_CREATE_INFERIOR_HOOK
2020infrun.c
2021@item SOME_NAMES_HAVE_DOT
2022minsyms.c
2023@item SP_REGNUM
2024parse.c
2025@item STAB_REG_TO_REGNUM
2026stabsread.h
2027@item STACK_ALIGN
2028valops.c
2029@item STACK_DIRECTION
2030alloca.c
2031@item START_INFERIOR_TRAPS_EXPECTED
2032infrun.c
2033@item STOP_SIGNAL
2034main.c
2035@item STORE_RETURN_VALUE
2036tm-68k.h
2037@item SUN4_COMPILER_FEATURE
2038infrun.c
2039@item SUN_FIXED_LBRAC_BUG
2040dbxread.c
2041@item SVR4_SHARED_LIBS
2042solib.c
2043@item SWITCH_ENUM_BUG
2044regex.c
2045@item SYM1
2046tm-ultra3.h
2047@item SYMBOL_RELOADING_DEFAULT
2048symfile.c
2049@item SYNTAX_TABLE
2050regex.c
2051@item Sword
2052regex.c
2053@item TARGET_BYTE_ORDER
2054defs.h
2055@item TARGET_CHAR_BIT
2056defs.h
2057@item TARGET_COMPLEX_BIT
2058defs.h
2059@item TARGET_DOUBLE_BIT
2060defs.h
2061@item TARGET_DOUBLE_COMPLEX_BIT
2062defs.h
2063@item TARGET_FLOAT_BIT
2064defs.h
2065@item TARGET_INT_BIT
2066defs.h
2067@item TARGET_LONG_BIT
2068defs.h
2069@item TARGET_LONG_DOUBLE_BIT
2070defs.h
2071@item TARGET_LONG_LONG_BIT
2072defs.h
2073@item TARGET_PTR_BIT
2074defs.h
2075@item TARGET_SHORT_BIT
2076defs.h
2077@item TDESC
2078infrun.c
2079@item TM_FILE_OVERRIDE
2080defs.h
2081@item T_ARG
2082coffread.c
2083@item T_VOID
2084coffread.c
2085@item UINT_MAX
2086defs.h
2087@item USER
2088m88k-tdep.c
2089@item USE_GAS
2090xm-news.h
2091@item USE_STRUCT_CONVENTION
2092values.c
2093@item USIZE
2094xm-m88k.h
2095@item U_FPSTATE
2096i386-xdep.c
2097@item VARIABLES_INSIDE_BLOCK
2098dbxread.c
2099@item WRS_ORIG
2100remote-vx.c
2101@item _LANG_c
2102language.c
2103@item _LANG_m2
2104language.c
2105@item __GO32__
2106inflow.c
2107@item __HAVE_68881__
2108m68k-stub.c
2109@item __HPUX_ASM__
2110xm-hp300hpux.h
2111@item __INT_VARARGS_H
2112printcmd.c
2113@item __not_on_pyr_yet
2114pyr-xdep.c
2115@item GOULD_PN
2116gould-pinsn.c
2117@item emacs
2118alloca.c
2119@item hp800
2120xm-hppabsd.h
493cf018
JG
2121@item hpux
2122hppabsd-core.c
2123@item longest_to_int
2124defs.h
2125@item mc68020
2126m68k-stub.c
2127@item ns32k_opcodeT
2128ns32k-opcode.h
2129@item sgi
2130mips-tdep.c
2131@item sparc
2132regex.c
2133@item static
2134alloca.c
2135@item sun
2136m68k-tdep.c
2137@item sun386
2138tm-sun386.h
2139@item test
2140regex.c
2141@item x_name
2142coffread.c
2143@item x_zeroes
2144coffread.c
2145@end table
2146
b517f124 2147@node Native Conditionals
968720bf
RP
2148@chapter Native Conditionals
2149
b517f124
JG
2150When GDB is configured and compiled, various macros are defined or left
2151undefined, to control compilation when the host and target systems
2152are the same. These macros should be defined (or left undefined)
2153in @file{nm-@var{system}.h}.
968720bf 2154
1b87a1b2 2155@table @code
968720bf
RP
2156@item ATTACH_DETACH
2157If defined, then gdb will include support for the @code{attach} and
2158@code{detach} commands.
968720bf
RP
2159@item FETCH_INFERIOR_REGISTERS
2160Define this if the native-dependent code will provide its
2161own routines
2162@code{fetch_inferior_registers} and @code{store_inferior_registers} in
2163@file{@var{HOST}-nat.c}.
2164If this symbol is @emph{not} defined, the default routines in
2165@file{infptrace.c} are used for these functions.
c3bbca3a
JG
2166@item GET_LONGJMP_TARGET
2167For most machines, this is a target-dependent parameter. On the DECstation
2168and the Iris, this is a native-dependent parameter, since <setjmp.h> is
2169needed to define it.
2170
2171This macro determines the target PC address that longjmp() will jump
2172to, assuming that we have just stopped at a longjmp breakpoint. It
2173takes a CORE_ADDR * as argument, and stores the target PC value through
2174this pointer. It examines the current state of the machine as needed.
968720bf
RP
2175@item PROC_NAME_FMT
2176Defines the format for the name of a @file{/proc} device. Should be
2177defined in @file{nm.h} @emph{only} in order to override the default
2178definition in @file{procfs.c}.
2179@item REGISTER_U_ADDR
2180Defines the offset of the registers in the ``u area''; @pxref{Host}.
2181@item USE_PROC_FS
2182This determines whether small routines that translate register values
2183to GDB's internal representation (from the /proc representation), and vice
2184verse, are compiled.
2185@item U_REGS_OFFSET
2186This is the offset of the registers in the upage. It need only be
2187defined if the generic ptrace register access routines in
2188@file{infptrace.c} are being used (that is,
2189@code{FETCH_INFERIOR_REGISTERS} is not defined). If the default value
2190from @file{infptrace.c} is good enough, leave it undefined.
2191
2192The default value means that u.u_ar0 @emph{points to} the location of the
2193registers. I'm guessing that @code{#define U_REGS_OFFSET 0} means that
2194u.u_ar0 @emph{is} the location of the registers.
2195@end table
2196
b517f124
JG
2197@node Obsolete Conditionals
2198@chapter Obsolete Conditionals
2199
2200Fragments of old code in GDB sometimes reference or set the following
2201configuration macros. They should not be used by new code, and
2202old uses should be removed as those parts of the debugger are
2203otherwise touched.
2204
2205@table @code
2206@item STACK_END_ADDR
2207This macro used to define where the end of the stack appeared, for use
2208in interpreting core file formats that don't record this address in the
2209core file itself. This information is now configured in BFD, and GDB
2210gets the info portably from there. The values in GDB's configuration
2211files should be moved into BFD configuration files (if needed there),
2212and deleted from all of GDB's config files.
2213
2214Any @file{@var{foo}-xdep.c} file that references STACK_END_ADDR
2215is so old that it has never been converted to use BFD. Now that's old!
2216@end table
ca714d03
RP
2217@contents
2218@bye