diff options
-rw-r--r-- | gdb/doc/Makefile.in | 241 | ||||
-rw-r--r-- | gdb/doc/all.m4 | 22 | ||||
-rw-r--r-- | gdb/doc/amd29k.m4 | 5 | ||||
-rw-r--r-- | gdb/doc/configure.in | 13 | ||||
-rw-r--r-- | gdb/doc/gdb-config.texi | 101 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 2693 | ||||
-rw-r--r-- | gdb/doc/gdbinv-m.m4.in | 25 | ||||
-rw-r--r-- | gdb/doc/gdbinv-s.m4.in | 989 | ||||
-rw-r--r-- | gdb/doc/gdbinv-s.texi | 985 | ||||
-rw-r--r-- | gdb/doc/gen.m4 | 13 | ||||
-rw-r--r-- | gdb/doc/h8-config.texi | 17 | ||||
-rw-r--r-- | gdb/doc/h8.m4 | 16 | ||||
-rw-r--r-- | gdb/doc/i80386.m4 | 5 | ||||
-rw-r--r-- | gdb/doc/i960.m4 | 12 | ||||
-rw-r--r-- | gdb/doc/lucid.m4 | 20 | ||||
-rw-r--r-- | gdb/doc/m680x0.m4 | 5 | ||||
-rw-r--r-- | gdb/doc/none.m4 | 70 | ||||
-rw-r--r-- | gdb/doc/pretex.m4 | 268 | ||||
-rw-r--r-- | gdb/doc/sparc.m4 | 5 | ||||
-rw-r--r-- | gdb/doc/vax.m4 | 5 | ||||
-rw-r--r-- | gdb/doc/z8000.m4 | 5 |
21 files changed, 2963 insertions, 2552 deletions
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index b2797fd..9ec56f8 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -21,24 +21,7 @@ srcdir = . prefix = /usr/local -exec_prefix = $(prefix) -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib - -datadir = $(prefix)/lib -mandir = $(prefix)/man -man1dir = $(mandir)/man1 -man2dir = $(mandir)/man2 -man3dir = $(mandir)/man3 -man4dir = $(mandir)/man4 -man5dir = $(mandir)/man5 -man6dir = $(mandir)/man6 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -man9dir = $(mandir)/man9 infodir = $(prefix)/info -includedir = $(prefix)/include -docdir = $(datadir)/doc SHELL = /bin/sh @@ -46,21 +29,11 @@ INSTALL = install -c INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -AR = ar -AR_FLAGS = qv -BISON = bison -RANLIB = ranlib - # main GDB source directory -gdbdir = .. - -# Documentation (gdb.dvi) needs either GNU m4 or SysV m4; -# Berkeley/Sun don't have quite enough. -#M4=/usr/5bin/m4 -M4=m4 +gdbdir = $(srcdir)/.. # where to find texinfo; GDB dist should include a recent one -TEXIDIR=$(srcdir)/${gdbdir}/../texinfo +TEXIDIR=${gdbdir}/../texinfo # where to find makeinfo, preferably one designed for texinfo-2 MAKEINFO=makeinfo @@ -68,17 +41,25 @@ MAKEINFO=makeinfo # where to find texi2roff, ditto TEXI2ROFF=texi2roff -# Where is the source dir for the READLINE library? Traditionally in .. or . -# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) -READLINE_DIR = $(srcdir)/${gdbdir}/../readline +# Where is the source dir for the READLINE library doc? +# Traditionally readline is in .. or . +READLINE_DIR = ${gdbdir}/../readline/doc + +SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS + +# Don Knuth's TeX formatter +TEX = tex + +# auxiliary program for sorting Texinfo indices +TEXINDEX = texindex # Main GDB manual's source files -SFILES_DOCDIR = \ - $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \ - $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4 +SFILES_INCLUDED = $(srcdir)/gdb-config.texi $(srcdir)/gdbinv-s.texi + +SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) -# Which version of GDB manual? default includes everything -CONFIG=all +SFILES_DOC = $(SFILES_LOCAL) \ + $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi #### Host, target, and site specific Makefile fragments come in here. ### @@ -87,8 +68,6 @@ all install: info: gdb.info gdbint.info stabs.info all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi -clean-info: - -rm -f *.info* install-info: info -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \ @@ -98,7 +77,7 @@ install-info: info $(INSTALL_DATA) $$i $(infodir)/$$i ; \ done -STAGESTUFF = *.info* gdb-all.texi gdbVN.m4 +STAGESTUFF = *.info* gdb-all.texi GDBvn.texi # Copy the object files from a particular stage into a subdirectory. stage1: force @@ -130,82 +109,76 @@ de-stage3: force -(cd stage3 ; mv -f * ..) -rmdir stage3 -clean: - rm -f gdb.dvi rluser.texinfo inc-hist.texi gdb-all* gdb.info* gdbVN.m4 - rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info - rm -f refcard.ps refcard.dvi refcard.log *~ +clean-info: + rm -f gdb.info* gdbint.info* stabs.info* + +clean-dvi: + rm -f gdb.dvi refcard.dvi gdbint.dvi stabs.dvi psref.dvi + +mostlyclean: clean-info clean-dvi + rm -f gdb.?? gdb.??? gdb.mm gdb.ms gdb.me + rm -f links2roff + rm -f refcard.ps lrefcard.ps refcard.log psref.* *~ + rm -f gdbint.?? gdbint.??? stabs.?? stabs.??? + +clean: mostlyclean + rm -f GDBvn.texi rluser.texinfo inc-hist.texi + +distclean: clean + rm -f Makefile config.status + +realclean: distclean + # GDB QUICK REFERENCE (TeX dvi file, CM fonts) refcard.dvi : $(srcdir)/refcard.tex - TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log + $(SET_TEXINPUTS) $(TEX) refcard.tex; rm -f refcard.log rm -f rcfonts.tex # GDB QUICK REFERENCE (PostScript output, common PS fonts) refcard.ps : $(srcdir)/refcard.tex $(srcdir)/psrc.sed sed -f $(srcdir)/psrc.sed $(srcdir)/refcard.tex >psref.tex - TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex + $(SET_TEXINPUTS) $(TEX) psref.tex dvips -t landscape psref -o; mv psref.ps refcard.ps rm -f psref.dvi psref.log # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names) lrefcard.ps : $(srcdir)/refcard.tex $(srcdir)/lpsrc.sed sed -f $(srcdir)/lpsrc.sed $(srcdir)/refcard.tex >psref.tex - TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex + $(SET_TEXINPUTS) $(TEX) psref.tex dvips -t landscape psref -o; mv psref.ps lrefcard.ps rm -f psref.dvi psref.log -# "Readline" appendices. Get them here so both TeX and texi2roff can find. -rluser.texinfo: ${READLINE_DIR}/doc/rluser.texinfo - ln -s ${READLINE_DIR}/doc/rluser.texinfo . || \ - ln ${READLINE_DIR}/doc/rluser.texinfo . || \ - cp ${READLINE_DIR}/doc/rluser.texinfo . - -inc-hist.texi: ${READLINE_DIR}/doc/inc-hist.texi - ln -s ${READLINE_DIR}/doc/inc-hist.texi . || \ - ln ${READLINE_DIR}/doc/inc-hist.texi . || \ - cp ${READLINE_DIR}/doc/inc-hist.texi . - # File to record current GDB version number (copied from main dir Makefile.in) -gdbVN.m4 : $(srcdir)/${gdbdir}/Makefile.in - echo "_define__(<_GDB_VN__>,`sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`)" > ./gdbVN.m4 - -# GDB MANUAL: texinfo source, created by preprocessing w/m4 -# If you want other configs in the makefile, add or modify instructions for -# building source here, then change CONFIG (that way you get info, dvi, -# roff targets automatically for your config). -# Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts... -# The nonsense with gdbVN.m4 is to get this to run with both Sun and GNU make. -# Note that we can *generate* gdbVN.m4, but since we distribute one in the +GDBvn.texi : ${gdbdir}/Makefile.in + echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`" > ./GDBvn.texi + +# GDB MANUAL: texinfo source, using @set/@clear/@value/@ifset/@ifclear +# If your texinfo or makeinfo don't support these, get a new texinfo release +# +# The nonsense with GDBvn.texi gets this to run with both Sun and GNU make. +# Note that we can *generate* GDBvn.texi, but since we distribute one in the # source directory for the benefit of people who *don't* use this makefile, # VPATH will often tell make not to bother building it, because the one # in the srcdir is up to date. (if not, then make should build one here). -gdb-all.texi: ${SFILES_DOCDIR} - if [ ! -f ./gdbVN.m4 ]; then \ - ln -s $(srcdir)/gdbVN.m4 . || \ - ln $(srcdir)/gdbVN.m4 . || \ - cp $(srcdir)/gdbVN.m4 . ; else true; fi - rm -f foobus.texinfo - ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 \ - gdbVN.m4 $(srcdir)/gdb.texinfo >foobus.texinfo - rm -f gdb-all.texi - mv foobus.texinfo ./gdb-all.texi - # GDB MANUAL: TeX dvi file -gdb.dvi : gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi - texindex gdb-${CONFIG}.?? - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi - mv gdb-${CONFIG}.dvi ./gdb.dvi - rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.??? +gdb.dvi: ${SFILES_DOC} + if [ ! -f ./GDBvn.texi ]; then \ + ln -s $(srcdir)/GDBvn.texi . || \ + ln $(srcdir)/GDBvn.texi . || \ + cp $(srcdir)/GDBvn.texi . ; else true; fi + $(SET_TEXINPUTS) $(TEX) gdb.texinfo + $(SET_TEXINPUTS) $(TEX) gdb.texinfo + $(TEXINDEX) gdb.?? + $(SET_TEXINPUTS) $(TEX) gdb.texinfo + rm -f gdb.?? gdb.log gdb.aux gdb.toc gdb.??s # GDB MANUAL: info file # We're using texinfo2, and older makeinfo's may not be able to -# cope with all the markup. In the meantime, we distribute the info -# files -gdb.info: gdb-${CONFIG}.texi - $(MAKEINFO) -o ./gdb.info gdb-${CONFIG}.texi +# cope with all the markup. +gdb.info: ${SFILES_DOC} + $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo # GDB MANUAL: roff translations # Try to use a recent texi2roff. v2 was put on prep in jan91. @@ -218,37 +191,48 @@ gdb.info: gdb-${CONFIG}.texi # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank # + @alphaenumerate is ridiculously new, turned into @enumerate - -# gdb manual suitable for [tn]roff -mm -# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, -# try leaving them in -# ditto special treatment of @ftable in rluser.texinfo -gdb.mm: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi - rm -f ./rluser.texinfo - sed -e 's/^@ftable/@table/g' \ +# texi2roff doesn't have a notion of include dirs, so we have to fake +# it out for gdb manual's include files---but only if not configured +# in main sourcedir. +links2roff: $(SFILES_INCLUDED) + if [ ! -f gdb-config.texi ]; then \ + ln -s $(SFILES_INCLUDED) . || \ + ln $(SFILES_INCLUDED) . || \ + cp $(SFILES_INCLUDED) . ; \ + fi + touch links2roff + +# "Readline" appendices. Get them also due to lack of includes, +# regardless of whether or not configuring in main sourcedir. +# @ftable removed due to bug in texi2roff-2; if your texi2roff +# is newer, try just ln or cp +rluser.texinfo: ${READLINE_DIR}/rluser.texinfo + sed -e 's/^@ftable/@table/g' \ -e 's/^@end ftable/@end table/g' \ - ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo + ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo + +inc-hist.texi: ${READLINE_DIR}/inc-hist.texi + ln -s ${READLINE_DIR}/inc-hist.texi . || \ + ln ${READLINE_DIR}/inc-hist.texi . || \ + cp ${READLINE_DIR}/inc-hist.texi . + +# gdb manual suitable for [gtn]roff -me +gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ -e '/^@c /d' \ -e 's/{.*,,/{/' \ - -e '/@noindent/d' \ -e 's/@ / /g' \ -e 's/^@alphaenumerate/@enumerate/g' \ -e 's/^@end alphaenumerate/@end enumerate/g' \ - gdb-${CONFIG}.texi | \ - $(TEXI2ROFF) -mm | \ + $(srcdir)/gdb.texinfo | \ + $(TEXI2ROFF) -me | \ sed -e 's/---/\\(em/g' \ - >gdb.mm - rm ./rluser.texinfo + >gdb.me -# gdb manual suitable for [gtn]roff -me -gdb.me: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi - rm -f ./rluser.texinfo - sed -e 's/^@ftable/@table/g' \ - -e 's/^@end ftable/@end table/g' \ - ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo +# gdb manual suitable for [gtn]roff -ms +gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -257,37 +241,34 @@ gdb.me: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi -e 's/@ / /g' \ -e 's/^@alphaenumerate/@enumerate/g' \ -e 's/^@end alphaenumerate/@end enumerate/g' \ - gdb-${CONFIG}.texi | \ - $(TEXI2ROFF) -me | \ + $(srcdir)/gdb.texinfo | \ + $(TEXI2ROFF) -ms | \ sed -e 's/---/\\(em/g' \ - >gdb.me - rm ./rluser.texinfo + >gdb.ms -# gdb manual suitable for [gtn]roff -ms -gdb.ms: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi - rm -f ./rluser.texinfo - sed -e 's/^@ftable/@table/g' \ - -e 's/^@end ftable/@end table/g' \ - ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo +# gdb manual suitable for [tn]roff -mm +# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, +# try leaving them in +gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ -e '/^@c /d' \ -e 's/{.*,,/{/' \ + -e '/@noindent/d' \ -e 's/@ / /g' \ -e 's/^@alphaenumerate/@enumerate/g' \ -e 's/^@end alphaenumerate/@end enumerate/g' \ - gdb-${CONFIG}.texi | \ - $(TEXI2ROFF) -ms | \ + $(srcdir)/gdb.texinfo | \ + $(TEXI2ROFF) -mm | \ sed -e 's/---/\\(em/g' \ - >gdb.ms - rm ./rluser.texinfo + >gdb.mm # GDB INTERNALS MANUAL: TeX dvi file gdbint.dvi : gdbint.texinfo - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo - texindex gdbint.?? - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo + $(SET_TEXINPUTS) $(TEX) gdbint.texinfo + $(TEXINDEX) gdbint.?? + $(SET_TEXINPUTS) $(TEX) gdbint.texinfo rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \ gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs @@ -302,9 +283,9 @@ stabs.info: stabs.texinfo # STABS DOCUMENTATION: TeX dvi file stabs.dvi : stabs.texinfo - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex stabs.texinfo - texindex stabs.?? - TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex stabs.texinfo + $(SET_TEXINPUTS) $(TEX) stabs.texinfo + $(TEXINDEX) stabs.?? + $(SET_TEXINPUTS) $(TEX) stabs.texinfo rm -f stabs.?? stabs.aux stabs.cps stabs.fns stabs.kys \ stabs.log stabs.pgs stabs.toc stabs.tps stabs.vrs diff --git a/gdb/doc/all.m4 b/gdb/doc/all.m4 deleted file mode 100644 index 9d5a153..0000000 --- a/gdb/doc/all.m4 +++ /dev/null @@ -1,22 +0,0 @@ -_divert__(-1) -_define__(<_ALL_ARCH__>,<1>) -_define__(<_GENERIC__>,<1>) In case none.m4 changes its mind abt default - -_define__(<_AOUT__>,<1>) -_define__(<_BOUT__>,<1>) -_define__(<_COFF__>,<1>) -_define__(<_ELF__>,<1>) - -_define__(<_REMOTESTUB__>,<1>) -_define__(<_AMD29K__>,<1>) -_define__(<_H8__>,<1>) -_define__(<_I80386__>,<1>) -_define__(<_I960__>,<1>) -_define__(<_M680X0__>,<1>) -_define__(<_SPARC__>,<1>) -_define__(<_ST2000__>,<1>) -_define__(<_VAX__>,<1>) -_define__(<_VXWORKS__>,<1>) -_define__(<_Z8000__>,<1>) - -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/amd29k.m4 b/gdb/doc/amd29k.m4 deleted file mode 100644 index cf3ba386..0000000 --- a/gdb/doc/amd29k.m4 +++ /dev/null @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_AMD29K__>,<1>) -_define__(<_HOST__>,<AMD 29K>) -_define__(<_MACH_DEP__>,<AMD29K Dependent> -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/configure.in b/gdb/doc/configure.in index 1889f2d..1d2b47e 100644 --- a/gdb/doc/configure.in +++ b/gdb/doc/configure.in @@ -1,16 +1,7 @@ srcname="GDB doc" srctrigger=gdb.texinfo # per-host: - -case "${host_os}" in - -sysv4* ) - host_makefile_frag=config/mh-sysv4 - ;; - -esac - # per-target: -files="gdbinv-m.m4.in gdbinv-s.m4.in" -links="gdbinv-m.m4 gdbinv-s.m4" +files="" +links="" diff --git a/gdb/doc/gdb-config.texi b/gdb/doc/gdb-config.texi new file mode 100644 index 0000000..367e37b --- /dev/null +++ b/gdb/doc/gdb-config.texi @@ -0,0 +1,101 @@ +@c GDB MANUAL configuration file. +@c Copyright (c) 1993 Free Software Foundation, Inc. +@c +@c NOTE: While the GDB manual is configurable (by changing these +@c switches), its configuration is ***NOT*** automatically tied in to +@c source configuration---because the authors expect that, save in +@c unusual cases, the most inclusive form of the manual is appropriate +@c no matter how the program itself is configured. +@c +@c The only automatically-varying variable is the GDB version number, +@c which the Makefile rewrites based on the VERSION variable from +@c `../Makefile.in'. +@c +@c GDB version number is recorded in the variable GDBVN +@include GDBvn.texi +@c +@c ---------------------------------------------------------------------- +@c PLATFORM FLAGS: +@set GENERIC +@c +@c Hitachi H8/300 target: +@set Hviii +@c Hitachi H8/300 target ONLY: +@clear HviiiEXCLUSIVE +@c +@c SPARC target: +@set SPARC +@c +@c AMD 29000 target: +@set AMDxxixK +@c +@c Intel 960 target: +@set Icmlx +@c +@c Tandem ST2000 (phone switch) target: +@set STmm +@c +@c Zilog 8000 target: +@set ZviiiK +@c +@c Lucid "Energize" environment: +@clear LUCID +@c +@c Wind River Systems VxWorks environment: +@set VXWORKS +@c +@c ---------------------------------------------------------------------- +@c DOC FEATURE FLAGS: +@c +@c Include change-from-old? +@set NOVEL +@c +@c Bare-board target? +@clear BARETARGET +@c +@c Restrict languages discussed to C? +@clear CONLY +@c +@c Specifically for host machine running DOS? +@clear DOSHOST +@c +@c Is manual stand-alone, or part of an agglomeration, with overall GPL? +@clear AGGLOMERATION +@c +@c Remote serial line settings of interest? +@set SERIAL +@c +@c Discuss features requiring Posix or similar OS environment? +@set POSIX +@c +@c Discuss remote serial debugging stub? +@set REMOTESTUB +@c +@c Refrain from discussing how to configure sw and format doc? +@clear PRECONFIGURED +@c +@c Refrain from referring to unfree publications? +@set FSFDOC +@c +@c ---------------------------------------------------------------------- +@c STRINGS: +@c +@c Name of GDB program. Used also for (gdb) prompt string. +@set GDBP gdb +@c +@c Name of GDB product. Used in running text. +@set GDBN GDB +@c +@c Name of GDB initialization file. +@set GDBINIT .gdbinit +@c +@c Name of host. Should not be used in generic configs, but generic +@c value may catch some flubs. +@set HOST machine specific +@c +@c Name of GCC product +@set NGCC GCC +@c +@c Name of GCC program +@set GCC gcc + diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 28a0518..2e480fe 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1,16 +1,19 @@ -_dnl__ -*-Texinfo-*- -_dnl__ Copyright (c) 1988 1989 1990 1991 1992 Free Software Foundation, Inc. -_dnl__ $Id$<>_dnl__ \input texinfo @c -*-texinfo-*- @c Copyright (c) 1988 1989 1990 1991 1992 Free Software Foundation, Inc. +@c @c %**start of header -@setfilename _GDBP__.info -_if__(_GENERIC__) -@settitle Debugging with _GDBN__ -_fi__(_GENERIC__) -_if__(!_GENERIC__) -@settitle Debugging with _GDBN__ (_HOST__) -_fi__(!_GENERIC__) +@c makeinfo ignores cmds prev to setfilename, so its arg cannot make use +@c of @set vars. However, we can override filename with makeinfo -o. +@setfilename gdb.info +@c +@include gdb-config.texi +@c +@ifset GENERIC +@settitle Debugging with @value{GDBN} +@end ifset +@ifclear GENERIC +@settitle Debugging with @value{GDBN} (@value{HOST}) +@end ifclear @setchapternewpage odd @c @smallbook @c @cropmarks @@ -19,7 +22,7 @@ _fi__(!_GENERIC__) @finalout @syncodeindex ky cp -_0__@c ===> NOTE! <==_1__ +@c ===> NOTE! <== @c Determine the edition number in *three* places by hand: @c 1. First ifinfo section 2. title page 3. top node @c To find the locations, search for !!set @@ -44,29 +47,15 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY @end format @end ifinfo -_if__(0) - -NOTE: this manual is marked up for preprocessing with a collection -of m4 macros called "pretex.m4". - -THIS IS THE SOURCE PRIOR TO PREPROCESSING. The full source needs to -be run through m4 before either tex- or info- formatting: for example, -_0__ - m4 pretex.m4 none.m4 all.m4 gdb.texinfo >gdb-all.texinfo -will produce (assuming your path finds either GNU m4 >= 0.84, or SysV -m4; Berkeley will not do) a file suitable for formatting. See the text in -"pretex.m4" for a fuller explanation (and the macro definitions). -_1__ - -_fi__(0) +@c @c @ifinfo -This file documents the GNU debugger _GDBN__. +This file documents the GNU debugger @value{GDBN}. @c !!set edition, date, version This is Edition 4.06, October 1992, -of @cite{Debugging with _GDBN__: the GNU Source-Level Debugger} -for GDB Version _GDB_VN__. +of @cite{Debugging with @value{GDBN}: the GNU Source-Level Debugger} +for GDB Version @value{GDBVN}. Copyright (C) 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. @@ -96,22 +85,22 @@ instead of in the original English. @end ifinfo @titlepage -@title Debugging with _GDBN__ +@title Debugging with @value{GDBN} @subtitle The GNU Source-Level Debugger -_if__(!_GENERIC__) -@subtitle on _HOST__ Systems -_fi__(!_GENERIC__) +@ifclear GENERIC +@subtitle on @value{HOST} Systems +@end ifclear @sp 1 @c !!set edition, date, version -@subtitle Edition 4.06, for _GDBN__ version _GDB_VN__ +@subtitle Edition 4.06, for @value{GDBN} version @value{GDBVN} @subtitle October 1992 @author by Richard M. Stallman and Roland H. Pesch @page @tex {\parskip=0pt \hfill pesch\@cygnus.com\par -\hfill (Send bugs and comments on _GDBN__ to bug-gdb\@prep.ai.mit.edu.) -\hfill {\it Debugging with _GDBN__}, \manvers\par +\hfill (Send bugs and comments on @value{GDBN} to bug-gdb\@prep.ai.mit.edu.)\par +\hfill {\it Debugging with @value{GDBN}}, \manvers\par \hfill \TeX{}info \texinfoversion\par } @end tex @@ -140,62 +129,614 @@ instead of in the original English. @ifinfo @node Top -@top Debugging with _GDBN__ +@top Debugging with @value{GDBN} -This file describes _GDBN__, the GNU symbolic debugger. +This file describes @value{GDBN}, the GNU symbolic debugger. @c !!set edition, date, version -This is Edition 4.06, October 1992, for GDB Version _GDB_VN__. -@end ifinfo +This is Edition 4.06, October 1992, for GDB Version @value{GDBVN}. +@c Makeinfo node defaulting gets very confused by conditionals in menus, +@c unfortunately. Otherwise we would use the following ignored menu, +@c which involves four switches: +@ignore @menu -* Summary:: Summary of _GDBN__ -_if__(_GENERIC__ || !_H8__) +* Summary:: Summary of @value{GDBN} +@ifset NOVEL * New Features:: New features since GDB version 3.5 -_fi__(_GENERIC__ || !_H8__) -_if__(!_BARE__) -* Sample Session:: A sample _GDBN__ session -_fi__(!_BARE__) -* Invocation:: Getting in and out of _GDBN__ -* Commands:: _GDBN__ commands -* Running:: Running programs under _GDBN__ +@end ifset +@ifclear BARETARGET +* Sample Session:: A sample @value{GDBN} session +@end ifclear +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} * Stopping:: Stopping and continuing * Stack:: Examining the stack * Source:: Examining source files * Data:: Examining data -_if__(!_CONLY__) -* Languages:: Using _GDBN__ with different languages -_fi__(!_CONLY__) -_if__(_CONLY__) +@ifclear CONLY +* Languages:: Using @value{GDBN} with different languages +@end ifclear +@ifset CONLY * C:: C and C++ -_fi__(_CONLY__) +@end ifset +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +@ifclear DOSHOST +* Emacs:: Using @value{GDBN} under GNU Emacs +@end ifclear +* GDB Bugs:: Reporting bugs in @value{GDBN} +@ifset NOVEL +* Renamed Commands:: +@end ifset +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ignore +@c +@c Since that doesn't work, we must unroll the above into 16 cases: +@c +@c Menu for NOVEL && !BARETARGET && !CONLY && !DOSHOST +@ifset NOVEL +@ifclear BARETARGET +@ifclear CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifclear +@end ifclear +@end ifset + +@c Menu for NOVEL && !BARETARGET && !CONLY && DOSHOST +@ifset NOVEL +@ifclear BARETARGET +@ifclear CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifclear +@end ifclear +@end ifset + +@c Menu for NOVEL && !BARETARGET && CONLY && !DOSHOST +@ifset NOVEL +@ifclear BARETARGET +@ifset CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language Support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifset +@end ifclear +@end ifset + +@c Menu for NOVEL && !BARETARGET && CONLY && DOSHOST +@ifset NOVEL +@ifclear BARETARGET +@ifset CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language Support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifset +@end ifclear +@end ifset + +@c Menu for NOVEL && BARETARGET && !CONLY && !DOSHOST +@ifset NOVEL +@ifset BARETARGET +@ifclear CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifclear +@end ifset +@end ifset + +@c Menu for NOVEL && BARETARGET && !CONLY && DOSHOST +@ifset NOVEL +@ifset BARETARGET +@ifclear CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifclear +@end ifset +@end ifset + +@c Menu for NOVEL && BARETARGET && CONLY && !DOSHOST +@ifset NOVEL +@ifset BARETARGET +@ifset CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language support * Symbols:: Examining the symbol table * Altering:: Altering execution -* _GDBN__ Files:: _GDBN__'s files +* GDB Files:: @value{GDBN}'s files * Targets:: Specifying a debugging target -* Controlling _GDBN__:: Controlling _GDBN__ +* Controlling GDB:: Controlling @value{GDBN} * Sequences:: Canned sequences of commands -_if__(!_DOSHOST__) -* Emacs:: Using _GDBN__ under GNU Emacs -_fi__(!_DOSHOST__) -* _GDBN__ Bugs:: Reporting bugs in _GDBN__ -_if__(_GENERIC__||!_H8__) +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} * Renamed Commands:: -_fi__(_GENERIC__||!_H8__) * Formatting Documentation:: How to format and print GDB documentation * Installing GDB:: Installing GDB * Copying:: GNU GENERAL PUBLIC LICENSE * Index:: Index @end menu +@end ifclear +@end ifset +@end ifset +@end ifset + +@c Menu for NOVEL && BARETARGET && CONLY && DOSHOST +@ifset NOVEL +@ifset BARETARGET +@ifset CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* New Features:: New features since GDB version 3.5 +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Renamed Commands:: +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifset +@end ifset +@end ifset + +@c Menu for !NOVEL && !BARETARGET && !CONLY && !DOSHOST +@ifclear NOVEL +@ifclear BARETARGET +@ifclear CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifclear +@end ifclear +@end ifclear + +@c Menu for !NOVEL && !BARETARGET && !CONLY && DOSHOST +@ifclear NOVEL +@ifclear BARETARGET +@ifclear CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifclear +@end ifclear +@end ifclear + +@c Menu for !NOVEL && !BARETARGET && CONLY && !DOSHOST +@ifclear NOVEL +@ifclear BARETARGET +@ifset CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifset +@end ifclear +@end ifclear + +@c Menu for !NOVEL && !BARETARGET && CONLY && DOSHOST +@ifclear NOVEL +@ifclear BARETARGET +@ifset CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Sample Session:: A sample @value{GDBN} session +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifset +@end ifclear +@end ifclear + +@c Menu for !NOVEL && BARETARGET && !CONLY && !DOSHOST +@ifclear NOVEL +@ifset BARETARGET +@ifclear CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifclear +@end ifset +@end ifclear + +@c Menu for !NOVEL && BARETARGET && !CONLY && DOSHOST +@ifclear NOVEL +@ifset BARETARGET +@ifclear CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* Languages:: Using @value{GDBN} with different languages +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifclear +@end ifset +@end ifclear + +@c Menu for !NOVEL && BARETARGET && CONLY && !DOSHOST +@ifclear NOVEL +@ifset BARETARGET +@ifset CONLY +@ifclear DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language Support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* Emacs:: Using @value{GDBN} under GNU Emacs +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifclear +@end ifset +@end ifset +@end ifclear + +@c Menu for !NOVEL && BARETARGET && CONLY && DOSHOST +@ifclear NOVEL +@ifset BARETARGET +@ifset CONLY +@ifset DOSHOST +@menu +* Summary:: Summary of @value{GDBN} +* Invocation:: Getting in and out of @value{GDBN} +* Commands:: @value{GDBN} commands +* Running:: Running programs under @value{GDBN} +* Stopping:: Stopping and continuing +* Stack:: Examining the stack +* Source:: Examining source files +* Data:: Examining data +* C:: C Language Support +* Symbols:: Examining the symbol table +* Altering:: Altering execution +* GDB Files:: @value{GDBN}'s files +* Targets:: Specifying a debugging target +* Controlling GDB:: Controlling @value{GDBN} +* Sequences:: Canned sequences of commands +* GDB Bugs:: Reporting bugs in @value{GDBN} +* Formatting Documentation:: How to format and print GDB documentation +* Installing GDB:: Installing GDB +* Copying:: GNU GENERAL PUBLIC LICENSE +* Index:: Index +@end menu +@end ifset +@end ifset +@end ifset +@end ifclear + +@end ifinfo @node Summary -@unnumbered Summary of _GDBN__ +@unnumbered Summary of @value{GDBN} -The purpose of a debugger such as _GDBN__ is to allow you to see what is +The purpose of a debugger such as @value{GDBN} is to allow you to see what is going on ``inside'' another program while it executes---or what another program was doing at the moment it crashed. -_GDBN__ can do four main kinds of things (plus other things in support of +@value{GDBN} can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act: @itemize @bullet @@ -213,10 +754,10 @@ Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another. @end itemize -_if__(!_CONLY__) -You can use _GDBN__ to debug programs written in C, C++, and Modula-2. +@ifclear CONLY +You can use @value{GDBN} to debug programs written in C, C++, and Modula-2. Fortran support will be added when a GNU Fortran compiler is ready. -_fi__(!_CONLY__) +@end ifclear @menu * Free Software:: Free Software @@ -226,7 +767,7 @@ _fi__(!_CONLY__) @node Free Software @unnumberedsec Free Software -_GDBN__ is @dfn{free software}, protected by the GNU General Public License +@value{GDBN} is @dfn{free software}, protected by the GNU General Public License (GPL). The GPL gives you the freedom to copy or adapt a licensed program---but every person getting a copy also gets with it the freedom to modify that copy (which means that they must get access to @@ -238,9 +779,9 @@ Fundamentally, the General Public License is a license which says that you have these freedoms and that you cannot take these freedoms away from anyone else. -_if__(!_AGGLOMERATION__) +@ifclear AGGLOMERATION For full details, @pxref{Copying, ,GNU GENERAL PUBLIC LICENSE}. -_fi__(!_AGGLOMERATION__) +@end ifclear @node Contributors @unnumberedsec Contributors to GDB @@ -318,7 +859,7 @@ manual. Fred Fish wrote most of the support for Unix System Vr4, and enhanced the command-completion support to cover C++ overloaded symbols. -_if__(_GENERIC__ || !_H8__) +@ifset NOVEL @node New Features @unnumbered New Features since GDB version 3.5 @@ -403,13 +944,13 @@ the Documentation}, for instructions to print it. Kernel debugging for BSD and Mach systems; Tahoe and HPPA architecture support. @end table -_fi__(_GENERIC__ || !_H8__) +@end ifset -_if__(!_BARE__) +@ifclear BARETARGET @node Sample Session -@chapter A Sample _GDBN__ Session +@chapter A Sample @value{GDBN} Session -You can use this manual at your leisure to read all about _GDBN__. +You can use this manual at your leisure to read all about @value{GDBN}. However, a handful of commands are enough to get started using the debugger. This chapter illustrates these commands. @@ -420,7 +961,7 @@ to make it easier to pick out from the surrounding output. @c FIXME: this example may not be appropriate for some configs, where @c FIXME...primary interest is in remote use. -_0__ + One of the preliminary versions of GNU @code{m4} (a generic macro processor) exhibits the following bug: sometimes, when we change its quote strings from the default, the commands used to capture one macro's @@ -451,10 +992,10 @@ m4: End of input: 0: fatal error: EOF in string @end smallexample @noindent -Let's use _GDBN__ to try to see what's going on. +Let's use @value{GDBN} to try to see what's going on. @smallexample -$ @b{_GDBP__ m4} +$ @b{@value{GDBP} m4} @c FIXME: this falsifies the exact text played out, to permit smallbook @c FIXME... format to come out better. GDB is free software and you are welcome to distribute copies @@ -462,38 +1003,38 @@ GDB is free software and you are welcome to distribute copies the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. -GDB _GDB_VN__, Copyright 1992 Free Software Foundation, Inc... -(_GDBP__) +GDB @value{GDBVN}, Copyright 1992 Free Software Foundation, Inc... +(@value{GDBP}) @end smallexample @noindent -_GDBN__ reads only enough symbol data to know where to find the rest when +@value{GDBN} reads only enough symbol data to know where to find the rest when needed; as a result, the first prompt comes up very quickly. We now -tell _GDBN__ to use a narrower display width than usual, so that examples +tell @value{GDBN} to use a narrower display width than usual, so that examples will fit in this manual. @smallexample -(_GDBP__) @b{set width 70} +(@value{GDBP}) @b{set width 70} @end smallexample @noindent Let's see how the @code{m4} built-in @code{changequote} works. Having looked at the source, we know the relevant subroutine is -@code{m4_changequote}, so we set a breakpoint there with _GDBN__'s +@code{m4_changequote}, so we set a breakpoint there with @value{GDBN}'s @code{break} command. @smallexample -(_GDBP__) @b{break m4_changequote} +(@value{GDBP}) @b{break m4_changequote} Breakpoint 1 at 0x62f4: file builtin.c, line 879. @end smallexample @noindent -Using the @code{run} command, we start @code{m4} running under _GDBN__ +Using the @code{run} command, we start @code{m4} running under @value{GDBN} control; as long as control does not reach the @code{m4_changequote} subroutine, the program runs as usual: @smallexample -(_GDBP__) @b{run} +(@value{GDBP}) @b{run} Starting program: /work/Editorial/gdb/gnu/m4/m4 @b{define(foo,0000)} @@ -502,7 +1043,7 @@ Starting program: /work/Editorial/gdb/gnu/m4/m4 @end smallexample @noindent -To trigger the breakpoint, we call @code{changequote}. _GDBN__ +To trigger the breakpoint, we call @code{changequote}. @value{GDBN} suspends execution of @code{m4}, displaying information about the context where it stops. @@ -519,7 +1060,7 @@ Now we use the command @code{n} (@code{next}) to advance execution to the next line of the current function. @smallexample -(_GDBP__) @b{n} +(@value{GDBP}) @b{n} 882 set_quotes((argc >= 2) ? TOKEN_DATA_TEXT(argv[1])\ : nil, @end smallexample @@ -531,7 +1072,7 @@ by using the command @code{s} (@code{step}) instead of @code{next}. subroutine, so it steps into @code{set_quotes}. @smallexample -(_GDBP__) @b{s} +(@value{GDBP}) @b{s} set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>") at input.c:530 530 if (lquote != def_lquote) @@ -546,7 +1087,7 @@ in the stack as a whole: the @code{backtrace} command displays a stack frame for each active subroutine. @smallexample -(_GDBP__) @b{bt} +(@value{GDBP}) @b{bt} #0 set_quotes (lq=0x34c78 "<QUOTE>", rq=0x34c88 "<UNQUOTE>") at input.c:530 #1 0x6344 in m4_changequote (argc=3, argv=0x33c70) @@ -564,15 +1105,15 @@ times, we can use @samp{s}; the next two times we use @code{n} to avoid falling into the @code{xstrdup} subroutine. @smallexample -(_GDBP__) @b{s} +(@value{GDBP}) @b{s} 0x3b5c 532 if (rquote != def_rquote) -(_GDBP__) @b{s} +(@value{GDBP}) @b{s} 0x3b80 535 lquote = (lq == nil || *lq == '\0') ? \ def_lquote : xstrdup(lq); -(_GDBP__) @b{n} +(@value{GDBP}) @b{n} 536 rquote = (rq == nil || *rq == '\0') ? def_rquote\ : xstrdup(rq); -(_GDBP__) @b{n} +(@value{GDBP}) @b{n} 538 len_lquote = strlen(rquote); @end smallexample @@ -583,9 +1124,9 @@ and right quotes we specified. We can use the command @code{p} (@code{print}) to see their values. @smallexample -(_GDBP__) @b{p lquote} +(@value{GDBP}) @b{p lquote} $1 = 0x35d40 "<QUOTE>" -(_GDBP__) @b{p rquote} +(@value{GDBP}) @b{p rquote} $2 = 0x35d50 "<UNQUOTE>" @end smallexample @@ -595,7 +1136,7 @@ Let's look at some context; we can display ten lines of source surrounding the current line, with the @code{l} (@code{list}) command. @smallexample -(_GDBP__) @b{l} +(@value{GDBP}) @b{l} 533 xfree(rquote); 534 535 lquote = (lq == nil || *lq == '\0') ? def_lquote\ @@ -615,13 +1156,13 @@ Let's step past the two lines that set @code{len_lquote} and @code{len_rquote}, and then examine the values of those variables. @smallexample -(_GDBP__) @b{n} +(@value{GDBP}) @b{n} 539 len_rquote = strlen(lquote); -(_GDBP__) @b{n} +(@value{GDBP}) @b{n} 540 @} -(_GDBP__) @b{p len_lquote} +(@value{GDBP}) @b{p len_lquote} $3 = 9 -(_GDBP__) @b{p len_rquote} +(@value{GDBP}) @b{p len_rquote} $4 = 7 @end smallexample @@ -634,9 +1175,9 @@ any expression---and that expression can include subroutine calls and assignments. @smallexample -(_GDBP__) @b{p len_lquote=strlen(lquote)} +(@value{GDBP}) @b{p len_lquote=strlen(lquote)} $5 = 7 -(_GDBP__) @b{p len_rquote=strlen(rquote)} +(@value{GDBP}) @b{p len_rquote=strlen(rquote)} $6 = 9 @end smallexample @@ -647,7 +1188,7 @@ executing with the @code{c} (@code{continue}) command, and then try the example that caused trouble initially: @smallexample -(_GDBP__) @b{c} +(@value{GDBP}) @b{c} Continuing. @b{define(baz,defn(<QUOTE>foo<UNQUOTE>))} @@ -667,136 +1208,214 @@ Program exited normally. @end smallexample @noindent -The message @samp{Program exited normally.} is from _GDBN__; it -indicates @code{m4} has finished executing. We can end our _GDBN__ -session with the _GDBN__ @code{quit} command. +The message @samp{Program exited normally.} is from @value{GDBN}; it +indicates @code{m4} has finished executing. We can end our @value{GDBN} +session with the @value{GDBN} @code{quit} command. @smallexample -(_GDBP__) @b{quit} -_1__@end smallexample -_fi__(!_BARE__) +(@value{GDBP}) @b{quit} +@end smallexample +@end ifclear @node Invocation -@chapter Getting In and Out of _GDBN__ +@chapter Getting In and Out of @value{GDBN} -This chapter discusses how to start _GDBN__, and how to get out of it. -(The essentials: type @samp{_GDBP__} to start GDB, and type @kbd{quit} +This chapter discusses how to start @value{GDBN}, and how to get out of it. +(The essentials: type @samp{@value{GDBP}} to start GDB, and type @kbd{quit} or @kbd{C-d} to exit.) +@ignore +@c original form of menu, pre-unfolding: @menu -* Invoking _GDBN__:: Starting _GDBN__ -* Leaving _GDBN__:: Leaving _GDBN__ -_if__(!_BARE__) +* Invoking GDB:: Starting @value{GDBN} +* Leaving GDB:: Leaving @value{GDBN} +@ifclear BARETARGET * Shell Commands:: Shell Commands -_fi__(!_BARE__) +@end ifclear @end menu +@end ignore -@node Invoking _GDBN__ -@section Starting _GDBN__ +@ifclear BARETARGET +@menu +* Invoking GDB:: Starting @value{GDBN} +* Leaving GDB:: Leaving @value{GDBN} +* Shell Commands:: Shell Commands +@end menu +@end ifclear -_if__(_H8__) -For details on starting up _GDBP__ as a +@ifset BARETARGET +@menu +* Invoking GDB:: Starting @value{GDBN} +* Leaving GDB:: Leaving @value{GDBN} +@end menu +@end ifset + +@node Invoking GDB +@section Starting @value{GDBN} + +@ifset HviiiEXCLUSIVE +For details on starting up @value{GDBP} as a remote debugger attached to a Hitachi H8/300 board, see @ref{Hitachi -H8/300 Remote,,_GDBN__ and the Hitachi H8/300}. -_fi__(_H8__) +H8/300 Remote,,@value{GDBN} and the Hitachi H8/300}. +@end ifset -Start _GDBN__ by running the program @code{_GDBP__}. Once it's running, -_GDBN__ reads commands from the terminal until you tell it to exit. +Start @value{GDBN} by running the program @code{@value{GDBP}}. Once it's running, +@value{GDBN} reads commands from the terminal until you tell it to exit. -You can also run @code{_GDBP__} with a variety of arguments and options, +You can also run @code{@value{GDBP}} with a variety of arguments and options, to specify more of your debugging environment at the outset. -_if__(_GENERIC__) +@ifset GENERIC The command-line options described here are designed to cover a variety of situations; in some environments, some of these options may effectively be unavailable. -_fi__(_GENERIC__) +@end ifset -The most usual way to start _GDBN__ is with one argument, +The most usual way to start @value{GDBN} is with one argument, specifying an executable program: @example -_GDBP__ @var{program} +@value{GDBP} @var{program} @end example -_if__(!_BARE__) +@ifclear BARETARGET @noindent You can also start with both an executable program and a core file specified: @example -_GDBP__ @var{program} @var{core} +@value{GDBP} @var{program} @var{core} @end example You can, instead, specify a process ID as a second argument, if you want to debug a running process: @example -_GDBP__ @var{program} 1234 +@value{GDBP} @var{program} 1234 @end example @noindent -would attach _GDBN__ to process @code{1234} (unless you also have a file -named @file{1234}; _GDBN__ does check for a core file first). +would attach @value{GDBN} to process @code{1234} (unless you also have a file +named @file{1234}; @value{GDBN} does check for a core file first). Taking advantage of the second command-line argument requires a fairly -complete operating system; when you use _GDBN__ as a remote debugger +complete operating system; when you use @value{GDBN} as a remote debugger attached to a bare board, there may not be any notion of ``process'', and there is often no way to get a core dump. -_fi__(!_BARE__) +@end ifclear @noindent -You can further control how _GDBN__ starts up by using command-line -options. _GDBN__ itself can remind you of the options available. +You can further control how @value{GDBN} starts up by using command-line +options. @value{GDBN} itself can remind you of the options available. @noindent Type @example -_GDBP__ -help +@value{GDBP} -help @end example @noindent to display all available options and briefly describe their use -(@samp{_GDBP__ -h} is a shorter equivalent). +(@samp{@value{GDBP} -h} is a shorter equivalent). All options and command line arguments you give are processed in sequential order. The order makes a difference when the @samp{-x} option is used. + +@ignore +@c original, intended form of this menu (pre-unfolding): @menu -_if__(!_GENERIC__) -_include__(gdbinv-m.m4)_dnl__ -_fi__(!_GENERIC__) +@ifclear GENERIC +@ifset REMOTESTUB +* Remote Serial:: @value{GDBN} remote serial protocol +@end ifset +@ifset Icmlx +* i960-Nindy Remote:: @value{GDBN} with a remote i960 (Nindy) +@end ifset +@ifset AMDxxixK +* EB29K Remote:: @value{GDBN} with a remote EB29K +@end ifset +@ifset VXWORKS +* VxWorks Remote:: @value{GDBN} and VxWorks +@end ifset +@ifset STmm +* ST2000 Remote:: @value{GDBN} with a Tandem ST2000 +@end ifset +@ifset Hviii +* Hitachi H8/300 Remote:: @value{GDBN} and the Hitachi H8/300 +@end ifset +@ifset ZviiiK +* Z8000 Simulator:: @value{GDBN} and its Zilog Z8000 Simulator +@end ifset +@end ifclear * File Options:: Choosing Files * Mode Options:: Choosing Modes @end menu +@end ignore -_if__(!_GENERIC__) -_include__(gdbinv-s.m4) -_fi__(!_GENERIC__) +@c Unfolded form: +@c Sigh--- GENERIC plus 7 switches mean 1+2^7 forms of this menu! +@c Add them only on demand; no point in including forms for which +@c there's no defined config file. Maybe by the time all are needed, +@c makeinfo will be capable of dealing with menus like the above. + +@ifset GENERIC +@menu +* File Options:: Choosing Files +* Mode Options:: Choosing Modes +@end menu +@end ifset + +@c Hviii config: !GENERIC && Hviii && nothing else +@ifclear GENERIC +@ifclear REMOTESTUB +@ifclear Icmlx +@ifclear AMDxxixK +@ifclear VXWORKS +@ifclear STmm +@ifset Hviii +@ifclear ZviiiK +@menu +* Hitachi H8/300 Remote:: @value{GDBN} and the Hitachi H8/300 +* File Options:: Choosing Files +* Mode Options:: Choosing Modes +@end menu +@end ifclear +@end ifset +@end ifclear +@end ifclear +@end ifclear +@end ifclear +@end ifclear +@end ifclear + +@ifclear GENERIC +@include gdbinv-s.texi +@end ifclear @node File Options @subsection Choosing Files -_if__(!_BARE__) -When _GDBN__ starts, it reads any arguments other than options as +@ifclear BARETARGET +When @value{GDBN} starts, it reads any arguments other than options as specifying an executable file and core file (or process ID). This is the same as if the arguments were specified by the @samp{-se} and -@samp{-c} options respectively. (_GDBN__ reads the first argument +@samp{-c} options respectively. (@value{GDBN} reads the first argument that does not have an associated option flag as equivalent to the @samp{-se} option followed by that argument; and the second argument that does not have an associated option flag, if any, as equivalent to the @samp{-c} option followed by that argument.) -_fi__(!_BARE__) -_if__(_BARE__) -When _GDBN__ starts, it reads any argument other than options as +@end ifclear +@ifset BARETARGET +When @value{GDBN} starts, it reads any argument other than options as specifying an executable file. This is the same as if the argument was specified by the @samp{-se} option. -_fi__(_BARE__) +@end ifset Many options have both long and short forms; both are shown in the -following list. _GDBN__ also recognizes the long forms if you truncate +following list. @value{GDBN} also recognizes the long forms if you truncate them, so long as enough of the option is present to be unambiguous. (If you prefer, you can flag option arguments with @samp{--} rather than @samp{-}, though we illustrate the more usual convention.) @@ -816,38 +1435,38 @@ dump. Read symbol table from file @var{file} and use it as the executable file. -_if__(!_BARE__) +@ifclear BARETARGET @item -core=@var{file} @itemx -c @var{file} Use file @var{file} as a core dump to examine. -_fi__(!_BARE__) +@end ifclear @item -command=@var{file} @itemx -x @var{file} -Execute _GDBN__ commands from file @var{file}. @xref{Command Files}. +Execute @value{GDBN} commands from file @var{file}. @xref{Command Files}. @item -directory=@var{directory} @itemx -d @var{directory} Add @var{directory} to the path to search for source files. -_if__(!_BARE__) +@ifclear BARETARGET @item -m @itemx -mapped @emph{Warning: this option depends on operating system facilities that are not supported on all systems.}@* If memory-mapped files are available on your system through the @code{mmap} system call, you can use this option -to have _GDBN__ write the symbols from your +to have @value{GDBN} write the symbols from your program into a reusable file in the current directory. If the program you are debugging is called @file{/tmp/fred}, the mapped symbol file will be @file{./fred.syms}. -Future _GDBN__ debugging sessions will notice the presence of this file, +Future @value{GDBN} debugging sessions will notice the presence of this file, and will quickly map in symbol information from it, rather than reading the symbol table from the executable program. -The @file{.syms} file is specific to the host machine on which _GDBN__ is run. -It holds an exact image of _GDBN__'s internal symbol table. It cannot be +The @file{.syms} file is specific to the host machine on which @value{GDBN} is run. +It holds an exact image of @value{GDBN}'s internal symbol table. It cannot be shared across multiple host platforms. -_fi__(!_BARE__) +@end ifclear @item -r @itemx -readnow @@ -856,7 +1475,7 @@ the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster. @end table -_if__(!_BARE__) +@ifclear BARETARGET The @code{-mapped} and @code{-readnow} options are typically combined in order to build a @file{.syms} file that contains complete symbol information. A simple GDB invocation to do nothing but build a @file{.syms} file for future @@ -865,18 +1484,18 @@ use is: @example gdb -batch -nx -mapped -readnow programname @end example -_fi__(!_BARE__) +@end ifclear @node Mode Options @subsection Choosing Modes -You can run _GDBN__ in various alternative modes---for example, in +You can run @value{GDBN} in various alternative modes---for example, in batch mode or quiet mode. @table @code @item -nx @itemx -n -Do not execute commands from any @file{_GDBINIT__} initialization files. +Do not execute commands from any @file{@value{GDBINIT}} initialization files. Normally, the commands in these files are executed after all the command options and arguments have been processed. @xref{Command Files}. @@ -888,11 +1507,11 @@ messages are also suppressed in batch mode. @item -batch Run in batch mode. Exit with status @code{0} after processing all the command -files specified with @samp{-x} (and @file{_GDBINIT__}, if not inhibited). -Exit with nonzero status if an error occurs in executing the _GDBN__ +files specified with @samp{-x} (and @file{@value{GDBINIT}}, if not inhibited). +Exit with nonzero status if an error occurs in executing the @value{GDBN} commands in the command files. -Batch mode may be useful for running _GDBN__ as a filter, for example to +Batch mode may be useful for running @value{GDBN} as a filter, for example to download and run a program on another computer; in order to make this more useful, the message @@ -901,107 +1520,107 @@ Program exited normally. @end example @noindent -(which is ordinarily issued whenever a program running under _GDBN__ control +(which is ordinarily issued whenever a program running under @value{GDBN} control terminates) is not issued when running in batch mode. @item -cd=@var{directory} -Run _GDBN__ using @var{directory} as its working directory, +Run @value{GDBN} using @var{directory} as its working directory, instead of the current directory. -_if__(_LUCID__) +@ifset LUCID @item -context @var{authentication} -When the Energize programming system starts up _GDBN__, it uses this +When the Energize programming system starts up @value{GDBN}, it uses this option to trigger an alternate mode of interaction. -@var{authentication} is a pair of numeric codes that identify _GDBN__ +@var{authentication} is a pair of numeric codes that identify @value{GDBN} as a client in the Energize environment. Avoid this option when you run -_GDBN__ directly from the command line. See @ref{Energize,,Using -_GDBN__ with Energize} for more discussion of using _GDBN__ with Energize. -_fi__(_LUCID__) +@value{GDBN} directly from the command line. See @ref{Energize,,Using +@value{GDBN} with Energize} for more discussion of using @value{GDBN} with Energize. +@end ifset @item -fullname @itemx -f -Emacs sets this option when it runs _GDBN__ as a subprocess. It tells _GDBN__ +Emacs sets this option when it runs @value{GDBN} as a subprocess. It tells @value{GDBN} to output the full file name and line number in a standard, recognizable fashion each time a stack frame is displayed (which includes each time your program stops). This recognizable format looks like two @samp{\032} characters, followed by the file name, line number and character position separated by colons, and a newline. The -Emacs-to-_GDBN__ interface program uses the two @samp{\032} characters as +Emacs-to-@value{GDBN} interface program uses the two @samp{\032} characters as a signal to display the source code for the frame. -_if__(_GENERIC__ || !_H8__) +@ifset SERIAL @item -b @var{bps} Set the line speed (baud rate or bits per second) of any serial -interface used by _GDBN__ for remote debugging. +interface used by @value{GDBN} for remote debugging. @item -tty=@var{device} Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. -_fi__(_GENERIC__ || !_H8__) +@end ifset @end table -@node Leaving _GDBN__ -@section Leaving _GDBN__ -@cindex exiting _GDBN__ +@node Leaving GDB +@section Leaving @value{GDBN} +@cindex exiting @value{GDBN} @table @code @item quit @kindex quit @kindex q -To exit _GDBN__, use the @code{quit} command (abbreviated @code{q}), or type +To exit @value{GDBN}, use the @code{quit} command (abbreviated @code{q}), or type an end-of-file character (usually @kbd{C-d}). @end table @cindex interrupt -An interrupt (often @kbd{C-c}) will not exit from _GDBN__, but rather -will terminate the action of any _GDBN__ command that is in progress and -return to _GDBN__ command level. It is safe to type the interrupt -character at any time because _GDBN__ does not allow it to take effect +An interrupt (often @kbd{C-c}) will not exit from @value{GDBN}, but rather +will terminate the action of any @value{GDBN} command that is in progress and +return to @value{GDBN} command level. It is safe to type the interrupt +character at any time because @value{GDBN} does not allow it to take effect until a time when it is safe. -_if__(!_BARE__) -If you have been using _GDBN__ to control an attached process or device, you +@ifclear BARETARGET +If you have been using @value{GDBN} to control an attached process or device, you can release it with the @code{detach} command; @pxref{Attach, ,Debugging an Already-Running Process}.. -_fi__(!_BARE__) +@end ifclear -_if__(!_BARE__) +@ifclear BARETARGET @node Shell Commands @section Shell Commands If you need to execute occasional shell commands during your -debugging session, there is no need to leave or suspend _GDBN__; you can +debugging session, there is no need to leave or suspend @value{GDBN}; you can just use the @code{shell} command. @table @code @item shell @var{command string} @kindex shell @cindex shell escape -Directs _GDBN__ to invoke an inferior shell to execute @var{command +Directs @value{GDBN} to invoke an inferior shell to execute @var{command string}. If it exists, the environment variable @code{SHELL} is used -for the name of the shell to run. Otherwise _GDBN__ uses +for the name of the shell to run. Otherwise @value{GDBN} uses @code{/bin/sh}. @end table The utility @code{make} is often needed in development environments. -You do not have to use the @code{shell} command for this purpose in _GDBN__: +You do not have to use the @code{shell} command for this purpose in @value{GDBN}: @table @code @item make @var{make-args} @kindex make @cindex calling make -Causes _GDBN__ to execute an inferior @code{make} program with the specified +Causes @value{GDBN} to execute an inferior @code{make} program with the specified arguments. This is equivalent to @samp{shell make @var{make-args}}. @end table -_fi__(!_BARE__) +@end ifclear @node Commands -@chapter _GDBN__ Commands +@chapter @value{GDBN} Commands -You can abbreviate a _GDBN__ command to the first few letters of the command +You can abbreviate a @value{GDBN} command to the first few letters of the command name, if that abbreviation is unambiguous; and you can repeat certain -_GDBN__ commands by typing just @key{RET}. You can also use the @key{TAB} -key to get _GDBN__ to fill out the rest of a word in a command (or to +@value{GDBN} commands by typing just @key{RET}. You can also use the @key{TAB} +key to get @value{GDBN} to fill out the rest of a word in a command (or to show you the alternatives available, if there's more than one possibility). @menu @@ -1013,7 +1632,7 @@ show you the alternatives available, if there's more than one possibility). @node Command Syntax @section Command Syntax -A _GDBN__ command is a single line of input. There is no limit on how long +A @value{GDBN} command is a single line of input. There is no limit on how long it can be. It starts with a command name, which is followed by arguments whose meaning depends on the command name. For example, the command @code{step} accepts an argument which is the number of times to step, @@ -1021,7 +1640,7 @@ as in @samp{step 5}. You can also use the @code{step} command with no arguments. Some command names do not allow any arguments. @cindex abbreviation -_GDBN__ command names may always be truncated if that abbreviation is +@value{GDBN} command names may always be truncated if that abbreviation is unambiguous. Other possible command abbreviations are listed in the documentation for individual commands. In some cases, even ambiguous abbreviations are allowed; for example, @code{s} is specially defined as @@ -1031,7 +1650,7 @@ arguments to the @code{help} command. @cindex repeating commands @kindex RET -A blank line as input to _GDBN__ (typing just @key{RET}) means to +A blank line as input to @value{GDBN} (typing just @key{RET}) means to repeat the previous command. Certain commands (for example, @code{run}) will not repeat this way; these are commands for which unintentional repetition might cause trouble and which you are unlikely to want to @@ -1041,10 +1660,10 @@ The @code{list} and @code{x} commands, when you repeat them with @key{RET}, construct new arguments rather than repeating exactly as typed. This permits easy scanning of source or memory. -_GDBN__ can also use @key{RET} in another way: to partition lengthy +@value{GDBN} can also use @key{RET} in another way: to partition lengthy output, in a way similar to the common utility @code{more} (@pxref{Screen Size}). Since it is easy to press one @key{RET} too many -in this situation, _GDBN__ disables command repetition after any command +in this situation, @value{GDBN} disables command repetition after any command that generates this sort of display. @kindex # @@ -1057,13 +1676,13 @@ This is useful mainly in command files (@pxref{Command Files}). @cindex completion @cindex word completion -_GDBN__ can fill in the rest of a word in a command for you, if there's +@value{GDBN} can fill in the rest of a word in a command for you, if there's only one possibility; it can also show you what the valid possibilities -are for the next word in a command, at any time. This works for _GDBN__ -commands, _GDBN__ subcommands, and the names of symbols in your program. +are for the next word in a command, at any time. This works for @value{GDBN} +commands, @value{GDBN} subcommands, and the names of symbols in your program. -Press the @key{TAB} key whenever you want _GDBN__ to fill out the rest -of a word. If there's only one possibility, _GDBN__ will fill in the +Press the @key{TAB} key whenever you want @value{GDBN} to fill out the rest +of a word. If there's only one possibility, @value{GDBN} will fill in the word, and wait for you to finish the command (or press @key{RET} to enter it). For example, if you type @@ -1072,15 +1691,15 @@ enter it). For example, if you type @c If texinfo enhancements make it unnecessary, it would be nice to @c replace " @key" by "@key" in the following... @example -(_GDBP__) info bre @key{TAB} +(@value{GDBP}) info bre @key{TAB} @end example @noindent -_GDBN__ fills in the rest of the word @samp{breakpoints}, since that's +@value{GDBN} fills in the rest of the word @samp{breakpoints}, since that's the only @code{info} subcommand beginning with @samp{bre}: @example -(_GDBP__) info breakpoints +(@value{GDBP}) info breakpoints @end example @noindent @@ -1092,47 +1711,47 @@ might as well just type @key{RET} immediately after @samp{info bre}, to exploit command abbreviations rather than command completion). If there is more than one possibility for the next word when you press -@key{TAB}, _GDBN__ will sound a bell. You can either supply more +@key{TAB}, @value{GDBN} will sound a bell. You can either supply more characters and try again, or just press @key{TAB} a second time, and -_GDBN__ will display all the possible completions for that word. For +@value{GDBN} will display all the possible completions for that word. For example, you might want to set a breakpoint on a subroutine whose name -begins with @samp{make_}, but when you type @kbd{b make_@key{TAB}} _GDBN__ +begins with @samp{make_}, but when you type @kbd{b make_@key{TAB}} @value{GDBN} just sounds the bell. Typing @key{TAB} again will display all the function names in your program that begin with those characters, for example: @example -(_GDBP__) b make_ @key{TAB} -@exdent _GDBN__ sounds bell; press @key{TAB} again, to see: +(@value{GDBP}) b make_ @key{TAB} +@exdent @value{GDBN} sounds bell; press @key{TAB} again, to see: make_a_section_from_file make_environ make_abs_section make_function_type make_blockvector make_pointer_type make_cleanup make_reference_type make_command make_symbol_completion_list -(GDBP__) b make_ +(@value{GDBP}) b make_ @end example @noindent -After displaying the available possibilities, _GDBN__ copies your +After displaying the available possibilities, @value{GDBN} copies your partial input (@samp{b make_} in the example) so you can finish the command. If you just want to see the list of alternatives in the first place, you can press @kbd{M-?} rather than pressing @key{TAB} twice. @kbd{M-?} means @kbd{@key{META} ?}. You can type this -_if__(_GENERIC__||!_DOSHOST__) +@ifclear DOSHOST either by holding down a key designated as the @key{META} shift on your keyboard (if there is one) while typing @kbd{?}, or -_fi__(_GENERIC__||!_DOSHOST__) +@end ifclear as @key{ESC} followed by @kbd{?}. @cindex quotes in commands @cindex completion of quoted strings Sometimes the string you need, while logically a ``word'', may contain -parentheses or other characters that _GDBN__ normally excludes from its +parentheses or other characters that @value{GDBN} normally excludes from its notion of a word. To permit word completion to work in this situation, -you may enclose words in @code{'} (single quote marks) in _GDBN__ commands. +you may enclose words in @code{'} (single quote marks) in @value{GDBN} commands. The most likely situation where you might need this is in typing the name of a C++ function. This is because C++ allows function overloading @@ -1142,29 +1761,29 @@ distinguish whether you mean the version of @code{name} that takes an @code{int} parameter, @code{name(int)}, or the version that takes a @code{float} parameter, @code{name(float)}. To use the word-completion facilities in this situation, type a single quote @code{'} at the -beginning of the function name. This alerts _GDBN__ that it may need to +beginning of the function name. This alerts @value{GDBN} that it may need to consider more information than usual when you press @key{TAB} or @kbd{M-?} to request word completion: @example -(_GDBP__) b 'bubble( @key{M-?} +(@value{GDBP}) b 'bubble( @key{M-?} bubble(double,double) bubble(int,int) -(_GDBP__) b 'bubble( +(@value{GDBP}) b 'bubble( @end example -In some cases, _GDBN__ can tell that completing a name will require -quotes. When this happens, _GDBN__ will insert the quote for you (while +In some cases, @value{GDBN} can tell that completing a name will require +quotes. When this happens, @value{GDBN} will insert the quote for you (while completing as much as it can) if you do not type the quote in the first place: @example -(_GDBP__) b bub @key{TAB} -@exdent _GDBN__ alters your input line to the following, and rings a bell: -(_GDBP__) b 'bubble( +(@value{GDBP}) b bub @key{TAB} +@exdent @value{GDBN} alters your input line to the following, and rings a bell: +(@value{GDBP}) b 'bubble( @end example @noindent -In general, _GDBN__ can tell that a quote is needed (and inserts it) if +In general, @value{GDBN} can tell that a quote is needed (and inserts it) if you have not yet started typing the argument list when you ask for completion on an overloaded symbol. @@ -1174,7 +1793,7 @@ completion on an overloaded symbol. @cindex online documentation @kindex help -You can always ask _GDBN__ itself for information on its commands, using the +You can always ask @value{GDBN} itself for information on its commands, using the command @code{help}. @table @code @@ -1185,7 +1804,7 @@ You can use @code{help} (abbreviated @code{h}) with no arguments to display a short list of named classes of commands: @smallexample -(_GDBP__) help +(@value{GDBP}) help List of classes of commands: running -- Running the program @@ -1204,7 +1823,7 @@ commands in that class. Type "help" followed by command name for full documentation. Command name abbreviations are allowed if unambiguous. -(_GDBP__) +(@value{GDBP}) @end smallexample @item help @var{class} @@ -1213,7 +1832,7 @@ list of the individual commands in that class. For example, here is the help display for the class @code{status}: @smallexample -(_GDBP__) help status +(@value{GDBP}) help status Status inquiries. List of commands: @@ -1224,17 +1843,17 @@ info -- Generic command for printing status Type "help" followed by command name for full documentation. Command name abbreviations are allowed if unambiguous. -(_GDBP__) +(@value{GDBP}) @end smallexample @item help @var{command} -With a command name as @code{help} argument, _GDBN__ will display a +With a command name as @code{help} argument, @value{GDBN} will display a short paragraph on how to use that command. @end table -In addition to @code{help}, you can use the _GDBN__ commands @code{info} +In addition to @code{help}, you can use the @value{GDBN} commands @code{info} and @code{show} to inquire about the state of your program, or the state -of _GDBN__ itself. Each command supports many topics of inquiry; this +of @value{GDBN} itself. Each command supports many topics of inquiry; this manual introduces each of them in the appropriate context. The listings under @code{info} and under @code{show} in the Index point to all the sub-commands. @xref{Index}. @@ -1253,7 +1872,7 @@ You can get a complete list of the @code{info} sub-commands with @kindex show @item show -In contrast, @code{show} is for describing the state of _GDBN__ itself. +In contrast, @code{show} is for describing the state of @value{GDBN} itself. You can change most of the things you can @code{show}, by using the related command @code{set}; for example, you can control what number system is used for displays with @code{set radix}, or simply inquire @@ -1276,16 +1895,16 @@ exceptional in lacking corresponding @code{set} commands: @kindex show version @cindex version number @item show version -Show what version of _GDBN__ is running. You should include this -information in _GDBN__ bug-reports. If multiple versions of _GDBN__ are in +Show what version of @value{GDBN} is running. You should include this +information in @value{GDBN} bug-reports. If multiple versions of @value{GDBN} are in use at your site, you may occasionally want to make sure what version -of _GDBN__ you are running; as _GDBN__ evolves, new commands are introduced, +of @value{GDBN} you are running; as @value{GDBN} evolves, new commands are introduced, and old ones may wither away. The version number is also announced -when you start _GDBN__ with no arguments. +when you start @value{GDBN} with no arguments. @kindex show copying @item show copying -Display information about permission for copying _GDBN__. +Display information about permission for copying @value{GDBN}. @kindex show warranty @item show warranty @@ -1293,14 +1912,16 @@ Display the GNU ``NO WARRANTY'' statement. @end table @node Running -@chapter Running Programs Under _GDBN__ +@chapter Running Programs Under @value{GDBN} -To debug a program, you must run it under _GDBN__. +To debug a program, you must run it under @value{GDBN}. +@ignore +@c pre-unfolding: @menu * Compilation:: Compiling for Debugging * Starting:: Starting your Program -_if__(!_BARE__) +@ifclear BARETARGET * Arguments:: Your Program's Arguments * Environment:: Your Program's Environment * Working Directory:: Your Program's Working Directory @@ -1308,8 +1929,30 @@ _if__(!_BARE__) * Attach:: Debugging an Already-Running Process * Kill Process:: Killing the Child Process * Process Information:: Additional Process Information -_fi__(!_BARE__) +@end ifclear @end menu +@end ignore + +@ifclear BARETARGET +@menu +* Compilation:: Compiling for Debugging +* Starting:: Starting your Program +* Arguments:: Your Program's Arguments +* Environment:: Your Program's Environment +* Working Directory:: Your Program's Working Directory +* Input/Output:: Your Program's Input and Output +* Attach:: Debugging an Already-Running Process +* Kill Process:: Killing the Child Process +* Process Information:: Additional Process Information +@end menu +@end ifclear + +@ifset BARETARGET +@menu +* Compilation:: Compiling for Debugging +* Starting:: Starting your Program +@end menu +@end ifset @node Compilation @section Compiling for Debugging @@ -1327,7 +1970,7 @@ Many C compilers are unable to handle the @samp{-g} and @samp{-O} options together. Using those compilers, you cannot generate optimized executables containing debugging information. -_GCC__, the GNU C compiler, supports @samp{-g} with or without +@value{NGCC}, the GNU C compiler, supports @samp{-g} with or without @samp{-O}, making it possible to debug optimized code. We recommend that you @emph{always} use @samp{-g} whenever you compile a program. You may think your program is correct, but there is no sense in pushing @@ -1339,7 +1982,7 @@ When you debug a program compiled with @samp{-g -O}, remember that the optimizer is rearranging your code; the debugger will show you what's really there. Don't be too surprised when the execution path doesn't exactly match your source file! An extreme example: if you define a -variable, but never use it, _GDBN__ will never see that +variable, but never use it, @value{GDBN} will never see that variable---because the compiler optimizes it out of existence. Some things do not work as well with @samp{-g -O} as with just @@ -1348,17 +1991,17 @@ doubt, recompile with @samp{-g} alone, and if this fixes the problem, please report it as a bug (including a test case!). Older versions of the GNU C compiler permitted a variant option -@w{@samp{-gg}} for debugging information. _GDBN__ no longer supports this +@w{@samp{-gg}} for debugging information. @value{GDBN} no longer supports this format; if your GNU C compiler has this option, do not use it. @ignore -@comment As far as I know, there are no cases in which _GDBN__ will +@comment As far as I know, there are no cases in which @value{GDBN} will @comment produce strange output in this case. (but no promises). If your program includes archives made with the @code{ar} program, and if the object files used as input to @code{ar} were compiled without the -@samp{-g} option and have names longer than 15 characters, _GDBN__ will get +@samp{-g} option and have names longer than 15 characters, @value{GDBN} will get confused reading your program's symbol table. No error message will be -given, but _GDBN__ may behave strangely. The reason for this problem is a +given, but @value{GDBN} may behave strangely. The reason for this problem is a deficiency in the Unix archive file format, which cannot represent file names longer than 15 characters. @@ -1376,26 +2019,26 @@ option or use shorter file names. Alternatively, use a version of GNU @item run @itemx r @kindex run -Use the @code{run} command to start your program under _GDBN__. You must +Use the @code{run} command to start your program under @value{GDBN}. You must first specify the program name -_if__(_VXWORKS__) +@ifset VXWORKS (except on VxWorks) -_fi__(_VXWORKS__) +@end ifset with an argument to -_GDBN__ (@pxref{Invocation, ,Getting In and Out of _GDBN__}), or by using the +@value{GDBN} (@pxref{Invocation, ,Getting In and Out of @value{GDBN}}), or by using the @code{file} or @code{exec-file} command (@pxref{Files, ,Commands to Specify Files}). @end table -_if__(!_BARE__) +@ifclear BARETARGET If you are running your program in an execution environment that supports processes, @code{run} creates an inferior process and makes that process run your program. (In environments without processes, @code{run} jumps to the start of your program.) The execution of a program is affected by certain information it -receives from its superior. _GDBN__ provides ways to specify this +receives from its superior. @value{GDBN} provides ways to specify this information, which you must do @emph{before} starting your program. (You can change it after starting your program, but such changes will only affect your program the next time you start it.) This information may be @@ -1412,19 +2055,19 @@ with the @code{SHELL} environment variable. @xref{Arguments, ,Your Program's Arguments}. @item The @emph{environment.} -Your program normally inherits its environment from _GDBN__, but you can -use the _GDBN__ commands @code{set environment} and @code{unset +Your program normally inherits its environment from @value{GDBN}, but you can +use the @value{GDBN} commands @code{set environment} and @code{unset environment} to change parts of the environment that will be given to your program. @xref{Environment, ,Your Program's Environment}. @item The @emph{working directory.} -Your program inherits its working directory from _GDBN__. You can set -_GDBN__'s working directory with the @code{cd} command in _GDBN__. +Your program inherits its working directory from @value{GDBN}. You can set +@value{GDBN}'s working directory with the @code{cd} command in @value{GDBN}. @xref{Working Directory, ,Your Program's Working Directory}. @item The @emph{standard input and output.} Your program normally uses the same device for standard input and -standard output as _GDBN__ is using. You can redirect input and output +standard output as @value{GDBN} is using. You can redirect input and output in the @code{run} command line, or you can use the @code{tty} command to set a different device for your program. @xref{Input/Output, ,Your Program's Input and Output}. @@ -1432,10 +2075,10 @@ set a different device for your program. @cindex pipes @emph{Warning:} While input and output redirection work, you cannot use pipes to pass the output of the program you are debugging to another -program; if you attempt this, _GDBN__ is likely to wind up debugging the +program; if you attempt this, @value{GDBN} is likely to wind up debugging the wrong program. @end table -_fi__(!_BARE__) +@end ifclear When you issue the @code{run} command, your program begins to execute immediately. @xref{Stopping, ,Stopping and Continuing}, for discussion @@ -1444,11 +2087,11 @@ stopped, you may calls functions in your program, using the @code{print} or @code{call} commands. @xref{Data, ,Examining Data}. If the modification time of your symbol file has changed since the -last time _GDBN__ read its symbols, _GDBN__ will discard its symbol table and -re-read it. When it does this, _GDBN__ tries to retain your current +last time @value{GDBN} read its symbols, @value{GDBN} will discard its symbol table and +re-read it. When it does this, @value{GDBN} tries to retain your current breakpoints. -_if__(!_BARE__) +@ifclear BARETARGET @node Arguments @section Your Program's Arguments @@ -1456,8 +2099,8 @@ _if__(!_BARE__) The arguments to your program can be specified by the arguments of the @code{run} command. They are passed to a shell, which expands wildcard characters and performs redirection of I/O, and thence to your program. -_GDBN__ uses the shell indicated by your environment variable -@code{SHELL} if it exists; otherwise, _GDBN__ uses @code{/bin/sh}. +@value{GDBN} uses the shell indicated by your environment variable +@code{SHELL} if it exists; otherwise, @value{GDBN} uses @code{/bin/sh}. @code{run} with no arguments uses the same arguments used by the previous @code{run}, or those set by the @code{set args} command. @@ -1486,21 +2129,21 @@ your user name, your home directory, your terminal type, and your search path for programs to run. Usually you set up environment variables with the shell and they are inherited by all the other programs you run. When debugging, it can be useful to try running your program with a modified -environment without having to start _GDBN__ over again. +environment without having to start @value{GDBN} over again. @table @code @item path @var{directory} @kindex path Add @var{directory} to the front of the @code{PATH} environment variable -(the search path for executables), for both _GDBN__ and your program. +(the search path for executables), for both @value{GDBN} and your program. You may specify several directory names, separated by @samp{:} or whitespace. If @var{directory} is already in the path, it is moved to the front, so it will be searched sooner. You can use the string @samp{$cwd} to refer to whatever is the current -working directory at the time _GDBN__ searches the path. If you use +working directory at the time @value{GDBN} searches the path. If you use @samp{.} instead, it refers to the directory where you executed the -@code{path} command. _GDBN__ fills in the current path where needed in +@code{path} command. @value{GDBN} fills in the current path where needed in the @var{directory} argument, before adding it to the search path. @c 'path' is explicitly nonrepeatable, but RMS points out it is silly to @c document that, since repeating it would be a no-op. @@ -1520,7 +2163,7 @@ your program. You can abbreviate @code{environment} as @code{env}. @item set environment @var{varname} @r{[}=@r{]} @var{value} @kindex set environment Sets environment variable @var{varname} to @var{value}. The value -changes for your program only, not for _GDBN__ itself. @var{value} may +changes for your program only, not for @value{GDBN} itself. @var{value} may be any string; the values of environment variables are just strings, and any interpretation is supplied by your program itself. The @var{value} parameter is optional; if it is eliminated, the variable is set to a @@ -1552,23 +2195,23 @@ rather than assigning it an empty value. @cindex working directory (of your program) Each time you start your program with @code{run}, it inherits its -working directory from the current working directory of _GDBN__. _GDBN__'s +working directory from the current working directory of @value{GDBN}. @value{GDBN}'s working directory is initially whatever it inherited from its parent process (typically the shell), but you can specify a new working -directory in _GDBN__ with the @code{cd} command. +directory in @value{GDBN} with the @code{cd} command. -The _GDBN__ working directory also serves as a default for the commands -that specify files for _GDBN__ to operate on. @xref{Files, ,Commands to +The @value{GDBN} working directory also serves as a default for the commands +that specify files for @value{GDBN} to operate on. @xref{Files, ,Commands to Specify Files}. @table @code @item cd @var{directory} @kindex cd -Set _GDBN__'s working directory to @var{directory}. +Set @value{GDBN}'s working directory to @var{directory}. @item pwd @kindex pwd -Print _GDBN__'s working directory. +Print @value{GDBN}'s working directory. @end table @node Input/Output @@ -1577,8 +2220,8 @@ Print _GDBN__'s working directory. @cindex redirection @cindex i/o @cindex terminal -By default, the program you run under _GDBN__ does input and output to -the same terminal that _GDBN__ uses. _GDBN__ switches the terminal to +By default, the program you run under @value{GDBN} does input and output to +the same terminal that @value{GDBN} uses. @value{GDBN} switches the terminal to its own terminal modes to interact with you, but it records the terminal modes your program was using and switches back to them when you continue running your program. @@ -1586,16 +2229,16 @@ running your program. @table @code @item info terminal @kindex info terminal -Displays _GDBN__'s recorded information about the terminal modes your +Displays @value{GDBN}'s recorded information about the terminal modes your program is using. @end table You can redirect your program's input and/or output using shell redirection with the @code{run} command. For example, -_0__@example +@example run > outfile -_1__@end example +@end example @noindent starts your program, diverting its output to the file @file{outfile}. @@ -1623,7 +2266,7 @@ terminal. When you use the @code{tty} command or redirect input in the @code{run} command, only the input @emph{for your program} is affected. The input -for _GDBN__ still comes from your terminal. +for @value{GDBN} still comes from your terminal. @node Attach @section Debugging an Already-Running Process @@ -1633,7 +2276,7 @@ for _GDBN__ still comes from your terminal. @table @code @item attach @var{process-id} This command -attaches to a running process---one that was started outside _GDBN__. +attaches to a running process---one that was started outside @value{GDBN}. (@code{info files} will show your active targets.) The command takes as argument a process ID. The usual way to find out the process-id of a Unix process is with the @code{ps} utility, or with the @samp{jobs -l} @@ -1645,34 +2288,34 @@ executing the command. To use @code{attach}, you must be debugging in an environment which supports processes. You must also have permission to send the process a -signal, and it must have the same effective user ID as the _GDBN__ +signal, and it must have the same effective user ID as the @value{GDBN} process. When using @code{attach}, you should first use the @code{file} command to specify the program running in the process and load its symbol table. @xref{Files, ,Commands to Specify Files}. -The first thing _GDBN__ does after arranging to debug the specified +The first thing @value{GDBN} does after arranging to debug the specified process is to stop it. You can examine and modify an attached process -with all the _GDBN__ commands that are ordinarily available when you start +with all the @value{GDBN} commands that are ordinarily available when you start processes with @code{run}. You can insert breakpoints; you can step and continue; you can modify storage. If you would rather the process continue running, you may use the @code{continue} command after -attaching _GDBN__ to the process. +attaching @value{GDBN} to the process. @table @code @item detach @kindex detach When you have finished debugging the attached process, you can use the -@code{detach} command to release it from _GDBN__'s control. Detaching +@code{detach} command to release it from @value{GDBN}'s control. Detaching the process continues its execution. After the @code{detach} command, -that process and _GDBN__ become completely independent once more, and you +that process and @value{GDBN} become completely independent once more, and you are ready to @code{attach} another process or start one with @code{run}. @code{detach} will not repeat if you press @key{RET} again after executing the command. @end table -If you exit _GDBN__ or use the @code{run} command while you have an attached +If you exit @value{GDBN} or use the @code{run} command while you have an attached process, you kill that process. By default, you will be asked for confirmation if you try to do either of these things; you can control whether or not you need to confirm by using the @code{set confirm} command @@ -1685,23 +2328,23 @@ whether or not you need to confirm by using the @code{set confirm} command @table @code @item kill @kindex kill -Kill the child process in which your program is running under _GDBN__. +Kill the child process in which your program is running under @value{GDBN}. @end table This command is useful if you wish to debug a core dump instead of a -running process. _GDBN__ ignores any core dump file while your program +running process. @value{GDBN} ignores any core dump file while your program is running. @c @end group -On some operating systems, a program cannot be executed outside _GDBN__ -while you have breakpoints set on it inside _GDBN__. You can use the +On some operating systems, a program cannot be executed outside @value{GDBN} +while you have breakpoints set on it inside @value{GDBN}. You can use the @code{kill} command in this situation to permit running your program outside the debugger. The @code{kill} command is also useful if you wish to recompile and relink your program, since on many systems it is impossible to modify an executable file while it is running in a process. In this case, when you -next type @code{run}, _GDBN__ will notice that the file has changed, and +next type @code{run}, @value{GDBN} will notice that the file has changed, and will re-read the symbol table (while trying to preserve your current breakpoint settings). @@ -1712,7 +2355,7 @@ breakpoint settings). @cindex process image Some operating systems provide a facility called @samp{/proc} that can be used to examine the image of a running process using file-system -subroutines. If _GDBN__ is configured for an operating system with this +subroutines. If @value{GDBN} is configured for an operating system with this facility, the command @code{info proc} is available to report on several kinds of information about the process running your program. @@ -1745,7 +2388,7 @@ received. @item info proc all Show all the above information about the process. @end table -_fi__(!_BARE__) +@end ifclear @node Stopping @chapter Stopping and Continuing @@ -1754,11 +2397,11 @@ The principal purpose of using a debugger is so that you can stop your program before it terminates; or so that, if your program runs into trouble, you can investigate and find out why. -Inside _GDBN__, your program may stop for any of several reasons, such -as a signal, a breakpoint, or reaching a new line after a _GDBN__ +Inside @value{GDBN}, your program may stop for any of several reasons, such +as a signal, a breakpoint, or reaching a new line after a @value{GDBN} command such as @code{step}. You may then examine and change variables, set new breakpoints or remove old ones, and then continue -execution. Usually, the messages shown by _GDBN__ provide ample +execution. Usually, the messages shown by @value{GDBN} provide ample explanation of the status of your program---but you can also explicitly request this information at any time. @@ -1769,26 +2412,75 @@ Display information about the status of your program: whether it is running or not, what process it is, and why it stopped. @end table +@ignore +@c original menu +@menu +@ifclear CONLY +* Breakpoints:: Breakpoints, Watchpoints, and Exceptions +@end ifclear +@ifset CONLY +* Breakpoints:: Breakpoints and Watchpoints +@end ifset +* Continuing and Stepping:: Resuming Execution +@ifset POSIX +* Signals:: Signals +@end ifset +@end menu +@end ignore + +@c !CONLY && POSIX +@ifclear CONLY +@ifset POSIX @menu -_if__(!_CONLY__) * Breakpoints:: Breakpoints, Watchpoints, and Exceptions -_fi__(!_CONLY__) -_if__(_CONLY__) +* Continuing and Stepping:: Resuming Execution +* Signals:: Signals +@end menu +@end ifset +@end ifclear + +@c CONLY && POSIX +@ifset CONLY +@ifset POSIX +@menu * Breakpoints:: Breakpoints and Watchpoints -_fi__(_CONLY__) * Continuing and Stepping:: Resuming Execution -_if__(_GENERIC__ || !_H8__) * Signals:: Signals -_fi__(_GENERIC__ || !_H8__) @end menu +@end ifset +@end ifset + +@c !CONLY && !POSIX +@ifclear CONLY +@ifclear POSIX +@menu +* Breakpoints:: Breakpoints, Watchpoints, and Exceptions +* Continuing and Stepping:: Resuming Execution +@end menu +@end ifclear +@end ifclear + +@c CONLY && !POSIX +@ifset CONLY +@ifclear POSIX +@menu +* Breakpoints:: Breakpoints and Watchpoints +* Continuing and Stepping:: Resuming Execution +@end menu +@end ifclear +@end ifset +@c node-defaulting requires adjacency of @node and sectioning cmds +@c ...hence distribute @node Breakpoints over two possible @if expansions. +@c +@ifclear CONLY @node Breakpoints -_if__(!_CONLY__) @section Breakpoints, Watchpoints, and Exceptions -_fi__(!_CONLY__) -_if__(_CONLY__) +@end ifclear +@ifset CONLY +@node Breakpoints @section Breakpoints and Watchpoints -_fi__(_CONLY__) +@end ifset @cindex breakpoints A @dfn{breakpoint} makes your program stop whenever a certain point in @@ -1798,11 +2490,11 @@ You can set breakpoints with the @code{break} command and its variants (@pxref{Set Breaks, ,Setting Breakpoints}), to specify the place where your program should stop by line number, function name or exact address in the program. -_if__(!_CONLY__) +@ifclear CONLY In languages with exception handling (such as GNU C++), you can also set breakpoints where an exception is raised (@pxref{Exception Handling, ,Breakpoints and Exceptions}). -_fi__(!_CONLY__) +@end ifclear @cindex watchpoints @cindex memory tracing @@ -1817,7 +2509,7 @@ and watchpoints using the same commands. @cindex breakpoint numbers @cindex numbers for breakpoints -_GDBN__ assigns a number to each breakpoint or watchpoint when you +@value{GDBN} assigns a number to each breakpoint or watchpoint when you create it; these numbers are successive integers starting with one. In many of the commands for controlling various features of breakpoints you use the breakpoint number to say which breakpoint you want to change. @@ -1859,11 +2551,11 @@ You have several ways to say where the breakpoint should go. @table @code @item break @var{function} Set a breakpoint at entry to function @var{function}. -_if__(!_CONLY__) +@ifclear CONLY When using source languages that permit overloading of symbols, such as C++, @var{function} may refer to more than one possible place to break. @xref{Breakpoint Menus}, for a discussion of that situation. -_fi__(!_CONLY__) +@end ifclear @item break +@var{offset} @itemx break -@var{offset} @@ -1898,11 +2590,11 @@ innermost, this will cause your program to stop as soon as control returns to that frame. This is similar to the effect of a @code{finish} command in the frame inside the selected frame---except that @code{finish} does not leave an active breakpoint. If you use -@code{break} without an argument in the innermost frame, _GDBN__ will stop +@code{break} without an argument in the innermost frame, @value{GDBN} will stop the next time it reaches the current location; this may be useful inside loops. -_GDBN__ normally ignores breakpoints when it resumes execution, until at +@value{GDBN} normally ignores breakpoints when it resumes execution, until at least one instruction has been executed. If it did not do this, you would be unable to proceed past a breakpoint without first disabling the breakpoint. This rule applies whether or not the breakpoint already @@ -1934,11 +2626,11 @@ breakpoints it set. Once these breakpoints are set, they are treated just like the breakpoints set with the @code{break} command. They can be deleted, disabled, made conditional, etc., in the standard ways. -_if__(!_CONLY__) +@ifclear CONLY When debugging C++ programs, @code{rbreak} is useful for setting breakpoints on overloaded functions that are not members of any special classes. -_fi__(!_CONLY__) +@end ifclear @kindex info breakpoints @cindex @code{$_} and @code{info breakpoints} @@ -1976,26 +2668,26 @@ the @code{x} command are set to the address of the last breakpoint listed (@pxref{Memory, ,Examining Memory}). @end table -_GDBN__ allows you to set any number of breakpoints at the same place in +@value{GDBN} allows you to set any number of breakpoints at the same place in your program. There is nothing silly or meaningless about this. When the breakpoints are conditional, this is even useful (@pxref{Conditions, ,Break Conditions}). @cindex negative breakpoint numbers -@cindex internal _GDBN__ breakpoints -_GDBN__ itself sometimes sets breakpoints in your program for special +@cindex internal @value{GDBN} breakpoints +@value{GDBN} itself sometimes sets breakpoints in your program for special purposes, such as proper handling of @code{longjmp} (in C programs). These internal breakpoints are assigned negative numbers, starting with @code{-1}; @samp{info breakpoints} does not display them. -You can see these breakpoints with the _GDBN__ maintenance command +You can see these breakpoints with the @value{GDBN} maintenance command @samp{maint info breakpoints}. @table @code @kindex maint info breakpoints @item maint info breakpoints Using the same format as @samp{info breakpoints}, display both the -breakpoints you've set explicitly, and those _GDBN__ is using for +breakpoints you've set explicitly, and those @value{GDBN} is using for internal purposes. Internal breakpoints are shown with negative breakpoint numbers. The type column identifies what kind of breakpoint is shown: @@ -2015,10 +2707,10 @@ Internal breakpoint, used to handle correctly stepping through Internal breakpoint at the target of a @code{longjmp}. @item until -Temporary internal breakpoint used by the _GDBN__ @code{until} command. +Temporary internal breakpoint used by the @value{GDBN} @code{until} command. @item finish -Temporary internal breakpoint used by the _GDBN__ @code{finish} command. +Temporary internal breakpoint used by the @value{GDBN} @code{finish} command. @end table @end table @@ -2036,7 +2728,7 @@ Watchpoints currently execute two orders of magnitude more slowly than other breakpoints, but this can well be worth it to catch errors where you have no clue what part of your program is the culprit. Some processors provide special hardware to support watchpoint evaluation; future -releases of _GDBN__ will use such hardware if it is available. +releases of @value{GDBN} will use such hardware if it is available. @table @code @kindex watch @@ -2054,7 +2746,7 @@ same as @code{info break}. @cindex exception handlers Some languages, such as GNU C++, implement exception handling. You can -use _GDBN__ to examine what caused your program to raise an exception, +use @value{GDBN} to examine what caused your program to raise an exception, and to list the exceptions your program is prepared to handle at a given point in time. @@ -2069,16 +2761,16 @@ to catch. You can use @code{info catch} to list active exception handlers. @xref{Frame Info, ,Information About a Frame}. -There are currently some limitations to exception handling in _GDBN__. +There are currently some limitations to exception handling in @value{GDBN}. These will be corrected in a future release. @itemize @bullet @item -If you call a function interactively, _GDBN__ normally returns +If you call a function interactively, @value{GDBN} normally returns control to you when the function has finished executing. If the call raises an exception, however, the call may bypass the mechanism that returns control to you and cause your program to simply continue -running until it hits a breakpoint, catches a signal that _GDBN__ is +running until it hits a breakpoint, catches a signal that @value{GDBN} is listening for, or exits. @item You cannot raise an exception interactively. @@ -2131,7 +2823,7 @@ where they are in your program. With the @code{delete} command you can delete individual breakpoints or watchpoints by specifying their breakpoint numbers. -It is not necessary to delete a breakpoint to proceed past it. _GDBN__ +It is not necessary to delete a breakpoint to proceed past it. @value{GDBN} automatically ignores breakpoints on the first instruction to be executed when you continue execution without changing the execution address. @@ -2156,7 +2848,7 @@ Delete any breakpoints set at or within the code of the specified line. @kindex delete @kindex d Delete the breakpoints or watchpoints of the numbers specified as -arguments. If no argument is specified, delete all breakpoints (_GDBN__ +arguments. If no argument is specified, delete all breakpoints (@value{GDBN} asks confirmation, unless you have @code{set confirm off}). You can abbreviate this command as @code{d}. @end table @@ -2262,7 +2954,7 @@ your program. This can be useful, for example, to activate functions that log program progress, or to use your own print functions to format special data structures. The effects are completely predictable unless there is another enabled breakpoint at the same address. (In -that case, _GDBN__ might see the other breakpoint first and stop your +that case, @value{GDBN} might see the other breakpoint first and stop your program without checking the condition of this one.) Note that breakpoint commands are usually more convenient and flexible for the purpose of performing side effects when a breakpoint is reached @@ -2281,12 +2973,12 @@ impose a further condition on a watchpoint. Specify @var{expression} as the break condition for breakpoint or watchpoint number @var{bnum}. From now on, this breakpoint will stop your program only if the value of @var{expression} is true (nonzero, in -C). When you use @code{condition}, _GDBN__ checks @var{expression} +C). When you use @code{condition}, @value{GDBN} checks @var{expression} immediately for syntactic correctness, and to determine whether symbols in it have referents in the context of your breakpoint. @c FIXME so what does GDB do if there is no referent? Moreover, what @c about watchpoints? -_GDBN__ does +@value{GDBN} does not actually evaluate @var{expression} at the time the @code{condition} command is given, however. @xref{Expressions, ,Expressions}. @@ -2312,7 +3004,7 @@ is reached. @kindex ignore Set the ignore count of breakpoint number @var{bnum} to @var{count}. The next @var{count} times the breakpoint is reached, your program's -execution will not stop; other than to decrement the ignore count, _GDBN__ +execution will not stop; other than to decrement the ignore count, @value{GDBN} takes no action. To make the breakpoint stop the next time it is reached, specify @@ -2340,7 +3032,7 @@ is not checked. Once the ignore count reaches zero, the condition will be checked. You could achieve the effect of the ignore count with a condition such -as _0__@w{@samp{$foo-- <= 0}}_1__ using a debugger convenience variable that +as @w{@samp{$foo-- <= 0}} using a debugger convenience variable that is decremented each time. @xref{Convenience Vars, ,Convenience Variables}. @@ -2371,7 +3063,7 @@ breakpoint or watchpoint set (not to the breakpoint most recently encountered). @end table -Pressing @key{RET} as a means of repeating the last _GDBN__ command is +Pressing @key{RET} as a means of repeating the last @value{GDBN} command is disabled within a @var{command-list}. You can use breakpoint commands to start your program up again. Simply @@ -2394,7 +3086,7 @@ precisely controlled output are often useful in silent breakpoints. For example, here is how you could use breakpoint commands to print the value of @code{x} at entry to @code{foo} whenever @code{x} is positive. -_0__@example +@example break foo if x>0 commands silent @@ -2403,7 +3095,7 @@ output x echo \n cont end -_1__@end example +@end example One application for breakpoint commands is to compensate for one bug so you can test for another. Put a breakpoint just after the erroneous line @@ -2425,7 +3117,7 @@ end @cindex lost output One deficiency in the operation of automatically continuing breakpoints under Unix appears when your program uses raw mode for the terminal. -_GDBN__ switches back to its own terminal modes (not raw) before executing +@value{GDBN} switches back to its own terminal modes (not raw) before executing commands, and then must switch back to raw mode when your program is continued. This causes any pending terminal input to be lost. @c FIXME: revisit below when GNU sys avail. @@ -2442,7 +3134,7 @@ condition 5 (x = y + 4), 0 @noindent specifies a condition expression (@pxref{Expressions, ,Expressions}) that will change @code{x} as needed, then always have the value zero so your -program will not stop. No input is lost here, because _GDBN__ evaluates +program will not stop. No input is lost here, because @value{GDBN} evaluates break conditions without changing the terminal modes. When you want to have nontrivial conditions for performing the side effects, the operators @samp{&&}, @samp{||} and @samp{?@dots{}:} may be useful. @@ -2455,10 +3147,10 @@ operators @samp{&&}, @samp{||} and @samp{?@dots{}:} may be useful. Some programming languages (notably C++) permit a single function name to be defined several times, for application in different contexts. This is called @dfn{overloading}. When a function name is overloaded, -@samp{break @var{function}} is not enough to tell _GDBN__ where you want +@samp{break @var{function}} is not enough to tell @value{GDBN} where you want a breakpoint. If you realize this will be a problem, you can use something like @samp{break @var{function}(@var{types})} to specify which -particular version of the function you want. Otherwise, _GDBN__ offers +particular version of the function you want. Otherwise, @value{GDBN} offers you a menu of numbered choices for different possible breakpoints, and waits for your selection with the prompt @samp{>}. The first two options are always @samp{[0] cancel} and @samp{[1] all}. Typing @kbd{1} @@ -2472,7 +3164,7 @@ We choose three particular definitions of that function name: @c FIXME! This is likely to change to show arg type lists, at least @example -(_GDBP__) b String::after +(@value{GDBP}) b String::after [0] cancel [1] all [2] file:String.cc; line number:867 @@ -2487,7 +3179,7 @@ Breakpoint 2 at 0xb344: file String.cc, line 875. Breakpoint 3 at 0xafcc: file String.cc, line 846. Multiple breakpoints were set. Use the "delete" command to delete unwanted breakpoints. -(_GDBP__) +(@value{GDBP}) @end example @node Error in Breakpoints @@ -2500,7 +3192,7 @@ Use the "delete" command to delete unwanted breakpoints. @c too. pesch, 20sep91 Under some operating systems, breakpoints cannot be used in a program if any other process is running that program. In this situation, -attempting to run or continue a program with a breakpoint causes _GDBN__ +attempting to run or continue a program with a breakpoint causes @value{GDBN} to stop the other process. When this happens, you have three ways to proceed: @@ -2510,8 +3202,8 @@ When this happens, you have three ways to proceed: Remove or disable the breakpoints, then continue. @item -Suspend _GDBN__, and copy the file containing your program to a new name. -Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__ +Suspend @value{GDBN}, and copy the file containing your program to a new name. +Resume @value{GDBN} and use the @code{exec-file} command to specify that @value{GDBN} should run your program under that name. Then start your program again. @c FIXME: RMS commented here "Show example". Maybe when someone @@ -2535,14 +3227,14 @@ one more ``step'' of your program, where ``step'' may mean either one line of source code, or one machine instruction (depending on what particular command you use). Either when continuing or when stepping, your program may stop even sooner, due to -_if__(_BARE__) +@ifset BARETARGET a breakpoint. -_fi__(_BARE__) -_if__(!_BARE__) +@end ifset +@ifclear BARETARGET a breakpoint or to a signal. (If due to a signal, you may want to use @code{handle}, or use @samp{signal 0} to resume execution. @xref{Signals, ,Signals}.) -_fi__(!_BARE__) +@end ifclear @table @code @item continue @r{[}@var{ignore-count}@r{]} @@ -2571,7 +3263,7 @@ variables that are interesting, until you see the problem happen. @kindex step @kindex s Continue running your program until control reaches a different source -line, then stop it and return control to _GDBN__. This command is +line, then stop it and return control to @value{GDBN}. This command is abbreviated @code{s}. @quotation @@ -2636,10 +3328,10 @@ example, in the following excerpt from a debugging session, the @code{f} @code{206}; yet when we use @code{until}, we get to line @code{195}: @example -(_GDBP__) f +(@value{GDBP}) f #0 main (argc=4, argv=0xf7fffae8) at m4.c:206 206 expand_input(); -(_GDBP__) until +(@value{GDBP}) until 195 for ( ; argc > 0; NEXTARG) @{ @end example @@ -2686,7 +3378,7 @@ proceed until the function returns. An argument is a repeat count, as in @code{next}. @end table -_if__(_GENERIC__ || !_H8__) +@ifset POSIX @node Signals @section Signals @cindex signals @@ -2708,12 +3400,12 @@ program has not specified in advance some other way to handle the signal. @code{SIGINT} does not indicate an error in your program, but it is normally fatal so it can carry out the purpose of the interrupt: to kill the program. -_GDBN__ has the ability to detect any occurrence of a signal in your -program. You can tell _GDBN__ in advance what to do for each kind of +@value{GDBN} has the ability to detect any occurrence of a signal in your +program. You can tell @value{GDBN} in advance what to do for each kind of signal. @cindex handling signals -Normally, _GDBN__ is set up to ignore non-erroneous signals like @code{SIGALRM} +Normally, @value{GDBN} is set up to ignore non-erroneous signals like @code{SIGALRM} (so as not to interfere with their role in the functioning of your program) but to stop your program immediately whenever an error signal happens. You can change these settings with the @code{handle} command. @@ -2721,13 +3413,13 @@ You can change these settings with the @code{handle} command. @table @code @item info signals @kindex info signals -Print a table of all the kinds of signals and how _GDBN__ has been told to +Print a table of all the kinds of signals and how @value{GDBN} has been told to handle each one. You can use this to see the signal numbers of all the defined types of signals. @item handle @var{signal} @var{keywords}@dots{} @kindex handle -Change the way _GDBN__ handles signal @var{signal}. @var{signal} can be the +Change the way @value{GDBN} handles signal @var{signal}. @var{signal} can be the number of a signal or its name (with or without the @samp{SIG} at the beginning). The @var{keywords} say what change to make. @end table @@ -2738,34 +3430,34 @@ Their full names are: @table @code @item nostop -_GDBN__ should not stop your program when this signal happens. It may +@value{GDBN} should not stop your program when this signal happens. It may still print a message telling you that the signal has come in. @item stop -_GDBN__ should stop your program when this signal happens. This implies +@value{GDBN} should stop your program when this signal happens. This implies the @code{print} keyword as well. @item print -_GDBN__ should print a message when this signal happens. +@value{GDBN} should print a message when this signal happens. @item noprint -_GDBN__ should not mention the occurrence of the signal at all. This +@value{GDBN} should not mention the occurrence of the signal at all. This implies the @code{nostop} keyword as well. @item pass -_GDBN__ should allow your program to see this signal; your program will be +@value{GDBN} should allow your program to see this signal; your program will be able to handle the signal, or may be terminated if the signal is fatal and not handled. @item nopass -_GDBN__ should not allow your program to see this signal. +@value{GDBN} should not allow your program to see this signal. @end table @c @end group When a signal has been set to stop your program, your program cannot see the signal until you continue. It will see the signal then, if @code{pass} is in effect for the signal in question @emph{at that time}. In other words, -after _GDBN__ reports a signal, you can use the @code{handle} command with +after @value{GDBN} reports a signal, you can use the @code{handle} command with @code{pass} or @code{nopass} to control whether that signal will be seen by your program when you later continue it. @@ -2778,7 +3470,7 @@ execution; but your program would probably terminate immediately as a result of the fatal signal once it saw the signal. To prevent this, you can continue with @samp{signal 0}. @xref{Signaling, ,Giving your Program a Signal}. -_fi__(_GENERIC__ || !_H8__) +@end ifset @node Stack @chapter Examining the Stack @@ -2794,17 +3486,17 @@ call and the local variables of the function that was called. All the stack frames are allocated in a region of memory called the @dfn{call stack}. -When your program stops, the _GDBN__ commands for examining the stack allow you +When your program stops, the @value{GDBN} commands for examining the stack allow you to see all of this information. @cindex selected frame -One of the stack frames is @dfn{selected} by _GDBN__ and many _GDBN__ commands +One of the stack frames is @dfn{selected} by @value{GDBN} and many @value{GDBN} commands refer implicitly to the selected frame. In particular, whenever you ask -_GDBN__ for the value of a variable in your program, the value is found in the -selected frame. There are special _GDBN__ commands to select whichever frame +@value{GDBN} for the value of a variable in your program, the value is found in the +selected frame. There are special @value{GDBN} commands to select whichever frame you are interested in. -When your program stops, _GDBN__ automatically selects the currently executing +When your program stops, @value{GDBN} automatically selects the currently executing frame and describes it briefly as the @code{frame} command does (@pxref{Frame Info, ,Information About a Frame}). @@ -2847,22 +3539,22 @@ in a register called the @dfn{frame pointer register} while execution is going on in that frame. @cindex frame number -_GDBN__ assigns numbers to all existing stack frames, starting with +@value{GDBN} assigns numbers to all existing stack frames, starting with zero for the innermost frame, one for the frame that called it, and so on upward. These numbers do not really exist in your program; -they are assigned by _GDBN__ to give you a way of designating stack -frames in _GDBN__ commands. +they are assigned by @value{GDBN} to give you a way of designating stack +frames in @value{GDBN} commands. @cindex frameless execution Some compilers allow functions to be compiled so that they operate -without stack frames. (For example, the @code{_GCC__} option +without stack frames. (For example, the @code{@value{GCC}} option @samp{-fomit-frame-pointer} will generate functions without a frame.) This is occasionally done with heavily used library functions to save -the frame setup time. _GDBN__ has limited facilities for dealing with +the frame setup time. @value{GDBN} has limited facilities for dealing with these function invocations. If the innermost function invocation has no -stack frame, _GDBN__ will nevertheless regard it as though it had a +stack frame, @value{GDBN} will nevertheless regard it as though it had a separate frame, which is numbered zero as usual, allowing correct -tracing of the function call chain. However, _GDBN__ has no provision +tracing of the function call chain. However, @value{GDBN} has no provision for frameless functions elsewhere in the stack. @node Backtrace @@ -2947,18 +3639,18 @@ frame. @itemx f @var{addr} Select the frame at address @var{addr}. This is useful mainly if the chaining of stack frames has been damaged by a bug, making it -impossible for _GDBN__ to assign numbers properly to all frames. In +impossible for @value{GDBN} to assign numbers properly to all frames. In addition, this can be useful when your program has multiple stacks and switches between them. -_if__(_SPARC__) +@ifset SPARC On the SPARC architecture, @code{frame} needs two addresses to select an arbitrary frame: a frame pointer and a stack pointer. @c note to future updaters: this is conditioned on a flag @c FRAME_SPECIFICATION_DYADIC in the tm-*.h files, currently only used @c by SPARC, hence the specific attribution. Generalize or list all @c possibilities if more supported machines start doing this. -_fi__(_SPARC__) +@end ifset @item up @var{n} @kindex up @@ -2983,7 +3675,7 @@ example: @smallexample @group -(_GDBP__) up +(@value{GDBP}) up #1 0x22f0 in main (argc=1, argv=0xf7fffbf4, env=0xf7fffbfc) at env.c:10 10 read_input_file (argv[i]); @@ -3002,7 +3694,7 @@ print ten lines centered on the point of execution in the frame. These two commands are variants of @code{up} and @code{down}, respectively; they differ in that they do their work silently, without causing display of the new frame. They are intended primarily for use -in _GDBN__ command scripts, where the output might be unnecessary and +in @value{GDBN} command scripts, where the output might be unnecessary and distracting. @end table @@ -3065,28 +3757,48 @@ exception handlers, visit the associated frame (using the @code{up}, @node Source @chapter Examining Source Files -_GDBN__ can print parts of your program's source, since the debugging -information recorded in your program tells _GDBN__ what source files were -used to build it. When your program stops, _GDBN__ spontaneously prints +@value{GDBN} can print parts of your program's source, since the debugging +information recorded in your program tells @value{GDBN} what source files were +used to build it. When your program stops, @value{GDBN} spontaneously prints the line where it stopped. Likewise, when you select a stack frame -(@pxref{Selection, ,Selecting a Frame}), _GDBN__ prints the line where +(@pxref{Selection, ,Selecting a Frame}), @value{GDBN} prints the line where execution in that frame has stopped. You can print other portions of source files by explicit command. -_if__(!_DOSHOST__) -If you use _GDBN__ through its GNU Emacs interface, you may prefer to use -Emacs facilities to view source; @pxref{Emacs, ,Using _GDBN__ under GNU +@ifclear DOSHOST +If you use @value{GDBN} through its GNU Emacs interface, you may prefer to use +Emacs facilities to view source; @pxref{Emacs, ,Using @value{GDBN} under GNU Emacs}. -_fi__(!_DOSHOST__) +@end ifclear +@ignore +@c pre-unfolded menu @menu * List:: Printing Source Lines -_if__(_GENERIC__ || !_H8__) +@ifclear DOSHOST * Search:: Searching Source Files -_fi__(_GENERIC__ || !_H8__) +@end ifclear * Source Path:: Specifying Source Directories * Machine Code:: Source and Machine Code @end menu +@end ignore + +@ifclear DOSHOST +@menu +* List:: Printing Source Lines +* Search:: Searching Source Files +* Source Path:: Specifying Source Directories +* Machine Code:: Source and Machine Code +@end menu +@end ifclear + +@ifset DOSHOST +@menu +* List:: Printing Source Lines +* Source Path:: Specifying Source Directories +* Machine Code:: Source and Machine Code +@end menu +@end ifset @node List @section Printing Source Lines @@ -3119,7 +3831,7 @@ Stack}), this prints lines centered around that line. Print lines just before the lines last printed. @end table -By default, _GDBN__ prints ten source lines with any of these forms of +By default, @value{GDBN} prints ten source lines with any of these forms of the @code{list} command. You can change this using @code{set listsize}: @table @code @@ -3207,7 +3919,7 @@ Specifies the line containing the program address @var{address}. @var{address} may be any expression. @end table -_if__(_GENERIC__ || !_H8__) +@ifclear DOSHOST @node Search @section Searching Source Files @cindex searching @@ -3233,7 +3945,7 @@ with the one before the last line listed and going backward, for a match for @var{regexp}. It lists the line that is found. You can abbreviate this command as @code{rev}. @end table -_fi__(_GENERIC__ || !_H8__) +@end ifclear @node Source Path @section Specifying Source Directories @@ -3243,26 +3955,26 @@ _fi__(_GENERIC__ || !_H8__) Executable programs sometimes do not record the directories of the source files from which they were compiled, just the names. Even when they do, the directories could be moved between the compilation and your debugging -session. _GDBN__ has a list of directories to search for source files; -this is called the @dfn{source path}. Each time _GDBN__ wants a source file, +session. @value{GDBN} has a list of directories to search for source files; +this is called the @dfn{source path}. Each time @value{GDBN} wants a source file, it tries all the directories in the list, in the order they are present in the list, until it finds a file with the desired name. Note that the executable search path is @emph{not} used for this purpose. Neither is the current working directory, unless it happens to be in the source path. -If _GDBN__ cannot find a source file in the source path, and the object -program records a directory, _GDBN__ tries that directory too. If the +If @value{GDBN} cannot find a source file in the source path, and the object +program records a directory, @value{GDBN} tries that directory too. If the source path is empty, and there is no record of the compilation -directory, _GDBN__ will, as a last resort, look in the current +directory, @value{GDBN} will, as a last resort, look in the current directory. -Whenever you reset or rearrange the source path, _GDBN__ will clear out +Whenever you reset or rearrange the source path, @value{GDBN} will clear out any information it has cached about where source files are found, where each line is in the file, etc. @kindex directory -When you start _GDBN__, its source path is empty. +When you start @value{GDBN}, its source path is empty. To add other directories, use the @code{directory} command. @table @code @@ -3275,7 +3987,7 @@ path; this moves it forward, so it will be searched sooner. You can use the string @samp{$cdir} to refer to the compilation directory (if one is recorded), and @samp{$cwd} to refer to the current working directory. @samp{$cwd} is not the same as @samp{.}---the former -tracks the current working directory as it changes during your _GDBN__ +tracks the current working directory as it changes during your @value{GDBN} session, while the latter is immediately expanded to the current directory at the time you add an entry to the source path. @@ -3291,7 +4003,7 @@ Print the source path: show which directories it contains. @end table If your source path is cluttered with directories that are no longer of -interest, _GDBN__ may sometimes cause confusion by finding the wrong +interest, @value{GDBN} may sometimes cause confusion by finding the wrong versions of source. You can correct the situation as follows: @enumerate @@ -3325,7 +4037,7 @@ the object code for the first line of function @code{m4_changequote}: @smallexample -(_GDBP__) info line m4_changecom +(@value{GDBP}) info line m4_changecom Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350. @end smallexample @@ -3333,7 +4045,7 @@ Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350. We can also inquire (using @code{*@var{addr}} as the form for @var{linespec}) what source line covers a particular address: @smallexample -(_GDBP__) info line *0x63ff +(@value{GDBP}) info line *0x63ff Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404. @end smallexample @@ -3356,14 +4068,14 @@ will be dumped. Two arguments specify a range of addresses (first inclusive, second exclusive) to dump. @end table -_if__(_GENERIC__||!_H8__) +@ifclear HviiiEXCLUSIVE We can use @code{disassemble} to inspect the object code range shown in the last @code{info line} example (the example shows SPARC machine instructions): -_0__ + @smallexample -(_GDBP__) disas 0x63e4 0x6404 +(@value{GDBP}) disas 0x63e4 0x6404 Dump of assembler code from 0x63e4 to 0x6404: 0x63e4 <builtin_init+5340>: ble 0x63f8 <builtin_init+5360> 0x63e8 <builtin_init+5344>: sethi %hi(0x4c00), %o0 @@ -3375,16 +4087,15 @@ Dump of assembler code from 0x63e4 to 0x6404: 0x6400 <builtin_init+5368>: nop End of assembler dump. @end smallexample -_1__ -_fi__(_GENERIC__||!_H8__) +@end ifclear -_if__(!_GENERIC__||_H8__) +@ifset HviiiEXCLUSIVE For example, here is the beginning of the output for the disassembly of a function @code{fact}: -_0__ + @smallexample -(_GDBP__) disas fact +(@value{GDBP}) disas fact Dump of assembler code for function fact: to 0x808c: 0x802c <fact>: 6d f2 mov.w r2,@@-r7 @@ -3397,9 +4108,7 @@ to 0x808c: . . @end smallexample -_1__ -_fi__(!_GENERIC__||_H8__) - +@end ifset @node Data @chapter Examining Data @@ -3413,11 +4122,11 @@ _fi__(!_GENERIC__||_H8__) @c different window or something like that. The usual way to examine data in your program is with the @code{print} command (abbreviated @code{p}), or its synonym @code{inspect}. -_if__(!_CONLY__) +@ifclear CONLY It evaluates and prints the value of an expression of the language your -program is written in (@pxref{Languages, ,Using _GDBN__ with Different +program is written in (@pxref{Languages, ,Using @value{GDBN} with Different Languages}). -_fi__(!_CONLY__) +@end ifclear @table @code @item print @var{exp} @@ -3429,7 +4138,7 @@ where @var{f} is a letter specifying the format; @pxref{Output formats}. @item print @itemx print /@var{f} -If you omit @var{exp}, _GDBN__ displays the last value again (from the +If you omit @var{exp}, @value{GDBN} displays the last value again (from the @dfn{value history}; @pxref{Value History, ,Value History}). This allows you to conveniently inspect the same value in an alternative format. @end table @@ -3442,6 +4151,26 @@ If you are interested in information about types, or about how the fields of a struct or class are declared, use the @code{ptype @var{exp}} command rather than @code{print}. @xref{Symbols, ,Examining the Symbol Table}. +@ignore +@c pre-unfold +@menu +* Expressions:: Expressions +* Variables:: Program Variables +* Arrays:: Artificial Arrays +* Output formats:: Output formats +* Memory:: Examining Memory +* Auto Display:: Automatic Display +* Print Settings:: Print Settings +* Value History:: Value History +* Convenience Vars:: Convenience Variables +* Registers:: Registers +@ifclear HviiiEXCLUSIVE +* Floating Point Hardware:: Floating Point Hardware +@end ifclear +@end menu +@end ignore + +@ifclear HviiiEXCLUSIVE @menu * Expressions:: Expressions * Variables:: Program Variables @@ -3453,38 +4182,52 @@ command rather than @code{print}. @xref{Symbols, ,Examining the Symbol Table}. * Value History:: Value History * Convenience Vars:: Convenience Variables * Registers:: Registers -_if__(_GENERIC__ || !_H8__) * Floating Point Hardware:: Floating Point Hardware -_fi__(_GENERIC__ || !_H8__) @end menu +@end ifclear + +@ifset HviiiEXCLUSIVE +@menu +* Expressions:: Expressions +* Variables:: Program Variables +* Arrays:: Artificial Arrays +* Output formats:: Output formats +* Memory:: Examining Memory +* Auto Display:: Automatic Display +* Print Settings:: Print Settings +* Value History:: Value History +* Convenience Vars:: Convenience Variables +* Registers:: Registers +@end menu +@end ifset @node Expressions @section Expressions @cindex expressions -@code{print} and many other _GDBN__ commands accept an expression and +@code{print} and many other @value{GDBN} commands accept an expression and compute its value. Any kind of constant, variable or operator defined by the programming language you are using is legal in an expression in -_GDBN__. This includes conditional expressions, function calls, casts +@value{GDBN}. This includes conditional expressions, function calls, casts and string constants. It unfortunately does not include symbols defined by preprocessor @code{#define} commands. -_if__(!_CONLY__) +@ifclear CONLY Because C is so widespread, most of the expressions shown in examples in -this manual are in C. @xref{Languages, , Using _GDBN__ with Different +this manual are in C. @xref{Languages, , Using @value{GDBN} with Different Languages}, for information on how to use expressions in other languages. -In this section, we discuss operators that you can use in _GDBN__ +In this section, we discuss operators that you can use in @value{GDBN} expressions regardless of your programming language. Casts are supported in all languages, not just in C, because it is so useful to cast a number into a pointer so as to examine a structure at that address in memory. @c FIXME: casts supported---Mod2 true? -_fi__(!_CONLY__) +@end ifclear -_GDBN__ supports these operators in addition to those of programming +@value{GDBN} supports these operators in addition to those of programming languages: @table @code @@ -3556,19 +4299,19 @@ using the colon-colon notation: @noindent Here @var{file} or @var{function} is the name of the context for the static @var{variable}. In the case of file names, you can use quotes to -make sure _GDBN__ parses the file name as a single word---for example, +make sure @value{GDBN} parses the file name as a single word---for example, to print a global value of @code{x} defined in @file{f2.c}: @example -(_GDBP__) p 'f2.c'::x +(@value{GDBP}) p 'f2.c'::x @end example -_if__(!_CONLY__) +@ifclear CONLY @cindex C++ scope resolution This use of @samp{::} is very rarely in conflict with the very similar -use of the same notation in C++. _GDBN__ also supports use of the C++ -scope resolution operator in _GDBN__ expressions. -_fi__(!_CONLY__) +use of the same notation in C++. @value{GDBN} also supports use of the C++ +scope resolution operator in @value{GDBN} expressions. +@end ifclear @cindex wrong values @cindex variable values, wrong @@ -3646,7 +4389,7 @@ p dtab[$i++]->fv @cindex formatted output @cindex output formats -By default, _GDBN__ prints a value according to its data type. Sometimes +By default, @value{GDBN} prints a value according to its data type. Sometimes this is not what you want. For example, you might want to print a number in hex, or a pointer in decimal. Or you might want to view data in memory at a certain address as a character string or as an instruction. To do @@ -3680,8 +4423,8 @@ nearest preceding symbol. This format can be used to discover where (in what function) an unknown address is located: @example -(_GDBP__) p/a 0x54320 -_0__$3 = 0x54320 <_initialize_vx+396>_1__ +(@value{GDBP}) p/a 0x54320 +$3 = 0x54320 <_initialize_vx+396> @end example @item c @@ -3700,7 +4443,7 @@ p/x $pc @noindent Note that no space is required before the slash; this is because command -names in _GDBN__ cannot contain a slash. +names in @value{GDBN} cannot contain a slash. To reprint the last value in the value history with a different format, you can use the @code{print} command with just a format and no @@ -3758,7 +4501,7 @@ default unit the next time you use @code{x}. (For the @samp{s} and @samp{i} formats, the unit size is ignored and is normally not written.) @item @var{addr}, starting display address -@var{addr} is the address where you want _GDBN__ to begin displaying +@var{addr} is the address where you want @value{GDBN} to begin displaying memory. The expression need not have a pointer value (though it may); it is always interpreted as an integer address of a byte of memory. @xref{Expressions, ,Expressions}, for more information on expressions. The default for @@ -3799,7 +4542,7 @@ for successive uses of @code{x}. @cindex @code{$_}, @code{$__}, and value history The addresses and contents printed by the @code{x} command are not saved in the value history because there is often too much of them and they -would get in the way. Instead, _GDBN__ makes these values available for +would get in the way. Instead, @value{GDBN} makes these values available for subsequent use in expressions as values of the convenience variables @code{$_} and @code{$__}. After an @code{x} command, the last address examined is available for use in expressions in the convenience variable @@ -3817,7 +4560,7 @@ address printed if several units were printed on the last line of output. If you find that you want to print the value of an expression frequently (to see how it changes), you might want to add it to the @dfn{automatic -display list} so that _GDBN__ will print its value each time your program stops. +display list} so that @value{GDBN} will print its value each time your program stops. Each expression added to the list is given a number to identify it; to remove an expression from the list, you specify that number. The automatic display looks like this: @@ -3911,7 +4654,7 @@ display expression once again. @cindex format options @cindex print settings -_GDBN__ provides the following ways to control how arrays, structures, +@value{GDBN} provides the following ways to control how arrays, structures, and symbols are printed. @noindent @@ -3921,7 +4664,7 @@ These settings are useful for debugging programs in any language: @item set print address @item set print address on @kindex set print address -_GDBN__ will print memory addresses showing the location of stack +@value{GDBN} will print memory addresses showing the location of stack traces, structure values, pointer values, breakpoints, and so forth, even when it also displays the contents of those addresses. The default is on. For example, this is what a stack frame display looks like, with @@ -3929,7 +4672,7 @@ is on. For example, this is what a stack frame display looks like, with @smallexample @group -(_GDBP__) f +(@value{GDBP}) f #0 set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>") at input.c:530 530 if (lquote != def_lquote) @@ -3942,8 +4685,8 @@ this is the same stack frame displayed with @code{set print address off}: @example @group -(_GDBP__) set print addr off -(_GDBP__) f +(@value{GDBP}) set print addr off +(@value{GDBP}) f #0 set_quotes (lq="<<", rq=">>") at input.c:530 530 if (lquote != def_lquote) @end group @@ -3956,7 +4699,7 @@ Show whether or not addresses are to be printed. @item set print array @itemx set print array on @kindex set print array -_GDBN__ will pretty print arrays. This format is more convenient to read, +@value{GDBN} will pretty print arrays. This format is more convenient to read, but uses more space. The default is off. @item set print array off. @@ -3969,18 +4712,18 @@ arrays. @item set print elements @var{number-of-elements} @kindex set print elements -If _GDBN__ is printing a large array, it will stop printing after it has +If @value{GDBN} is printing a large array, it will stop printing after it has printed the number of elements set by the @code{set print elements} command. This limit also applies to the display of strings. @item show print elements @kindex show print elements -Display the number of elements of a large array that _GDBN__ will print +Display the number of elements of a large array that @value{GDBN} will print before losing patience. @item set print pretty on @kindex set print pretty -Cause _GDBN__ to print structures in an indented format with one member per +Cause @value{GDBN} to print structures in an indented format with one member per line, like this: @example @@ -3997,7 +4740,7 @@ $1 = @{ @end example @item set print pretty off -Cause _GDBN__ to print structures in a compact format, like this: +Cause @value{GDBN} to print structures in a compact format, like this: @smallexample @group @@ -4011,12 +4754,12 @@ This is the default format. @item show print pretty @kindex show print pretty -Show which format _GDBN__ will use to print structures. +Show which format @value{GDBN} will use to print structures. @item set print sevenbit-strings on @kindex set print sevenbit-strings Print using only seven-bit characters; if this option is set, -_GDBN__ will display any eight-bit characters (in strings or character +@value{GDBN} will display any eight-bit characters (in strings or character values) using the notation @code{\}@var{nnn}. For example, @kbd{M-a} is displayed as @code{\341}. @@ -4026,19 +4769,19 @@ is the default. @item show print sevenbit-strings @kindex show print sevenbit-strings -Show whether or not _GDBN__ will print only seven-bit characters. +Show whether or not @value{GDBN} will print only seven-bit characters. @item set print union on @kindex set print union -Tell _GDBN__ to print unions which are contained in structures. This is the +Tell @value{GDBN} to print unions which are contained in structures. This is the default setting. @item set print union off -Tell _GDBN__ not to print unions which are contained in structures. +Tell @value{GDBN} not to print unions which are contained in structures. @item show print union @kindex show print union -Ask _GDBN__ whether or not it will print unions which are contained in +Ask @value{GDBN} whether or not it will print unions which are contained in structures. For example, given the declarations @@ -4134,7 +4877,7 @@ Show whether C++ virtual function tables are pretty printed, or not. @section Value History @cindex value history -Values printed by the @code{print} command are saved in _GDBN__'s @dfn{value +Values printed by the @code{print} command are saved in @value{GDBN}'s @dfn{value history} so that you can refer to them in other expressions. Values are kept until the symbol table is re-read or discarded (for example with the @code{file} or @code{symbol-file} commands). When the symbol table @@ -4209,9 +4952,9 @@ same effect as @samp{show values +}. @section Convenience Variables @cindex convenience variables -_GDBN__ provides @dfn{convenience variables} that you can use within -_GDBN__ to hold on to a value and refer to it later. These variables -exist entirely within _GDBN__; they are not part of your program, and +@value{GDBN} provides @dfn{convenience variables} that you can use within +@value{GDBN} to hold on to a value and refer to it later. These variables +exist entirely within @value{GDBN}; they are not part of your program, and setting a convenience variable has no direct effect on further execution of your program. That is why you can use them freely. @@ -4252,13 +4995,13 @@ One of the ways to use a convenience variable is as a counter to be incremented or a pointer to be advanced. For example, to print a field from successive elements of an array of structures: -_0__@example +@example set $i = 0 print bar[$i++]->contents @i{@dots{} repeat that command by typing @key{RET}.} -_1__@end example +@end example -Some convenience variables are created automatically by _GDBN__ and given +Some convenience variables are created automatically by @value{GDBN} and given values likely to be useful. @table @code @@ -4306,7 +5049,7 @@ Print the relativized value of each specified register @var{regname}. or without the initial @samp{$}. @end table -_GDBN__ has four ``standard'' register names that are available (in +@value{GDBN} has four ``standard'' register names that are available (in expressions) on most machines---whenever they do not conflict with an architecture's canonical mnemonics for registers. The register names @code{$pc} and @code{$sp} are used for the program counter register and @@ -4346,7 +5089,7 @@ shows the canonical names. For example, on the SPARC, @code{info registers} displays the processor status register as @code{$psr} but you can also refer to it as @code{$ps}. -_GDBN__ always considers the contents of an ordinary register as an +@value{GDBN} always considers the contents of an ordinary register as an integer when the register is examined in this way. Some machines have special registers which can hold nothing but floating point; these registers are considered to have floating point values. There is no way @@ -4360,7 +5103,7 @@ the operating system is not the same one that your program normally sees. For example, the registers of the 68881 floating point coprocessor are always saved in ``extended'' (raw) format, but all C programs expect to work with ``double'' (virtual) format. In such -cases, _GDBN__ normally works with the virtual format only (the format that +cases, @value{GDBN} normally works with the virtual format only (the format that makes sense for your program), but the @code{info registers} command prints the data in both formats. @@ -4371,21 +5114,21 @@ were exited and their saved registers restored. In order to see the true contents of hardware registers, you must select the innermost frame (with @samp{frame 0}). -However, _GDBN__ must deduce where registers are saved, from the machine +However, @value{GDBN} must deduce where registers are saved, from the machine code generated by your compiler. If some registers are not saved, or if -_GDBN__ is unable to locate the saved registers, the selected stack +@value{GDBN} is unable to locate the saved registers, the selected stack frame will make no difference. -_if__(_AMD29K__) +@ifset AMDxxixK @table @code @item set rstack_high_address @var{address} @kindex set rstack_high_address @cindex AMD 29K register stack @cindex register stack, AMD29K On AMD 29000 family processors, registers are saved in a separate -``register stack''. There is no way for _GDBN__ to determine the extent -of this stack. Normally, _GDBN__ just assumes that the stack is ``large -enough''. This may result in _GDBN__ referencing memory locations that +``register stack''. There is no way for @value{GDBN} to determine the extent +of this stack. Normally, @value{GDBN} just assumes that the stack is ``large +enough''. This may result in @value{GDBN} referencing memory locations that don't exist. If necessary, you can get around this problem by specifying the ending address of the register stack with the @code{set rstack_high_address} command. The argument should be an address, which @@ -4397,14 +5140,14 @@ hexadecimal. Display the current limit of the register stack, on AMD 29000 family processors. @end table -_fi__(_AMD29K__) +@end ifset -_if__(_GENERIC__ || !_H8__) +@ifclear HviiiEXCLUSIVE @node Floating Point Hardware @section Floating Point Hardware @cindex floating point -Depending on the host machine architecture, _GDBN__ may be able to give +Depending on the host machine architecture, @value{GDBN} may be able to give you more information about the status of the floating point hardware. @table @code @@ -4418,11 +5161,11 @@ floating point chip. @c FIXME...supported currently on arm's and 386's. Mark properly with @c FIXME... m4 macros to isolate general statements from hardware-dep, @c FIXME... at that point. -_fi__(_GENERIC__ || !_H8__) +@end ifclear -_if__(!_CONLY__) +@ifclear CONLY @node Languages -@chapter Using _GDBN__ with Different Languages +@chapter Using @value{GDBN} with Different Languages @cindex languages Although programming languages generally have common aspects, they are @@ -4433,12 +5176,12 @@ represented (and displayed) differently. Hex numbers in C are written like @samp{0x1ae}, while in Modula-2 they appear as @samp{1AEH}. @cindex working language -Language-specific information is built into _GDBN__ for some languages, +Language-specific information is built into @value{GDBN} for some languages, allowing you to express operations like the above in your program's -native language, and allowing _GDBN__ to output values in a manner +native language, and allowing @value{GDBN} to output values in a manner consistent with the syntax of your program's native language. The language you use to build expressions, called the @dfn{working -language}, can be selected manually, or _GDBN__ can set it +language}, can be selected manually, or @value{GDBN} can set it automatically. @menu @@ -4451,14 +5194,14 @@ automatically. @node Setting @section Switching between source languages -There are two ways to control the working language---either have _GDBN__ +There are two ways to control the working language---either have @value{GDBN} set it automatically, or select it manually yourself. You can use the -@code{set language} command for either purpose. On startup, _GDBN__ +@code{set language} command for either purpose. On startup, @value{GDBN} defaults to setting the language automatically. @menu * Manually:: Setting the working language manually -* Automatically:: Having _GDBN__ infer the source language +* Automatically:: Having @value{GDBN} infer the source language @end menu @node Manually @@ -4469,12 +5212,12 @@ To set the language, issue the command @samp{set language @var{lang}}, where @var{lang} is the name of a language: @code{c} or @code{modula-2}. For a list of the supported languages, type @samp{set language}. -Setting the language manually prevents _GDBN__ from updating the working +Setting the language manually prevents @value{GDBN} from updating the working language automatically. This can lead to confusion if you try to debug a program when the working language is not the same as the source language, when an expression is acceptable to both languages---but means different things. For instance, if the current -source file were written in C, and _GDBN__ was parsing Modula-2, a +source file were written in C, and @value{GDBN} was parsing Modula-2, a command such as: @example @@ -4487,15 +5230,15 @@ might not have the effect you intended. In C, this means to add printed would be the value of @code{a}. In Modula-2, this means to compare @code{a} to the result of @code{b+c}, yielding a @code{BOOLEAN} value. -If you allow _GDBN__ to set the language automatically, then +If you allow @value{GDBN} to set the language automatically, then you can count on expressions evaluating the same way in your debugging session and in your program. @node Automatically -@subsection Having _GDBN__ infer the source language +@subsection Having @value{GDBN} infer the source language -To have _GDBN__ set the working language automatically, use @samp{set -language local} or @samp{set language auto}. _GDBN__ then infers the +To have @value{GDBN} set the working language automatically, use @samp{set +language local} or @samp{set language auto}. @value{GDBN} then infers the language that a program was written in by looking at the name of its source files, and examining their extensions: @@ -4513,11 +5256,11 @@ C++ source file This information is recorded for each function or procedure in a source file. When your program stops in a frame (usually by encountering a -breakpoint), _GDBN__ sets the working language to the language recorded +breakpoint), @value{GDBN} sets the working language to the language recorded for the function in that frame. If the language for a frame is unknown (that is, if the function or block corresponding to the frame was defined in a source file that does not have a recognized extension), the -current working language is not changed, and _GDBN__ issues a warning. +current working language is not changed, and @value{GDBN} issues a warning. This may not seem necessary for most programs, which are written entirely in one source language. However, program modules and libraries @@ -4555,7 +5298,7 @@ Symbol Table}) is the source language of this source file. @section Type and range Checking @quotation -@emph{Warning:} In this release, the _GDBN__ commands for type and range +@emph{Warning:} In this release, the @value{GDBN} commands for type and range checking are included, but they do not yet have any effect. This section documents the intended facilities. @end quotation @@ -4569,11 +5312,11 @@ these help to ensure a program's correctness once it has been compiled by eliminating type mismatches, and providing active checks for range errors when your program is running. -_GDBN__ can check for conditions like the above if you wish. -Although _GDBN__ will not check the statements in your program, it -can check expressions entered directly into _GDBN__ for evaluation via +@value{GDBN} can check for conditions like the above if you wish. +Although @value{GDBN} will not check the statements in your program, it +can check expressions entered directly into @value{GDBN} for evaluation via the @code{print} command, for example. As with the working language, -_GDBN__ can also decide whether or not to check automatically based on +@value{GDBN} can also decide whether or not to check automatically based on your program's source language. @xref{Support, ,Supported Languages}, for the default settings of supported languages. @@ -4601,15 +5344,15 @@ errors from ever causing any run-time problems. For example, The second example fails because the @code{CARDINAL} 1 is not type-compatible with the @code{REAL} 2.3. -For expressions you use in _GDBN__ commands, you can tell the _GDBN__ +For expressions you use in @value{GDBN} commands, you can tell the @value{GDBN} type checker to skip checking; to treat any mismatches as errors and abandon the expression; or only issue warnings when type mismatches occur, but evaluate the expression anyway. When you choose the last of -these, _GDBN__ evaluates expressions like the second example above, but +these, @value{GDBN} evaluates expressions like the second example above, but also issues a warning. Even though you may turn type checking off, other type-based reasons may -prevent _GDBN__ from evaluating an expression. For instance, _GDBN__ does not +prevent @value{GDBN} from evaluating an expression. For instance, @value{GDBN} does not know how to add an @code{int} and a @code{struct foo}. These particular type errors have nothing to do with the language in use, and usually arise from expressions, such as the one described above, which make @@ -4622,7 +5365,7 @@ represented as numbers, so that they are valid arguments to mathematical operators. @xref{Support, ,Supported Languages}, for further details on specific languages. -_GDBN__ provides some additional commands for controlling the type checker: +@value{GDBN} provides some additional commands for controlling the type checker: @kindex set check @kindex set check type @@ -4638,17 +5381,17 @@ each language. Set type checking on or off, overriding the default setting for the current working language. Issue a warning if the setting does not match the language's default. If any type mismatches occur in -evaluating an expression while typechecking is on, _GDBN__ prints a +evaluating an expression while typechecking is on, @value{GDBN} prints a message and aborts evaluation of the expression. @item set check type warn Cause the type checker to issue warnings, but to always attempt to evaluate the expression. Evaluating the expression may still -be impossible for other reasons. For example, _GDBN__ cannot add +be impossible for other reasons. For example, @value{GDBN} cannot add numbers and structures. @item show type -Show the current setting of the type checker, and whether or not _GDBN__ is +Show the current setting of the type checker, and whether or not @value{GDBN} is setting it automatically. @end table @@ -4663,7 +5406,7 @@ checking is meant to ensure program correctness by making sure computations do not overflow, or indices on an array element access do not exceed the bounds of the array. -For expressions you use in _GDBN__ commands, you can tell _GDBN__ to +For expressions you use in @value{GDBN} commands, you can tell @value{GDBN} to ignore range errors; to always treat them as errors and abandon the expression; or to issue warnings when a range error occurs but evaluate the expression anyway. @@ -4683,7 +5426,7 @@ This, too, is specific to individual languages, and in some cases specific to individual compilers or machines. @xref{Support, , Supported Languages}, for further details on specific languages. -_GDBN__ provides some additional commands for controlling the range checker: +@value{GDBN} provides some additional commands for controlling the range checker: @kindex set check @kindex set check range @@ -4702,7 +5445,7 @@ match the language's default. If a range error occurs, then a message is printed and evaluation of the expression is aborted. @item set check range warn -Output messages when the _GDBN__ range checker detects a range error, +Output messages when the @value{GDBN} range checker detects a range error, but attempt to evaluate the expression anyway. Evaluating the expression may still be impossible for other reasons, such as accessing memory that the process does not own (a typical example from many UNIX @@ -4710,22 +5453,22 @@ systems). @item show range Show the current setting of the range checker, and whether or not it is -being set automatically by _GDBN__. +being set automatically by @value{GDBN}. @end table @node Support @section Supported Languages -_GDBN__ 4 supports C, C++, and Modula-2. Some _GDBN__ +@value{GDBN} 4 supports C, C++, and Modula-2. Some @value{GDBN} features may be used in expressions regardless of the language you -use: the _GDBN__ @code{@@} and @code{::} operators, and the +use: the @value{GDBN} @code{@@} and @code{::} operators, and the @samp{@{type@}addr} construct (@pxref{Expressions, ,Expressions}) can be used with the constructs of any of the supported languages. The following sections detail to what degree each of these -source languages is supported by _GDBN__. These sections are +source languages is supported by @value{GDBN}. These sections are not meant to be language tutorials or references, but serve only as a -reference guide to what the _GDBN__ expression parser will accept, and +reference guide to what the @value{GDBN} expression parser will accept, and what input and output formats should look like for different languages. There are many good books written on each of these languages; please look to these for a language reference or tutorial. @@ -4740,7 +5483,7 @@ look to these for a language reference or tutorial. @cindex C and C++ @cindex expressions in C or C++ -Since C and C++ are so closely related, many features of _GDBN__ apply +Since C and C++ are so closely related, many features of @value{GDBN} apply to both languages. Whenever this is the case, we discuss both languages together. @@ -4748,56 +5491,56 @@ together. @kindex g++ @cindex GNU C++ The C++ debugging facilities are jointly implemented by the GNU C++ -compiler and _GDBN__. Therefore, to debug your C++ code effectively, +compiler and @value{GDBN}. Therefore, to debug your C++ code effectively, you must compile your C++ programs with the GNU C++ compiler, @code{g++}. -_fi__(!_CONLY__) -_if__(_CONLY__) +@end ifclear +@ifset CONLY @node C @chapter C Language Support @cindex C language @cindex expressions in C -Information specific to the C language is built into _GDBN__ so that you -can use C expressions while degugging. This also permits _GDBN__ to +Information specific to the C language is built into @value{GDBN} so that you +can use C expressions while degugging. This also permits @value{GDBN} to output values in a manner consistent with C conventions. @menu * C Operators:: C Operators * C Constants:: C Constants -* Debugging C:: _GDBN__ and C +* Debugging C:: @value{GDBN} and C @end menu -_fi__(_CONLY__) -_if__(!_CONLY__) +@end ifset +@ifclear CONLY @menu * C Operators:: C and C++ Operators * C Constants:: C and C++ Constants * Cplusplus expressions:: C++ Expressions * C Defaults:: Default settings for C and C++ * C Checks:: C and C++ Type and Range Checks -* Debugging C:: _GDBN__ and C +* Debugging C:: @value{GDBN} and C * Debugging C plus plus:: Special features for C++ @end menu -_fi__(!_CONLY__) +@end ifclear -_if__(!_CONLY__) +@ifclear CONLY @cindex C and C++ operators @node C Operators @subsubsection C and C++ Operators -_fi__(!_CONLY__) -_if__(_CONLY__) +@end ifclear +@ifset CONLY @cindex C operators @node C Operators @section C Operators -_fi__(_CONLY__) +@end ifset Operators must be defined on values of specific types. For instance, @code{+} is defined on numbers, but not on structures. Operators are often defined on groups of types. -_if__(!_CONLY__) +@ifclear CONLY For the purposes of C and C++, the following definitions hold: -_fi__(!_CONLY__) +@end ifclear @itemize @bullet @item @@ -4820,7 +5563,7 @@ The following operators are supported. They are listed here in order of increasing precedence: @table @code -_0__@item , +@item , The comma or sequencing operator. Expressions in a comma-separated list are evaluated from left to right, with the result of the entire expression being the last expression evaluated. @@ -4866,10 +5609,10 @@ Defined on scalar types. The value of these expressions is 0 for false and non-zero for true. @item <<@r{, }>> -left shift, and right shift. Defined on integral types._1__ +left shift, and right shift. Defined on integral types. @item @@ -The _GDBN__ ``artificial array'' operator (@pxref{Expressions, ,Expressions}). +The @value{GDBN} ``artificial array'' operator (@pxref{Expressions, ,Expressions}). @item +@r{, }- Addition and subtraction. Defined on integral types, floating-point types and @@ -4893,13 +5636,13 @@ Pointer dereferencing. Defined on pointer types. Same precedence as @item & Address operator. Defined on variables. Same precedence as @code{++}. -_if__(!_CONLY__) -For debugging C++, _GDBN__ implements a use of @samp{&} beyond what's +@ifclear CONLY +For debugging C++, @value{GDBN} implements a use of @samp{&} beyond what's allowed in the C++ language itself: you can use @samp{&(&@var{ref})} (or, if you prefer, simply @samp{&&@var{ref}} to examine the address where a C++ reference variable (declared with @samp{&@var{ref}}) is stored. -_fi__(!_CONLY__) +@end ifclear @item - Negative. Defined on integral and floating-point types. Same @@ -4913,10 +5656,10 @@ Logical negation. Defined on integral types. Same precedence as Bitwise complement operator. Defined on integral types. Same precedence as @code{++}. -_0__ + @item .@r{, }-> Structure member, and pointer-to-structure member. For convenience, -_GDBN__ regards the two as equivalent, choosing whether to dereference a +@value{GDBN} regards the two as equivalent, choosing whether to dereference a pointer based on the stored type information. Defined on @code{struct}s and @code{union}s. @@ -4925,37 +5668,37 @@ Array indexing. @code{@var{a}[@var{i}]} is defined as @code{*(@var{a}+@var{i})}. Same precedence as @code{->}. @item () -Function parameter list. Same precedence as @code{->}._1__ +Function parameter list. Same precedence as @code{->}. -_if__(!_CONLY__) +@ifclear CONLY @item :: C++ scope resolution operator. Defined on @code{struct}, @code{union}, and @code{class} types. -_fi__(!_CONLY__) +@end ifclear @item :: -The _GDBN__ scope operator (@pxref{Expressions, ,Expressions}). -_if__(!_CONLY__) +The @value{GDBN} scope operator (@pxref{Expressions, ,Expressions}). +@ifclear CONLY Same precedence as @code{::}, above. -_fi__(!_CONLY__) +@end ifclear @end table -_if__(!_CONLY__) +@ifclear CONLY @cindex C and C++ constants @node C Constants @subsubsection C and C++ Constants -_GDBN__ allows you to express the constants of C and C++ in the +@value{GDBN} allows you to express the constants of C and C++ in the following ways: -_fi__(!_CONLY__) -_if__(_CONLY__) +@end ifclear +@ifset CONLY @cindex C constants @node C Constants @section C Constants -_GDBN__ allows you to express the constants of C in the +@value{GDBN} allows you to express the constants of C in the following ways: -_fi__(_CONLY__) +@end ifset @itemize @bullet @item @@ -4994,12 +5737,12 @@ by double quotes (@code{"}). Pointer constants are an integral value. @end itemize -_if__(!_CONLY__) +@ifclear CONLY @node Cplusplus expressions @subsubsection C++ Expressions @cindex expressions in C++ -_GDBN__'s expression handling has a number of extensions to +@value{GDBN}'s expression handling has a number of extensions to interpret a significant subset of C++ expressions. @cindex C++ support, not in @sc{coff} @@ -5018,9 +5761,9 @@ extendable object code format. In particular, if your system uses a.out, MIPS @sc{ecoff}, RS/6000 @sc{xcoff}, or Sun @sc{elf} with stabs extensions to the symbol table, these facilities are all available. Where the object code format is standard @sc{coff}, on the other hand, -most of the C++ support in _GDBN__ will @emph{not} work, nor can it. +most of the C++ support in @value{GDBN} will @emph{not} work, nor can it. For the standard SVr4 debugging format, @sc{dwarf} in @sc{elf}, the -standard is still evolving, so the C++ support in _GDBN__ is still +standard is still evolving, so the C++ support in @value{GDBN} is still fragile; when this debugging format stabilizes, however, C++ support will also be available on systems that use it. @end quotation @@ -5040,36 +5783,36 @@ count = aml->GetOriginal(x, y) @item While a member function is active (in the selected stack frame), your expressions have the same namespace available as the member function; -that is, _GDBN__ allows implicit references to the class instance +that is, @value{GDBN} allows implicit references to the class instance pointer @code{this} following the same rules as C++. @cindex call overloaded functions @cindex type conversions in C++ @item -You can call overloaded functions; _GDBN__ will resolve the function +You can call overloaded functions; @value{GDBN} will resolve the function call to the right definition, with one restriction---you must use arguments of the type required by the function that you want to call. -_GDBN__ will not perform conversions requiring constructors or +@value{GDBN} will not perform conversions requiring constructors or user-defined type operators. @cindex reference declarations @item -_GDBN__ understands variables declared as C++ references; you can use them in +@value{GDBN} understands variables declared as C++ references; you can use them in expressions just as you do in C++ source---they are automatically dereferenced. -In the parameter list shown when _GDBN__ displays a frame, the values of +In the parameter list shown when @value{GDBN} displays a frame, the values of reference variables are not displayed (unlike other variables); this avoids clutter, since references are often used for large structures. The @emph{address} of a reference variable is always shown, unless you have specified @samp{set print address off}. @item -_GDBN__ supports the C++ name resolution operator @code{::}---your +@value{GDBN} supports the C++ name resolution operator @code{::}---your expressions can use it just as expressions in your program do. Since one scope may be defined in another, you can use @code{::} repeatedly if necessary, for example in an expression like -@samp{@var{scope1}::@var{scope2}::@var{name}}. _GDBN__ also allows +@samp{@var{scope1}::@var{scope2}::@var{name}}. @value{GDBN} also allows resolving name scope by reference to source files, in both C and C++ debugging (@pxref{Variables, ,Program Variables}). @end enumerate @@ -5078,15 +5821,15 @@ debugging (@pxref{Variables, ,Program Variables}). @subsubsection C and C++ Defaults @cindex C and C++ defaults -If you allow _GDBN__ to set type and range checking automatically, they +If you allow @value{GDBN} to set type and range checking automatically, they both default to @code{off} whenever the working language changes to -C or C++. This happens regardless of whether you, or _GDBN__, +C or C++. This happens regardless of whether you, or @value{GDBN}, selected the working language. -If you allow _GDBN__ to set the language automatically, it sets the +If you allow @value{GDBN} to set the language automatically, it sets the working language to C or C++ on entering code compiled from a source file whose name ends with @file{.c}, @file{.C}, or @file{.cc}. -@xref{Automatically, ,Having _GDBN__ infer the source language}, for +@xref{Automatically, ,Having @value{GDBN} infer the source language}, for further details. @node C Checks @@ -5094,13 +5837,13 @@ further details. @cindex C and C++ checks @quotation -@emph{Warning:} in this release, _GDBN__ does not yet perform type or +@emph{Warning:} in this release, @value{GDBN} does not yet perform type or range checking. @end quotation @c FIXME remove warning when type/range checks added -By default, when _GDBN__ parses C or C++ expressions, type checking -is not used. However, if you turn type checking on, _GDBN__ will +By default, when @value{GDBN} parses C or C++ expressions, type checking +is not used. However, if you turn type checking on, @value{GDBN} will consider two variables type equivalent if: @itemize @bullet @@ -5125,15 +5868,16 @@ compilers.) Range checking, if turned on, is done on mathematical operations. Array indices are not checked, since they are often used to index a pointer that is not itself an array. -_fi__(!_CONLY__) +@end ifclear +@ifclear CONLY @node Debugging C -_if__(!_CONLY__) -@subsubsection _GDBN__ and C -_fi__(!_CONLY__) -_if__(_CONLY__) -@section _GDBN__ and C -_fi__(_CONLY__) +@subsubsection @value{GDBN} and C +@end ifclear +@ifset CONLY +@node Debugging C +@section @value{GDBN} and C +@end ifset The @code{set print union} and @code{show print union} commands apply to the @code{union} type. When set to @samp{on}, any @code{union} that is @@ -5143,24 +5887,19 @@ Otherwise, it will appear as @samp{@{...@}}. The @code{@@} operator aids in the debugging of dynamic arrays, formed with pointers and a memory allocation function. (@pxref{Expressions, ,Expressions}) -_if__(!_CONLY__) +@ifclear CONLY @node Debugging C plus plus -_if__(!_CONLY__) -@subsubsection _GDBN__ Features for C++ -_fi__(!_CONLY__) -_if__(_CONLY__) -@section _GDBN__ Features for C++ -_fi__(_CONLY__) +@subsubsection @value{GDBN} Features for C++ @cindex commands for C++ -Some _GDBN__ commands are particularly useful with C++, and some are +Some @value{GDBN} commands are particularly useful with C++, and some are designed specifically for use with C++. Here is a summary: @table @code @cindex break in overloaded functions @item @r{breakpoint menus} When you want a breakpoint in a function whose name is overloaded, -_GDBN__'s breakpoint menus help you specify which function definition +@value{GDBN}'s breakpoint menus help you specify which function definition you want. @xref{Breakpoint Menus}. @cindex overloading in C++ @@ -5205,7 +5944,7 @@ Control the format for printing virtual function tables. You can specify a particular definition of an overloaded symbol, using the same notation that's used to declare such symbols in C++: type @code{@var{symbol}(@var{types})} rather than just @var{symbol}. You can -also use _GDBN__'s command-line word completion facilities to list the +also use @value{GDBN}'s command-line word completion facilities to list the available choices, or to finish the type list for you. @xref{Completion,, Command Completion}, for details on how to do this. @end table @@ -5214,11 +5953,11 @@ available choices, or to finish the type list for you. @subsection Modula-2 @cindex Modula-2 -The extensions made to _GDBN__ to support Modula-2 support output +The extensions made to @value{GDBN} to support Modula-2 support output from the GNU Modula-2 compiler (which is currently being developed). Other Modula-2 compilers are not currently supported, and attempting to debug executables produced by them will most likely result in an error -as _GDBN__ reads in the executable's symbol table. +as @value{GDBN} reads in the executable's symbol table. @cindex expressions in Modula-2 @menu @@ -5229,7 +5968,7 @@ as _GDBN__ reads in the executable's symbol table. * Deviations:: Deviations from standard Modula-2 * M2 Checks:: Modula-2 Type and Range Checks * M2 Scope:: The scope operators @code{::} and @code{.} -* GDB/M2:: _GDBN__ and Modula-2 +* GDB/M2:: @value{GDBN} and Modula-2 @end menu @node M2 Operators @@ -5274,7 +6013,7 @@ increasing precedence: @table @code @item , Function argument or array index separator. -_0__ + @item := Assignment. The value of @var{var} @code{:=} @var{value} is @var{value}. @@ -5290,7 +6029,7 @@ set types. Same precedence as @code{<}. @item =@r{, }<>@r{, }# Equality and two ways of expressing inequality, valid on scalar types. -Same precedence as @code{<}. In _GDBN__ scripts, only @code{<>} is +Same precedence as @code{<}. In @value{GDBN} scripts, only @code{<>} is available for inequality, since @code{#} conflicts with the script comment character. @@ -5305,7 +6044,7 @@ Boolean disjunction. Defined on boolean types. Boolean conjuction. Defined on boolean types. @item @@ -The _GDBN__ ``artificial array'' operator (@pxref{Expressions, ,Expressions}). +The @value{GDBN} ``artificial array'' operator (@pxref{Expressions, ,Expressions}). @item +@r{, }- Addition and subtraction on integral and floating-point types, or union @@ -5345,16 +6084,16 @@ Procedure argument list. Defined on @code{PROCEDURE}s. Same precedence as @code{^}. @item ::@r{, }. -_GDBN__ and Modula-2 scope operators. +@value{GDBN} and Modula-2 scope operators. @end table @quotation -@emph{Warning:} Sets and their operations are not yet supported, so _GDBN__ +@emph{Warning:} Sets and their operations are not yet supported, so @value{GDBN} will treat the use of the operator @code{IN}, or the use of operators @code{+}, @code{-}, @code{*}, @code{/}, @code{=}, , @code{<>}, @code{#}, @code{<=}, and @code{>=} on sets as an error. @end quotation -_1__ + @cindex Modula-2 built-ins @node Built-In Func/Proc @subsubsection Built-in Functions and Procedures @@ -5463,7 +6202,7 @@ Returns the member of the type @var{t} whose ordinal value is @var{i}. @quotation @emph{Warning:} Sets and their operations are not yet supported, so -_GDBN__ will treat the use of procedures @code{INCL} and @code{EXCL} as +@value{GDBN} will treat the use of procedures @code{INCL} and @code{EXCL} as an error. @end quotation @@ -5471,7 +6210,7 @@ an error. @node M2 Constants @subsubsection Constants -_GDBN__ allows you to express the constants of Modula-2 in the following +@value{GDBN} allows you to express the constants of Modula-2 in the following ways: @itemize @bullet @@ -5521,14 +6260,14 @@ Set constants are not yet supported. @subsubsection Modula-2 Defaults @cindex Modula-2 defaults -If type and range checking are set automatically by _GDBN__, they +If type and range checking are set automatically by @value{GDBN}, they both default to @code{on} whenever the working language changes to -Modula-2. This happens regardless of whether you, or _GDBN__, +Modula-2. This happens regardless of whether you, or @value{GDBN}, selected the working language. -If you allow _GDBN__ to set the language automatically, then entering +If you allow @value{GDBN} to set the language automatically, then entering code compiled from a file whose name ends with @file{.mod} will set the -working language to Modula-2. @xref{Automatically, ,Having _GDBN__ set +working language to Modula-2. @xref{Automatically, ,Having @value{GDBN} set the language automatically}, for further details. @node Deviations @@ -5549,7 +6288,7 @@ returned a pointer.) @item C escape sequences can be used in strings and characters to represent -non-printable characters. _GDBN__ will print out strings with these +non-printable characters. @value{GDBN} will print out strings with these escape sequences embedded. Single non-printable characters are printed using the @samp{CHR(@var{nnn})} format. @@ -5566,12 +6305,12 @@ All built-in procedures both modify @emph{and} return their argument. @cindex Modula-2 checks @quotation -@emph{Warning:} in this release, _GDBN__ does not yet perform type or +@emph{Warning:} in this release, @value{GDBN} does not yet perform type or range checking. @end quotation @c FIXME remove warning when type/range checks added -_GDBN__ considers two Modula-2 variables type equivalent if: +@value{GDBN} considers two Modula-2 variables type equivalent if: @itemize @bullet @item @@ -5603,7 +6342,7 @@ index bounds, and all built-in functions and procedures. @end iftex There are a few subtle differences between the Modula-2 scope operator -(@code{.}) and the _GDBN__ scope operator (@code{::}). The two have +(@code{.}) and the @value{GDBN} scope operator (@code{::}). The two have similar syntax: @example @@ -5617,12 +6356,12 @@ where @var{scope} is the name of a module or a procedure, @var{module} the name of a module, and @var{id} is any declared identifier within your program, except another module. -Using the @code{::} operator makes _GDBN__ search the scope +Using the @code{::} operator makes @value{GDBN} search the scope specified by @var{scope} for the identifier @var{id}. If it is not -found in the specified scope, then _GDBN__ will search all scopes +found in the specified scope, then @value{GDBN} will search all scopes enclosing the one specified by @var{scope}. -Using the @code{.} operator makes _GDBN__ search the current scope for +Using the @code{.} operator makes @value{GDBN} search the current scope for the identifier specified by @var{id} that was imported from the definition module specified by @var{module}. With this operator, it is an error if the identifier @var{id} was not imported from definition @@ -5630,9 +6369,9 @@ module @var{module}, or if @var{id} is not an identifier in @var{module}. @node GDB/M2 -@subsubsection _GDBN__ and Modula-2 +@subsubsection @value{GDBN} and Modula-2 -Some _GDBN__ commands have little use when debugging Modula-2 programs. +Some @value{GDBN} commands have little use when debugging Modula-2 programs. Five subcommands of @code{set print} and @code{show print} apply specifically to C and C++: @samp{vtbl}, @samp{demangle}, @samp{asm-demangle}, @samp{object}, and @samp{union}. The first four @@ -5645,12 +6384,12 @@ intent is to aid the debugging of @dfn{dynamic arrays}, which cannot be created in Modula-2 as they can in C or C++. However, because an address can be specified by an integral constant, the construct @samp{@{@var{type}@}@var{adrexp}} is still useful. (@pxref{Expressions, ,Expressions}) -_0__ + @cindex @code{#} in Modula-2 -In _GDBN__ scripts, the Modula-2 inequality operator @code{#} is +In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is interpreted as the beginning of a comment. Use @code{<>} instead. -_1__ -_fi__(!_CONLY__) + +@end ifclear @node Symbols @chapter Examining the Symbol Table @@ -5658,8 +6397,8 @@ _fi__(!_CONLY__) The commands described in this section allow you to inquire about the symbols (names of variables, functions and types) defined in your program. This information is inherent in the text of your program and -does not change as your program executes. _GDBN__ finds it in your -program's symbol table, in the file indicated when you started _GDBN__ +does not change as your program executes. @value{GDBN} finds it in your +program's symbol table, in the file indicated when you started @value{GDBN} (@pxref{File Options, ,Choosing Files}), or by one of the file-management commands (@pxref{Files, ,Commands to Specify Files}). @@ -5669,12 +6408,12 @@ file-management commands (@pxref{Files, ,Commands to Specify Files}). @cindex names of symbols @cindex quoting names Occasionally, you may need to refer to symbols that contain unusual -characters, which _GDBN__ ordinarily treats as word delimiters. The +characters, which @value{GDBN} ordinarily treats as word delimiters. The most frequent case is in referring to static variables in other source files (@pxref{Variables,,Program Variables}). File names -are recorded in object files as debugging symbols, but _GDBN__ would +are recorded in object files as debugging symbols, but @value{GDBN} would ordinarily parse a typical file name, like @file{foo.c}, as the three words -@samp{foo} @samp{.} @samp{c}. To allow _GDBN__ to recognize +@samp{foo} @samp{.} @samp{c}. To allow @value{GDBN} to recognize @samp{foo.c} as a single symbol, enclose it in single quotes; for example, @example @@ -5729,9 +6468,9 @@ compare the output of the two commands: @example @group -(_GDBP__) whatis v +(@value{GDBP}) whatis v type = struct complex -(_GDBP__) ptype v +(@value{GDBP}) ptype v type = struct complex @{ double real; double imag; @@ -5812,18 +6551,18 @@ which match the regular-expression @var{regexp}. @kindex maint print psymbols @cindex partial symbol dump Write a dump of debugging symbol data into the file @var{filename}. -These commands are used to debug the _GDBN__ symbol-reading code. Only +These commands are used to debug the @value{GDBN} symbol-reading code. Only symbols with debugging data are included. If you use @samp{maint print -symbols}, _GDBN__ includes all the symbols for which it has already +symbols}, @value{GDBN} includes all the symbols for which it has already collected full details: that is, @var{filename} reflects symbols for -only those files whose symbols _GDBN__ has read. You can use the +only those files whose symbols @value{GDBN} has read. You can use the command @code{info sources} to find out which files these are. If you use @samp{maint print psymbols} instead, the dump shows information about -symbols that _GDBN__ only knows partially---that is, symbols defined in -files that _GDBN__ has skimmed, but not yet read completely. Finally, +symbols that @value{GDBN} only knows partially---that is, symbols defined in +files that @value{GDBN} has skimmed, but not yet read completely. Finally, @samp{maint print msymbols} dumps just the minimal symbol information -required for each object file from which _GDBN__ has read some symbols. -The description of @code{symbol-file} explains how _GDBN__ reads +required for each object file from which @value{GDBN} has read some symbols. +The description of @code{symbol-file} explains how @value{GDBN} reads symbols; both @code{info source} and @code{symbol-file} are described in @ref{Files, ,Commands to Specify Files}. @end table @@ -5834,23 +6573,47 @@ symbols; both @code{info source} and @code{symbol-file} are described in Once you think you have found an error in your program, you might want to find out for certain whether correcting the apparent error would lead to correct results in the rest of the run. You can find the answer by -experiment, using the _GDBN__ features for altering execution of the +experiment, using the @value{GDBN} features for altering execution of the program. For example, you can store new values into variables or memory locations, give your program a signal, restart it at a different address, or even return prematurely from a function to its caller. +@ignore +@c pre-unfold @menu * Assignment:: Assignment to Variables * Jumping:: Continuing at a Different Address -_if__(!_BARE__) +@ifclear BARETARGET * Signaling:: Giving your program a Signal -_fi__(!_BARE__) +@end ifclear * Returning:: Returning from a Function * Calling:: Calling your Program's Functions * Patching:: Patching your Program @end menu +@end ignore + +@ifclear BARETARGET +@menu +* Assignment:: Assignment to Variables +* Jumping:: Continuing at a Different Address +* Signaling:: Giving your program a Signal +* Returning:: Returning from a Function +* Calling:: Calling your Program's Functions +* Patching:: Patching your Program +@end menu +@end ifclear + +@ifset BARETARGET +@menu +* Assignment:: Assignment to Variables +* Jumping:: Continuing at a Different Address +* Returning:: Returning from a Function +* Calling:: Calling your Program's Functions +* Patching:: Patching your Program +@end menu +@end ifset @node Assignment @section Assignment to Variables @@ -5867,10 +6630,10 @@ print x=4 @noindent stores the value 4 into the variable @code{x}, and then prints the value of the assignment expression (which is 4). -_if__(!_CONLY__) -@xref{Languages, ,Using _GDBN__ with Different Languages}, for more +@ifclear CONLY +@xref{Languages, ,Using @value{GDBN} with Different Languages}, for more information on operators in supported languages. -_fi__(!_CONLY__) +@end ifclear @kindex set variable @cindex variables, setting @@ -5886,14 +6649,14 @@ variable} command instead of just @code{set}. This command is identical to @code{set} except for its lack of subcommands. For example, a program might well have a variable @code{width}---which leads to an error if we try to set a new value with just @samp{set width=13}, as -we might if @code{set width} did not happen to be a _GDBN__ command: +we might if @code{set width} did not happen to be a @value{GDBN} command: @example -(_GDBP__) whatis width +(@value{GDBP}) whatis width type = double -(_GDBP__) p width +(@value{GDBP}) p width $4 = 13 -(_GDBP__) set width=47 +(@value{GDBP}) set width=47 Invalid syntax in expression. @end example @@ -5902,10 +6665,10 @@ The invalid expression, of course, is @samp{=47}. What we can do in order to actually set our program's variable @code{width} is @example -(_GDBP__) set var width=47 +(@value{GDBP}) set var width=47 @end example -_GDBN__ allows more implicit conversions in assignments than C; you can +@value{GDBN} allows more implicit conversions in assignments than C; you can freely store an integer value into a pointer variable or vice versa, and any structure can be converted to any other structure that is the same length or shorter. @@ -5972,7 +6735,7 @@ The most common occasion to use the @code{jump} command is to back up, perhaps with more breakpoints set, over a portion of a program that has already executed, in order to examine its execution in more detail. -_if__(!_BARE__) +@ifclear BARETARGET @node Signaling @c @group @section Giving your program a Signal @@ -5993,7 +6756,7 @@ signal. after executing the command. @end table @c @end group -_fi__(!_BARE__) +@end ifclear @node Returning @section Returning from a Function @@ -6009,7 +6772,7 @@ command. If you give an value. @end table -When you use @code{return}, _GDBN__ discards the selected stack frame +When you use @code{return}, @value{GDBN} discards the selected stack frame (and all frames within it). You can think of this as making the discarded frame return prematurely. If you wish to specify a value to be returned, give that value as the argument to @code{return}. @@ -6048,7 +6811,7 @@ the value history, if it is not void. @cindex writing into executables @cindex writing into corefiles -By default, _GDBN__ opens the file containing your program's executable +By default, @value{GDBN} opens the file containing your program's executable code (or the corefile) read-only. This prevents accidental alterations to machine code; but it also prevents you from intentionally patching your program's binary. @@ -6062,12 +6825,12 @@ repairs. @item set write on @itemx set write off @kindex set write -If you specify @samp{set write on}, _GDBN__ will open executable -_if__(!_BARE__) +If you specify @samp{set write on}, @value{GDBN} will open executable +@ifclear BARETARGET and core -_fi__(!_BARE__) +@end ifclear files for both reading and writing; if you specify @samp{set write -off} (the default), _GDBN__ will open them read-only. +off} (the default), @value{GDBN} will open them read-only. If you have already loaded a file, you must load it again (using the @code{exec-file} or @code{core-file} command) after @@ -6076,21 +6839,21 @@ changing @code{set write}, for your new setting to take effect. @item show write @kindex show write Display whether executable files -_if__(!_BARE__) +@ifclear BARETARGET and core files -_fi__(!_BARE__) +@end ifclear will be opened for writing as well as reading. @end table -@node _GDBN__ Files -@chapter _GDBN__'s Files +@node GDB Files +@chapter @value{GDBN}'s Files -_GDBN__ needs to know the file name of the program to be debugged, both in +@value{GDBN} needs to know the file name of the program to be debugged, both in order to read its symbol table and in order to start your program. -_if__(!_BARE__) -To debug a core dump of a previous run, _GDBN__ must be told the file +@ifclear BARETARGET +To debug a core dump of a previous run, @value{GDBN} must be told the file name of the core dump. -_fi__(!_BARE__) +@end ifclear @menu * Files:: Commands to Specify Files @@ -6101,21 +6864,21 @@ _fi__(!_BARE__) @section Commands to Specify Files @cindex symbol table -_if__(!_BARE__) +@ifclear BARETARGET @cindex core dump file The usual way to specify executable and core dump file names is with -the command arguments given when you start _GDBN__, (@pxref{Invocation, -,Getting In and Out of _GDBN__}. -_fi__(!_BARE__) -_if__(_BARE__) +the command arguments given when you start @value{GDBN}, (@pxref{Invocation, +,Getting In and Out of @value{GDBN}}. +@end ifclear +@ifset BARETARGET The usual way to specify an executable file name is with -the command argument given when you start _GDBN__, (@pxref{Invocation, -,Getting In and Out of _GDBN__}. -_fi__(_BARE__) +the command argument given when you start @value{GDBN}, (@pxref{Invocation, +,Getting In and Out of @value{GDBN}}. +@end ifset Occasionally it is necessary to change to a different file during a -_GDBN__ session. Or you may run _GDBN__ and forget to specify a file you -want to use. In these situations the _GDBN__ commands to specify new files +@value{GDBN} session. Or you may run @value{GDBN} and forget to specify a file you +want to use. In these situations the @value{GDBN} commands to specify new files are useful. @table @code @@ -6125,28 +6888,28 @@ are useful. Use @var{filename} as the program to be debugged. It is read for its symbols and for the contents of pure memory. It is also the program executed when you use the @code{run} command. If you do not specify a -directory and the file is not found in _GDBN__'s working directory, _GDBN__ +directory and the file is not found in @value{GDBN}'s working directory, @value{GDBN} uses the environment variable @code{PATH} as a list of directories to search, just as the shell does when looking for a program to run. You -can change the value of this variable, for both _GDBN__ and your program, +can change the value of this variable, for both @value{GDBN} and your program, using the @code{path} command. On systems with memory-mapped files, an auxiliary symbol table file @file{@var{filename}.syms} may be available for @var{filename}. If it -is, _GDBN__ will map in the symbol table from +is, @value{GDBN} will map in the symbol table from @file{@var{filename}.syms}, starting up more quickly. See the descriptions of the options @samp{-mapped} and @samp{-readnow} (available on the command line, and with the commands @code{file}, @code{symbol-file}, or @code{add-symbol-file}), for more information. @item file -@code{file} with no argument makes _GDBN__ discard any information it +@code{file} with no argument makes @value{GDBN} discard any information it has on both executable file and the symbol table. @item exec-file @r{[} @var{filename} @r{]} @kindex exec-file Specify that the program to be run (but not the symbol table) is found -in @var{filename}. _GDBN__ will search the environment variable @code{PATH} +in @var{filename}. @value{GDBN} will search the environment variable @code{PATH} if necessary to locate your program. Omitting @var{filename} means to discard information on the executable file. @@ -6156,23 +6919,23 @@ Read symbol table information from file @var{filename}. @code{PATH} is searched when necessary. Use the @code{file} command to get both symbol table and program to run from the same file. -@code{symbol-file} with no argument clears out _GDBN__'s information on your +@code{symbol-file} with no argument clears out @value{GDBN}'s information on your program's symbol table. -The @code{symbol-file} command causes _GDBN__ to forget the contents of its +The @code{symbol-file} command causes @value{GDBN} to forget the contents of its convenience variables, the value history, and all breakpoints and auto-display expressions. This is because they may contain pointers to the internal data recording symbols and data types, which are part of -the old symbol table data being discarded inside _GDBN__. +the old symbol table data being discarded inside @value{GDBN}. @code{symbol-file} will not repeat if you press @key{RET} again after executing it once. -When _GDBN__ is configured for a particular environment, it will +When @value{GDBN} is configured for a particular environment, it will understand debugging information in whatever format is the standard generated for that environment; you may use either a GNU compiler, or other compilers that adhere to the local conventions. Best results are -usually obtained from GNU compilers; for example, using @code{_GCC__} +usually obtained from GNU compilers; for example, using @code{@value{GCC}} you can generate debugging information for optimized code. On some kinds of object files, the @code{symbol-file} command does not @@ -6181,7 +6944,7 @@ the symbol table quickly to find which source files and which symbols are present. The details are read later, one source file at a time, as they are needed. -The purpose of this two-stage reading strategy is to make _GDBN__ start up +The purpose of this two-stage reading strategy is to make @value{GDBN} start up faster. For the most part, it is invisible except for occasional pauses while the symbol table details for a particular source file are being read. (The @code{set verbose} command can turn these pauses @@ -6200,20 +6963,20 @@ the two-stage strategy for COFF yet. @kindex mapped @cindex memory-mapped symbol file @cindex saving symbol table -You can override the _GDBN__ two-stage strategy for reading symbol +You can override the @value{GDBN} two-stage strategy for reading symbol tables by using the @samp{-readnow} option with any of the commands that -load symbol table information, if you want to be sure _GDBN__ has the +load symbol table information, if you want to be sure @value{GDBN} has the entire symbol table available. -_if__(!_BARE__) +@ifclear BARETARGET If memory-mapped files are available on your system through the @code{mmap} system call, you can use another option, @samp{-mapped}, to -cause _GDBN__ to write the symbols for your program into a reusable -file. Future _GDBN__ debugging sessions will map in symbol information +cause @value{GDBN} to write the symbols for your program into a reusable +file. Future @value{GDBN} debugging sessions will map in symbol information from this auxiliary symbol file (if the program hasn't changed), rather than spending time reading the symbol table from the executable program. Using the @samp{-mapped} option has the same effect as -starting _GDBN__ with the @samp{-mapped} command-line option. +starting @value{GDBN} with the @samp{-mapped} command-line option. You can use both options together, to make sure the auxiliary symbol file has all the symbol information for your program. @@ -6224,7 +6987,7 @@ shared across multiple host platforms. The auxiliary symbol file for a program called @var{myprog} is called @samp{@var{myprog}.syms}. Once this file exists (so long as it is newer -than the corresponding executable), _GDBN__ will always attempt to use +than the corresponding executable), @value{GDBN} will always attempt to use it when you debug @var{myprog}; no special options or commands are needed. @c FIXME: for now no mention of directories, since this seems to be in @@ -6240,59 +7003,59 @@ needed. @kindex core-file Specify the whereabouts of a core dump file to be used as the ``contents of memory''. Traditionally, core files contain only some parts of the -address space of the process that generated them; _GDBN__ can access the +address space of the process that generated them; @value{GDBN} can access the executable file itself for other parts. @code{core-file} with no argument specifies that no core file is to be used. Note that the core file is ignored when your program is actually running -under _GDBN__. So, if you have been running your program and you wish to +under @value{GDBN}. So, if you have been running your program and you wish to debug a core file instead, you must kill the subprocess in which the program is running. To do this, use the @code{kill} command (@pxref{Kill Process, ,Killing the Child Process}). -_fi__(!_BARE__) +@end ifclear @item load @var{filename} @kindex load -_if__(_GENERIC__) +@ifset GENERIC Depending on what remote debugging facilities are configured into -_GDBN__, the @code{load} command may be available. Where it exists, it +@value{GDBN}, the @code{load} command may be available. Where it exists, it is meant to make @var{filename} (an executable) available for debugging on the remote system---by downloading, or dynamic linking, for example. -@code{load} also records @var{filename}'s symbol table in _GDBN__, like +@code{load} also records @var{filename}'s symbol table in @value{GDBN}, like the @code{add-symbol-file} command. -If @code{load} is not available on your _GDBN__, attempting to execute +If @code{load} is not available on your @value{GDBN}, attempting to execute it gets the error message ``@code{You can't do that when your target is @dots{}}'' -_fi__(_GENERIC__) +@end ifset -_if__(_VXWORKS__) +@ifset VXWORKS On VxWorks, @code{load} will dynamically link @var{filename} on the -current target system as well as adding its symbols in _GDBN__. -_fi__(_VXWORKS__) +current target system as well as adding its symbols in @value{GDBN}. +@end ifset -_if__(_I960__) +@ifset Icmlx @cindex download to Nindy-960 With the Nindy interface to an Intel 960 board, @code{load} will download @var{filename} to the 960 as well as adding its symbols in -_GDBN__. -_fi__(_I960__) +@value{GDBN}. +@end ifset -_if__(_H8__) +@ifset Hviii @cindex download to H8/300 @cindex H8/300 download When you select remote debugging to a Hitachi H8/300 board (@pxref{Hitachi -H8/300 Remote,,_GDBN__ and the Hitachi H8/300}), the +H8/300 Remote,,@value{GDBN} and the Hitachi H8/300}), the @code{load} command downloads your program to the H8/300 and also opens -it as the current executable target for _GDBN__ on your host (like the +it as the current executable target for @value{GDBN} on your host (like the @code{file} command). -_fi__(_H8__) +@end ifset @code{load} will not repeat if you press @key{RET} again after using it. -_if__(!_BARE__) +@ifclear BARETARGET @item add-symbol-file @var{filename} @var{address} @itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]} @r{[} -mapped @r{]} @kindex add-symbol-file @@ -6301,7 +7064,7 @@ The @code{add-symbol-file} command reads additional symbol table information from the file @var{filename}. You would use this command when @var{filename} has been dynamically loaded (by some other means) into the program that is running. @var{address} should be the memory address at which the -file has been loaded; _GDBN__ cannot figure this out for itself. +file has been loaded; @value{GDBN} cannot figure this out for itself. The symbol table of the file @var{filename} is added to the symbol table originally read with the @code{symbol-file} command. You can use the @@ -6312,9 +7075,9 @@ use the @code{symbol-file} command. @code{add-symbol-file} will not repeat if you press @key{RET} after using it. You can use the @samp{-mapped} and @samp{-readnow} options just as with -the @code{symbol-file} command, to change how _GDBN__ manages the symbol +the @code{symbol-file} command, to change how @value{GDBN} manages the symbol table information for @var{filename}. -_fi__(!_BARE__) +@end ifclear @item info files @itemx info target @@ -6323,25 +7086,25 @@ _fi__(!_BARE__) @code{info files} and @code{info target} are synonymous; both print the current targets (@pxref{Targets, ,Specifying a Debugging Target}), including the names of the executable and core dump files currently in -use by _GDBN__, and the files from which symbols were loaded. The command +use by @value{GDBN}, and the files from which symbols were loaded. The command @code{help targets} lists all possible targets rather than current ones. @end table All file-specifying commands allow both absolute and relative file names -as arguments. _GDBN__ always converts the file name to an absolute path +as arguments. @value{GDBN} always converts the file name to an absolute path name and remembers it that way. -_if__(!_BARE__) +@ifclear BARETARGET @cindex shared libraries -_GDBN__ supports SunOS, SVR4, and IBM RS/6000 shared libraries. -_GDBN__ automatically loads symbol definitions from shared libraries +@value{GDBN} supports SunOS, SVR4, and IBM RS/6000 shared libraries. +@value{GDBN} automatically loads symbol definitions from shared libraries when you use the @code{run} command, or when you examine a core file. -(Before you issue the @code{run} command, _GDBN__ will not understand +(Before you issue the @code{run} command, @value{GDBN} will not understand references to a function in a shared library, however---unless you are debugging a core file). -@c FIXME: next _GDBN__ release should permit some refs to undef +@c FIXME: next @value{GDBN} release should permit some refs to undef @c FIXME...symbols---eg in a break cmd---assuming they are from a shared lib @table @code @@ -6362,19 +7125,19 @@ shared libraries required by your program for a core file or after typing @code{run}. If @var{regex} is omitted all shared libraries required by your program are loaded. @end table -_fi__(!_BARE__) +@end ifclear @node Symbol Errors @section Errors Reading Symbol Files -While reading a symbol file, _GDBN__ will occasionally encounter problems, +While reading a symbol file, @value{GDBN} will occasionally encounter problems, such as symbol types it does not recognize, or known bugs in compiler -output. By default, _GDBN__ does not notify you of such problems, since +output. By default, @value{GDBN} does not notify you of such problems, since they are relatively common and primarily of interest to people debugging compilers. If you are interested in seeing information -about ill-constructed symbol tables, you can either ask _GDBN__ to print +about ill-constructed symbol tables, you can either ask @value{GDBN} to print only one message about each such type of problem, no matter how many -times the problem occurs; or you can ask _GDBN__ to print more messages, +times the problem occurs; or you can ask @value{GDBN} to print more messages, to see how many times the problems occur, with the @code{set complaints} command (@pxref{Messages/Warnings, ,Optional Warnings and Messages}). @@ -6389,7 +7152,7 @@ The symbol information shows where symbol scopes begin and end error indicates that an inner scope block is not fully contained in its outer scope blocks. -_GDBN__ circumvents the problem by treating the inner block as if it had +@value{GDBN} circumvents the problem by treating the inner block as if it had the same scope as the outer block. In the error message, @var{symbol} may be shown as ``@code{(don't know)}'' if the outer block is not a function. @@ -6400,7 +7163,7 @@ The symbol information for symbol scope blocks should occur in order of increasing addresses. This error indicates that it does not do so. -_GDBN__ does not circumvent this problem, and will have trouble locating +@value{GDBN} does not circumvent this problem, and will have trouble locating symbols in the source file whose symbols being read. (You can often determine what source file is affected by specifying @code{set verbose on}. @xref{Messages/Warnings, ,Optional Warnings and Messages}.) @@ -6411,7 +7174,7 @@ The symbol information for a symbol scope block has a start address smaller than the address of the preceding source line. This is known to occur in the SunOS 4.1.1 (and earlier) C compiler. -_GDBN__ circumvents the problem by treating the symbol scope block as +@value{GDBN} circumvents the problem by treating the symbol scope block as starting on the previous source line. @item bad string table offset in symbol @var{n} @@ -6420,25 +7183,25 @@ starting on the previous source line. Symbol number @var{n} contains a pointer into the string table which is larger than the size of the string table. -_GDBN__ circumvents the problem by considering the symbol to have the +@value{GDBN} circumvents the problem by considering the symbol to have the name @code{foo}, which may cause other problems if many symbols end up with this name. @item unknown symbol type @code{0x@var{nn}} -The symbol information contains new data types that _GDBN__ does not yet +The symbol information contains new data types that @value{GDBN} does not yet know how to read. @code{0x@var{nn}} is the symbol type of the misunderstood information, in hexadecimal. -_GDBN__ circumvents the error by ignoring this symbol information. This +@value{GDBN} circumvents the error by ignoring this symbol information. This will usually allow your program to be debugged, though certain symbols will not be accessible. If you encounter such a problem and feel like -debugging it, you can debug @code{_GDBP__} with itself, breakpoint on +debugging it, you can debug @code{@value{GDBP}} with itself, breakpoint on @code{complain}, then go up to the function @code{read_dbx_symtab} and examine @code{*bufp} to see the symbol. @item stub type has NULL name -_GDBN__ could not find the full definition for a struct or class. +@value{GDBN} could not find the full definition for a struct or class. @item const/volatile indicator missing (ok if using g++ v1.x), got@dots{} @@ -6448,7 +7211,7 @@ for it. @item info mismatch between compiler and debugger -_GDBN__ could not parse a type specification output by the compiler. +@value{GDBN} could not parse a type specification output by the compiler. @end table @node Targets @@ -6457,19 +7220,19 @@ _GDBN__ could not parse a type specification output by the compiler. @kindex target A @dfn{target} is the execution environment occupied by your program. -_if__(!_BARE__) -Often, _GDBN__ runs in the same host environment as your program; in +@ifclear BARETARGET +Often, @value{GDBN} runs in the same host environment as your program; in that case, the debugging target is specified as a side effect when you use the @code{file} or @code{core} commands. When you need more -flexibility---for example, running _GDBN__ on a physically separate +flexibility---for example, running @value{GDBN} on a physically separate host, or controlling a standalone system over a serial port or a realtime system over a TCP/IP connection---you -_fi__(!_BARE__) -_if__(_BARE__) +@end ifclear +@ifset BARETARGET You -_fi__(_BARE__) +@end ifset can use the @code{target} command to specify one of the target types -configured for _GDBN__ (@pxref{Target Commands, ,Commands for Managing +configured for @value{GDBN} (@pxref{Target Commands, ,Commands for Managing Targets}). @menu @@ -6484,9 +7247,9 @@ Targets}). @cindex active targets @cindex multiple targets -_if__(!_BARE__) +@ifclear BARETARGET There are three classes of targets: processes, core files, and -executable files. _GDBN__ can work concurrently on up to three active +executable files. @value{GDBN} can work concurrently on up to three active targets, one in each class. This allows you to (for example) start a process and inspect its activity without abandoning your work on a core file. @@ -6494,42 +7257,42 @@ file. If, for example, you execute @samp{gdb a.out}, then the executable file @code{a.out} is the only active target. If you designate a core file as well---presumably from a prior run that crashed and coredumped---then -_GDBN__ has two active targets and will use them in tandem, looking +@value{GDBN} has two active targets and will use them in tandem, looking first in the corefile target, then in the executable file, to satisfy requests for memory addresses. (Typically, these two classes of target are complementary, since core files contain only a program's read-write memory---variables and so on---plus machine status, while executable files contain only the program text and initialized data.) -_fi__(!_BARE__) +@end ifclear When you type @code{run}, your executable file becomes an active process -target as well. When a process target is active, all _GDBN__ commands +target as well. When a process target is active, all @value{GDBN} commands requesting memory addresses refer to that target; addresses in an -_if__(!_BARE__) +@ifclear BARETARGET active core file or -_fi__(!_BARE__) +@end ifclear executable file target are obscured while the process target is active. -_if__(_BARE__) +@ifset BARETARGET Use the @code{exec-file} command to select a new executable target (@pxref{Files, ,Commands to Specify Files}). -_fi__(_BARE__) -_if__(!_BARE__) +@end ifset +@ifclear BARETARGET Use the @code{core-file} and @code{exec-file} commands to select a new core file or executable target (@pxref{Files, ,Commands to Specify Files}). To specify as a target a process that is already running, use the @code{attach} command (@pxref{Attach, ,Debugging an Already-Running Process}.). -_fi__(!_BARE__) +@end ifclear @node Target Commands @section Commands for Managing Targets @table @code @item target @var{type} @var{parameters} -Connects the _GDBN__ host environment to a target machine or process. A +Connects the @value{GDBN} host environment to a target machine or process. A target is typically a protocol for talking to debugging facilities. You use the argument @var{type} to specify the type or protocol of the target machine. @@ -6566,15 +7329,15 @@ An executable file. @samp{target exec @var{prog}} is the same as A core dump file. @samp{target core @var{filename}} is the same as @samp{core-file @var{filename}}. -_if__(_REMOTESTUB__) +@ifset REMOTESTUB @item target remote @var{dev} @kindex target remote Remote serial target in GDB-specific protocol. The argument @var{dev} specifies what serial device to use for the connection (e.g. @file{/dev/ttya}). @xref{Remote, ,Remote Debugging}. -_fi__(_REMOTESTUB__) +@end ifset -_if__(_AMD29K__) +@ifset AMDxxixK @item target amd-eb @var{dev} @var{speed} @var{PROG} @kindex target amd-eb @cindex AMD EB29K @@ -6582,49 +7345,49 @@ Remote PC-resident AMD EB29K board, attached over serial lines. @var{dev} is the serial device, as for @code{target remote}; @var{speed} allows you to specify the linespeed; and @var{PROG} is the name of the program to be debugged, as it appears to DOS on the PC. -@xref{EB29K Remote, ,_GDBN__ with a Remote EB29K}. +@xref{EB29K Remote, ,@value{GDBN} with a Remote EB29K}. -_fi__(_AMD29K__) -_if__(_H8__) +@end ifset +@ifset Hviii @item target hms @kindex target hms A Hitachi H8/300 board, attached via serial line to your host. Use special commands @code{device} and @code{speed} to control the serial line and the communications speed used. @xref{Hitachi H8/300 -Remote,,_GDBN__ and the Hitachi H8/300}. +Remote,,@value{GDBN} and the Hitachi H8/300}. -_fi__(_H8__) -_if__(_I960__) +@end ifset +@ifset Icmlx @item target nindy @var{devicename} @kindex target nindy An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is the name of the serial device to use for the connection, e.g. -@file{/dev/ttya}. @xref{i960-Nindy Remote, ,_GDBN__ with a Remote i960 (Nindy)}. +@file{/dev/ttya}. @xref{i960-Nindy Remote, ,@value{GDBN} with a Remote i960 (Nindy)}. -_fi__(_I960__) -_if__(_ST2000__) +@end ifset +@ifset STmm @item target st2000 @var{dev} @var{speed} @kindex target st2000 A Tandem ST2000 phone switch, running Tandem's STDBUG protocol. @var{dev} is the name of the device attached to the ST2000 serial line; @var{speed} is the communication line speed. The arguments are not used -if _GDBN__ is configured to connect to the ST2000 using TCP or Telnet. -@xref{ST2000 Remote,,_GDBN__ with a Tandem ST2000}. +if @value{GDBN} is configured to connect to the ST2000 using TCP or Telnet. +@xref{ST2000 Remote,,@value{GDBN} with a Tandem ST2000}. -_fi__(_ST2000__) -_if__(_VXWORKS__) +@end ifset +@ifset VXWORKS @item target vxworks @var{machinename} @kindex target vxworks A VxWorks system, attached via TCP/IP. The argument @var{machinename} is the target system's machine name or IP address. -@xref{VxWorks Remote, ,_GDBN__ and VxWorks}. -_fi__(_VXWORKS__) +@xref{VxWorks Remote, ,@value{GDBN} and VxWorks}. +@end ifset @end table -_if__(_GENERIC__) -Different targets are available on different configurations of _GDBN__; your +@ifset GENERIC +Different targets are available on different configurations of @value{GDBN}; your configuration may have more or fewer targets. -_fi__(_GENERIC__) +@end ifset @node Remote @section Remote Debugging @@ -6646,21 +7409,59 @@ communicate with GDB. Other remote targets may be available in your configuration of GDB; use @code{help targets} to list them. -_if__(_GENERIC__) -_dnl__ Text on starting up GDB in various specific cases; it goes up front -_dnl__ in manuals configured for any of those particular situations, here -_dnl__ otherwise. +@ifset GENERIC +@c Text on starting up GDB in various specific cases; it goes up front +@c in manuals configured for any of those particular situations, here +@c otherwise. +@ignore +@c original, intended form of this menu (pre-unfolding): +@menu +@ifset REMOTESTUB +* Remote Serial:: @value{GDBN} remote serial protocol +@end ifset +@ifset Icmlx +* i960-Nindy Remote:: @value{GDBN} with a remote i960 (Nindy) +@end ifset +@ifset AMDxxixK +* EB29K Remote:: @value{GDBN} with a remote EB29K +@end ifset +@ifset VXWORKS +* VxWorks Remote:: @value{GDBN} and VxWorks +@end ifset +@ifset STmm +* ST2000 Remote:: @value{GDBN} with a Tandem ST2000 +@end ifset +@ifset Hviii +* Hitachi H8/300 Remote:: @value{GDBN} and the Hitachi H8/300 +@end ifset +@ifset ZviiiK +* Z8000 Simulator:: @value{GDBN} and its Zilog Z8000 Simulator +@end ifset +@end menu +@end ignore + +@c Unfolded menus: +@c add as configs require, while unfolding remains necessary. +@c +@c All target details: @menu -_include__(gdbinv-m.m4)<>_dnl__ +* Remote Serial:: @value{GDBN} remote serial protocol +* i960-Nindy Remote:: @value{GDBN} with a remote i960 (Nindy) +* EB29K Remote:: @value{GDBN} with a remote EB29K +* VxWorks Remote:: @value{GDBN} and VxWorks +* ST2000 Remote:: @value{GDBN} with a Tandem ST2000 +* Hitachi H8/300 Remote:: @value{GDBN} and the Hitachi H8/300 +* Z8000 Simulator:: @value{GDBN} and its Zilog Z8000 Simulator @end menu -_include__(gdbinv-s.m4) -_fi__(_GENERIC__) -@node Controlling _GDBN__ -@chapter Controlling _GDBN__ +@include gdbinv-s.texi +@end ifset + +@node Controlling GDB +@chapter Controlling @value{GDBN} -You can alter many aspects of _GDBN__'s interaction with you by using -the @code{set} command. For commands controlling how _GDBN__ displays +You can alter many aspects of @value{GDBN}'s interaction with you by using +the @code{set} command. For commands controlling how @value{GDBN} displays data, @pxref{Print Settings, ,Print Settings}; other settings are described here. @menu @@ -6676,17 +7477,17 @@ data, @pxref{Print Settings, ,Print Settings}; other settings are described here @section Prompt @cindex prompt -_GDBN__ indicates its readiness to read a command by printing a string -called the @dfn{prompt}. This string is normally @samp{(_GDBP__)}. You +@value{GDBN} indicates its readiness to read a command by printing a string +called the @dfn{prompt}. This string is normally @samp{(@value{GDBP})}. You can change the prompt string with the @code{set prompt} command. For -instance, when debugging _GDBN__ with _GDBN__, it is useful to change -the prompt in one of the _GDBN__<>s so that you can always tell which +instance, when debugging @value{GDBN} with @value{GDBN}, it is useful to change +the prompt in one of the @value{GDBN}s so that you can always tell which one you are talking to. @table @code @item set prompt @var{newprompt} @kindex set prompt -Directs _GDBN__ to use @var{newprompt} as its prompt string henceforth. +Directs @value{GDBN} to use @var{newprompt} as its prompt string henceforth. @kindex show prompt @item show prompt Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}} @@ -6697,14 +7498,14 @@ Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}} @cindex readline @cindex command line editing -_GDBN__ reads its input commands via the @dfn{readline} interface. This +@value{GDBN} reads its input commands via the @dfn{readline} interface. This GNU library provides consistent behavior for programs which provide a command line interface to the user. Advantages are @code{emacs}-style or @code{vi}-style inline editing of commands, @code{csh}-like history substitution, and a storage and recall of command history across debugging sessions. -You may control the behavior of command line editing in _GDBN__ with the +You may control the behavior of command line editing in @value{GDBN} with the command @code{set}. @table @code @@ -6730,8 +7531,8 @@ Show whether command line editing is enabled. @cindex history file @kindex set history filename @item set history filename @var{fname} -Set the name of the _GDBN__ command history file to @var{fname}. This is -the file from which _GDBN__ will read an initial command history +Set the name of the @value{GDBN} command history file to @var{fname}. This is +the file from which @value{GDBN} will read an initial command history list or to which it will write this list when it exits. This list is accessed through history expansion or through the history command editing characters listed below. This file defaults to the @@ -6751,7 +7552,7 @@ Stop recording command history in a file. @cindex history size @kindex set history size @item set history size @var{size} -Set the number of commands which _GDBN__ will keep in its history list. +Set the number of commands which @value{GDBN} will keep in its history list. This defaults to the value of the environment variable @code{HISTSIZE}, or to 256 if this variable is not set. @end table @@ -6795,7 +7596,7 @@ or @code{vi} may wish to read it. @itemx show history save @itemx show history size @itemx show history expansion -These commands display the state of the _GDBN__ history parameters. +These commands display the state of the @value{GDBN} history parameters. @code{show history} by itself displays all four states. @c @end group @end table @@ -6817,15 +7618,15 @@ Print ten commands just after the commands last printed. @cindex size of screen @cindex pauses in output -Certain commands to _GDBN__ may produce large amounts of information -output to the screen. To help you read all of it, _GDBN__ pauses and +Certain commands to @value{GDBN} may produce large amounts of information +output to the screen. To help you read all of it, @value{GDBN} pauses and asks you for input at the end of each page of output. Type @key{RET} -when you want to continue the output. _GDBN__ also uses the screen +when you want to continue the output. @value{GDBN} also uses the screen width setting to determine when to wrap lines of output. Depending on what is being printed, it tries to break the line at a readable place, rather than simply letting it overflow onto the following line. -Normally _GDBN__ knows the size of the screen from the termcap data base +Normally @value{GDBN} knows the size of the screen from the termcap data base together with the value of the @code{TERM} environment variable and the @code{stty rows} and @code{stty cols} settings. If this is not correct, you can override it with the @code{set height} and @code{set @@ -6844,7 +7645,7 @@ These @code{set} commands specify a screen height of @var{lpp} lines and a screen width of @var{cpl} characters. The associated @code{show} commands display the current settings. -If you specify a height of zero lines, _GDBN__ will not pause during output +If you specify a height of zero lines, @value{GDBN} will not pause during output no matter how long the output is. This is useful if output is to a file or to an editor buffer. @end table @@ -6854,7 +7655,7 @@ or to an editor buffer. @cindex number representation @cindex entering numbers -You can always enter numbers in octal, decimal, or hexadecimal in _GDBN__ by +You can always enter numbers in octal, decimal, or hexadecimal in @value{GDBN} by the usual conventions: octal numbers begin with @samp{0}, decimal numbers end with @samp{.}, and hexadecimal numbers begin with @samp{0x}. Numbers that begin with none of these are, by default, entered in base @@ -6889,9 +7690,9 @@ Display the current default base for numeric input and display. @node Messages/Warnings @section Optional Warnings and Messages -By default, _GDBN__ is silent about its inner workings. If you are running +By default, @value{GDBN} is silent about its inner workings. If you are running on a slow machine, you may want to use the @code{set verbose} command. -It will make _GDBN__ tell you when it does a lengthy internal operation, so +It will make @value{GDBN} tell you when it does a lengthy internal operation, so you will not think it has crashed. Currently, the messages controlled by @code{set verbose} are those @@ -6901,39 +7702,39 @@ see @code{symbol-file} in @ref{Files, ,Commands to Specify Files}. @table @code @kindex set verbose @item set verbose on -Enables _GDBN__'s output of certain informational messages. +Enables @value{GDBN}'s output of certain informational messages. @item set verbose off -Disables _GDBN__'s output of certain informational messages. +Disables @value{GDBN}'s output of certain informational messages. @kindex show verbose @item show verbose Displays whether @code{set verbose} is on or off. @end table -By default, if _GDBN__ encounters bugs in the symbol table of an object +By default, if @value{GDBN} encounters bugs in the symbol table of an object file, it is silent; but if you are debugging a compiler, you may find this information useful (@pxref{Symbol Errors, ,Errors Reading Symbol Files}). @table @code @kindex set complaints @item set complaints @var{limit} -Permits _GDBN__ to output @var{limit} complaints about each type of unusual +Permits @value{GDBN} to output @var{limit} complaints about each type of unusual symbols before becoming silent about the problem. Set @var{limit} to zero to suppress all complaints; set it to a large number to prevent complaints from being suppressed. @kindex show complaints @item show complaints -Displays how many symbol complaints _GDBN__ is permitted to produce. +Displays how many symbol complaints @value{GDBN} is permitted to produce. @end table -By default, _GDBN__ is cautious, and asks what sometimes seems to be a +By default, @value{GDBN} is cautious, and asks what sometimes seems to be a lot of stupid questions to confirm certain commands. For example, if you try to run a program which is already running: @example -(_GDBP__) run +(@value{GDBP}) run The program being debugged has been started already. Start it from the beginning? (y or n) @end example @@ -6961,11 +7762,11 @@ Displays state of confirmation requests. @cindex reloading symbols Some systems allow individual object files that make up your program to be replaced without stopping and restarting your program. -_if__(_VXWORKS__) +@ifset VXWORKS For example, in VxWorks you can simply recompile a defective object file and keep on running. -_fi__(_VXWORKS__) -If you are running on one of these systems, you can allow _GDBN__ to +@end ifset +If you are running on one of these systems, you can allow @value{GDBN} to reload the symbols for automatically relinked modules: @table @code @@ -6978,7 +7779,7 @@ object file with a particular name is seen again. Do not replace symbol definitions when re-encountering object files of the same name. This is the default state; if you are not running on a system that permits automatically relinking modules, you should leave -@code{symbol-reloading} off, since otherwise _GDBN__ may discard symbols +@code{symbol-reloading} off, since otherwise @value{GDBN} may discard symbols when linking large programs, that may contain several modules (from different directories or libraries) with the same name. @@ -6990,7 +7791,7 @@ Show the current @code{on} or @code{off} setting. @chapter Canned Sequences of Commands Aside from breakpoint commands (@pxref{Break Commands, ,Breakpoint -Command Lists}), _GDBN__ provides two ways to store sequences of commands +Command Lists}), @value{GDBN} provides two ways to store sequences of commands for execution as a unit: user-defined commands and command files. @menu @@ -7004,7 +7805,7 @@ for execution as a unit: user-defined commands and command files. @section User-Defined Commands @cindex user-defined command -A @dfn{user-defined command} is a sequence of _GDBN__ commands to which you +A @dfn{user-defined command} is a sequence of @value{GDBN} commands to which you assign a new name as a command. This is done with the @code{define} command. @@ -7014,7 +7815,7 @@ command. Define a command named @var{commandname}. If there is already a command by that name, you are asked to confirm that you want to redefine it. -The definition of the command is made up of other _GDBN__ command lines, +The definition of the command is made up of other @value{GDBN} command lines, which are given following the @code{define} command. The end of these commands is marked by a line containing @code{end}. @@ -7039,7 +7840,7 @@ List all user-defined commands, with the first line of the documentation @item show user @itemx show user @var{commandname} @kindex show user -Display the _GDBN__ commands used to define @var{commandname} (but not its +Display the @value{GDBN} commands used to define @var{commandname} (but not its documentation). If no @var{commandname} is given, display the definitions for all user-defined commands. @end table @@ -7049,7 +7850,7 @@ commands of the definition are not printed. An error in any command stops execution of the user-defined command. Commands that would ask for confirmation if used interactively proceed -without asking when used inside a user-defined command. Many _GDBN__ commands +without asking when used inside a user-defined command. Many @value{GDBN} commands that normally print messages to say what they are doing omit the messages when used in a user-defined command. @@ -7098,15 +7899,15 @@ will get a warning from the @code{define} command. @section Command Files @cindex command files -A command file for _GDBN__ is a file of lines that are _GDBN__ commands. Comments +A command file for @value{GDBN} is a file of lines that are @value{GDBN} commands. Comments (lines starting with @kbd{#}) may also be included. An empty line in a command file does nothing; it does not mean to repeat the last command, as it would from the terminal. @cindex init file -@cindex @file{_GDBINIT__} -When you start _GDBN__, it automatically executes commands from its -@dfn{init files}. These are files named @file{_GDBINIT__}. _GDBN__ reads +@cindex @file{@value{GDBINIT}} +When you start @value{GDBN}, it automatically executes commands from its +@dfn{init files}. These are files named @file{@value{GDBINIT}}. @value{GDBN} reads the init file (if any) in your home directory and then the init file (if any) in the current working directory. (The init files are not executed if you use the @samp{-nx} option; @pxref{Mode Options, @@ -7124,7 +7925,7 @@ printed as they are executed. An error in any command terminates execution of the command file. Commands that would ask for confirmation if used interactively proceed -without asking when used in a command file. Many _GDBN__ commands that +without asking when used in a command file. Many @value{GDBN} commands that normally print messages to say what they are doing omit the messages when called from command files. @@ -7132,7 +7933,7 @@ when called from command files. @section Commands for Controlled Output During the execution of a command file or a user-defined command, normal -_GDBN__ output is suppressed; the only output that appears is what is +@value{GDBN} output is suppressed; the only output that appears is what is explicitly printed by the commands in the definition. This section describes three commands useful for generating exactly the output you want. @@ -7203,21 +8004,21 @@ string are the simple ones that consist of backslash followed by a letter. @end table -_if__(!_DOSHOST__) +@ifclear DOSHOST @node Emacs -@chapter Using _GDBN__ under GNU Emacs +@chapter Using @value{GDBN} under GNU Emacs @cindex emacs A special interface allows you to use GNU Emacs to view (and edit) the source files for the program you are debugging with -_GDBN__. +@value{GDBN}. To use this interface, use the command @kbd{M-x gdb} in Emacs. Give the executable file you want to debug as an argument. This command starts -_GDBN__ as a subprocess of Emacs, with input and output through a newly +@value{GDBN} as a subprocess of Emacs, with input and output through a newly created Emacs buffer. -Using _GDBN__ under Emacs is just like using _GDBN__ normally except for two +Using @value{GDBN} under Emacs is just like using @value{GDBN} normally except for two things: @itemize @bullet @@ -7225,7 +8026,7 @@ things: All ``terminal'' input and output goes through the Emacs buffer. @end itemize -This applies both to _GDBN__ commands and their output, and to the input +This applies both to @value{GDBN} commands and their output, and to the input and output done by the program you are debugging. This is useful because it means that you can copy the text of previous @@ -7239,37 +8040,37 @@ stop. @itemize @bullet @item -_GDBN__ displays source code through Emacs. +@value{GDBN} displays source code through Emacs. @end itemize -Each time _GDBN__ displays a stack frame, Emacs automatically finds the -source file for that frame and puts an arrow (_0__@samp{=>}_1__) at the +Each time @value{GDBN} displays a stack frame, Emacs automatically finds the +source file for that frame and puts an arrow (@samp{=>}) at the left margin of the current line. Emacs uses a separate buffer for -source display, and splits the window to show both your _GDBN__ session +source display, and splits the window to show both your @value{GDBN} session and the source. -Explicit _GDBN__ @code{list} or search commands still produce output as +Explicit @value{GDBN} @code{list} or search commands still produce output as usual, but you probably will have no reason to use them. @quotation @emph{Warning:} If the directory where your program resides is not your current directory, it can be easy to confuse Emacs about the location of the source files, in which case the auxiliary display buffer will not -appear to show your source. _GDBN__ can find programs by searching your -environment's @code{PATH} variable, so the _GDBN__ input and output +appear to show your source. @value{GDBN} can find programs by searching your +environment's @code{PATH} variable, so the @value{GDBN} input and output session will proceed normally; but Emacs does not get enough information -back from _GDBN__ to locate the source files in this situation. To -avoid this problem, either start _GDBN__ mode from the directory where +back from @value{GDBN} to locate the source files in this situation. To +avoid this problem, either start @value{GDBN} mode from the directory where your program resides, or specify a full path name when prompted for the @kbd{M-x gdb} argument. -A similar confusion can result if you use the _GDBN__ @code{file} command to +A similar confusion can result if you use the @value{GDBN} @code{file} command to switch to debugging a program in some other location, from an existing -_GDBN__ buffer in Emacs. +@value{GDBN} buffer in Emacs. @end quotation By default, @kbd{M-x gdb} calls the program called @file{gdb}. If -you need to call _GDBN__ by a different name (for example, if you keep +you need to call @value{GDBN} by a different name (for example, if you keep several configurations around, with different names) you can set the Emacs variable @code{gdb-command-name}; for example, @@ -7282,36 +8083,36 @@ Emacs variable @code{gdb-command-name}; for example, in your @file{.emacs} file) will make Emacs call the program named ``@code{mygdb}'' instead. -In the _GDBN__ I/O buffer, you can use these special Emacs commands in +In the @value{GDBN} I/O buffer, you can use these special Emacs commands in addition to the standard Shell mode commands: @table @kbd @item C-h m -Describe the features of Emacs' _GDBN__ Mode. +Describe the features of Emacs' @value{GDBN} Mode. @item M-s -Execute to another source line, like the _GDBN__ @code{step} command; also +Execute to another source line, like the @value{GDBN} @code{step} command; also update the display window to show the current file and location. @item M-n Execute to next source line in this function, skipping all function -calls, like the _GDBN__ @code{next} command. Then update the display window +calls, like the @value{GDBN} @code{next} command. Then update the display window to show the current file and location. @item M-i -Execute one instruction, like the _GDBN__ @code{stepi} command; update +Execute one instruction, like the @value{GDBN} @code{stepi} command; update display window accordingly. @item M-x gdb-nexti -Execute to next instruction, using the _GDBN__ @code{nexti} command; update +Execute to next instruction, using the @value{GDBN} @code{nexti} command; update display window accordingly. @item C-c C-f -Execute until exit from the selected stack frame, like the _GDBN__ +Execute until exit from the selected stack frame, like the @value{GDBN} @code{finish} command. @item M-c -Continue execution of your program, like the _GDBN__ @code{continue} +Continue execution of your program, like the @value{GDBN} @code{continue} command. @emph{Warning:} In Emacs v19, this command is @kbd{C-c C-p}. @@ -7319,19 +8120,19 @@ command. @item M-u Go up the number of frames indicated by the numeric argument (@pxref{Arguments, , Numeric Arguments, emacs, The GNU Emacs Manual}), -like the _GDBN__ @code{up} command. +like the @value{GDBN} @code{up} command. @emph{Warning:} In Emacs v19, this command is @kbd{C-c C-u}. @item M-d Go down the number of frames indicated by the numeric argument, like the -_GDBN__ @code{down} command. +@value{GDBN} @code{down} command. @emph{Warning:} In Emacs v19, this command is @kbd{C-c C-d}. @item C-x & Read the number where the cursor is positioned, and insert it at the end -of the _GDBN__ I/O buffer. For example, if you wish to disassemble code +of the @value{GDBN} I/O buffer. For example, if you wish to disassemble code around an address that was displayed earlier, type @kbd{disassemble}; then move the cursor to the address display, and pick up the argument for @code{disassemble} by typing @kbd{C-x &}. @@ -7347,19 +8148,19 @@ is passed as an argument to the corresponding list element. @end table In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break}) -tells _GDBN__ to set a breakpoint on the source line point is on. +tells @value{GDBN} to set a breakpoint on the source line point is on. If you accidentally delete the source-display buffer, an easy way to get -it back is to type the command @code{f} in the _GDBN__ buffer, to +it back is to type the command @code{f} in the @value{GDBN} buffer, to request a frame display; when you run under Emacs, this will recreate the source buffer if necessary to show you the context of the current frame. The source files displayed in Emacs are in ordinary Emacs buffers which are visiting the source files in the usual way. You can edit -the files with these buffers if you wish; but keep in mind that _GDBN__ +the files with these buffers if you wish; but keep in mind that @value{GDBN} communicates with Emacs in terms of line numbers. If you add or -delete lines from the text, the line numbers that _GDBN__ knows will cease +delete lines from the text, the line numbers that @value{GDBN} knows will cease to correspond properly to the code. @c The following dropped because Epoch is nonstandard. Reactivate @@ -7374,47 +8175,47 @@ environment. Users of this environment can use a new command, @code{inspect} which performs identically to @code{print} except that each value is printed in its own window. @end ignore -_fi__(!_DOSHOST__) +@end ifclear -_if__(_LUCID__) +@ifset LUCID @node Energize -@chapter Using _GDBN__ with Energize +@chapter Using @value{GDBN} with Energize @cindex Energize The Energize Programming System is an integrated development environment that includes a point-and-click interface to many programming tools. -When you use _GDBN__ in this environment, you can use the standard -Energize graphical interface to drive _GDBN__; you can also, if you -choose, type _GDBN__ commands as usual in a debugging window. Even if +When you use @value{GDBN} in this environment, you can use the standard +Energize graphical interface to drive @value{GDBN}; you can also, if you +choose, type @value{GDBN} commands as usual in a debugging window. Even if you use the graphical interface, the debugging window (which uses Emacs, -and resembles the standard Emacs interface to _GDBN__) displays the +and resembles the standard Emacs interface to @value{GDBN}) displays the equivalent commands, so that the history of your debugging session is properly reflected. -When Energize starts up a _GDBN__ session, it uses one of the +When Energize starts up a @value{GDBN} session, it uses one of the command-line options @samp{-energize} or @samp{-cadillac} (``cadillac'' is the name of the communications protocol used by the Energize system). -This option makes _GDBN__ run as one of the tools in the Energize Tool +This option makes @value{GDBN} run as one of the tools in the Energize Tool Set: it sends all output to the Energize kernel, and accept input from it as well. See the user manual for the Energize Programming System for information on how to use the Energize graphical interface and the other -development tools that Energize integrates with _GDBN__. +development tools that Energize integrates with @value{GDBN}. -_fi__(_LUCID__) +@end ifset -@node _GDBN__ Bugs -@chapter Reporting Bugs in _GDBN__ -@cindex Bugs in _GDBN__ -@cindex Reporting Bugs in _GDBN__ +@node GDB Bugs +@chapter Reporting Bugs in @value{GDBN} +@cindex Bugs in @value{GDBN} +@cindex Reporting Bugs in @value{GDBN} -Your bug reports play an essential role in making _GDBN__ reliable. +Your bug reports play an essential role in making @value{GDBN} reliable. Reporting a bug may help you by bringing a solution to your problem, or it may not. But in any case the principal function of a bug report is to help -the entire community by making the next version of _GDBN__ work better. Bug -reports are your contribution to the maintenance of _GDBN__. +the entire community by making the next version of @value{GDBN} work better. Bug +reports are your contribution to the maintenance of @value{GDBN}. In order for a bug report to serve its purpose, you must include the information that enables us to fix the bug. @@ -7435,37 +8236,37 @@ If you are not sure whether you have found a bug, here are some guidelines: @cindex fatal signal @cindex core dump If the debugger gets a fatal signal, for any input whatever, that is a -_GDBN__ bug. Reliable debuggers never crash. +@value{GDBN} bug. Reliable debuggers never crash. @item @cindex error on valid input -If _GDBN__ produces an error message for valid input, that is a bug. +If @value{GDBN} produces an error message for valid input, that is a bug. @item @cindex Invalid Input -If _GDBN__ does not produce an error message for invalid input, +If @value{GDBN} does not produce an error message for invalid input, that is a bug. However, you should note that your idea of ``invalid input'' might be our idea of ``an extension'' or ``support for traditional practice''. @item If you are an experienced user of debugging tools, your suggestions -for improvement of _GDBN__ are welcome in any case. +for improvement of @value{GDBN} are welcome in any case. @end itemize @node Bug Reporting @section How to Report Bugs @cindex bug reports -@cindex _GDBN__ bugs, reporting +@cindex @value{GDBN} bugs, reporting A number of companies and individuals offer support for GNU products. -If you obtained _GDBN__ from a support organization, we recommend you +If you obtained @value{GDBN} from a support organization, we recommend you contact that organization first. Contact information for many support companies and individuals is available in the file @file{etc/SERVICE} in the GNU Emacs distribution. -In any event, we also recommend that you send bug reports for _GDBN__ to one +In any event, we also recommend that you send bug reports for @value{GDBN} to one of these addresses: @example @@ -7474,7 +8275,7 @@ bug-gdb@@prep.ai.mit.edu @end example @strong{Do not send bug reports to @samp{info-gdb}, or to -@samp{help-gdb}, or to any newsgroups.} Most users of _GDBN__ do not want to +@samp{help-gdb}, or to any newsgroups.} Most users of @value{GDBN} do not want to receive bug reports. Those that do, have arranged to receive @samp{bug-gdb}. The mailing list @samp{bug-gdb} has a newsgroup @samp{gnu.gdb.bug} which @@ -7523,23 +8324,23 @@ To enable us to fix the bug, you should include all these things: @itemize @bullet @item -The version of _GDBN__. _GDBN__ announces it if you start with no +The version of @value{GDBN}. @value{GDBN} announces it if you start with no arguments; you can also print it at any time using @code{show version}. Without this, we will not know whether there is any point in looking for -the bug in the current version of _GDBN__. +the bug in the current version of @value{GDBN}. @item The type of machine you are using, and the operating system name and version number. @item -What compiler (and its version) was used to compile _GDBN__---e.g. -``_GCC__-2.0''. +What compiler (and its version) was used to compile @value{GDBN}---e.g. +``@value{GCC}--2.0''. @item What compiler (and its version) was used to compile the program you -are debugging---e.g. ``_GCC__-2.0''. +are debugging---e.g. ``@value{GCC}--2.0''. @item The command arguments you gave the compiler to compile your example and @@ -7558,14 +8359,14 @@ reproduce the bug. A description of what behavior you observe that you believe is incorrect. For example, ``It gets a fatal signal.'' -Of course, if the bug is that _GDBN__ gets a fatal signal, then we will +Of course, if the bug is that @value{GDBN} gets a fatal signal, then we will certainly notice it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. We are human, after all. You might as well not give us a chance to make a mistake. Even if the problem you experience is a fatal signal, you should still say so explicitly. Suppose something strange is going on, such as, -your copy of _GDBN__ is out of synch, or you have encountered a +your copy of @value{GDBN} is out of synch, or you have encountered a bug in the C library on your system. (This has happened!) Your copy might crash and ours would not. If you told us to expect a crash, then when ours fails to crash, we would know that the bug was not @@ -7573,8 +8374,8 @@ happening for us. If you had not told us to expect a crash, then we would not be able to draw any conclusion from our observations. @item -If you wish to suggest changes to the _GDBN__ source, send us context -diffs. If you even discuss something in the _GDBN__ source, refer to +If you wish to suggest changes to the @value{GDBN} source, send us context +diffs. If you even discuss something in the @value{GDBN} source, refer to it by context, not by line number. The line numbers in our development sources will not match those in your @@ -7612,7 +8413,7 @@ the necessary information, such as the test case, on the assumption that a patch is all we need. We might see problems with your patch and decide to fix the problem another way, or we might not understand it at all. -Sometimes with a program as complicated as _GDBN__ it is very hard to +Sometimes with a program as complicated as @value{GDBN} it is very hard to construct an example that will make the program follow a certain path through the code. If you do not send us the example, we will not be able to construct one, so we will not be able to verify that the bug is fixed. @@ -7637,7 +8438,7 @@ things without first using the debugger to find the facts. @include inc-hist.texi @end iftex -_if__(_GENERIC__||!_H8__) +@ifset NOVEL @node Renamed Commands @appendix Renamed Commands @@ -7754,9 +8555,9 @@ unset &&\rm(No longer an alias for delete)\cr } @end tex @c END TEXI2ROFF-KILL -_fi__(_GENERIC__||!_H8__) +@end ifset -_if__(!_PRECONFIGURED__) +@ifclear PRECONFIGURED @node Formatting Documentation @appendix Formatting the Documentation @@ -7765,7 +8566,7 @@ _if__(!_PRECONFIGURED__) The GDB 4 release includes an already-formatted reference card, ready for printing with PostScript or GhostScript, in the @file{gdb} subdirectory of the main source directory---in -@file{gdb-_GDB_VN__/gdb/refcard.ps} of the version _GDB_VN__ release. +@file{gdb-@value{GDBVN}/gdb/refcard.ps} of the version @value{GDBVN} release. If you can use PostScript or GhostScript with your printer, you can print the reference card immediately with @file{refcard.ps}. @@ -7804,7 +8605,7 @@ Info formatting programs, such as @code{texinfo-format-buffer} or @code{makeinfo}. If you have @code{makeinfo} installed, and are in the top level GDB -source directory (@file{gdb-_GDB_VN__}, in the case of version _GDB_VN__), you can +source directory (@file{gdb-@value{GDBVN}}, in the case of version @value{GDBVN}), you can make the Info file by typing: @example @@ -7834,7 +8635,7 @@ directory. If you have @TeX{} and a @sc{dvi} printer program installed, you can typeset and print this manual. First switch to the the @file{gdb} subdirectory of the main source directory (for example, to -@file{gdb-_GDB_VN__/gdb}) and then type: +@file{gdb-@value{GDBVN}/gdb}) and then type: @example make gdb.dvi @@ -7849,7 +8650,7 @@ make gdb.dvi @c irrelevant in info file; it's as current as the code it lives with. @quotation @emph{Warning:} These installation instructions are current as of -GDB version _GDB_VN__. If you're installing a more recent release +GDB version @value{GDBVN}. If you're installing a more recent release of GDB, we may have improved the installation procedures since printing this manual; see the @file{README} file included in your release for the most recent instructions. @@ -7864,41 +8665,41 @@ The GDB distribution includes all the source code you need for GDB in a single directory, whose name is usually composed by appending the version number to @samp{gdb}. -For example, the GDB version _GDB_VN__ distribution is in the @file{gdb-_GDB_VN__} +For example, the GDB version @value{GDBVN} distribution is in the @file{gdb-@value{GDBVN}} directory. That directory contains: @table @code -@item gdb-_GDB_VN__/configure @r{(and supporting files)} +@item gdb-@value{GDBVN}/configure @r{(and supporting files)} script for configuring GDB and all its supporting libraries. -@item gdb-_GDB_VN__/gdb +@item gdb-@value{GDBVN}/gdb the source specific to GDB itself -@item gdb-_GDB_VN__/bfd +@item gdb-@value{GDBVN}/bfd source for the Binary File Descriptor library -@item gdb-_GDB_VN__/include +@item gdb-@value{GDBVN}/include GNU include files -@item gdb-_GDB_VN__/libiberty +@item gdb-@value{GDBVN}/libiberty source for the @samp{-liberty} free software library -@item gdb-_GDB_VN__/opcodes +@item gdb-@value{GDBVN}/opcodes source for the library of opcode tables and disassemblers -@item gdb-_GDB_VN__/readline +@item gdb-@value{GDBVN}/readline source for the GNU command-line interface -@item gdb-_GDB_VN__/glob +@item gdb-@value{GDBVN}/glob source for the GNU filename pattern-matching subroutine -@item gdb-_GDB_VN__/mmalloc +@item gdb-@value{GDBVN}/mmalloc source for the GNU memory-mapped malloc package @end table The simplest way to configure and build GDB is to run @code{configure} from the @file{gdb-@var{version-number}} source directory, which in -this example is the @file{gdb-_GDB_VN__} directory. +this example is the @file{gdb-@value{GDBVN}} directory. First switch to the @file{gdb-@var{version-number}} source directory if you are not already in it; then run @code{configure}. Pass the @@ -7908,7 +8709,7 @@ argument. For example: @example -cd gdb-_GDB_VN__ +cd gdb-@value{GDBVN} ./configure @var{host} make @end example @@ -7932,7 +8733,7 @@ sh configure @var{host} If you run @code{configure} from a directory that contains source directories for multiple libraries or programs, such as the -@file{gdb-_GDB_VN__} source directory for version _GDB_VN__, @code{configure} +@file{gdb-@value{GDBVN}} source directory for version @value{GDBVN}, @code{configure} creates configuration files for every directory level underneath (unless you tell it not to, with the @samp{--norecursion} option). @@ -7940,17 +8741,17 @@ You can run the @code{configure} script from any of the subordinate directories in the GDB distribution, if you only want to configure that subdirectory; but be sure to specify a path to it. -For example, with version _GDB_VN__, type the following to configure only +For example, with version @value{GDBVN}, type the following to configure only the @code{bfd} subdirectory: @example @group -cd gdb-_GDB_VN__/bfd +cd gdb-@value{GDBVN}/bfd ../configure @var{host} @end group @end example -You can install @code{_GDBP__} anywhere; it has no hardwired paths. +You can install @code{@value{GDBP}} anywhere; it has no hardwired paths. However, you should make sure that the shell on your path (named by the @samp{SHELL} environment variable) is publicly readable. Remember that GDB uses the shell to start your program---some systems refuse to @@ -7981,15 +8782,15 @@ itself from your working directory. If the path to @code{configure} would be the same as the argument to @samp{--srcdir}, you can leave out the @samp{--srcdir} option; it will be assumed.) -For example, with version _GDB_VN__, you can build GDB in a separate +For example, with version @value{GDBVN}, you can build GDB in a separate directory for a Sun 4 like this: @example @group -cd gdb-_GDB_VN__ +cd gdb-@value{GDBVN} mkdir ../gdb-sun4 cd ../gdb-sun4 -../gdb-_GDB_VN__/configure sun4 +../gdb-@value{GDBVN}/configure sun4 make @end group @end example @@ -8013,8 +8814,8 @@ called @code{configure} (or one of its subdirectories). The @code{Makefile} generated by @code{configure} for each source directory also runs recursively. If you type @code{make} in a source -directory such as @file{gdb-_GDB_VN__} (or in a separate configured -directory configured with @samp{--srcdir=@var{path}/gdb-_GDB_VN__}), you +directory such as @file{gdb-@value{GDBVN}} (or in a separate configured +directory configured with @samp{--srcdir=@var{path}/gdb-@value{GDBVN}}), you will build all the required libraries, then build GDB. When you have multiple hosts or targets configured in separate @@ -8062,13 +8863,13 @@ Invalid configuration `i786v': machine `i786v' not recognized @noindent @code{config.sub} is also distributed in the GDB source -directory (@file{gdb-_GDB_VN__}, for version _GDB_VN__). +directory (@file{gdb-@value{GDBVN}}, for version @value{GDBVN}). @node configure Options @section @code{configure} Options Here is a summary of the @code{configure} options and arguments that -are most often useful for building _GDBN__. @code{configure} also has +are most often useful for building @value{GDBN}. @code{configure} also has several other options not listed here. @inforef{What Configure Does,,configure.info}, for a full explanation of @code{configure}. @c FIXME: Would this be more, or less, useful as an xref (ref to printed @@ -8138,9 +8939,9 @@ There is no convenient way to generate a list of all available hosts. @code{configure} accepts other options, for compatibility with configuring other GNU tools recursively; but these are the only options that affect GDB or its supporting libraries. -_fi__(!_PRECONFIGURED__) +@end ifclear -_if__(!_AGGLOMERATION__) +@ifclear AGGLOMERATION @node Copying @unnumbered GNU GENERAL PUBLIC LICENSE @center Version 2, June 1991 @@ -8535,7 +9336,7 @@ proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. -_fi__(!_AGGLOMERATION__) +@end ifclear @node Index @unnumbered Index diff --git a/gdb/doc/gdbinv-m.m4.in b/gdb/doc/gdbinv-m.m4.in index edafe2e..e69de29 100644 --- a/gdb/doc/gdbinv-m.m4.in +++ b/gdb/doc/gdbinv-m.m4.in @@ -1,25 +0,0 @@ -_dnl__ -*- Texinfo -*- -_dnl__ Copyright (c) 1991 Free Software Foundation, Inc. -_dnl__ This file is part of the source for the GDB manual. -_dnl__ M4 FRAGMENT: $Id$ -_if__(_REMOTESTUB__) -* Remote Serial:: _GDBN__ remote serial protocol -_fi__(_REMOTESTUB__) -_if__(_I960__) -* i960-Nindy Remote:: _GDBN__ with a remote i960 (Nindy) -_fi__(_I960__) -_if__(_AMD29K__) -* EB29K Remote:: _GDBN__ with a remote EB29K -_fi__(_AMD29K__) -_if__(_VXWORKS__) -* VxWorks Remote:: _GDBN__ and VxWorks -_fi__(_VXWORKS__) -_if__(_ST2000__) -* ST2000 Remote:: _GDBN__ with a Tandem ST2000 -_fi__(_ST2000__) -_if__(_H8__) -* Hitachi H8/300 Remote:: _GDBN__ and the Hitachi H8/300 -_fi__(_H8__) -_if__(_Z8000__) -* Z8000 Simulator:: _GDBN__ and its Zilog Z8000 Simulator -_fi__(_Z8000__) diff --git a/gdb/doc/gdbinv-s.m4.in b/gdb/doc/gdbinv-s.m4.in index 8130b67..e69de29 100644 --- a/gdb/doc/gdbinv-s.m4.in +++ b/gdb/doc/gdbinv-s.m4.in @@ -1,989 +0,0 @@ -_dnl__ -*- Texinfo -*- -_dnl__ Copyright (c) 1990 1991 1992 Free Software Foundation, Inc. -_dnl__ This file is part of the source for the GDB manual. -_dnl__ M4 FRAGMENT $Id$ -_dnl__ This text diverted to "Remote Debugging" section in general case; -_dnl__ however, if we're doing a manual specifically for one of these, it -_dnl__ belongs up front (in "Getting In and Out" chapter). -_if__(_REMOTESTUB__) -@node Remote Serial -@subsection The _GDBN__ remote serial protocol - -@cindex remote serial debugging, overview -To debug a program running on another machine (the debugging -@dfn{target} machine), you must first arrange for all the usual -prerequisites for the program to run by itself. For example, for a C -program, you need - -@enumerate -@item -A startup routine to set up the C runtime environment; these usually -have a name like @file{crt0}. The startup routine may be supplied by -your hardware supplier, or you may have to write your own. - -@item -You probably need a C subroutine library to support your program's -subroutine calls, notably managing input and output. - -@item -A way of getting your program to the other machine---for example, a -download program. These are often supplied by the hardware -manufacturer, but you may have to write your own from hardware -documentation. -@end enumerate - -The next step is to arrange for your program to use a serial port to -communicate with the machine where _GDBN__ is running (the @dfn{host} -machine). In general terms, the scheme looks like this: - -@table @emph -@item On the host, -_GDBN__ already understands how to use this protocol; when everything -else is set up, you can simply use the @samp{target remote} command -(@pxref{Targets,,Specifying a Debugging Target}). - -@item On the target, -you must link with your program a few special-purpose subroutines that -implement the _GDBN__ remote serial protocol. The file containing these -subroutines is called a @dfn{debugging stub}. -@end table - -The debugging stub is specific to the architecture of the remote -machine; for example, use @file{sparc-stub.c} to debug programs on -@sc{sparc} boards. - -@cindex remote serial stub list -These working remote stubs are distributed with _GDBN__: - -@c FIXME! verify these... -@table @code -@item sparc-stub.c -@kindex sparc-stub.c -For @sc{sparc} architectures. - -@item m68k-stub.c -@kindex m68-stub.c -For Motorola 680x0 architectures. - -@item i386-stub.c -@kindex i36-stub.c -For Intel 386 and compatible architectures. -@end table - -The @file{README} file in the _GDBN__ distribution may list other -recently added stubs. - -@menu -* stub contents:: What the stub can do for you -* bootstrapping:: What you must do for the stub -* debug session:: Putting it all together -* protocol:: Outline of the communication protocol -@end menu - -@node stub contents -@subsubsection What the stub can do for you - -@cindex remote serial stub -The debugging stub for your architecture supplies these three -subroutines: - -@table @code -@item set_debug_traps -@kindex set_debug_traps -@cindex remote serial stub, initialization -This routine arranges to transfer control to @code{handle_exception} -when your program stops. You must call this subroutine explicitly near -the beginning of your program. - -@item handle_exception -@kindex handle_exception -@cindex remote serial stub, main routine -This is the central workhorse, but your program never calls it -explicitly---the setup code arranges for @code{handle_exception} to -run when a trap is triggered. - -@code{handle_exception} takes control when your program stops during -execution (for example, on a breakpoint), and mediates communications -with _GDBN__ on the host machine. This is where the communications -protocol is implemented; @code{handle_exception} acts as the _GDBN__ -representative on the target machine; it begins by sending summary -information on the state of your program, then continues to execute, -retrieving and transmitting any information _GDBN__ needs, until you -execute a _GDBN__ command that makes your program resume; at that point, -@code{handle_exception} returns control to your own code on the target -machine. - -@item breakpoint -@cindex @code{breakpoint} subroutine, remote -Use this auxiliary subroutine to make your program contain a -breakpoint. Depending on the particular situation, this may be the only -way for _GDBN__ to get control. For instance, if your target -machine has some sort of interrupt button, you won't need to call this; -pressing the interrupt button will transfer control to -@code{handle_exception}---in efect, to _GDBN__. On some machines, -simply receiving characters on the serial port may also trigger a trap; -again, in that situation, you don't need to call @code{breakpoint} from -your own program---simply running @samp{target remote} from the host -_GDBN__ session will get control. - -Call @code{breakpoint} if none of these is true, or if you simply want -to make certain your program stops at a predetermined point for the -start of your debugging session. -@end table - -@node bootstrapping -@subsubsection What you must do for the stub - -@cindex remote stub, support routines -The debugging stubs that come with _GDBN__ are set up for a particular -chip architecture, but they have no information about the rest of your -debugging target machine. To allow the stub to work, you must supply -these special low-level subroutines: - -@table @code -@item int getDebugChar() -@kindex getDebugChar -Write this subroutine to read a single character from the serial port. -It may be identical to @code{getchar} for your target system; a -different name is used to allow you to distinguish the two if you wish. - -@item void putDebugChar(int) -@kindex putDebugChar -Write this subroutine to write a single character to the serial port. -It may be identical to @code{putchar} for your target system; a -different name is used to allow you to distinguish the two if you wish. - -@item void flush_i_cache() -@kindex flush_i_cache -Write this subroutine to flush the instruction cache, if any, on your -target machine. If there is no instruction cache, this subroutine may -be a no-op. - -On target machines that have instruction caches, _GDBN__ requires this -function to make certain that the state of your program is stable. -@end table - -@noindent -You must also make sure this library routine is available: - -@table @code -@item void *memset(void *, int, int) -@kindex memset -This is the standard library function @code{memset} that sets an area of -memory to a known value. If you have one of the free versions of -@code{libc.a}, @code{memset} can be found there; otherwise, you must -either obtain it from your hardware manufacturer, or write your own. -@end table - -If you do not use the GNU C compiler, you may need other standard -library subroutines as well; this will vary from one stub to another, -but in general the stubs are likely to use any of the common library -subroutines which @code{gcc} generates as inline code. - - -@node debug session -@subsubsection Putting it all together - -@cindex remote serial debugging summary -In summary, when your program is ready to debug, you must follow these -steps. - -@enumerate -@item -Make sure you have the supporting low-level routines: -@code{getDebugChar}, @code{putDebugChar}, @code{flush_i_cache}, -@code{memset}. - -@item -Insert these lines near the top of your program: - -@example -set_debug_traps(); -breakpoint(); -@end example - -@item -Compile and link together: your program, the _GDBN__ debugging stub for -your target architecture, and the supporting subroutines. - -@item -Make sure you have a serial connection between your target machine and -the _GDBN__ host, and identify the serial port used for this on the host. - -@item -Download your program to your target machine (or get it there by -whatever means the manufacturer provides), and start it. - -@item -To start remote debugging, run _GDBN__ on the host machine, and specify -as an executable file the program that is running in the remote machine. -This tells _GDBN__ how to find your program's symbols and the contents -of its pure text. - -Then establish communication using the @code{target remote} command. -Its argument is the name of the device you're using to control the -target machine. For example: - -@example -target remote /dev/ttyb -@end example - -@noindent -if the serial line is connected to the device named @file{/dev/ttyb}. -@ignore -@c this is from the old text, but it doesn't seem to make sense now that I've -@c seen an example... pesch 4sep1992 -This will stop the remote machine if it is not already stopped. -@end ignore - -@end enumerate - -Now you can use all the usual commands to examine and change data and to -step and continue the remote program. - -To resume the remote program and stop debugging it, use the @code{detach} -command. - -@node protocol -@subsubsection Outline of the communication protocol - -@cindex debugging stub, example -@cindex remote stub, example -@cindex stub example, remote debugging -The stub files provided with _GDBN__ implement the target side of the -communication protocol, and the _GDBN__ side is implemented in the -_GDBN__ source file @file{remote.c}. Normally, you can simply allow -these subroutines to communicate, and ignore the details. (If you're -implementing your own stub file, you can still ignore the details: start -with one of the existing stub files. @file{sparc-stub.c} is the best -organized, and therefore the easiest to read.) - -However, there may be occasions when you need to know something about -the protocol---for example, if there is only one serial port to your -target machine, you might want your program to do something special if -it recognizes a packet meant for _GDBN__. - -@cindex protocol, _GDBN__ remote serial -@cindex serial protocol, _GDBN__ remote -@cindex remote serial protocol -All _GDBN__ commands and responses (other than acknowledgements, which -are single characters) are sent as a packet which includes a -checksum. A packet is introduced with the character @samp{$}, and ends -with the character @samp{#} followed by a two-digit checksum: - -@example -$@var{packet info}#@var{checksum} -@end example - -@cindex checksum, for _GDBN__ remote -@noindent -@var{checksum} is computed as the modulo 256 sum of the @var{packet -info} characters. - -When either the host or the target machine receives a packet, the first -response expected is an acknowledgement: a single character, either -@samp{+} (to indicate the package was received correctly) or @samp{-} -(to request retransmission). - -The host (_GDBN__) sends commands, and the target (the debugging stub -incorporated in your program) sends data in response. The target also -sends data when your program stops. - -Command packets are distinguished by their first character, which -identifies the kind of command. - -These are the commands currently supported: - -@table @code -@item g -Requests the values of CPU registers. - -@item G -Sets the values of CPU registers. - -@item m@var{addr},@var{count} -Read @var{count} bytes at location @var{addr}. - -@item M@var{addr},@var{count}:@dots{} -Write @var{count} bytes at location @var{addr}. - -@item c -@itemx c@var{addr} -Resume execution at the current address (or at @var{addr} if supplied). - -@item s -@itemx s@var{addr} -Step the target program for one instruction, from either the current -program counter or from @var{addr} if supplied. - -@item k -Kill the target program. - -@item ? -Report the most recent signal. To allow you to take advantage of the -_GDBN__ signal handling commands, one of the functions of the debugging -stub is to report CPU traps as the corresponding POSIX signal values. -@end table - -@kindex set remotedebug -@kindex show remotedebug -@cindex packets, reporting on stdout -@cindex serial connections, debugging -If you have trouble with the serial connection, you can use the command -@code{set remotedebug}. This makes _GDBN__ report on all packets sent -back and forth across the serial line to the remote machine. The -packet-debugging information is printed on the _GDBN__ standard output -stream. @code{set remotedebug off} turns it off, and @code{show -remotedebug} will show you its current state. -_fi__(_REMOTESTUB__) - -_if__(_I960__) -@node i960-Nindy Remote -@subsection _GDBN__ with a Remote i960 (Nindy) - -@cindex Nindy -@cindex i960 -@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When -_GDBN__ is configured to control a remote Intel 960 using Nindy, you can -tell _GDBN__ how to connect to the 960 in several ways: - -@itemize @bullet -@item -Through command line options specifying serial port, version of the -Nindy protocol, and communications speed; - -@item -By responding to a prompt on startup; - -@item -By using the @code{target} command at any point during your _GDBN__ -session. @xref{Target Commands, ,Commands for Managing Targets}. - -@end itemize - -@menu -* Nindy Startup:: Startup with Nindy -* Nindy Options:: Options for Nindy -* Nindy reset:: Nindy Reset Command -@end menu - -@node Nindy Startup -@subsubsection Startup with Nindy - -If you simply start @code{_GDBP__} without using any command-line -options, you are prompted for what serial port to use, @emph{before} you -reach the ordinary _GDBN__ prompt: - -@example -Attach /dev/ttyNN -- specify NN, or "quit" to quit: -@end example - -@noindent -Respond to the prompt with whatever suffix (after @samp{/dev/tty}) -identifies the serial port you want to use. You can, if you choose, -simply start up with no Nindy connection by responding to the prompt -with an empty line. If you do this, and later wish to attach to Nindy, -use @code{target} (@pxref{Target Commands, ,Commands for Managing Targets}). - -@node Nindy Options -@subsubsection Options for Nindy - -These are the startup options for beginning your _GDBN__ session with a -Nindy-960 board attached: - -@table @code -@item -r @var{port} -Specify the serial port name of a serial interface to be used to connect -to the target system. This option is only available when _GDBN__ is -configured for the Intel 960 target architecture. You may specify -@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a -device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique -suffix for a specific @code{tty} (e.g. @samp{-r a}). - -@item -O -(An uppercase letter ``O'', not a zero.) Specify that _GDBN__ should use -the ``old'' Nindy monitor protocol to connect to the target system. -This option is only available when _GDBN__ is configured for the Intel 960 -target architecture. - -@quotation -@emph{Warning:} if you specify @samp{-O}, but are actually trying to -connect to a target system that expects the newer protocol, the connection -will fail, appearing to be a speed mismatch. _GDBN__ will repeatedly -attempt to reconnect at several different line speeds. You can abort -this process with an interrupt. -@end quotation - -@item -brk -Specify that _GDBN__ should first send a @code{BREAK} signal to the target -system, in an attempt to reset it, before connecting to a Nindy target. - -@quotation -@emph{Warning:} Many target systems do not have the hardware that this -requires; it only works with a few boards. -@end quotation -@end table - -The standard @samp{-b} option controls the line speed used on the serial -port. - -@c @group -@node Nindy reset -@subsubsection Nindy Reset Command - -@table @code -@item reset -@kindex reset -For a Nindy target, this command sends a ``break'' to the remote target -system; this is only useful if the target has been equipped with a -circuit to perform a hard reset (or some other interesting action) when -a break is detected. -@end table -@c @end group -_fi__(_I960__) - -_if__(_AMD29K__) -@node EB29K Remote -@subsection _GDBN__ with a Remote EB29K - -@cindex EB29K board -@cindex running 29K programs - -To use _GDBN__ from a Unix system to run programs on AMD's EB29K -board in a PC, you must first connect a serial cable between the PC -and a serial port on the Unix system. In the following, we assume -you've hooked the cable between the PC's @file{COM1} port and -@file{/dev/ttya} on the Unix system. - -@menu -* Comms (EB29K):: Communications Setup -* _GDBP__-EB29K:: EB29K cross-debugging -* Remote Log:: Remote Log -@end menu - -@node Comms (EB29K) -@subsubsection Communications Setup - -The next step is to set up the PC's port, by doing something like the -following in DOS on the PC: - -_0__@example -C:\> MODE com1:9600,n,8,1,none -_1__@end example - -@noindent -This example---run on an MS DOS 4.0 system---sets the PC port to 9600 -bps, no parity, eight data bits, one stop bit, and no ``retry'' action; -you must match the communications parameters when establishing the Unix -end of the connection as well. -@c FIXME: Who knows what this "no retry action" crud from the DOS manual may -@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91 - -To give control of the PC to the Unix side of the serial line, type -the following at the DOS console: - -_0__@example -C:\> CTTY com1 -_1__@end example - -@noindent -(Later, if you wish to return control to the DOS console, you can use -the command @code{CTTY con}---but you must send it over the device that -had control, in our example over the @file{COM1} serial line). - -From the Unix host, use a communications program such as @code{tip} or -@code{cu} to communicate with the PC; for example, - -@example -cu -s 9600 -l /dev/ttya -@end example - -@noindent -The @code{cu} options shown specify, respectively, the linespeed and the -serial port to use. If you use @code{tip} instead, your command line -may look something like the following: - -@example -tip -9600 /dev/ttya -@end example - -@noindent -Your system may define a different name where our example uses -@file{/dev/ttya} as the argument to @code{tip}. The communications -parameters, including which port to use, are associated with the -@code{tip} argument in the ``remote'' descriptions file---normally the -system table @file{/etc/remote}. -@c FIXME: What if anything needs doing to match the "n,8,1,none" part of -@c the DOS side's comms setup? cu can support -o (odd -@c parity), -e (even parity)---apparently no settings for no parity or -@c for character size. Taken from stty maybe...? John points out tip -@c can set these as internal variables, eg ~s parity=none; man stty -@c suggests that it *might* work to stty these options with stdin or -@c stdout redirected... ---pesch@cygnus.com, 25feb91 - -@kindex EBMON -Using the @code{tip} or @code{cu} connection, change the DOS working -directory to the directory containing a copy of your 29K program, then -start the PC program @code{EBMON} (an EB29K control program supplied -with your board by AMD). You should see an initial display from -@code{EBMON} similar to the one that follows, ending with the -@code{EBMON} prompt @samp{#}--- - -_0__@example -C:\> G: - -G:\> CD \usr\joe\work29k - -G:\USR\JOE\WORK29K> EBMON -Am29000 PC Coprocessor Board Monitor, version 3.0-18 -Copyright 1990 Advanced Micro Devices, Inc. -Written by Gibbons and Associates, Inc. - -Enter '?' or 'H' for help - -PC Coprocessor Type = EB29K -I/O Base = 0x208 -Memory Base = 0xd0000 - -Data Memory Size = 2048KB -Available I-RAM Range = 0x8000 to 0x1fffff -Available D-RAM Range = 0x80002000 to 0x801fffff - -PageSize = 0x400 -Register Stack Size = 0x800 -Memory Stack Size = 0x1800 - -CPU PRL = 0x3 -Am29027 Available = No -Byte Write Available = Yes - -# ~. -_1__@end example - -Then exit the @code{cu} or @code{tip} program (done in the example by -typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep -running, ready for _GDBN__ to take over. - -For this example, we've assumed what is probably the most convenient -way to make sure the same 29K program is on both the PC and the Unix -system: a PC/NFS connection that establishes ``drive @code{G:}'' on the -PC as a file system on the Unix host. If you do not have PC/NFS or -something similar connecting the two systems, you must arrange some -other way---perhaps floppy-disk transfer---of getting the 29K program -from the Unix system to the PC; _GDBN__ will @emph{not} download it over the -serial line. - -@node _GDBP__-EB29K -@subsubsection EB29K cross-debugging - -Finally, @code{cd} to the directory containing an image of your 29K -program on the Unix system, and start _GDBN__---specifying as argument the -name of your 29K program: - -@example -cd /usr/joe/work29k -_GDBP__ myfoo -@end example - -Now you can use the @code{target} command: - -@example -target amd-eb /dev/ttya 9600 MYFOO -@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to -@c emphasize that this is the name as seen by DOS (since I think DOS is -@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91 -@end example - -@noindent -In this example, we've assumed your program is in a file called -@file{myfoo}. Note that the filename given as the last argument to -@code{target amd-eb} should be the name of the program as it appears to DOS. -In our example this is simply @code{MYFOO}, but in general it can include -a DOS path, and depending on your transfer mechanism may not resemble -the name on the Unix side. - -At this point, you can set any breakpoints you wish; when you are ready -to see your program run on the 29K board, use the _GDBN__ command -@code{run}. - -To stop debugging the remote program, use the _GDBN__ @code{detach} -command. - -To return control of the PC to its console, use @code{tip} or @code{cu} -once again, after your _GDBN__ session has concluded, to attach to -@code{EBMON}. You can then type the command @code{q} to shut down -@code{EBMON}, returning control to the DOS command-line interpreter. -Type @code{CTTY con} to return command input to the main DOS console, -and type @kbd{~.} to leave @code{tip} or @code{cu}. - -@node Remote Log -@subsubsection Remote Log -@kindex eb.log -@cindex log file for EB29K - -The @code{target amd-eb} command creates a file @file{eb.log} in the -current working directory, to help debug problems with the connection. -@file{eb.log} records all the output from @code{EBMON}, including echoes -of the commands sent to it. Running @samp{tail -f} on this file in -another window often helps to understand trouble with @code{EBMON}, or -unexpected events on the PC side of the connection. - -_fi__(_AMD29K__) - -_if__(_ST2000__) -@node ST2000 Remote -@subsection _GDBN__ with a Tandem ST2000 - -To connect your ST2000 to the host system, see the manufacturer's -manual. Once the ST2000 is physically attached, you can run - -@example -target st2000 @var{dev} @var{speed} -@end example - -@noindent -to establish it as your debugging environment. - -The @code{load} and @code{attach} commands are @emph{not} defined for -this target; you must load your program into the ST2000 as you normally -would for standalone operation. _GDBN__ will read debugging information -(such as symbols) from a separate, debugging version of the program -available on your host computer. -@c FIXME!! This is terribly vague; what little content is here is -@c basically hearsay. - -@cindex ST2000 auxiliary commands -These auxiliary _GDBN__ commands are available to help you with the ST2000 -environment: - -@table @code -@item st2000 @var{command} -@kindex st2000 @var{cmd} -@cindex STDBUG commands (ST2000) -@cindex commands to STDBUG (ST2000) -Send a @var{command} to the STDBUG monitor. See the manufacturer's -manual for available commands. - -@item connect -@cindex connect (to STDBUG) -Connect the controlling terminal to the STDBUG command monitor. When -you are done interacting with STDBUG, typing either of two character -sequences will get you back to the _GDBN__ command prompt: -@kbd{@key{RET}~.} (Return, followed by tilde and period) or -@kbd{@key{RET}~@key{C-d}} (Return, followed by tilde and control-D). -@end table -_fi__(_ST2000__) - -_if__(_VXWORKS__) -@node VxWorks Remote -@subsection _GDBN__ and VxWorks -@cindex VxWorks - -_GDBN__ enables developers to spawn and debug tasks running on networked -VxWorks targets from a Unix host. Already-running tasks spawned from -the VxWorks shell can also be debugged. _GDBN__ uses code that runs on -both the UNIX host and on the VxWorks target. The program -@code{_GDBP__} is installed and executed on the UNIX host. - -The following information on connecting to VxWorks was current when -this manual was produced; newer releases of VxWorks may use revised -procedures. - -The remote debugging interface (RDB) routines are installed and executed -on the VxWorks target. These routines are included in the VxWorks library -@file{rdb.a} and are incorporated into the system image when source-level -debugging is enabled in the VxWorks configuration. - -@kindex INCLUDE_RDB -If you wish, you can define @code{INCLUDE_RDB} in the VxWorks -configuration file @file{configAll.h} to include the RDB interface -routines and spawn the source debugging task @code{tRdbTask} when -VxWorks is booted. For more information on configuring and remaking -_if__(_FSF__) -VxWorks, see the manufacturer's manual. -_fi__(_FSF__) -_if__(!_FSF__) -VxWorks, see the @cite{VxWorks Programmer's Guide}. -_fi__(!_FSF__) - -Once you have included the RDB interface in your VxWorks system image -and set your Unix execution search path to find _GDBN__, you are ready -to run _GDBN__. From your UNIX host, type: - -@smallexample -% _GDBP__ -@end smallexample - -_GDBN__ will come up showing the prompt: - -@smallexample -(_GDBP__) -@end smallexample - -@menu -* VxWorks connection:: Connecting to VxWorks -* VxWorks download:: VxWorks Download -* VxWorks attach:: Running Tasks -@end menu - -@node VxWorks connection -@subsubsection Connecting to VxWorks - -The _GDBN__ command @code{target} lets you connect to a VxWorks target on the -network. To connect to a target whose host name is ``@code{tt}'', type: - -@smallexample -(_GDBP__) target vxworks tt -@end smallexample - -_GDBN__ will display a message similar to the following: - -@smallexample -Attaching remote machine across net... Success! -@end smallexample - -_GDBN__ will then attempt to read the symbol tables of any object modules -loaded into the VxWorks target since it was last booted. _GDBN__ locates -these files by searching the directories listed in the command search -path (@pxref{Environment, ,Your Program's Environment}); if it fails -to find an object file, it will display a message such as: - -@smallexample -prog.o: No such file or directory. -@end smallexample - -This will cause the @code{target} command to abort. When this happens, -you should add the appropriate directory to the search path, with the -_GDBN__ command @code{path}, and execute the @code{target} command -again. - -@node VxWorks download -@subsubsection VxWorks Download - -@cindex download to VxWorks -If you have connected to the VxWorks target and you want to debug an -object that has not yet been loaded, you can use the _GDBN__ @code{load} -command to download a file from UNIX to VxWorks incrementally. The -object file given as an argument to the @code{load} command is actually -opened twice: first by the VxWorks target in order to download the code, -then by _GDBN__ in order to read the symbol table. This can lead to -problems if the current working directories on the two systems differ. -It is simplest to set the working directory on both systems to the -directory in which the object file resides, and then to reference the -file by its name, without any path. Thus, to load a program -@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type: - -@smallexample --> cd "wherever/vw/demo/rdb" -@end smallexample - -On _GDBN__ type: - -@smallexample -(_GDBP__) cd wherever/vw/demo/rdb -(_GDBP__) load prog.o -@end smallexample - -_GDBN__ will display a response similar to the following: - -@smallexample -Reading symbol data from wherever/vw/demo/rdb/prog.o... done. -@end smallexample - -You can also use the @code{load} command to reload an object module -after editing and recompiling the corresponding source file. Note that -this will cause _GDBN__ to delete all currently-defined breakpoints, -auto-displays, and convenience variables, and to clear the value -history. (This is necessary in order to preserve the integrity of -debugger data structures that reference the target system's symbol -table.) - -@node VxWorks attach -@subsubsection Running Tasks - -@cindex running VxWorks tasks -You can also attach to an existing task using the @code{attach} command as -follows: - -@smallexample -(_GDBP__) attach @var{task} -@end smallexample - -@noindent -where @var{task} is the VxWorks hexadecimal task ID. The task can be running -or suspended when you attach to it. If running, it will be suspended at -the time of attachment. -_fi__(_VXWORKS__) - -_if__(_H8__) -@node Hitachi H8/300 Remote -@subsection _GDBN__ and the Hitachi H8/300 -_GDBN__ needs to know these things to talk to your H8/300: - -@enumerate -@item -that you want to use @samp{target hms}, the remote debugging -interface for the H8/300 (this is the default when -GDB is configured specifically for the H8/300); - -@item -what serial device connects your host to your H8/300 (the first serial -device available on your host is the default); - -@ignore -@c this is only for Unix hosts, not currently of interest. -@item -what speed to use over the serial device. -@end ignore -@end enumerate - -@kindex device -@cindex serial device for H8/300 -@ignore -@c only for Unix hosts -Use the special @code{gdb83} command @samp{device @var{port}} if you -need to explicitly set the serial device. The default @var{port} is the -first available port on your host. This is only necessary on Unix -hosts, where it is typically something like @file{/dev/ttya}. - -@kindex speed -@cindex serial line speed for H8/300 -@code{gdb83} has another special command to set the communications speed -for the H8/300: @samp{speed @var{bps}}. This command also is only used -from Unix hosts; on DOS hosts, set the line speed as usual from outside -GDB with the DOS @kbd{mode} command (for instance, @w{@samp{mode -com2:9600,n,8,1,p}} for a 9600 bps connection). -@end ignore - -_GDBN__ depends on an auxiliary terminate-and-stay-resident program -called @code{asynctsr} to communicate with the H8/300 development board -through a PC serial port. You must also use the DOS @code{mode} command -to set up the serial port on the DOS side. - -The following sample session illustrates the steps needed to start a -program under _GDBN__ control on your H8/300. The example uses a sample -H8/300 program called @file{t.x}. - -First hook up your H8/300 development board. In this example, we use a -board attached to serial port @code{COM2}; if you use a different serial -port, substitute its name in the argument of the @code{mode} command. -When you call @code{asynctsr}, the auxiliary comms program used by the -degugger, you give it just the numeric part of the serial port's name; -for example, @samp{asyncstr 2} below runs @code{asyncstr} on -@code{COM2}. - -@smallexample -(eg-C:\H8300\TEST) mode com2:9600,n,8,1,p - -Resident portion of MODE loaded - -COM2: 9600, n, 8, 1, p - -(eg-C:\H8300\TEST) asynctsr 2 -@end smallexample - -@quotation -@emph{Warning:} We have noticed a bug in PC-NFS that conflicts with -@code{asynctsr}. If you also run PC-NFS on your DOS host, you may need to -disable it, or even boot without it, to use @code{asynctsr} to control -your H8/300 board. -@end quotation - -Now that serial communications are set up, and the H8/300 is connected, -you can start up _GDBN__. Call @code{_GDBP__} with the name of your -program as the argument. @code{_GDBP__} prompts you, as usual, with the -prompt @samp{(_GDBP__)}. Use two special commands to begin your debugging -session: @samp{target hms} to specify cross-debugging to the Hitachi board, -and the @code{load} command to download your program to the board. -@code{load} displays the names of the -program's sections, and a @samp{*} for each 2K of data downloaded. (If -you want to refresh _GDBN__ data on symbols or on the executable file -without downloading, use the _GDBN__ commands @code{file} or -@code{symbol-file}. These commands, and @code{load} itself, are -described in @ref{Files,,Commands to Specify Files}.) - -@smallexample -(eg-C:\H8300\TEST) _GDBP__ t.x -GDB is free software and you are welcome to distribute copies - of it under certain conditions; type "show copying" to see - the conditions. -There is absolutely no warranty for GDB; type "show warranty" -for details. -GDB _GDB_VN__, Copyright 1992 Free Software Foundation, Inc... -(gdb) target hms -Connected to remote H8/300 HMS system. -(gdb) load t.x -.text : 0x8000 .. 0xabde *********** -.data : 0xabde .. 0xad30 * -.stack : 0xf000 .. 0xf014 * -@end smallexample - -At this point, you're ready to run or debug your program. From here on, -you can use all the usual _GDBN__ commands. The @code{break} command -sets breakpoints; the @code{run} command starts your program; -@code{print} or @code{x} display data; the @code{continue} command -resumes execution after stopping at a breakpoint. You can use the -@code{help} command at any time to find out more about _GDBN__ commands. - -Remember, however, that @emph{operating system} facilities aren't -available on your H8/300; for example, if your program hangs, you can't -send an interrupt---but you can press the @sc{reset} switch! - -Use the @sc{reset} button on the H8/300 board -@itemize @bullet -@item -to interrupt your program (don't use @kbd{ctl-C} on the DOS host---it has -no way to pass an interrupt signal to the H8/300); and - -@item -to return to the _GDBN__ command prompt after your program finishes -normally. The communications protocol provides no other way for _GDBN__ -to detect program completion. -@end itemize - -In either case, _GDBN__ will see the effect of a @sc{reset} on the -H8/300 board as a ``normal exit'' of your program. -_fi__(_H8__) - -_if__(_Z8000__) -@node Z8000 Simulator -@subsection _GDBN__ and its Zilog Z8000 Simulator - -@cindex simulator, Z8000 -@cindex Zilog Z8000 simulator -When configured for debugging Zilog Z8000 targets, _GDBN__ includes a Z8000 -simulator. - -@table @code -@item target z8ksim -@kindex z8ksim -This debugging target is a simulator for the Z8002, the unsegmented -variant of the Z8000 architecture. -@end table - -@noindent -After this point, you can debug Z8000 programs in the same style as -programs for your host computer; use the @code{file} command to load a -new program image, the @code{run} command to run your program, and so -on. - -As well as making available all the usual Z8000 registers (see -@code{info reg}), this debugging target provides three additional items -of information as specially named registers: - -@table @code -@item cycles -Counts clock-ticks in the simulator. - -@item insts -Counts instructions run in the simulator. - -@item time -Execution time in 60ths of a second. -@end table - -You can refer to these values in _GDBN__ expressions with the usual -conventions; for example, @w{@samp{b fputc if $cycles>5000}} sets a -conditional breakpoint that will suspend only after at least 5000 -simulated clock ticks. -_fi__(_Z8000__) diff --git a/gdb/doc/gdbinv-s.texi b/gdb/doc/gdbinv-s.texi new file mode 100644 index 0000000..2bc1bbb --- /dev/null +++ b/gdb/doc/gdbinv-s.texi @@ -0,0 +1,985 @@ +@c -*- Texinfo -*- +@c Copyright (c) 1990 1991 1992 1993 Free Software Foundation, Inc. +@c This file is part of the source for the GDB manual. +@c This text diverted to "Remote Debugging" section in general case; +@c however, if we're doing a manual specifically for one of these, it +@c belongs up front (in "Getting In and Out" chapter). +@ifset REMOTESTUB + +@node Remote Serial +@subsection The @value{GDBN} remote serial protocol + +@cindex remote serial debugging, overview +To debug a program running on another machine (the debugging +@dfn{target} machine), you must first arrange for all the usual +prerequisites for the program to run by itself. For example, for a C +program, you need + +@enumerate +@item +A startup routine to set up the C runtime environment; these usually +have a name like @file{crt0}. The startup routine may be supplied by +your hardware supplier, or you may have to write your own. + +@item +You probably need a C subroutine library to support your program's +subroutine calls, notably managing input and output. + +@item +A way of getting your program to the other machine---for example, a +download program. These are often supplied by the hardware +manufacturer, but you may have to write your own from hardware +documentation. +@end enumerate + +The next step is to arrange for your program to use a serial port to +communicate with the machine where @value{GDBN} is running (the @dfn{host} +machine). In general terms, the scheme looks like this: + +@table @emph +@item On the host, +@value{GDBN} already understands how to use this protocol; when everything +else is set up, you can simply use the @samp{target remote} command +(@pxref{Targets,,Specifying a Debugging Target}). + +@item On the target, +you must link with your program a few special-purpose subroutines that +implement the @value{GDBN} remote serial protocol. The file containing these +subroutines is called a @dfn{debugging stub}. +@end table + +The debugging stub is specific to the architecture of the remote +machine; for example, use @file{sparc-stub.c} to debug programs on +@sc{sparc} boards. + +@cindex remote serial stub list +These working remote stubs are distributed with @value{GDBN}: + +@c FIXME! verify these... +@table @code +@item sparc-stub.c +@kindex sparc-stub.c +For @sc{sparc} architectures. + +@item m68k-stub.c +@kindex m68-stub.c +For Motorola 680x0 architectures. + +@item i386-stub.c +@kindex i36-stub.c +For Intel 386 and compatible architectures. +@end table + +The @file{README} file in the @value{GDBN} distribution may list other +recently added stubs. + +@menu +* stub contents:: What the stub can do for you +* bootstrapping:: What you must do for the stub +* debug session:: Putting it all together +* protocol:: Outline of the communication protocol +@end menu + +@node stub contents +@subsubsection What the stub can do for you + +@cindex remote serial stub +The debugging stub for your architecture supplies these three +subroutines: + +@table @code +@item set_debug_traps +@kindex set_debug_traps +@cindex remote serial stub, initialization +This routine arranges to transfer control to @code{handle_exception} +when your program stops. You must call this subroutine explicitly near +the beginning of your program. + +@item handle_exception +@kindex handle_exception +@cindex remote serial stub, main routine +This is the central workhorse, but your program never calls it +explicitly---the setup code arranges for @code{handle_exception} to +run when a trap is triggered. + +@code{handle_exception} takes control when your program stops during +execution (for example, on a breakpoint), and mediates communications +with @value{GDBN} on the host machine. This is where the communications +protocol is implemented; @code{handle_exception} acts as the @value{GDBN} +representative on the target machine; it begins by sending summary +information on the state of your program, then continues to execute, +retrieving and transmitting any information @value{GDBN} needs, until you +execute a @value{GDBN} command that makes your program resume; at that point, +@code{handle_exception} returns control to your own code on the target +machine. + +@item breakpoint +@cindex @code{breakpoint} subroutine, remote +Use this auxiliary subroutine to make your program contain a +breakpoint. Depending on the particular situation, this may be the only +way for @value{GDBN} to get control. For instance, if your target +machine has some sort of interrupt button, you won't need to call this; +pressing the interrupt button will transfer control to +@code{handle_exception}---in efect, to @value{GDBN}. On some machines, +simply receiving characters on the serial port may also trigger a trap; +again, in that situation, you don't need to call @code{breakpoint} from +your own program---simply running @samp{target remote} from the host +@value{GDBN} session will get control. + +Call @code{breakpoint} if none of these is true, or if you simply want +to make certain your program stops at a predetermined point for the +start of your debugging session. +@end table + +@node bootstrapping +@subsubsection What you must do for the stub + +@cindex remote stub, support routines +The debugging stubs that come with @value{GDBN} are set up for a particular +chip architecture, but they have no information about the rest of your +debugging target machine. To allow the stub to work, you must supply +these special low-level subroutines: + +@table @code +@item int getDebugChar() +@kindex getDebugChar +Write this subroutine to read a single character from the serial port. +It may be identical to @code{getchar} for your target system; a +different name is used to allow you to distinguish the two if you wish. + +@item void putDebugChar(int) +@kindex putDebugChar +Write this subroutine to write a single character to the serial port. +It may be identical to @code{putchar} for your target system; a +different name is used to allow you to distinguish the two if you wish. + +@item void flush_i_cache() +@kindex flush_i_cache +Write this subroutine to flush the instruction cache, if any, on your +target machine. If there is no instruction cache, this subroutine may +be a no-op. + +On target machines that have instruction caches, @value{GDBN} requires this +function to make certain that the state of your program is stable. +@end table + +@noindent +You must also make sure this library routine is available: + +@table @code +@item void *memset(void *, int, int) +@kindex memset +This is the standard library function @code{memset} that sets an area of +memory to a known value. If you have one of the free versions of +@code{libc.a}, @code{memset} can be found there; otherwise, you must +either obtain it from your hardware manufacturer, or write your own. +@end table + +If you do not use the GNU C compiler, you may need other standard +library subroutines as well; this will vary from one stub to another, +but in general the stubs are likely to use any of the common library +subroutines which @code{gcc} generates as inline code. + + +@node debug session +@subsubsection Putting it all together + +@cindex remote serial debugging summary +In summary, when your program is ready to debug, you must follow these +steps. + +@enumerate +@item +Make sure you have the supporting low-level routines: +@code{getDebugChar}, @code{putDebugChar}, @code{flush_i_cache}, +@code{memset}. + +@item +Insert these lines near the top of your program: + +@example +set_debug_traps(); +breakpoint(); +@end example + +@item +Compile and link together: your program, the @value{GDBN} debugging stub for +your target architecture, and the supporting subroutines. + +@item +Make sure you have a serial connection between your target machine and +the @value{GDBN} host, and identify the serial port used for this on the host. + +@item +Download your program to your target machine (or get it there by +whatever means the manufacturer provides), and start it. + +@item +To start remote debugging, run @value{GDBN} on the host machine, and specify +as an executable file the program that is running in the remote machine. +This tells @value{GDBN} how to find your program's symbols and the contents +of its pure text. + +Then establish communication using the @code{target remote} command. +Its argument is the name of the device you're using to control the +target machine. For example: + +@example +target remote /dev/ttyb +@end example + +@noindent +if the serial line is connected to the device named @file{/dev/ttyb}. +@ignore +@c this is from the old text, but it doesn't seem to make sense now that I've +@c seen an example... pesch 4sep1992 +This will stop the remote machine if it is not already stopped. +@end ignore + +@end enumerate + +Now you can use all the usual commands to examine and change data and to +step and continue the remote program. + +To resume the remote program and stop debugging it, use the @code{detach} +command. + +@node protocol +@subsubsection Outline of the communication protocol + +@cindex debugging stub, example +@cindex remote stub, example +@cindex stub example, remote debugging +The stub files provided with @value{GDBN} implement the target side of the +communication protocol, and the @value{GDBN} side is implemented in the +@value{GDBN} source file @file{remote.c}. Normally, you can simply allow +these subroutines to communicate, and ignore the details. (If you're +implementing your own stub file, you can still ignore the details: start +with one of the existing stub files. @file{sparc-stub.c} is the best +organized, and therefore the easiest to read.) + +However, there may be occasions when you need to know something about +the protocol---for example, if there is only one serial port to your +target machine, you might want your program to do something special if +it recognizes a packet meant for @value{GDBN}. + +@cindex protocol, @value{GDBN} remote serial +@cindex serial protocol, @value{GDBN} remote +@cindex remote serial protocol +All @value{GDBN} commands and responses (other than acknowledgements, which +are single characters) are sent as a packet which includes a +checksum. A packet is introduced with the character @samp{$}, and ends +with the character @samp{#} followed by a two-digit checksum: + +@example +$@var{packet info}#@var{checksum} +@end example + +@cindex checksum, for @value{GDBN} remote +@noindent +@var{checksum} is computed as the modulo 256 sum of the @var{packet +info} characters. + +When either the host or the target machine receives a packet, the first +response expected is an acknowledgement: a single character, either +@samp{+} (to indicate the package was received correctly) or @samp{-} +(to request retransmission). + +The host (@value{GDBN}) sends commands, and the target (the debugging stub +incorporated in your program) sends data in response. The target also +sends data when your program stops. + +Command packets are distinguished by their first character, which +identifies the kind of command. + +These are the commands currently supported: + +@table @code +@item g +Requests the values of CPU registers. + +@item G +Sets the values of CPU registers. + +@item m@var{addr},@var{count} +Read @var{count} bytes at location @var{addr}. + +@item M@var{addr},@var{count}:@dots{} +Write @var{count} bytes at location @var{addr}. + +@item c +@itemx c@var{addr} +Resume execution at the current address (or at @var{addr} if supplied). + +@item s +@itemx s@var{addr} +Step the target program for one instruction, from either the current +program counter or from @var{addr} if supplied. + +@item k +Kill the target program. + +@item ? +Report the most recent signal. To allow you to take advantage of the +@value{GDBN} signal handling commands, one of the functions of the debugging +stub is to report CPU traps as the corresponding POSIX signal values. +@end table + +@kindex set remotedebug +@kindex show remotedebug +@cindex packets, reporting on stdout +@cindex serial connections, debugging +If you have trouble with the serial connection, you can use the command +@code{set remotedebug}. This makes @value{GDBN} report on all packets sent +back and forth across the serial line to the remote machine. The +packet-debugging information is printed on the @value{GDBN} standard output +stream. @code{set remotedebug off} turns it off, and @code{show +remotedebug} will show you its current state. +@end ifset + +@ifset Icmlx +@node i960-Nindy Remote +@subsection @value{GDBN} with a Remote i960 (Nindy) + +@cindex Nindy +@cindex i960 +@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When +@value{GDBN} is configured to control a remote Intel 960 using Nindy, you can +tell @value{GDBN} how to connect to the 960 in several ways: + +@itemize @bullet +@item +Through command line options specifying serial port, version of the +Nindy protocol, and communications speed; + +@item +By responding to a prompt on startup; + +@item +By using the @code{target} command at any point during your @value{GDBN} +session. @xref{Target Commands, ,Commands for Managing Targets}. + +@end itemize + +@menu +* Nindy Startup:: Startup with Nindy +* Nindy Options:: Options for Nindy +* Nindy reset:: Nindy Reset Command +@end menu + +@node Nindy Startup +@subsubsection Startup with Nindy + +If you simply start @code{@value{GDBP}} without using any command-line +options, you are prompted for what serial port to use, @emph{before} you +reach the ordinary @value{GDBN} prompt: + +@example +Attach /dev/ttyNN -- specify NN, or "quit" to quit: +@end example + +@noindent +Respond to the prompt with whatever suffix (after @samp{/dev/tty}) +identifies the serial port you want to use. You can, if you choose, +simply start up with no Nindy connection by responding to the prompt +with an empty line. If you do this, and later wish to attach to Nindy, +use @code{target} (@pxref{Target Commands, ,Commands for Managing Targets}). + +@node Nindy Options +@subsubsection Options for Nindy + +These are the startup options for beginning your @value{GDBN} session with a +Nindy-960 board attached: + +@table @code +@item -r @var{port} +Specify the serial port name of a serial interface to be used to connect +to the target system. This option is only available when @value{GDBN} is +configured for the Intel 960 target architecture. You may specify +@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a +device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique +suffix for a specific @code{tty} (e.g. @samp{-r a}). + +@item -O +(An uppercase letter ``O'', not a zero.) Specify that @value{GDBN} should use +the ``old'' Nindy monitor protocol to connect to the target system. +This option is only available when @value{GDBN} is configured for the Intel 960 +target architecture. + +@quotation +@emph{Warning:} if you specify @samp{-O}, but are actually trying to +connect to a target system that expects the newer protocol, the connection +will fail, appearing to be a speed mismatch. @value{GDBN} will repeatedly +attempt to reconnect at several different line speeds. You can abort +this process with an interrupt. +@end quotation + +@item -brk +Specify that @value{GDBN} should first send a @code{BREAK} signal to the target +system, in an attempt to reset it, before connecting to a Nindy target. + +@quotation +@emph{Warning:} Many target systems do not have the hardware that this +requires; it only works with a few boards. +@end quotation +@end table + +The standard @samp{-b} option controls the line speed used on the serial +port. + +@c @group +@node Nindy reset +@subsubsection Nindy Reset Command + +@table @code +@item reset +@kindex reset +For a Nindy target, this command sends a ``break'' to the remote target +system; this is only useful if the target has been equipped with a +circuit to perform a hard reset (or some other interesting action) when +a break is detected. +@end table +@c @end group +@end ifset + +@ifset AMDxxixK +@node EB29K Remote +@subsection @value{GDBN} with a Remote EB29K + +@cindex EB29K board +@cindex running 29K programs + +To use @value{GDBN} from a Unix system to run programs on AMD's EB29K +board in a PC, you must first connect a serial cable between the PC +and a serial port on the Unix system. In the following, we assume +you've hooked the cable between the PC's @file{COM1} port and +@file{/dev/ttya} on the Unix system. + +@menu +* Comms (EB29K):: Communications Setup +* gdb-EB29K:: EB29K cross-debugging +* Remote Log:: Remote Log +@end menu + +@node Comms (EB29K) +@subsubsection Communications Setup + +The next step is to set up the PC's port, by doing something like the +following in DOS on the PC: + +@example +C:\> MODE com1:9600,n,8,1,none +@end example + +@noindent +This example---run on an MS DOS 4.0 system---sets the PC port to 9600 +bps, no parity, eight data bits, one stop bit, and no ``retry'' action; +you must match the communications parameters when establishing the Unix +end of the connection as well. +@c FIXME: Who knows what this "no retry action" crud from the DOS manual may +@c mean? It's optional; leave it out? ---pesch@cygnus.com, 25feb91 + +To give control of the PC to the Unix side of the serial line, type +the following at the DOS console: + +@example +C:\> CTTY com1 +@end example + +@noindent +(Later, if you wish to return control to the DOS console, you can use +the command @code{CTTY con}---but you must send it over the device that +had control, in our example over the @file{COM1} serial line). + +From the Unix host, use a communications program such as @code{tip} or +@code{cu} to communicate with the PC; for example, + +@example +cu -s 9600 -l /dev/ttya +@end example + +@noindent +The @code{cu} options shown specify, respectively, the linespeed and the +serial port to use. If you use @code{tip} instead, your command line +may look something like the following: + +@example +tip -9600 /dev/ttya +@end example + +@noindent +Your system may define a different name where our example uses +@file{/dev/ttya} as the argument to @code{tip}. The communications +parameters, including which port to use, are associated with the +@code{tip} argument in the ``remote'' descriptions file---normally the +system table @file{/etc/remote}. +@c FIXME: What if anything needs doing to match the "n,8,1,none" part of +@c the DOS side's comms setup? cu can support -o (odd +@c parity), -e (even parity)---apparently no settings for no parity or +@c for character size. Taken from stty maybe...? John points out tip +@c can set these as internal variables, eg ~s parity=none; man stty +@c suggests that it *might* work to stty these options with stdin or +@c stdout redirected... ---pesch@cygnus.com, 25feb91 + +@kindex EBMON +Using the @code{tip} or @code{cu} connection, change the DOS working +directory to the directory containing a copy of your 29K program, then +start the PC program @code{EBMON} (an EB29K control program supplied +with your board by AMD). You should see an initial display from +@code{EBMON} similar to the one that follows, ending with the +@code{EBMON} prompt @samp{#}--- + +@example +C:\> G: + +G:\> CD \usr\joe\work29k + +G:\USR\JOE\WORK29K> EBMON +Am29000 PC Coprocessor Board Monitor, version 3.0-18 +Copyright 1990 Advanced Micro Devices, Inc. +Written by Gibbons and Associates, Inc. + +Enter '?' or 'H' for help + +PC Coprocessor Type = EB29K +I/O Base = 0x208 +Memory Base = 0xd0000 + +Data Memory Size = 2048KB +Available I-RAM Range = 0x8000 to 0x1fffff +Available D-RAM Range = 0x80002000 to 0x801fffff + +PageSize = 0x400 +Register Stack Size = 0x800 +Memory Stack Size = 0x1800 + +CPU PRL = 0x3 +Am29027 Available = No +Byte Write Available = Yes + +# ~. +@end example + +Then exit the @code{cu} or @code{tip} program (done in the example by +typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} will keep +running, ready for @value{GDBN} to take over. + +For this example, we've assumed what is probably the most convenient +way to make sure the same 29K program is on both the PC and the Unix +system: a PC/NFS connection that establishes ``drive @code{G:}'' on the +PC as a file system on the Unix host. If you do not have PC/NFS or +something similar connecting the two systems, you must arrange some +other way---perhaps floppy-disk transfer---of getting the 29K program +from the Unix system to the PC; @value{GDBN} will @emph{not} download it over the +serial line. + +@node gdb-EB29K +@subsubsection EB29K cross-debugging + +Finally, @code{cd} to the directory containing an image of your 29K +program on the Unix system, and start @value{GDBN}---specifying as argument the +name of your 29K program: + +@example +cd /usr/joe/work29k +@value{GDBP} myfoo +@end example + +Now you can use the @code{target} command: + +@example +target amd-eb /dev/ttya 9600 MYFOO +@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to +@c emphasize that this is the name as seen by DOS (since I think DOS is +@c single-minded about case of letters). ---pesch@cygnus.com, 25feb91 +@end example + +@noindent +In this example, we've assumed your program is in a file called +@file{myfoo}. Note that the filename given as the last argument to +@code{target amd-eb} should be the name of the program as it appears to DOS. +In our example this is simply @code{MYFOO}, but in general it can include +a DOS path, and depending on your transfer mechanism may not resemble +the name on the Unix side. + +At this point, you can set any breakpoints you wish; when you are ready +to see your program run on the 29K board, use the @value{GDBN} command +@code{run}. + +To stop debugging the remote program, use the @value{GDBN} @code{detach} +command. + +To return control of the PC to its console, use @code{tip} or @code{cu} +once again, after your @value{GDBN} session has concluded, to attach to +@code{EBMON}. You can then type the command @code{q} to shut down +@code{EBMON}, returning control to the DOS command-line interpreter. +Type @code{CTTY con} to return command input to the main DOS console, +and type @kbd{~.} to leave @code{tip} or @code{cu}. + +@node Remote Log +@subsubsection Remote Log +@kindex eb.log +@cindex log file for EB29K + +The @code{target amd-eb} command creates a file @file{eb.log} in the +current working directory, to help debug problems with the connection. +@file{eb.log} records all the output from @code{EBMON}, including echoes +of the commands sent to it. Running @samp{tail -f} on this file in +another window often helps to understand trouble with @code{EBMON}, or +unexpected events on the PC side of the connection. + +@end ifset + +@ifset STmm +@node ST2000 Remote +@subsection @value{GDBN} with a Tandem ST2000 + +To connect your ST2000 to the host system, see the manufacturer's +manual. Once the ST2000 is physically attached, you can run + +@example +target st2000 @var{dev} @var{speed} +@end example + +@noindent +to establish it as your debugging environment. + +The @code{load} and @code{attach} commands are @emph{not} defined for +this target; you must load your program into the ST2000 as you normally +would for standalone operation. @value{GDBN} will read debugging information +(such as symbols) from a separate, debugging version of the program +available on your host computer. +@c FIXME!! This is terribly vague; what little content is here is +@c basically hearsay. + +@cindex ST2000 auxiliary commands +These auxiliary @value{GDBN} commands are available to help you with the ST2000 +environment: + +@table @code +@item st2000 @var{command} +@kindex st2000 @var{cmd} +@cindex STDBUG commands (ST2000) +@cindex commands to STDBUG (ST2000) +Send a @var{command} to the STDBUG monitor. See the manufacturer's +manual for available commands. + +@item connect +@cindex connect (to STDBUG) +Connect the controlling terminal to the STDBUG command monitor. When +you are done interacting with STDBUG, typing either of two character +sequences will get you back to the @value{GDBN} command prompt: +@kbd{@key{RET}~.} (Return, followed by tilde and period) or +@kbd{@key{RET}~@key{C-d}} (Return, followed by tilde and control-D). +@end table +@end ifset + +@ifset VXWORKS +@node VxWorks Remote +@subsection @value{GDBN} and VxWorks +@cindex VxWorks + +@value{GDBN} enables developers to spawn and debug tasks running on networked +VxWorks targets from a Unix host. Already-running tasks spawned from +the VxWorks shell can also be debugged. @value{GDBN} uses code that runs on +both the UNIX host and on the VxWorks target. The program +@code{@value{GDBP}} is installed and executed on the UNIX host. + +The following information on connecting to VxWorks was current when +this manual was produced; newer releases of VxWorks may use revised +procedures. + +The remote debugging interface (RDB) routines are installed and executed +on the VxWorks target. These routines are included in the VxWorks library +@file{rdb.a} and are incorporated into the system image when source-level +debugging is enabled in the VxWorks configuration. + +@kindex INCLUDE_RDB +If you wish, you can define @code{INCLUDE_RDB} in the VxWorks +configuration file @file{configAll.h} to include the RDB interface +routines and spawn the source debugging task @code{tRdbTask} when +VxWorks is booted. For more information on configuring and remaking +VxWorks, see the manufacturer's manual. +@c VxWorks, see the @cite{VxWorks Programmer's Guide}. + +Once you have included the RDB interface in your VxWorks system image +and set your Unix execution search path to find @value{GDBN}, you are ready +to run @value{GDBN}. From your UNIX host, type: + +@smallexample +% @value{GDBP} +@end smallexample + +@value{GDBN} will come up showing the prompt: + +@smallexample +(@value{GDBP}) +@end smallexample + +@menu +* VxWorks connection:: Connecting to VxWorks +* VxWorks download:: VxWorks Download +* VxWorks attach:: Running Tasks +@end menu + +@node VxWorks connection +@subsubsection Connecting to VxWorks + +The @value{GDBN} command @code{target} lets you connect to a VxWorks target on the +network. To connect to a target whose host name is ``@code{tt}'', type: + +@smallexample +(@value{GDBP}) target vxworks tt +@end smallexample + +@value{GDBN} will display a message similar to the following: + +@smallexample +Attaching remote machine across net... Success! +@end smallexample + +@value{GDBN} will then attempt to read the symbol tables of any object modules +loaded into the VxWorks target since it was last booted. @value{GDBN} locates +these files by searching the directories listed in the command search +path (@pxref{Environment, ,Your Program's Environment}); if it fails +to find an object file, it will display a message such as: + +@smallexample +prog.o: No such file or directory. +@end smallexample + +This will cause the @code{target} command to abort. When this happens, +you should add the appropriate directory to the search path, with the +@value{GDBN} command @code{path}, and execute the @code{target} command +again. + +@node VxWorks download +@subsubsection VxWorks Download + +@cindex download to VxWorks +If you have connected to the VxWorks target and you want to debug an +object that has not yet been loaded, you can use the @value{GDBN} @code{load} +command to download a file from UNIX to VxWorks incrementally. The +object file given as an argument to the @code{load} command is actually +opened twice: first by the VxWorks target in order to download the code, +then by @value{GDBN} in order to read the symbol table. This can lead to +problems if the current working directories on the two systems differ. +It is simplest to set the working directory on both systems to the +directory in which the object file resides, and then to reference the +file by its name, without any path. Thus, to load a program +@file{prog.o}, residing in @file{wherever/vw/demo/rdb}, on VxWorks type: + +@smallexample +-> cd "wherever/vw/demo/rdb" +@end smallexample + +On @value{GDBN} type: + +@smallexample +(@value{GDBP}) cd wherever/vw/demo/rdb +(@value{GDBP}) load prog.o +@end smallexample + +@value{GDBN} will display a response similar to the following: + +@smallexample +Reading symbol data from wherever/vw/demo/rdb/prog.o... done. +@end smallexample + +You can also use the @code{load} command to reload an object module +after editing and recompiling the corresponding source file. Note that +this will cause @value{GDBN} to delete all currently-defined breakpoints, +auto-displays, and convenience variables, and to clear the value +history. (This is necessary in order to preserve the integrity of +debugger data structures that reference the target system's symbol +table.) + +@node VxWorks attach +@subsubsection Running Tasks + +@cindex running VxWorks tasks +You can also attach to an existing task using the @code{attach} command as +follows: + +@smallexample +(@value{GDBP}) attach @var{task} +@end smallexample + +@noindent +where @var{task} is the VxWorks hexadecimal task ID. The task can be running +or suspended when you attach to it. If running, it will be suspended at +the time of attachment. +@end ifset + +@ifset Hviii +@node Hitachi H8/300 Remote +@subsection @value{GDBN} and the Hitachi H8/300 +@value{GDBN} needs to know these things to talk to your H8/300: + +@enumerate +@item +that you want to use @samp{target hms}, the remote debugging +interface for the H8/300 (this is the default when +GDB is configured specifically for the H8/300); + +@item +what serial device connects your host to your H8/300 (the first serial +device available on your host is the default); + +@ignore +@c this is only for Unix hosts, not currently of interest. +@item +what speed to use over the serial device. +@end ignore +@end enumerate + +@kindex device +@cindex serial device for H8/300 +@ignore +@c only for Unix hosts +Use the special @code{gdb83} command @samp{device @var{port}} if you +need to explicitly set the serial device. The default @var{port} is the +first available port on your host. This is only necessary on Unix +hosts, where it is typically something like @file{/dev/ttya}. + +@kindex speed +@cindex serial line speed for H8/300 +@code{gdb83} has another special command to set the communications speed +for the H8/300: @samp{speed @var{bps}}. This command also is only used +from Unix hosts; on DOS hosts, set the line speed as usual from outside +GDB with the DOS @kbd{mode} command (for instance, @w{@samp{mode +com2:9600,n,8,1,p}} for a 9600 bps connection). +@end ignore + +@value{GDBN} depends on an auxiliary terminate-and-stay-resident program +called @code{asynctsr} to communicate with the H8/300 development board +through a PC serial port. You must also use the DOS @code{mode} command +to set up the serial port on the DOS side. + +The following sample session illustrates the steps needed to start a +program under @value{GDBN} control on your H8/300. The example uses a sample +H8/300 program called @file{t.x}. + +First hook up your H8/300 development board. In this example, we use a +board attached to serial port @code{COM2}; if you use a different serial +port, substitute its name in the argument of the @code{mode} command. +When you call @code{asynctsr}, the auxiliary comms program used by the +degugger, you give it just the numeric part of the serial port's name; +for example, @samp{asyncstr 2} below runs @code{asyncstr} on +@code{COM2}. + +@smallexample +(eg-C:\H8300\TEST) mode com2:9600,n,8,1,p + +Resident portion of MODE loaded + +COM2: 9600, n, 8, 1, p + +(eg-C:\H8300\TEST) asynctsr 2 +@end smallexample + +@quotation +@emph{Warning:} We have noticed a bug in PC-NFS that conflicts with +@code{asynctsr}. If you also run PC-NFS on your DOS host, you may need to +disable it, or even boot without it, to use @code{asynctsr} to control +your H8/300 board. +@end quotation + +Now that serial communications are set up, and the H8/300 is connected, +you can start up @value{GDBN}. Call @code{@value{GDBP}} with the name of your +program as the argument. @code{@value{GDBP}} prompts you, as usual, with the +prompt @samp{(@value{GDBP})}. Use two special commands to begin your debugging +session: @samp{target hms} to specify cross-debugging to the Hitachi board, +and the @code{load} command to download your program to the board. +@code{load} displays the names of the +program's sections, and a @samp{*} for each 2K of data downloaded. (If +you want to refresh @value{GDBN} data on symbols or on the executable file +without downloading, use the @value{GDBN} commands @code{file} or +@code{symbol-file}. These commands, and @code{load} itself, are +described in @ref{Files,,Commands to Specify Files}.) + +@smallexample +(eg-C:\H8300\TEST) @value{GDBP} t.x +GDB is free software and you are welcome to distribute copies + of it under certain conditions; type "show copying" to see + the conditions. +There is absolutely no warranty for GDB; type "show warranty" +for details. +GDB @value{GDBVN}, Copyright 1992 Free Software Foundation, Inc... +(gdb) target hms +Connected to remote H8/300 HMS system. +(gdb) load t.x +.text : 0x8000 .. 0xabde *********** +.data : 0xabde .. 0xad30 * +.stack : 0xf000 .. 0xf014 * +@end smallexample + +At this point, you're ready to run or debug your program. From here on, +you can use all the usual @value{GDBN} commands. The @code{break} command +sets breakpoints; the @code{run} command starts your program; +@code{print} or @code{x} display data; the @code{continue} command +resumes execution after stopping at a breakpoint. You can use the +@code{help} command at any time to find out more about @value{GDBN} commands. + +Remember, however, that @emph{operating system} facilities aren't +available on your H8/300; for example, if your program hangs, you can't +send an interrupt---but you can press the @sc{reset} switch! + +Use the @sc{reset} button on the H8/300 board +@itemize @bullet +@item +to interrupt your program (don't use @kbd{ctl-C} on the DOS host---it has +no way to pass an interrupt signal to the H8/300); and + +@item +to return to the @value{GDBN} command prompt after your program finishes +normally. The communications protocol provides no other way for @value{GDBN} +to detect program completion. +@end itemize + +In either case, @value{GDBN} will see the effect of a @sc{reset} on the +H8/300 board as a ``normal exit'' of your program. +@end ifset + +@ifset ZviiiK +@node Z8000 Simulator +@subsection @value{GDBN} and its Zilog Z8000 Simulator + +@cindex simulator, Z8000 +@cindex Zilog Z8000 simulator +When configured for debugging Zilog Z8000 targets, @value{GDBN} includes a Z8000 +simulator. + +@table @code +@item target z8ksim +@kindex z8ksim +This debugging target is a simulator for the Z8002, the unsegmented +variant of the Z8000 architecture. +@end table + +@noindent +After this point, you can debug Z8000 programs in the same style as +programs for your host computer; use the @code{file} command to load a +new program image, the @code{run} command to run your program, and so +on. + +As well as making available all the usual Z8000 registers (see +@code{info reg}), this debugging target provides three additional items +of information as specially named registers: + +@table @code +@item cycles +Counts clock-ticks in the simulator. + +@item insts +Counts instructions run in the simulator. + +@item time +Execution time in 60ths of a second. +@end table + +You can refer to these values in @value{GDBN} expressions with the usual +conventions; for example, @w{@samp{b fputc if $cycles>5000}} sets a +conditional breakpoint that will suspend only after at least 5000 +simulated clock ticks. +@end ifset diff --git a/gdb/doc/gen.m4 b/gdb/doc/gen.m4 deleted file mode 100644 index be995bf..0000000 --- a/gdb/doc/gen.m4 +++ /dev/null @@ -1,13 +0,0 @@ -_divert__(-1) -_define__(<_GENERIC__>,<1>) In case none.m4 changes its mind abt default - -_define__(<_AOUT__>,<1>) -_define__(<_COFF__>,<1>) -_define__(<_ELF__>,<1>) - -_define__(<_I80386__>,<1>) -_define__(<_M680X0__>,<1>) -_define__(<_SPARC__>,<1>) -_define__(<_VAX__>,<1>) - -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/h8-config.texi b/gdb/doc/h8-config.texi new file mode 100644 index 0000000..5164cb4 --- /dev/null +++ b/gdb/doc/h8-config.texi @@ -0,0 +1,17 @@ +@set Hviii +@set HviiiEXCLUSIVE +@clear NOVEL +@set BARETARGET +@set CONLY +@set DOSHOST +@set AGGLOMERATION +@clear SERIAL +@clear VXWORKS +@clear POSIX +@clear SPARC +@clear AMDxxixK +@clear Icmlx +@clear REMOTESTUB +@clear STmm +@set PRECONFIGURED +@clear ZviiiK diff --git a/gdb/doc/h8.m4 b/gdb/doc/h8.m4 index 5b84ee01..e69de29 100644 --- a/gdb/doc/h8.m4 +++ b/gdb/doc/h8.m4 @@ -1,16 +0,0 @@ -_divert__(-1) -_define__(<_REMOTESTUB__>,<0>) -_define__(<_H8__>,<1>) -_define__(<_GENERIC__>,<0>) -_define__(<_AGGLOMERATION__>,<1>) GPL formatted separately -_define__(<_PRECONFIGURED__>,<1>) manual is *only* for preconfigured sw -_define__(<_BARE__>,<1>) -_define__(<_CONLY__>,<1>) -_define__(<_DOSHOST__>,<1>) -_define__(<_AS__>,<as>) -_define__(<_GCC__>,<gcc>) -_define__(<_LD__>,<ld>) -_define__(<_GDBP__>,<gdb>) -_define__(<_GDBN__>,<GDB>) -_define__(<_HOST__>,<Hitachi H8/300>) -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/i80386.m4 b/gdb/doc/i80386.m4 deleted file mode 100644 index d8293d1..0000000 --- a/gdb/doc/i80386.m4 +++ /dev/null @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_I80386__>,<1>) -_define__(<_HOST__>,<Intel 80386>) -_define__(<_MACH_DEP__>,<80386 Dependent> -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/i960.m4 b/gdb/doc/i960.m4 deleted file mode 100644 index e98155d..0000000 --- a/gdb/doc/i960.m4 +++ /dev/null @@ -1,12 +0,0 @@ -_divert__(-1) -_define__(<_I960__>,<1>) -_define__(<_AOUT__>,<0>) -_define__(<_BOUT__>,<1>) -_define__(<_COFF__>,<1>) -_define__(<_AS__>,<gas960>) -_define__(<_GCC__>,<gcc960>) -_define__(<_LD__>,<gld960>) -_define__(<_GDB__>,<gdb960>) -_define__(<_HOST__>,<Intel 960>) -_define__(<_MACH_DEP__>,<i960 Dependent>) -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/lucid.m4 b/gdb/doc/lucid.m4 index 4830c16..e69de29 100644 --- a/gdb/doc/lucid.m4 +++ b/gdb/doc/lucid.m4 @@ -1,20 +0,0 @@ -_divert__(-1) -_define__(<_ALL_ARCH__>,<1>) -_define__(<_GENERIC__>,<1>) In case none.m4 changes its mind abt default - -_define__(<_AOUT__>,<1>) -_define__(<_BOUT__>,<1>) -_define__(<_COFF__>,<1>) -_define__(<_ELF__>,<1>) - -_define__(<_LUCID__>,<1>) - -_define__(<_AMD29K__>,<1>) -_define__(<_I80386__>,<1>) -_define__(<_I960__>,<1>) -_define__(<_M680X0__>,<1>) -_define__(<_SPARC__>,<1>) -_define__(<_VAX__>,<1>) -_define__(<_VXWORKS__>,<1>) - -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/m680x0.m4 b/gdb/doc/m680x0.m4 deleted file mode 100644 index e5f83b6..0000000 --- a/gdb/doc/m680x0.m4 +++ /dev/null @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_M680X0__>,<1>) -_define__(<_HOST__>,<Motorola 680x0>) -_define__(<_MACH_DEP__>,<M680x0 Dependent>) -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/none.m4 b/gdb/doc/none.m4 deleted file mode 100644 index a2fe088..0000000 --- a/gdb/doc/none.m4 +++ /dev/null @@ -1,70 +0,0 @@ - -_divert__(-1) - -Switches: - -_define__(<_ALL_ARCH__>,<0>) (Meant as most inclusive; file turning - it on is expected to also turn on - all arch-related switches including - "_GENERIC__") -_define__(<_GENERIC__>,<1>) (may not be quite all configs; - meant for "most vanilla" manual) -_define__(<_AGGLOMERATION__>,<0>) is manual part of an agglomeration, - with GPL formatted separately? -_define__(<_PRECONFIGURED__>,<0>) is manual *only* for preconfigured sw? -_define__(<_FSF__>,<1>) set to zero to include things - FSF won't take which Cygnus may want. -_define__(<_INTERNALS__>,<0>) - -_define__(<_AOUT__>,<1>) Object formats. Note we turn on one. -_define__(<_BOUT__>,<0>) -_define__(<_COFF__>,<0>) -_define__(<_ELF__>,<0>) - -_define__(<_LUCID__>,<0>) A programming environment. - -_define__(<_BARE__>,<0>) Turn on to indicate no OS facilities - (like shells, user prog args, program - environment, corefiles) - -_define__(<_DOSHOST__>,<0>) Is this GDB DOS-hosted? - -_define__(<_CONLY__>,<0>) Mention only C debugging if - turned on. - -_define__(<_REMOTESTUB__>,<1>) Generic remote serial stub -_define__(<_AMD29K__>,<0>) Specific architectures. Note none -_define__(<_H8__>,<0>) -_define__(<_I80386__>,<0>) starts out on. -_define__(<_I960__>,<0>) -_define__(<_M680X0__>,<0>) -_define__(<_SPARC__>,<0>) -_define__(<_ST2000__>,<0>) -_define__(<_VAX__>,<0>) -_define__(<_VXWORKS__>,<0>) -_define__(<_Z8000__>,<0>) - -Text: - -Default names; individual configs may override -Assembler: -_define__(<_AS__>,<as>) -C Compiler: -_define__(<_GCC__>,<gcc>) -Linker: -_define__(<_LD__>,<ld>) -Debugger name: -_define__(<_GDBN__>,<GDB>) -Debugger program: -_define__(<_GDBP__>,<gdb>) -Debugger init file: -_define__(<_GDBINIT__>,<.gdbinit>) - -Text for host; individual configs *should* override, but this may -catch some flubs -_define__(<_HOST__>,<machine specific>) - -"Machine Dependent" nodename -_define__(<_MACH_DEP__>,<Machine Dependent>) - -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/pretex.m4 b/gdb/doc/pretex.m4 deleted file mode 100644 index 40c3d26..0000000 --- a/gdb/doc/pretex.m4 +++ /dev/null @@ -1,268 +0,0 @@ -divert(-1) -*-Text-*- -` Copyright (c) 1991 Free Software Foundation, Inc.' -` This file defines and documents the M4 macros used ' -` to preprocess some GNU manuals' -` $Id$' - -I. INTRODUCTION - -This collection of M4 macros is meant to help in pre-processing texinfo -files to allow configuring them by hosts; for example, the reader of an -as manual who only has access to a 386 may not really want to see crud about -VAXen. - -A preprocessor is used, rather than extending texinfo, because this -way we can hack the conditionals in only one place; otherwise we would -have to write TeX macros, update makeinfo, and update the Emacs -info-formatting functions. - -II. COMPATIBILITY - -These macros should work with GNU m4 and System V m4; they do not work -with Sun or Berkeley M4. - -III. USAGE - -A. M4 INVOCATION -Assume this file is called "pretex.m4". Then, to preprocess a -document "mybook.texinfo" you might do something like the following: - - m4 pretex.m4 none.m4 PARTIC.m4 mybook.texinfo >mybook-PARTIC.texinfo - ----where your path is set to find GNU or SysV "m4", and the other m4 -files mentioned are as follows: - - none.m4: A file that defines, as 0, all the options you might - want to turn on using the conditionals defined below. - Unlike the C preprocessor, m4 does not default - undefined macros to 0. For example, here is a "none.m4" - I have been using: - _divert__(-1) - - _define__(<_ALL_ARCH__>,<0>) - _define__(<_INTERNALS__>,<0>) - - _define__(<_AMD29K__>,<0>) - _define__(<_I80386__>,<0>) - _define__(<_I960__>,<0>) - _define__(<_M680X0__>,<0>) - _define__(<_SPARC__>,<0>) - _define__(<_VAX__>,<0>) - - _divert__<> - - PARTIC.m4: A file that turns on whichever options you actually - want the manual configured for, in this particular - instance. Its contents are similar to one or more of - the lines in "none.m4", but of course the second - argument to _define__ is <1> rather than <0>. - - This is also a convenient place to _define__ any macros - that you want to expand to different text for - different configurations---for example, the name of - the program being described. - -Naturally, these are just suggested conventions; you could put your macro -definitions in any files or combinations of files you like. - -These macros use the characters < and > as m4 quotes; if you need -these characters in your text, you will also want to use the macros -_0__ and _1__ from this package---see the description of "Quote -Handling" in the "Implementation" section below. - -B. WHAT GOES IN THE PRE-TEXINFO SOURCE - -For the most part, the text of your book. In addition, you can -have text that is included only conditionally, using the macros -_if__ and _fi__ defined below. They BOTH take an argument! This is -primarily meant for readability (so a human can more easily see what -conditional end matches what conditional beginning), but the argument -is actually used in the _fi__ as well as the _if__ implementation. -You should always give a _fi__ the same argument as its matching -_if__. Other arguments may appear to work for a while, but are almost -certain to produce the wrong output for some configurations. - -For example, here is an excerpt from the very beginning of the -documentation for GNU as, to name the info file appropriately for -different configurations: - _if__(_ALL_ARCH__) - @setfilename as.info - _fi__(_ALL_ARCH__) - _if__(_M680X0__ && !_ALL_ARCH__) - @setfilename as-m680x0.info - _fi__(_M680X0__ && !_ALL_ARCH__) - _if__(_AMD29K__ && !_ALL_ARCH__) - @setfilename as-29k.info - _fi__(_AMD29K__ && !_ALL_ARCH__) - -Note that you can use Boolean expressions in the arguments; the -expression language is that of the built-in m4 macro `eval', described -in the m4 manual. - -IV. IMPLEMENTATION - -A.PRIMITIVE RENAMING -First, we redefine m4's built-ins to avoid conflict with plain text. -The naming convention used is that our macros all begin with a single -underbar and end with two underbars. The asymmetry is meant to avoid -conflict with some other conventions (which we may want to document) that -are intended to avoid conflict, like ANSI C predefined macros. - -define(`_undefine__',defn(`undefine')) -define(`_define__',defn(`define')) -define(`_defn__',defn(`defn')) -define(`_ppf__',`_define__(`_$1__',_defn__(`$1'))_undefine__(`$1')') -_ppf__(`builtin') -_ppf__(`changecom') -_ppf__(`changequote') -_ppf__(`decr') -_ppf__(`define') -_ppf__(`defn') -_ppf__(`divert') -_ppf__(`divnum') -_ppf__(`dnl') -_ppf__(`dumpdef') -_ppf__(`errprint') -_ppf__(`esyscmd') -_ppf__(`eval') -_ppf__(`format') -_ppf__(`ifdef') -_ppf__(`ifelse') -_ppf__(`include') -_ppf__(`incr') -_ppf__(`index') -_ppf__(`len') -_ppf__(`m4exit') -_ppf__(`m4wrap') -_ppf__(`maketemp') -_ppf__(`patsubst') -_ppf__(`popdef') -_ppf__(`pushdef') -_ppf__(`regexp') -_ppf__(`shift') -_ppf__(`sinclude') -_ppf__(`substr') -_ppf__(`syscmd') -_ppf__(`sysval') -_ppf__(`traceoff') -_ppf__(`traceon') -_ppf__(`translit') -_ppf__(`undefine') -_ppf__(`undivert') -_ppf__(`unix') - -B. QUOTE HANDLING. - -The characters used as quotes by M4, by default, are unfortunately -quite likely to occur in ordinary text. To avoid surprises, we will -use the characters <> ---which are just as suggestive (more so to -Francophones, perhaps) but a little less common in text (save for -those poor Francophones. You win some, you lose some). Still, we -expect also to have to set < and > occasionally in text; to do that, -we define a macro to turn off quote handling (_0__) and a macro to -turn it back on (_1__), according to our convention. - - BEWARE: This seems to make < and > unusable as relational operations - in calls to the builtin "eval". So far I've gotten - along without; but a better choice may be possible. - -Note that we postponed this for a while, for convenience in discussing -the issue and in the primitive renaming---not to mention in defining -_0__ and _1__ themselves! However, the quote redefinitions MUST -precede the _if__ / _fi__ definitions, because M4 will expand the text -as given---if we use the wrong quotes here, we will get the wrong -quotes when we use the conditionals. - -_define__(_0__,`_changequote__(,)')_define__(_1__,`_changequote__(<,>)') -_1__ - -C. CONDITIONALS - -We define two macros, _if__ and _fi__. BOTH take arguments! This is -meant both to help the human reader match up a _fi__ with its -corresponding _if__ and to aid in the implementation. You may use the -full expression syntax supported by M4 (see docn of `eval' builtin in -the m4 manual). - -The conditional macros are carefully defined to avoid introducing -extra whitespace (i.e., blank lines or blank characters). One side -effect exists--- - - BEWARE: text following an `_if__' on the same line is - DISCARDED even if the condition is true; text - following a `_fi__' on the same line is also - always discarded. - -The recommended convention is to always place _if__ and _fi__ on a -line by themselves. This will also aid the human reader. TeX won't -care about the line breaks; as for info, you may want to insert calls -to `@refill' at the end of paragraphs containing conditionalized text, -where you don't want line breaks separating unconditional from -conditional text. info formatting will then give you nice looking -paragraphs in the info file. - -Nesting: conditionals are designed to nest, in the following way: -*nothing* is output between an outer pair of false conditionals, even -if there are true conditionals inside. A false conditional "defeats" -all conditionals within it. The counter _IF_FS__ is used to -implement this; kindly avoid redefining it directly. - -_define__(<_IF_FS__>,<0>) - -NOTE: The definitions for our "pushf" and "popf" macros use eval -rather than incr and decr, because GNU m4 (0.75) tries to call eval -for us when we say "incr" or "decr"---but doesn't notice we've changed -eval's name. - -_define__( - <_pushf__>, - <_define__(<_IF_FS__>, - _eval__((_IF_FS__)+1))>) -_define__( - <_popf__>, - <_ifelse__(0,_IF_FS__, - <<>_dnl__<>>, - <_define__(<_IF_FS__>,_eval__((_IF_FS__)-1))>)>) - -_define__( - <_if__>, - <_ifelse__(1,_eval__( ($1) ), - <<>_dnl__<>>, - <_pushf__<>_divert__(-1)>)>) -_define__( - <_fi__>, - <_ifelse__(1,_eval__( ($1) ), - <<>_dnl__<>>, - <_popf__<>_ifelse__(0,_IF_FS__, - <_divert__<>_dnl__<>>,<>)>)>) - -D. CHAPTER/SECTION MACRO -In a parametrized manual, the heading level may need to be calculated; -for example, a manual that has a chapter on machine dependencies -should be conditionally structured as follows: - - IF the manual is configured for a SINGLE machine type, use -the chapter heading for that machine type, and run headings down -from there (top level for a particular machine is chapter, then within -that we have section, subsection etc); - - ELSE, if MANY machine types are described in the chapter, -use a generic chapter heading such as "@chapter Machine Dependencies", -use "section" for the top level description of EACH machine, and run -headings down from there (top level for a particular machine is -section, then within that we have subsection, subsubsection etc). - -The macro <_CHAPSEC__> is for this purpose: its argument is evaluated (so -you can construct expressions to express choices such as above), then -expands as follows: - 0: @chapter - 1: @section - 2: @subsection - 3: @subsubsection - ...and so on. - -_define__(<_CHAPSEC__>,<@_cs__(_eval__($1))>) -_define__(<_cs__>,<_ifelse__( - 0, $1, <chapter>, - 1, $1, <section>, - <sub<>_cs__(_eval__($1 - 1))>)>) - -_divert__<>_dnl__<> diff --git a/gdb/doc/sparc.m4 b/gdb/doc/sparc.m4 deleted file mode 100644 index 8cc6a3e..0000000 --- a/gdb/doc/sparc.m4 +++ /dev/null @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_SPARC__>,<1>) -_define__(<_HOST__>,<SPARC>) -_define__(<_MACH_DEP__>,<SPARC Dependent>) -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/vax.m4 b/gdb/doc/vax.m4 deleted file mode 100644 index 59cb2ab..0000000 --- a/gdb/doc/vax.m4 +++ /dev/null @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_VAX__>,<1>) -_define__(<_HOST__>,<VAX>) -_define__(<_MACH_DEP__>,<VAX Dependent>) -_divert__<>
\ No newline at end of file diff --git a/gdb/doc/z8000.m4 b/gdb/doc/z8000.m4 index 99cefd6..e69de29 100644 --- a/gdb/doc/z8000.m4 +++ b/gdb/doc/z8000.m4 @@ -1,5 +0,0 @@ -_divert__(-1) -_define__(<_Z8000__>,<1>) -_define__(<_HOST__>,<Zilog Z8000>) -_define__(<_MACH_DEP__>,<Z8000 Dependent>) -_divert__<>
\ No newline at end of file |