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