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