From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Eli Zaretskii Cc: kettenis@wins.uva.nl, gdb-patches@sourceware.cygnus.com Subject: Re: RFA: minor watchpoint code cleanup Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <200003180006.TAA26919@zwingli.cygnus.com> <200003190944.EAA07454@indy.delorie.com> <200003192255.e2JMtcs00643@delius.kettenis.local> <200003200958.EAA09356@indy.delorie.com> X-SW-Source: 2000-q1/msg00828.html Yes, yes, but does anyone have comments on my little patch? :) >From kingdon@redhat.com Sat Apr 01 00:00:00 2000 From: Jim Kingdon To: gdb-patches@sourceware.cygnus.com Subject: Re: cvs server: [09:25:59] waiting for anoncvs's lock in /cvs/src/src/gdb/rdi-share Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <38B56A4E.155F87BC@cygnus.com> X-SW-Source: 2000-q1/msg00361.html Content-length: 229 > cvs server: [09:25:59] waiting for anoncvs's lock in > /cvs/src/src/gdb/rdi-share Is this fixed? I don't see the lock file there but I don't see your checkin as having happened either. Jim sourceware.cygnus.com admin >From msnyder@cygnus.com Sat Apr 01 00:00:00 2000 From: Michael Snyder To: gdb-patches@sourceware.cygnus.com Subject: [PATCH]: Allow struct compare in expressions. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003222043.MAA10512@cleaver.cygnus.com> X-SW-Source: 2000-q1/msg00911.html Content-length: 4627 The following change allows GDB to evaluate (and set watchpoints on) expressions of the form (a == b) and (a != b), where a and b are simple C structs or unions. It would be possible to extend this further by allowing simple binary comparison for classes that don't have an operator== method: I leave that as an exercise for someone else. Jim Blandy, David Taylor, I think both of your approvals is required. 2000-03-22 Michael Snyder * eval.c (evaluate_subexp_standard): allow for simple comparison of structures, in the absense of C++ method symbols. * symtab.c (total_number_of_methods): make public, for use above. * symtab.h (total_number_of_methods): publish prototype. Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.163 diff -c -r1.163 ChangeLog *** ChangeLog 2000/03/22 09:45:01 1.163 --- ChangeLog 2000/03/22 20:38:33 *************** *** 1,3 **** --- 1,10 ---- + 2000-03-22 Michael Snyder + + * eval.c (evaluate_subexp_standard): allow for simple comparison + of structures, in the absense of C++ method symbols. + * symtab.c (total_number_of_methods): make public, for use above. + * symtab.h (total_number_of_methods): publish prototype. + 2000-03-22 Mark Kettenis * config/i386/tm-i386aix.h (I386_AIX_TARGET): Remove. Index: eval.c =================================================================== RCS file: /cvs/src/src/gdb/eval.c,v retrieving revision 1.2 diff -c -r1.2 eval.c *** eval.c 2000/03/14 17:01:04 1.2 --- eval.c 2000/03/22 20:38:34 *************** *** 1448,1454 **** arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; ! if (binop_user_defined_p (op, arg1, arg2)) { return value_x_binop (arg1, arg2, op, OP_NULL, noside); } --- 1448,1459 ---- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; ! ! /* NOTE: because BINOP_EQUAL is a legal operaton for ! C structs (as opposed to C++ classes), revert to ! simple value comparison if the type has no methods. */ ! if (binop_user_defined_p (op, arg1, arg2) && ! total_number_of_methods (arg1->type) > 0) { return value_x_binop (arg1, arg2, op, OP_NULL, noside); } *************** *** 1463,1469 **** arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; ! if (binop_user_defined_p (op, arg1, arg2)) { return value_x_binop (arg1, arg2, op, OP_NULL, noside); } --- 1468,1479 ---- arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; ! ! /* NOTE: because BINOP_NOTEQUAL is a legal operaton for ! C structs (as opposed to C++ classes), revert to ! simple value comparison if the type has no methods. */ ! if (binop_user_defined_p (op, arg1, arg2) && ! total_number_of_methods (arg1->type) > 0) { return value_x_binop (arg1, arg2, op, OP_NULL, noside); } Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.2 diff -c -r1.2 symtab.c *** symtab.c 2000/02/08 04:39:02 1.2 --- symtab.c 2000/03/22 20:38:34 *************** *** 2217,2225 **** reader because the type of the baseclass might still be stubbed when the definition of the derived class is parsed. */ ! static int total_number_of_methods PARAMS ((struct type * type)); ! ! static int total_number_of_methods (type) struct type *type; { --- 2217,2223 ---- reader because the type of the baseclass might still be stubbed when the definition of the derived class is parsed. */ ! int total_number_of_methods (type) struct type *type; { Index: symtab.h =================================================================== RCS file: /cvs/src/src/gdb/symtab.h,v retrieving revision 1.4 diff -c -r1.4 symtab.h *** symtab.h 2000/03/21 22:37:42 1.4 --- symtab.h 2000/03/22 20:38:34 *************** *** 1462,1467 **** --- 1462,1472 ---- extern int in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start)); + /* Number of method symbols for TYPE + (and all its base classes) */ + extern int + total_number_of_methods PARAMS ((struct type * type)); + extern struct symbol * fixup_symbol_section PARAMS ((struct symbol *, struct objfile *)); >From kingdon@redhat.com Sat Apr 01 00:00:00 2000 From: Jim Kingdon To: gdb-patches@sourceware.cygnus.com Subject: Re: Remaining GNU C isms. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <20000219120800.R9448@rjlhome.sco.com> X-SW-Source: 2000-q1/msg00250.html Content-length: 253 > Also, language.c has the non-C89 'long long' in a few places. Since > they're marked with "FIXME" comments, I assume someone is already on top > of this. You assume a lot :-). I'd go ahead and submit a patch - cleaning this up would be nice. >From cgf@cygnus.com Sat Apr 01 00:00:00 2000 From: cgf@cygnus.com (Chris Faylor) To: gdb-patches@sourceware.cygnus.com Subject: Re: dlclose() Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <88nurn$e4d$1@cronkite.cygnus.com> References: <200002161953.OAA07411@devserv.devel.redhat.com> <200002200521.AAA29598@devserv.devel.redhat.com> X-SW-Source: 2000-q1/msg00252.html Content-length: 794 In article < 200002200521.AAA29598@devserv.devel.redhat.com >, Jim Kingdon wrote: >> Here's another patch for the dlclose() problem we've been talking >> about (5130 in bugzilla.redhat.com and all). > >Early feedback seems to be positive (thanks Chris), so here is a >slightly revised version (cleans up some of the free'ing). As far as >I know this is ready to check in. Of course, if people want to weigh >in that could help make it clear. Does this mean that it does not cause test suite regressions? Am I mistaken in the observation that people rarely post test suite results when they submit patches? cgf -- cgf@cygnus.com Cygnus Solutions, a Red Hat company http://sourcware.cygnus.com/ http://www.redhat.com/ >From ac131313@cygnus.com Sat Apr 01 00:00:00 2000 From: Andrew Cagney To: GDB Patches Subject: [PATCH] MI - Add configury ... Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38B0E80F.59EED586@cygnus.com> X-SW-Source: 2000-q1/msg00270.html Content-length: 9788 Hello, The attatched patch adds configury for the MI sub directory to GDB. The thing that is probably of interest is the addition of the configury option: --enable-gdbmi (It can be changed to --enable-gdb-mi. JimB you tend to be up on this.) Andrew Mon Feb 21 13:57:27 2000 Andrew Cagney * configure.in (CONFIG_INITS): Fix typo, was CONFIG_INIT. (ENABLE_CFLAGS): Move initialization to start of file. (enable-gdbmi): Add new configure option --enable-gdbmi. When selected and an ${srcdir}/mi directory is present enable MI interface. * configure: Regenerate. * Makefile.in (SUBDIR_MI_OBS, SUBDIR_MI_SRCS, SUBDIR_MI_DEPS, SUBDIR_MI_INITS, SUBDIR_MI_LDFLAGS, SUBDIR_MI_CFLAGS): New macros. (CONFIG_OBS, CONFIG_SRCS, CONFIG_DEPS, CONFIG_INITS, CONFIG_LDFLAGS): New macros. Initialized by autoconf via @CONFIG...@. (INTERNAL_LDFLAGS, CDEPS, LINTFILES, DEPFILES, SOURCES, INIT_FILES): Use $(CONFIG_...) instead of @CONFIG...@. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.5 diff -p -r1.5 Makefile.in *** Makefile.in 2000/02/16 23:35:19 1.5 --- Makefile.in 2000/02/21 07:08:31 *************** TUI_DIR=tui *** 141,146 **** --- 141,167 ---- TUI_SRC = $(srcdir)/$(TUI_DIR) TUI_CFLAGS= -I$(TUI_SRC) + # + # MI sub directory definitons + # + SUBDIR_MI_OBS = \ + mi-out.o mi-console.o \ + mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ + mi-cmd-disas.o \ + mi-main.o mi-parse.o mi-getopt.o + SUBDIR_MI_SRCS = \ + mi/mi-out.c mi/mi-console.c \ + mi/mi-cmds.c \ + mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \ + mi/mi-cmd-disas.c \ + mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c + SUBDIR_MI_DEPS = + SUBDIR_MI_INITS = \ + mi/mi-cmds.c mi/mi-parse.c mi/mi-main.c + SUBDIR_MI_LDFLAGS= + SUBDIR_MI_CFLAGS= \ + -DUI_OUT=1 + # Opcodes currently live in one of two places. Either they are in the # opcode library, typically ../opcodes, or they are in a header file # in INCLUDE_DIR. *************** LIBGUI = @LIBGUI@ *** 200,205 **** --- 221,231 ---- GUI_CFLAGS_X = @GUI_CFLAGS_X@ IDE_CFLAGS=$(GUI_CFLAGS_X) $(IDE_CFLAGS_X) + CONFIG_OBS= @CONFIG_OBS@ + CONFIG_SRCS= @CONFIG_SRCS@ + CONFIG_DEPS= @CONFIG_DEPS@ + CONFIG_INITS= @CONFIG_INITS@ + CONFIG_LDFLAGS = @CONFIG_LDFLAGS@ ENABLE_CFLAGS= @ENABLE_CFLAGS@ # -I. for config files. *************** INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS *** 240,246 **** # Profiling options need to go here to work. # I think it's perfectly reasonable for a user to set -pg in CFLAGS # and have it work; that's why CFLAGS is here. ! INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) @CONFIG_LDFLAGS@ @HLDFLAGS@ HLDENV = @HLDENV@ # We are using our own version of REGEX now to be consistent across --- 266,272 ---- # Profiling options need to go here to work. # I think it's perfectly reasonable for a user to set -pg in CFLAGS # and have it work; that's why CFLAGS is here. ! INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) @HLDFLAGS@ HLDENV = @HLDENV@ # We are using our own version of REGEX now to be consistent across *************** CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCO *** 265,271 **** $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ! $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) @CONFIG_DEPS@ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) --- 291,297 ---- $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ! $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) *************** SFILES = ax-general.c ax-gdb.c bcache.c *** 449,455 **** tui/tui-file.h tui/tui-file.c \ ui-file.h ui-file.c ! LINTFILES = $(SFILES) $(YYFILES) @CONFIG_SRCS@ init.c # "system" headers. Using these in dependencies is a rather personal # choice. (-rich, summer 1993) --- 475,481 ---- tui/tui-file.h tui/tui-file.c \ ui-file.h ui-file.c ! LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c # "system" headers. Using these in dependencies is a rather personal # choice. (-rich, summer 1993) *************** POSSLIBS = gnu-regex.c gnu-regex.h *** 551,559 **** # Makefile.in DEPFILES = $(TDEPFILES) $(XDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \ ! $(REMOTE_OBS) $(SIM_OBS) @CONFIG_OBS@ ! SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) @CONFIG_SRCS@ # Don't include YYFILES (*.tab.c) because we already include *.y in SFILES, # and it's more useful to see it in the .y file. TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \ --- 577,585 ---- # Makefile.in DEPFILES = $(TDEPFILES) $(XDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \ ! $(REMOTE_OBS) $(SIM_OBS) $(CONFIG_OBS) ! SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS) # Don't include YYFILES (*.tab.c) because we already include *.y in SFILES, # and it's more useful to see it in the .y file. TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \ *************** uninstall: force *** 693,699 **** # tui-file.c. # ! INIT_FILES = $(OBS) $(TSOBS) $(SUBDIR_INIT_FILES) @CONFIG_INITS@ init.c: $(INIT_FILES) @echo Making init.c @rm -f init.c-tmp init.l-tmp --- 719,725 ---- # tui-file.c. # ! INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_INITS) init.c: $(INIT_FILES) @echo Making init.c @rm -f init.c-tmp init.l-tmp *************** varobj.o: varobj.c $(defs_h) $(frame_h) *** 1851,1855 **** --- 1877,1920 ---- $(language_h) valprint.h varobj.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) wrapper.h + + # + # MI dependencies + # + # Need to explicitly specify the compile rule as make will do nothing + # or try to compile the object file into the mi directory. + + mi_cmds_h = $(srcdir)/mi/mi-cmds.h + mi_out_h = $(srcdir)/mi/mi-out.h + mi_parse_h = $(srcdir)/mi/mi-parse.h + mi_getopt_h = $(srcdir)/mi/mi-getopt.h + mi_console_h = $(srcdir)/mi/mi-console.h + + mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c + mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(top_h) $(mi_cmds_h) \ + $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c + mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(top_h) $(mi_cmds_h) \ + $(ui_out_h) $(frame_h) $(value_h) $(target_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c + mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ + $(ui_out_h) $(mi_getopt_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c + mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \ + $(ui_out_h) $(value_h) $(target_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c + mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \ + $(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \ + $(mi_getopt_h) + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/mi/mi-main.c + mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c + mi-console.o: $(srcdir)/mi/mi-console.c $(mi_out_h) $(defs_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c + mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_parse_h) $(mi_cmds_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c + mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c ### end of the gdb Makefile.in. Index: configure.in =================================================================== RCS file: /cvs/src/src/gdb/configure.in,v retrieving revision 1.4 diff -p -r1.4 configure.in *** configure.in 2000/02/16 23:35:19 1.4 --- configure.in 2000/02/21 07:09:00 *************** dnl List of object files added by config *** 41,47 **** CONFIG_OBS= CONFIG_DEPS= CONFIG_SRCS= ! CONFIG_INIT= configdirs="doc testsuite" --- 41,48 ---- CONFIG_OBS= CONFIG_DEPS= CONFIG_SRCS= ! CONFIG_INITS= ! ENABLE_CFLAGS= configdirs="doc testsuite" *************** if test ${build} = ${host} -a ${host} = *** 363,369 **** fi dnl Handle optional features that can be enabled. ! ENABLE_CFLAGS= AC_ARG_ENABLE(tui, [ --enable-tui Enable full-screen terminal user interface], --- 364,393 ---- fi dnl Handle optional features that can be enabled. ! ! dnl Handle MI sub-directory configury. ! AC_ARG_ENABLE(gdbmi, ! [ --enable-gdbmi Enable GDB-MI interface], ! [ ! case "${enable_gdbmi}" in ! yes | no) ;; ! "") enable_gdbmi=yes ;; ! *) ! AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval}) ! ;; ! esac ! ]) ! case ${enable_gdbmi} in ! "yes" ) ! if test -d "${srcdir}/mi" ; then ! CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_MI_OBS)" ! CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_MI_DEPS)" ! CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_MI_SRCS)" ! CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)" ! ENABLE_CFLAGS="${ENABLE_CFLAGS} -DUI_OUT=1" ! fi ! ;; ! esac AC_ARG_ENABLE(tui, [ --enable-tui Enable full-screen terminal user interface], >From dima@Chg.RU Sat Apr 01 00:00:00 2000 From: Dmitry Sivachenko To: gdb-patches@sourceware.cygnus.com Subject: patch for gdb.texinfo Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200001272009.XAA80346@netserv1.chg.ru> X-SW-Source: 2000-q1/msg00038.html Content-length: 30338 Hello! Please apply this patch to gdb.texinfo (I made it against revision 1.1.1.14). It corrects several typos and adds better markup. Thank you in advance, Dima. --- gdb.texinfo.orig Thu Jan 27 22:35:02 2000 +++ gdb.texinfo Thu Jan 27 23:06:45 2000 @@ -403,7 +403,7 @@ @b{define(baz,defn(foo))} @b{baz} -@b{C-d} +@kbd{C-d} m4: End of input: 0: fatal error: EOF in string @end smallexample @@ -620,7 +620,7 @@ lengths. We allow @code{m4} exit by giving it an EOF as input: @smallexample -@b{C-d} +@kbd{C-d} Program exited normally. @end smallexample @@ -697,7 +697,7 @@ will warn you if it is unable to attach or to read core dumps. You can run @code{gdb} without printing the front material, which describes -@value{GDBN}'s non-warranty, by specifying @code{-silent}: +@value{GDBN}'s non-warranty, by specifying @option{-silent}: @smallexample @value{GDBP} -silent @@ -720,7 +720,7 @@ 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. +@option{-x} option is used. @menu @@ -733,12 +733,12 @@ 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. (@value{GDBN} reads the first argument +the same as if the arguments were specified by the @option{-se} and +@option{-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 +@option{-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.) +the @option{-c} option followed by that argument.) If @value{GDBN} has not been configured to included core file support, such as for most embedded targets, then it will complain about a second @@ -807,7 +807,7 @@ @end table -You typically combine the @code{-mapped} and @code{-readnow} options in +You typically combine the @option{-mapped} and @option{-readnow} options in order to build a @file{.syms} file that contains complete symbol information. (@xref{Files,,Commands to specify files}, for information on @file{.syms} files.) A simple @value{GDBN} invocation to do nothing @@ -839,8 +839,8 @@ @item -batch Run in batch mode. Exit with status @code{0} after processing all the -command files specified with @samp{-x} (and all commands from -initialization files, if not inhibited with @samp{-n}). Exit with +command files specified with @option{-x} (and all commands from +initialization files, if not inhibited with @option{-n}). Exit with nonzero status if an error occurs in executing the @value{GDBN} commands in the command files. @@ -947,7 +947,7 @@ @cindex shell escape @item shell @var{command string} Invoke a standard shell to execute @var{command string}. -If it exists, the environment variable @code{SHELL} determines which +If it exists, the environment variable @env{SHELL} determines which shell to run. Otherwise @value{GDBN} uses the default shell (@file{/bin/sh} on Unix systems, @file{COMMAND.COM} on MS-DOS, etc.). @end table @@ -1114,7 +1114,7 @@ @kbd{M-?} to request word completion: @example -(@value{GDBP}) b 'bubble( @key{M-?} +(@value{GDBP}) b 'bubble( @kbd{M-?} bubble(double,double) bubble(int,int) (@value{GDBP}) b 'bubble( @end example @@ -1290,7 +1290,7 @@ version of @value{GDBN} you are running; as @value{GDBN} evolves, new commands are introduced, and old ones may wither away. Also, many system vendors ship variant versions of @value{GDBN}, and there are -variant versions of @value{GDBN} in GNU/Linux distributions as well. +variant versions of @value{GDBN} in @sc{gnu}/Linux distributions as well. The version number is the same as the one announced when you start @value{GDBN}. @@ -1340,35 +1340,35 @@ variable or function and the correspondence between source line numbers and addresses in the executable code. -To request debugging information, specify the @samp{-g} option when you run +To request debugging information, specify the @option{-g} option when you run the compiler. -Many C compilers are unable to handle the @samp{-g} and @samp{-O} +Many C compilers are unable to handle the @option{-g} and @option{-O} options together. Using those compilers, you cannot generate optimized executables containing debugging information. -@value{NGCC}, the @sc{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 +@value{NGCC}, the @sc{gnu} C compiler, supports @option{-g} with or +without @option{-O}, making it possible to debug optimized code. We +recommend that you @emph{always} use @option{-g} whenever you compile a program. You may think your program is correct, but there is no sense in pushing your luck. @cindex optimized code, debugging @cindex debugging optimized code -When you debug a program compiled with @samp{-g -O}, remember that the +When you debug a program compiled with @option{-g -O}, remember that the optimizer is rearranging your code; the debugger shows you what is really there. Do not be too surprised when the execution path does not exactly match your source file! An extreme example: if you define a variable, but never use it, @value{GDBN} never sees that variable---because the compiler optimizes it out of existence. -Some things do not work as well with @samp{-g -O} as with just -@samp{-g}, particularly on machines with instruction scheduling. If in -doubt, recompile with @samp{-g} alone, and if this fixes the problem, +Some things do not work as well with @option{-g -O} as with just +@option{-g}, particularly on machines with instruction scheduling. If in +doubt, recompile with @option{-g} alone, and if this fixes the problem, please report it to us as a bug (including a test case!). Older versions of the @sc{gnu} C compiler permitted a variant option -@w{@samp{-gg}} for debugging information. @value{GDBN} no longer supports this +@w{@option{-gg}} for debugging information. @value{GDBN} no longer supports this format; if your @sc{gnu} C compiler has this option, do not use it. @need 2000 @@ -1409,7 +1409,7 @@ (such as wildcard expansion or variable substitution) in describing the arguments. In Unix systems, you can control which shell is used with the -@code{SHELL} environment variable. +@env{SHELL} environment variable. @xref{Arguments, ,Your program's arguments}. @item The @emph{environment.} @@ -1456,8 +1456,8 @@ @code{run} command. They are passed to a shell, which expands wildcard characters and performs redirection of I/O, and thence to your program. Your -@code{SHELL} environment variable (if it exists) specifies what shell -@value{GDBN} uses. If you do not define @code{SHELL}, @value{GDBN} uses +@env{SHELL} environment variable (if it exists) specifies what shell +@value{GDBN} uses. If you do not define @env{SHELL}, @value{GDBN} uses the default shell (@file{/bin/sh} on Unix). On non-Unix systems, the program is usually invoked directly by @@ -1497,7 +1497,7 @@ @table @code @kindex path @item path @var{directory} -Add @var{directory} to the front of the @code{PATH} environment variable +Add @var{directory} to the front of the @env{PATH} environment variable (the search path for executables), for both @value{GDBN} and your program. You may specify several directory names, separated by whitespace or by a system-dependent separator character (@samp{:} on Unix, @samp{;} on @@ -1515,7 +1515,7 @@ @kindex show paths @item show paths -Display the list of search paths for executables (the @code{PATH} +Display the list of search paths for executables (the @env{PATH} environment variable). @kindex show environment @@ -1557,10 +1557,10 @@ @emph{Warning:} On Unix systems, @value{GDBN} runs your program using the shell indicated -by your @code{SHELL} environment variable if it exists (or -@code{/bin/sh} if not). If your @code{SHELL} variable names a shell +by your @env{SHELL} environment variable if it exists (or +@code{/bin/sh} if not). If your @env{SHELL} variable names a shell that runs an initialization file---such as @file{.cshrc} for C-shell, or -@file{.bashrc} for BASH---any variables you set in that file affect +@file{.bashrc} for Bash---any variables you set in that file affect your program. You may wish to move setting of environment variables to files that are only run when you sign on, such as @file{.login} or @file{.profile}. @@ -2996,7 +2996,7 @@ @item Relink your program so that the text segment is nonsharable, using the -linker option @samp{-N}. The operating system limitation may not apply +linker option @option{-N}. The operating system limitation may not apply to nonsharable executables. @end enumerate @c @end ifclear @@ -3481,7 +3481,7 @@ @cindex frameless execution Some compilers provide a way to compile functions so that they operate without stack frames. (For example, the @code{@value{GCC}} option -@samp{-fomit-frame-pointer} generates functions without a frame.) +@option{-fomit-frame-pointer} generates functions without a frame.) This is occasionally done with heavily used library functions to save the frame setup time. @value{GDBN} has limited facilities for dealing with these function invocations. If the innermost function invocation @@ -3594,7 +3594,7 @@ addition, this can be useful when your program has multiple stacks and switches between them. -On the SPARC architecture, @code{frame} needs two addresses to +On the @sc{sparc} architecture, @code{frame} needs two addresses to select an arbitrary frame: a frame pointer and a stack pointer. On the MIPS and Alpha architecture, it needs two addresses: a stack @@ -4300,9 +4300,9 @@ To solve such problems, either recompile without optimizations, or use a different debug info format, if the compiler supports several such formats. For example, @value{NGCC}, the @sc{gnu} C/C++ compiler usually -supports the @samp{-gstabs} option. @samp{-gstabs} produces debug info +supports the @option{-gstabs} option. @option{-gstabs} produces debug info in a format that is superior to formats such as COFF. You may be able -to use DWARF-2 (@samp{-gdwarf-2}), which is also an effective form for +to use DWARF-2 (@option{-gdwarf-2}), which is also an effective form for debug info. See @ref{Debugging Options,,Options for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}, for more information. @@ -5238,7 +5238,7 @@ Whenever possible, these four standard register names are available on your machine even though the machine has different canonical mnemonics, so long as there is no conflict. The @code{info registers} command -shows the canonical names. For example, on the SPARC, @code{info +shows the canonical names. For example, on the @sc{sparc}, @code{info registers} displays the processor status register as @code{$psr} but you can also refer to it as @code{$ps}; and on x86-based machines @code{$ps} is an alias for the @sc{eflags} register. @@ -5691,7 +5691,7 @@ For best results when using @sc{gnu} C++, use the stabs debugging format. You can select that format explicitly with the @code{g++} -command-line options @samp{-gstabs} or @samp{-gstabs+}. See +command-line options @option{-gstabs} or @option{-gstabs+}. See @ref{Debugging Options,,Options for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}, for more information. @@ -5954,7 +5954,7 @@ special support. In particular, if your compiler generates a.out, MIPS @sc{ecoff}, RS/6000 @sc{xcoff}, or @sc{elf} with stabs extensions to the symbol table, these facilities are all available. (With @sc{gnu} CC, -you can use the @samp{-gstabs} option to request stabs debugging +you can use the @option{-gstabs} option to request stabs debugging extensions explicitly.) Where the object code format is standard @sc{coff} or @sc{dwarf} in @sc{elf}, on the other hand, most of the C++ support in @value{GDBN} does @emph{not} work. @@ -6620,7 +6620,7 @@ The @code{@@} operator (@pxref{Expressions, ,Expressions}), while available with any language, is not useful with Modula-2. Its -intent is to aid the debugging of @dfn{dynamic arrays}, which cannot be +intent is to aid the debugging of 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. @@ -6704,10 +6704,10 @@ @item @r{@emph{Procedure mode}} The procedure mode is displayed by @code{type = PROC() - EXCEPTIONS ()}. The @code{ EXCEPTIONS ()}. The @code{} is a list of the parameter modes. @code{} indicates -the mode of the result of the procedure if any. The exceptionlist lists -all possible exceptions which can be raised by the procedure. +the mode of the result of the procedure if any. The @code{} +lists all possible exceptions which can be raised by the procedure. @ignore @item @r{@emph{Instance mode}} @@ -6762,7 +6762,7 @@ list>)}. The @code{} consists of names and modes of fields of the structure. Variant structures have the keyword @code{CASE OF ESAC} in their field list. Since the current version -of the GNU Chill compiler doesn't implement tag processing (no runtime +of the @sc{gnu} Chill compiler doesn't implement tag processing (no runtime checks of variant fields, and therefore no debugging info), the output always displays all variant fields. @smallexample @@ -7002,7 +7002,7 @@ @item @code{SQRT()} @end table -For a detailed description refer to the GNU Chill implementation manual +For a detailed description refer to the @sc{gnu} Chill implementation manual chapter 1.6. @end ignore @@ -7660,7 +7660,7 @@ 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 the @value{GDBN} working directory, -@value{GDBN} uses the environment variable @code{PATH} as a list of +@value{GDBN} uses the environment variable @env{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 @value{GDBN} and your program, using the @code{path} command. @@ -7669,7 +7669,7 @@ @file{@var{filename}.syms} may hold symbol table information for @var{filename}. If so, @value{GDBN} maps in the symbol table from @file{@var{filename}.syms}, starting up more quickly. See the -descriptions of the file options @samp{-mapped} and @samp{-readnow} +descriptions of the file options @option{-mapped} and @option{-readnow} (available on the command line, and with the commands @code{file}, @code{symbol-file}, or @code{add-symbol-file}, described below), for more information. @@ -7681,13 +7681,13 @@ @kindex exec-file @item exec-file @r{[} @var{filename} @r{]} Specify that the program to be run (but not the symbol table) is found -in @var{filename}. @value{GDBN} searches the environment variable @code{PATH} +in @var{filename}. @value{GDBN} searches the environment variable @env{PATH} if necessary to locate your program. Omitting @var{filename} means to discard information on the executable file. @kindex symbol-file @item symbol-file @r{[} @var{filename} @r{]} -Read symbol table information from file @var{filename}. @code{PATH} is +Read symbol table information from file @var{filename}. @env{PATH} is searched when necessary. Use the @code{file} command to get both symbol table and program to run from the same file. @@ -7739,18 +7739,18 @@ @item symbol-file @var{filename} @r{[} -readnow @r{]} @r{[} -mapped @r{]} @itemx file @var{filename} @r{[} -readnow @r{]} @r{[} -mapped @r{]} 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 +tables by using the @option{-readnow} option with any of the commands that load symbol table information, if you want to be sure @value{GDBN} has the entire symbol table available. If memory-mapped files are available on your system through the -@code{mmap} system call, you can use another option, @samp{-mapped}, to +@code{mmap} system call, you can use another option, @option{-mapped}, to cause @value{GDBN} to write the symbols for your program into a reusable file. Future @value{GDBN} debugging sessions map in symbol information from this auxiliary symbol file (if the program has not changed), rather than spending time reading the symbol table from the executable -program. Using the @samp{-mapped} option has the same effect as -starting @value{GDBN} with the @samp{-mapped} command-line option. +program. Using the @option{-mapped} option has the same effect as +starting @value{GDBN} with the @option{-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. @@ -7815,7 +7815,7 @@ @code{add-symbol-file} does not repeat if you press @key{RET} after using it. -You can use the @samp{-mapped} and @samp{-readnow} options just as with +You can use the @option{-mapped} and @option{-readnow} options just as with the @code{symbol-file} command, to change how @value{GDBN} manages the symbol table information for @var{filename}. @@ -7828,10 +7828,10 @@ @kindex section @item section -The @code{section} command changes the base address of section SECTION of -the exec file to ADDR. This can be used if the exec file does not contain -section addresses, (such as in the a.out format), or when the addresses -specified in the file itself are wrong. Each section must be changed +The @code{section} command changes the base address of section @var{section} of +the executable file to @var{address}. This can be used if the exec file does +not contain section addresses, (such as in the a.out format), or when the +addresses specified in the file itself are wrong. Each section must be changed separately. The @code{info files} command, described below, lists all the sections and their addresses. @@ -7860,7 +7860,7 @@ when you use the @code{run} command, or when you examine a core file. (Before you issue the @code{run} command, @value{GDBN} does not understand references to a function in a shared library, however---unless you are -debugging a core file). +debugging a core file.) On HP-UX, if the program loads a library explicitly, @value{GDBN} automatically loads the symbols at the time of the @code{shl_load} call. @@ -8043,7 +8043,7 @@ start a process and inspect its activity without abandoning your work on a core file. -For example, if you execute @samp{gdb a.out}, then the executable file +For example, if you execute @samp{@value{GDBP} 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 @value{GDBN} has two active targets and uses them in tandem, looking @@ -8186,7 +8186,7 @@ If your @value{GDBN} does not have a @code{load} command, attempting to execute it gets the error message ``@code{You can't do that when your -target is @dots{}}'' +target is @dots{}}''. The file is loaded at whatever address is specified in the executable. For some object file formats, you can specify the load address when you @@ -8300,7 +8300,7 @@ @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}. +subroutines is called a @dfn{debugging stub}. On certain remote targets, you can use an auxiliary program @code{gdbserver} instead of linking a stub into your program. @@ -8495,7 +8495,7 @@ 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 +If you do not use the @sc{gnu} C compiler, you may need other standard library subroutines as well; this varies from one stub to another, but in general the stubs are likely to use any of the common library subroutines which @code{@value{GCC}} generates as inline code. @@ -9426,7 +9426,7 @@ you need an unstripped copy of your program, since @value{GDBN} needs symbols and debugging information. Start up @value{GDBN} as usual, using the name of the local copy of your program as the first argument. -(You may also need the @w{@samp{--baud}} option if the serial line is +(You may also need the @w{@option{--baud}} option if the serial line is running at anything other than 9600@dmn{bps}.) After that, use @code{target remote} to establish communications with @code{gdbserver}. Its argument is either a device name (usually a serial device, like @@ -9495,7 +9495,7 @@ you need an unstripped copy of your program, since @value{GDBN} needs symbols and debugging information. Start up @value{GDBN} as usual, using the name of the local copy of your program as the first argument. -(You may also need the @w{@samp{--baud}} option if the serial line is +(You may also need the @w{@option{--baud}} option if the serial line is running at anything other than 9600@dmn{bps}. After that, use @code{target remote} to establish communications with @code{gdbserve.nlm}. Its argument is a device name (usually a serial device, like @@ -9880,7 +9880,7 @@ @var{keyword} is an entry in the AMD configuration file @file{udi_soc}. This file contains keyword entries which specify parameters used to connect to a29k targets. If the @file{udi_soc} file is not in your -working directory, you must set the environment variable @samp{UDICONF} +working directory, you must set the environment variable @env{UDICONF} to its pathname. @end table @@ -10410,7 +10410,7 @@ target architecture. @quotation -@emph{Warning:} if you specify @samp{-O}, but are actually trying to +@emph{Warning:} if you specify @option{-O}, but are actually trying to connect to a target system that expects the newer protocol, the connection fails, appearing to be a speed mismatch. @value{GDBN} repeatedly attempts to reconnect at several different line speeds. You can abort @@ -10427,7 +10427,7 @@ @end quotation @end table -The standard @samp{-b} option controls the line speed used on the serial +The standard @option{-b} option controls the line speed used on the serial port. @c @group @@ -10740,10 +10740,10 @@ @end table @kindex Compiling -When compiling for debugging, include the options @samp{-g} to get debug +When compiling for debugging, include the options @option{-g} to get debug information and @samp{-Ttext} to relocate the program to where you wish to -load it on the target. You may also want to add the options @samp{-n} or -@samp{-N} in order to reduce the size of the sections. Example: +load it on the target. You may also want to add the options @option{-n} or +@option{-N} in order to reduce the size of the sections. Example: @example sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N @@ -11153,7 +11153,7 @@ list, and where it writes the command history from this session when it exits. You can access this list through history expansion or through the history command editing characters listed below. This file defaults -to the value of the environment variable @code{GDBHISTFILE}, or to +to the value of the environment variable @env{GDBHISTFILE}, or to @file{./.gdb_history} (@file{./_gdb_history} on MS-DOS) if this variable is not set. @@ -11172,7 +11172,7 @@ @item set history size @var{size} Set the number of commands which @value{GDBN} keeps in its history list. This defaults to the value of the environment variable -@code{HISTSIZE}, or to 256 if this variable is not set. +@env{HISTSIZE}, or to 256 if this variable is not set. @end table @cindex history expansion @@ -11247,7 +11247,7 @@ Normally @value{GDBN} knows the size of the screen from the terminal driver software. For example, on Unix @value{GDBN} uses the termcap data base -together with the value of the @code{TERM} environment variable and the +together with the value of the @env{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 width} commands: @@ -11566,13 +11566,15 @@ @dfn{init files}. These are files named @file{.gdbinit} on Unix, or @file{gdb.ini} on DOS/Windows. @value{GDBN} reads the init file (if any) in your home directory@footnote{On DOS/Windows systems, the home -directory is the one pointed to by the @code{HOME} environment +directory is the one pointed to by the @env{HOME} environment variable.}, then processes command line options and operands, and then reads the init file (if any) in the current working directory. This is so the init file in your home directory can set options (such as @code{set complaints}) which affect the processing of the command line options and operands. The init files are not executed if you use the -@samp{-nx} option; @pxref{Mode Options, ,Choosing modes}. +@option{-nx} option +(@pxref{Mode Options, ,Choosing modes}). +@comment pxref should be used only in () !! @cindex init file name On some configurations of @value{GDBN}, the init file is known by a @@ -11584,15 +11586,15 @@ @kindex .vxgdbinit @itemize @bullet @item -VxWorks (Wind River Systems real-time OS): @samp{.vxgdbinit} +VxWorks (Wind River Systems real-time OS): @file{.vxgdbinit} @kindex .os68gdbinit @item -OS68K (Enea Data Systems real-time OS): @samp{.os68gdbinit} +OS68K (Enea Data Systems real-time OS): @file{.os68gdbinit} @kindex .esgdbinit @item -ES-1800 (Ericsson Telecom AB M68000 emulator): @samp{.esgdbinit} +ES-1800 (Ericsson Telecom AB M68000 emulator): @file{.esgdbinit} @end itemize You can also request the execution of a command file with the @@ -11747,7 +11749,7 @@ current directory, it can be easy to confuse Emacs about the location of the source files, in which case the auxiliary display buffer does not 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 +environment's @env{PATH} variable, so the @value{GDBN} input and output session proceeds normally; but Emacs does not get enough information 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 @@ -11934,7 +11936,7 @@ @c should add a web page ref... In any event, we also recommend that you send bug reports for -@value{GDBN} to this addresses: +@value{GDBN} to this address: @example bug-gdb@@gnu.org @@ -12010,13 +12012,13 @@ @item What compiler (and its version) was used to compile the program you are debugging---e.g. ``@value{GCC}--2.8.1'', or ``HP92453-01 A.10.32.03 HP -C Compiler''. For GCC, you can say @code{gcc --version} to get this +C Compiler''. For @value{NGCC}, you can say @code{gcc --version} to get this information; for other compilers, see the documentation for those compilers. @item The command arguments you gave the compiler to compile your example and -observe the bug. For example, did you use @samp{-O}? To guarantee +observe the bug. For example, did you use @option{-O}? To guarantee you will not omit something important, list them all. A copy of the Makefile (or the output from make) is sufficient. @@ -12183,7 +12185,7 @@ @TeX{} also requires a macro definitions file called @file{texinfo.tex}. This file tells @TeX{} how to typeset a document written in Texinfo format. On its own, @TeX{} cannot either read or -typeset a Texinfo file. @file{texinfo.tex} is distributed with GDB +typeset a Texinfo file. @file{texinfo.tex} is distributed with @value{GDBN} and is located in the @file{gdb-@var{version-number}/texinfo} directory. @@ -12290,7 +12292,7 @@ directories for multiple libraries or programs, such as the @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). +you tell it not to, with the @option{--norecursion} option). You can run the @code{configure} script from any of the subordinate directories in the @value{GDBN} distribution if you only want to @@ -12308,7 +12310,7 @@ 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 +the @env{SHELL} environment variable) is publicly readable. Remember that @value{GDBN} uses the shell to start your program---some systems refuse to let @value{GDBN} debug child processes whose programs are not readable. @@ -12331,11 +12333,11 @@ program specified there. To build @code{gdb} in a separate directory, run @code{configure} -with the @samp{--srcdir} option to specify where to find the source. +with the @option{--srcdir} option to specify where to find the source. (You also need to specify a path to find @code{configure} 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 is assumed.) +would be the same as the argument to @option{--srcdir}, you can leave out +the @option{--srcdir} option; it is assumed.) For example, with version @value{GDBVN}, you can build @value{GDBN} in a separate directory for a Sun 4 like this: >From eliz@delorie.com Sat Apr 01 00:00:00 2000 From: Eli Zaretskii To: Dmitry Sivachenko Cc: gdb-patches@sourceware.cygnus.com Subject: Re: patch for gdb.texinfo Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200001281722.MAA28565@indy.delorie.com> References: <200001281622.LAA27785@indy.delorie.com> <200001281642.TAA04176@netserv1.chg.ru> X-SW-Source: 2000-q1/msg00043.html Content-length: 857 Dmitry Sivachenko writes: > > Why is it a good idea to remove the @dfn here? > > Because there is no definition of 'dynamic arrays' here in the text. @dfn is not only for something that is being defined. Here's what the Texinfo manual says: Use the `@dfn' command to identify the introductory or defining use of a technical term. Use the command only in passages whose purpose is to introduce a term which will be used again or which the reader ought to know. Mere passing mention of a term for the first time does not deserve @dfn. This doesn't seem to be limited to text that defines a term. It does say that if the term is never to be used again, it doesn't deserve a @dfn. OTOH, if ``dynamic arrays'' aren't mentioned anywhere else, then why was it important to mention them here? Perhaps it should be removed altogether. >From phdm@macqel.be Sat Apr 01 00:00:00 2000 From: "Philippe De Muyter" To: ac131313@cygnus.com (Andrew Cagney) Cc: gdb-patches@sourceware.cygnus.com Subject: Re: PATCH/RFA : m68k_find_saved_regs Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003241031.LAA03585@mail.macqel.be> References: <38DADC6D.5EDF1966@cygnus.com> X-SW-Source: 2000-q1/msg00984.html Content-length: 520 Andrew Cagney wrote : > You're is the third person today :-) Could people please separate out > the ChangeLog entry. Having it lurking in a patch is dangerous :-). Actually, as I intended to commit the patch myself, and submitted it only for review, it was easier for me to merely integrate the result of `cvs diff' in my mail. And, as I had mentionned it it my mail, I even had added `-b' to the `diff' options, to make the diffs more readable for review, but perhaps rendering it unsuitable for `patch'. Philippe >From guo@cup.hp.com Sat Apr 01 00:00:00 2000 From: Jimmy Guo To: gdb-patches@sourceware.cygnus.com Subject: regression analysis: gdb.sum postprocessing script Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: X-SW-Source: 2000-q1/msg00990.html Content-length: 28607 Here is a Perl script I wrote to postprocess one or more gdb.sum files and provide a complete dejagnu test outcome summary (or diff if more than one gdb.sum files are given). It's most useful if you want to have a complete view of regression status between two source trees and/or if you set up your testing to run multiple passes (to see how a test point behaves in different passes), however you can use it just on one test run's gdb.sum file and play around with the options to get test outcome presented in a much organized and useful way than going through the flat gdb.sum file. I don't know if this is useful to keep around in the repository ... - Jimmy Guo, guo@cup.hp.com Index: gdbsum /usr/local/bin/diff -c -w -L gdbsum gdbsum.orig gdbsum *** gdbsum.orig --- gdbsum Wed Jan 26 16:48:40 2000 *************** *** 0 **** --- 1,1050 ---- + #!/usr/local/bin/perl + + # + # gdbsum - smart gdb.sum filter / merge / diff utility + # + # Command line: + # gdbsum [] [ ...] + # + # : + # [-no-f/ail] don't list FAIL + # [-no-xfa/il] don't list XFAIL + # [-no-xpa/ss] don't list XPASS + # [-no-unr/esolved] don't list UNRESOLVED + # [-no-ski/pped] don't list skipped tests + # [-no-oth/er] don't list unclassfiable outputs + # [-runpass ] list only the run pass(es) specified in the + # space delimited run pass list (string). + # + # - the default is to list all + # + # identifier for the run corresponding to + # pathname of gdb.sum file + # + # - if one pair specified, produce filtered test + # result to stdout + # - if multiple pairs specified, produce a + # difference of filtered test result to stdout + # + + # initialize + # + &init; + + # parse command line args + # + &parseCmdLine; + $do_diff = 1 if ($#sum_ids > 0); + + # parse all gdb.sum files specified + # + $sum_seq = 0; + while ($sum_seq <= $#sum_ids) { + &parseSumFile($sum_seq, $sum_files[$sum_seq]); + $sum_seq++; + } + + # merge all passes from multiple runs + # + $tmp = " $passes[0] "; + @allpasses = split(/\s+/, $passes[0]); + for ($sum_seq = 1; $sum_seq <= $#sum_ids; $sum_seq++) { + @tmps = split(/\s+/, $passes[$sum_seq]); + foreach $pass (@tmps) { + push(@allpasses, $pass) + if (index($tmp, " $pass ") == -1); + } + $tmp = ' '.join(" ", @allpasses).' '; + } + @allpasses = sort @allpasses; + + # merge all tests from multiple runs + # + $tmp = " $tests[0] "; + @alltests = split(/\s+/, $tests[0]); + for ($sum_seq = 1; $sum_seq <= $#sum_ids; $sum_seq++) { + @tmps = split(/\s+/, $tests[$sum_seq]); + foreach $test (@tmps) { + push(@alltests, $test) + if (index($tmp, " $test ") == -1); + } + $tmp = ' '.join(" ", @alltests).' '; + } + @alltests = sort @alltests; + + # print filtered / diff'd output to stdout + # + print $errbuf if ($errbuf ne ''); + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + print " <$sum_seq>:" if ($do_diff); + print " $sum_ids[$sum_seq]\n"; + print " # of expected passes $p_cnts[$sum_seq]\n"; + print " # of unexpected failures $f_cnts[$sum_seq]\n"; + print " # of unexpected successes $xpa_cnts[$sum_seq]\n"; + print " # of expected failures $xfa_cnts[$sum_seq]\n"; + print " # of unresolved testcases $unr_cnts[$sum_seq]\n"; + print " # of unsupported tests $ski_cnts[$sum_seq]\n"; + } + print "\n"; + + # list 'others' first + # these are usually caused by test / system problems + # that need to be resolved + # + &printOthers if (! $no_other); + + # list FAIL, XPASS, XFAIL, and UNRESOLVED test entries + # + &printEntries if (! ($no_fail && $no_xfail && no_xpass && $no_unr)); + + # list skipped tests + # + &printSkipped if (! $no_ski); + + # done + # + exit 0; + + + # + # init + # + # Function: - initialize program + # Accepts: - (none) + # Returns: - (initializes global variables) + # + sub init + { + $this = $0; + $this =~ s/^.*\/([^\/]+)$/$1/; + + # listing options + # + $no_fail = + $no_xfail = + $no_xpass = + $no_unr = + $no_ski = + $no_other = 0; + + # space delimited list of run passes to provide summary on + # + $runpass = ''; + + # gdb.sum ids + # + @sum_ids = (); + + # gdb.sum file pathnames + # + @sum_files = (); + + # test result anchor + # + $anchor = '=== gdb Summary ==='; + + # error message buffer + # + $errbuf = ''; + + # diff'd output? + # + $do_diff = 0; + + # array of all multipass passes seen + # indexed by + # value is space-delimited string of pass names + @passes = (); + + # array of all tests seen + # indexed by '' + # value is space-delimited list of test pathnames + # + @tests = (); + + # hash of test point entries and outcome + # keyed by ' ' + # value is ' ' + # + %entries = (); + + # hash of unclassifiable errors + # keyed by ' ' + # value is multiline output + # + %others = (); + + # hash of test point entries and outcome for all passes + # keyed by '' + # value is '( )+' + # + %allentries = (); + + # array of all multipass passes seen in all runs + # + @allpasses = (); + + # array of all tests seen in all runs + # + @alltests = (); + + # array of counts of all PASS for a gdb.sum file + # indexed by '' + # value is count + # + @p_cnts = (); + + # array of counts of all FAIL for a gdb.sum file + # indexed by '' + # value is count + # + @f_cnts = (); + + # array of counts of all XPASS for a gdb.sum file + # indexed by '' + # value is count + # + @xpa_cnts = (); + + # array of counts of all XFAIL for a gdb.sum file + # indexed by '' + # value is count + # + @xfa_cnts = (); + + # array of counts of all UNRESOLVED tests for a gdb.sum file + # indexed by '' + # value is count + # + @unr_cnts = (); + + # array of counts of all skipped (unsupported) tests for a gdb.sum file + # indexed by '' + # value is count + # + @ski_cnts = (); + } + + # + # parseCmdLine + # + # Function: - parse program command line arguments + # Accepts: - (none) + # Returns: - (none) + # + sub parseCmdLine + { + local($arg, $arg2, $seen_quick); + + &usage('') if ($#ARGV < 1); + + $seen_quick = 0; + + while ($#ARGV >= 0) { + $arg = shift @ARGV; + + if ($arg =~ /^-no-f/) { + if ($seen_quick) { + $errbuf .= "(warning): -quick overrides -no-fail\n"; + } else { + $no_fail = 1; + } + } elsif ($arg =~ /^-no-xfa/) { + $no_xfail = 1; + } elsif ($arg =~ /^-no-xpa/) { + $no_xpass = 1; + } elsif ($arg =~ /^-no-unr/) { + $no_unr = 1; + } elsif ($arg =~ /^-no-ski/) { + $no_ski = 1; + } elsif ($arg =~ /^-no-oth/) { + $no_other = 1; + } elsif ($arg =~ /^-quick/) { + $errbuf .= "(warning): -quick overrides -no-fail\n" + if ($no_fail); + $no_fail = 0; + $no_xfail = $no_xpass = $no_unr = $no_ski = $no_other = 1; + $seen_quick = 1; + } elsif ($arg eq '-runpass') { + &usage("(error): need -runpass argument pair") + if ($#ARGV == -1); + $runpass = shift @ARGV; + $runpass = ' '.$runpass.' '; + } else { + &usage("(error): need argument pair") + if ($#ARGV == -1); + $arg2 = shift @ARGV; + &usage("(error): cannot read gdb.sum file '$arg2'") + if ((! -f $arg2) || (! -r $arg2)); + system("grep -q '$anchor' $arg2"); + $rc = ($? >> 8); + if ($rc) { + $errbuf .= "(warning): $arg2 ($arg) incomplete, skipped ...\n"; + } else { + push(@sum_ids, $arg); + push(@sum_files, $arg2); + } + } + } + + &usage("$errbuf"."(error): need argument pair") + if ($#sum_ids == -1); + + print STDERR "$this $errbuf" if ($errbuf ne ''); + } + + + # + # parseSumFile + # + # Function: - parse a gdb.sum file and stuff test result info into + # hash tables + # Accepts: - sum_seq: sequence number of gdb.sum file + # - sum_file: pathname of gdb.sum file + # Returns: - (modifies global hash tables) + # + sub parseSumFile + { + local($sum_seq, $sum_file) = @_; + local($pass, $test, $testname, $entry); + local($skippass); + + open(SUMFILE, $sum_file) || + die "$this: (error): cannot read gdb.sum file '$sum_file'"; + + # initialize counts + # + $p_cnts[$sum_seq] = + $f_cnts[$sum_seq] = + $xpa_cnts[$sum_seq] = + $xfa_cnts[$sum_seq] = + $unr_cnts[$sum_seq] = + $ski_cnts[$sum_seq] = 0; + + # skip the gdb.sum header + # + $pass = ' '; + $test = ''; + $skippass = 0; + + while () { + chop; + + if (/^Running pass \`(.+)\'\s+\.\.\.\s*$/) { + # seen a multipass pass + # record the pass + # + if (($runpass ne '') && (index($runpass, " $1 ") == -1)) { + $skippass = 1; + next; + } else { + $skippass = 0; + $pass = $1; + $passes[$sum_seq] = $pass; + } + } elsif ($skippass) { + # we've seen a multipass pass, and we skipped it since it's + # not what the user wanted us to summarize on. + # skip all info associated with the skipped pass until we + # see the next pass. + # + next; + } elsif (/^Running.+testsuite\/(.+)\s+\.\.\.\s*$/) { + # seen the first test + # $test is pathname of test under testsuite/ + # + $test = $1; + + # $testname is what runtest spits out, e.g. + # if $test is gdb.hp/gdb.base-hp/foo.exp, + # $testname is gdb.base-hp/foo.exp + # (this is to handle the unexpected case where + # a directory's basename is the same as another directory's) + # + $testname = $test; + $testname = $1 if ($testname =~ /\/([^\/]+\/[^\/]+)$/); + # + # escape regexp characters in $testname, e.g. c++ -> c\+\+, + # since we need to use $testname in regexp pattern matching later on + # + $testname =~ s/\+/\\+/g; + $testname =~ s/\?/\\?/g; + $testname =~ s/\*/\\*/g; + + # break out of loop since we've found the starting location + # of test result summary + last; + } + } + + # if we didn't find any test, just return + # + return if ($test eq ''); + + # if we've skipped to the end of the file without finding + # any pass to start on, just return. + # + return if ($skippass); + $skippass = 0; + + # for no-multipass add the '1' pass identifier + # (this is to handle the case when multipass is not defined for the test run) + # + if ($pass eq ' ') { + $pass = '1'; + $passes[$sum_seq] = $pass; + } + + # initialize %tests, %entries, and %others hash table entries + # + &initTestInfo($sum_seq, $pass, $test); + + # parse each line of test result summary until done + # + while () { + chop; + + if (/^\s*$/) { + # empty line, ignore + # + next; + } elsif (/^Running pass \`(.+)\'\s+\.\.\.\s*$/) { + # another multipass pass + # + + # chop the last \n from %entries and %others hash table entries + # (this is for the last test in this multipass pass) + # ... we must only do this once + # + if (! $skippass) { + if (defined($entries{"$sum_seq $pass $test"})) { + chop $entries{"$sum_seq $pass $test"}; + $ski_cnts[$sum_seq]++ + if ($entries{"$sum_seq $pass $test"} eq ''); + } + + if (defined($others{"$sum_seq $pass $test"})) { + chop $others{"$sum_seq $pass $test"}; + } + } + + if (($runpass ne '') && (index($runpass, " $1 ") == -1)) { + $skippass = 1; + next; + } else { + $skippass = 0; + $pass = $1; + $passes[$sum_seq] .= ' '.$pass; + } + } elsif (/^\s+$anchor\s*$/) { + # end of test result body + # + + # chop the last \n from %entries and %others hash table entries + # (this is for the last test in the whole test run) + # ... we must only do this once + # + if (! $skippass) { + if (defined($entries{"$sum_seq $pass $test"})) { + chop $entries{"$sum_seq $pass $test"}; + $ski_cnts[$sum_seq]++ + if ($entries{"$sum_seq $pass $test"} eq ''); + } + + if (defined($others{"$sum_seq $pass $test"})) { + chop $others{"$sum_seq $pass $test"}; + } + } + + # we're done parsing this file + # + last; + } elsif ($skippass) { + # we've seen a multipass pass, and we skipped it since it's + # not what the user wanted us to summarize on. + # skip all info associated with the skipped pass until we + # see the next pass. + # + next; + } elsif (/^Running.+testsuite\/(.+)\s+\.\.\.\s*$/) { + # another test + # + + # chop the last \n from %entries and %others hash table entries + # + if (defined($entries{"$sum_seq $pass $test"})) { + chop $entries{"$sum_seq $pass $test"}; + $ski_cnts[$sum_seq]++ + if ($entries{"$sum_seq $pass $test"} eq ''); + } + + if (defined($others{"$sum_seq $pass $test"})) { + chop $others{"$sum_seq $pass $test"}; + } + + # setup for the next test + # + $test = $1; + + $testname = $test; + $testname = $1 if ($testname =~ /\/([^\/]+\/[^\/]+)$/); + $testname =~ s/\+/\\+/g; + $testname =~ s/\?/\\?/g; + $testname =~ s/\*/\\*/g; + + &initTestInfo($sum_seq, $pass, $test); + } elsif (/^PASS:.*$testname: (.+)\s*$/) { + # PASS + # + $p_cnts[$sum_seq]++; + $entry = $1; + $entry =~ s/\s+/ /g; + $entries{"$sum_seq $pass $test"} .= "P $entry\n"; + } elsif (/^FAIL:.*$testname: (.+)\s*$/) { + # FAIL + # + $f_cnts[$sum_seq]++; + $entry = $1; + $entry =~ s/\s+/ /g; + if ($entry =~ /\(timeout\)/) { + $entry =~ s/ \(timeout\)//; + $entry =~ s/\(timeout\) //; + $entries{"$sum_seq $pass $test"} .= "FTM $entry\n"; + } else { + $entries{"$sum_seq $pass $test"} .= "F $entry\n"; + } + } elsif (/^XFAIL:.*$testname: (.+)\s*$/) { + # XFAIL + # + $xfa_cnts[$sum_seq]++; + $entry = $1; + $entry =~ s/\s+/ /g; + $entry =~ s/ \(PRMS [^\)]+\)//; + $entry =~ s/\(PRMS [^\)]+\) //; + if ($entry =~ /\(timeout\)/) { + $entry =~ s/ \(timeout\)//; + $entry =~ s/\(timeout\) //; + $entries{"$sum_seq $pass $test"} .= "XTM $entry\n"; + } else { + $entries{"$sum_seq $pass $test"} .= "XFA $entry\n"; + } + } elsif (/^XPASS:.*$testname: (.+)\s*$/) { + # XPASS + # + $xpa_cnts[$sum_seq]++; + $entry = $1; + $entry =~ s/\s+/ /g; + $entry =~ s/ \(PRMS [^\)]+\)//; + $entry =~ s/\(PRMS [^\)]+\) //; + $entries{"$sum_seq $pass $test"} .= "XPA $entry\n"; + } elsif (/^UNRESOLVED:.*$testname: (.+)\s*$/) { + # UNRESOLVED + # + $unr_cnts[$sum_seq]++; + $entry = $1; + $entry =~ s/\s+/ /g; + $entries{"$sum_seq $pass $test"} .= "UNR $entry\n"; + } else { + # other unclassifiable line, e.g. + # verbose compilation failures, ERRORs, etc. + # + if (defined($others{"$sum_seq $pass $test"})) { + # only interested in specific test related junks, + # in case junks are seen after a multipass id line but + # before a test id line + # + $others{"$sum_seq $pass $test"} .= $_."\n"; + } + } + } + + close(SUMFILE); + } + + + # + # initTestInfo + # + # Function: - initialize test information variables + # Accepts: - sum_seq: gdb.sum file sequence number + # - pass: multipass pass id + # - test: test pathname + # Returns: - (modifies global hash tables) + # + sub initTestInfo + { + local($sum_seq, $pass, $test) = @_; + + if (! defined($tests[$sum_seq])) { + $tests[$sum_seq] = $test; + } else { + $tests[$sum_seq] .= ' '.$test + if (index(" $tests[$sum_seq] ", " $test ") == -1); + } + + $entries{"$sum_seq $pass $test"} = ''; + $others{"$sum_seq $pass $test"} = ''; + } + + + # + # printOthers + # + # Function: - prints unclassifiable test result output + # Accepts: - (none) + # Returns: - (none) + # + sub printOthers + { + local($sum_seq); + local($seen, $othcnt, $prevbuf, $printed, $pass, $indent); + + $indent = 8; + $indent += 5 if ($do_diff); + + &printHeader("Unknown", ''); + foreach $test (@alltests) { + $printed = 0; + foreach $pass (@allpasses) { + $seen = 0; + $othcnt = 0; + $prevbuf = ''; + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + if (defined($others{"$sum_seq $pass $test"}) + && + ($others{"$sum_seq $pass $test"} ne '')) { + $othcnt++; + if ($sum_seq == 0) { + $prevbuf = $others{"$sum_seq $pass $test"}; + } elsif ($prevbuf ne $others{"$sum_seq $pass $test"}) { + $seen = 1; + last; + } + } + } + $seen = 1 if (($othcnt != 0) + && + ((! $do_diff) || ($othcnt != $#sum_ids+1))); + if ($seen) { + print "$test\n" if (! $printed); + $printed = 1; + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + if (! defined($others{"$sum_seq $pass $test"})) { + if ($do_diff) { + print " <$sum_seq>:"; + print &listPcodes($pass); + print "\n"; + } + } elsif ($others{"$sum_seq $pass $test"} eq '') { + if ($do_diff) { + print " <$sum_seq>:"; + print &listPcodes($pass); + print "\n"; + } + } else { + print " <$sum_seq>:" if ($do_diff); + print &listPcodes($pass); + print join("\n".(' 'x$indent), + split(/\n+/, $others{"$sum_seq $pass $test"})); + print "\n"; + } + } + print "\n"; + } + } + } + } + + + # + # printEntries + # + # Function: - prints FAIL/XFAIL/XPASS/UNRESOLVED test entries + # Accepts: - (none) + # Returns: - (none) + # + sub printEntries + { + local($tmp, $test); + + $tmp = ''; + $tmp .= 'FAIL / ' if (! $no_fail); + $tmp .= 'XFAIL / ' if (! $no_xfail); + $tmp .= 'XPASS / ' if (! $no_xpass); + $tmp .= 'UNRESOLVED / ' if (! $no_xpass); + chop $tmp; chop $tmp; chop $tmp; + + &printHeader($tmp, + '(P:PASS F:FAIL FTM:FAIL/timeout XFA:XFAIL XTM:XFAIL/timeout XPA:XPASS UNR:UNRESOLVED SKI:skipped \'-\':not run)'); + + &mergeEntries; + + foreach $test (@alltests) { + if ((defined($allentries{$test})) && ($allentries{$test} ne '')) { + print "$test\n$allentries{$test}"; + print "\n" if (! $do_diff); + } + } + } + + + # + # printSkipped + # + # Function: - prints skipped tests + # Accepts: - (none) + # Returns: - (none) + # + sub printSkipped + { + local($sum_seq); + local($seen, $skicnt, $pass, @pcodes); + + &printHeader('Skipped', 'ran:Tested SKI:Skipped \'-\':Not run'); + foreach $test (@alltests) { + $seen = 0; + foreach $pass (@allpasses) { + $skicnt = 0; + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + if ((defined($entries{"$sum_seq $pass $test"})) + && + ($entries{"$sum_seq $pass $test"} eq '')) { + $skicnt++; + } + } + $seen = 1 if (($skicnt != 0) + && + ((! $do_diff) || ($skicnt != $#sum_ids+1))); + last if ($seen); + } + if ($seen) { + print "$test\n"; + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + @pcodes = (); + foreach $pass (@allpasses) { + if (! defined($entries{"$sum_seq $pass $test"})) { + push(@pcodes, '-'); + } elsif ($entries{"$sum_seq $pass $test"} eq '') { + push(@pcodes, 'SKI'); + } else { + push(@pcodes, 'ran'); + } + } + print " <$sum_seq>:" if ($do_diff); + print &listPcodes(@pcodes); + print "\n"; + } + print "\n"; + } + } + } + + + # + # mergeEntries + # + # Function: - merge %entries hash into %allentries hash for print + # Accepts: - (none) + # Returns: - (modifies global hash tables) + # + sub mergeEntries + { + local($sum_seq, $test, $pass); + local(@allentrynames); + local(@entrybufs, $pcode, $entryname); + local(%entrylookup); + local($failcnt, $failtmcnt, $xfailcnt, $xpasscnt, $unrcnt); + local($i, $j, $seen); + local(@pcodes); + + foreach $test (@alltests) { + $allentries{$test} = ''; + + # merge all entry names from all passes of all runs for $test + # + @allentrynames = (); + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + foreach $pass (@allpasses) { + @allentrynames = &mergeEntryNames($sum_seq, $pass, $test, + @allentrynames); + } + } + next if ($#allentrynames == -1); + + # create entryname -> pcode lookup hash grouped by sum_seq and pass id + # + %entrylookup = (); + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + foreach $pass (@allpasses) { + if (! defined($entries{"$sum_seq $pass $test"})) { + for ($i = 0; $i <= $#allentrynames; $i++) { + $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"} = '-'; + } + } elsif ($entries{"$sum_seq $pass $test"} eq '') { + for ($i = 0; $i <= $#allentrynames; $i++) { + $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"} = 'SKI'; + } + } else { + @entrybufs = split(/\n+/, $entries{"$sum_seq $pass $test"}); + $i = $j = 0; + while ($i <= $#allentrynames) { + if ($j > $#entrybufs) { + $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"} = '-'; + } else { + $entrybufs[$j] =~ /^([PFXATMUNRSKI\-]+) (.+)$/; + $pcode = $1; + $entryname = $2; + if ($entryname ne $allentrynames[$i]) { + $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"} = '-'; + } else { + $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"} = $pcode; + $j++; + } + } + $i++; + } + } + } + } + + # filter entries + # + for ($i = 0; $i <= $#allentrynames; $i++) { + $seen = 0; + foreach $pass (@allpasses) { + $failcnt = $failtmcnt = + $xfailcnt = $xfailtmcnt = + $xpasscnt = $unrcnt = 0; + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + $pcode = $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"}; + if ($pcode eq 'F') { + $failcnt++; + } elsif ($pcode eq 'FTM') { + $failtmcnt++; + } elsif ($pcode eq 'XFA') { + $xfailcnt++; + } elsif ($pcode eq 'XFM') { + $xfailtmcnt++; + } elsif ($pcode eq 'XPA') { + $xpasscnt++; + } elsif ($pcode eq 'UNR') { + $unrcnt++; + } + } + if ((!$no_fail) && ($failcnt || $failtmcnt)) { + $seen = 1 if ((! $do_diff) + || + ($failcnt != 0) && ($failcnt != $#sum_ids+1) + || + ($failtmcnt != 0) && ($failtmcnt != $#sum_ids+1)); + } + if ((!$no_xfail) && ($xfailcnt || $xfailtmcnt)) { + $seen = 1 if ((! $do_diff) + || + ($xfailcnt != 0) && ($xfailcnt != $#sum_ids+1) + || + ($xfailtmcnt != 0) && ($xfailtmcnt != $#sum_ids+1)); + } + if ((!$no_xpass) && $xpasscnt) { + $seen = 1 if ((! $do_diff) || ($xpasscnt != $#sum_ids+1)); + } + if ((!$no_unr) && $unrcnt) { + $seen =1 if ((! $do_diff) || ($unrcnt != $#sum_ids+1)); + } + last if ($seen); + } + + # merge pass + # + if ($seen) { + for ($sum_seq = 0; $sum_seq <= $#sum_ids; $sum_seq++) { + $allentries{$test} .= " <$sum_seq>:" if ($do_diff); + @pcodes = (); + foreach $pass (@allpasses) { + push(@pcodes, $entrylookup{"$sum_seq $pass $i $allentrynames[$i]"}); + } + $allentries{$test} .= &listPcodes(@pcodes); + $allentries{$test} .= "$allentrynames[$i]\n"; + } + $allentries{$test} .= "\n" if ($do_diff); + } + } + } + } + + + # + # mergeEntryNames + # + # Function: - merge two list of entries into one + # Accepts: - sum_seq: gdb.sum sequence number + # - pass: multipass pass id + # - test: test pathname + # - allentrynames: array to merge into + # Returns: - array of merged entry names + # + sub mergeEntryNames + { + local($sum_seq, $pass, $test, @allentrynames) = @_; + local(@entrynames, $entryname); + local($insidx, $srcidx, $dstidx, $seen); + + @entrynames = split(/\n+/, $entries{"$sum_seq $pass $test"}); + foreach $entryname (@entrynames) { + $entryname =~ s/^[^ ]+ //; + } + + # initial insertion point is end of @allentrynames + # + $insidx = $#allentrynames + 1; + + # seek insertion starting from the end of @entrynames + # + for ($srcidx = $#entrynames; $srcidx >= 0; $srcidx--) { + $seen = 0; + + # look for the same item in @allentrynames + # starting from the last insertion point moving towards the array head + # + for ($dstidx = $insidx - 1; $dstidx >= 0; $dstidx--) { + if ($entrynames[$srcidx] eq $allentrynames[$dstidx]) { + # seen the same item, skip insertion + # move insertion point forward to this item + # + $seen = 1; + $insidx = $dstidx; + last; + } + } + + if (! $seen) { + # no match + # put the entry just ahead of the last inserted item + # + splice(@allentrynames, $insidx, 0, $entrynames[$srcidx]); + } + } + + return(@allentrynames); + } + + + # + # printHeader + # + # Function: - print filter output header + # Accepts: - section name + # - legend string + # Returns: - (none) + # + sub printHeader + { + local($what, $legend) = @_; + local($indent, $str, $i); + + print '-'x72, "\n", " Section - $what\n"; + + $indent = 1; + print ' '; + if ($do_diff) { + $indent += 5; + print ' '; + } + + if ($legend) { + for ($i = 0; $i <= $#allpasses; $i++) { + print '|'.(' 'x((3-length($allpasses[$i]))/2)).$allpasses[$i]. + (' 'x((3-length($allpasses[$i]))/2)); + $indent += 4; + } + print '|: '; + $indent += 3; + while ((length($legend) + $indent) > 72) { + $str = substr($legend, 0, 72 - $indent); + $legend = substr($legend, 72 - $indent); + $i = rindex($str, ' '); + if (($i != -1) && ($i != length($str) - 1)) { + $legend = substr($str, $i+1).$legend; + $str = substr($str, 0, $i); + } + print "$str\n"; + print ' 'x($indent+1); + } + print $legend; + } else { + print '||: '; + } + + print "\n", '-'x72, "\n"; + } + + + # + # listPcodes + # + # Function: - lists passcodes prefix + # Accepts: - pass codes + # Returns: - prefix string + # + sub listPcodes + { + local(@pcodes) = @_; + local($pcode); + local($buf); + + $buf = ' '; + foreach $pcode (@pcodes) { + $buf .= '|'.(' 'x((3-length($pcode))/2)).$pcode. + (' 'x((3-length($pcode))/2)); + } + $buf .= '|: '; + + return($buf); + } + + + # + # usage + # + # Function: - prints tool usage and exits + # Accepts: - error message + # Returns: - exits program + # + sub usage + { + local($msg) = @_; + + print STDERR "$this: $msg\n" if ($msg); + + print STDERR " + $this - smart gdb.sum filter / merge / diff utility + + Command line: + $this [] [ ...] + + : + [-no-f/ail] don't list FAIL + [-no-xfa/il] don't list XFAIL + [-no-xpa/ss] don't list XPASS + [-no-unr/esolved] don't list UNRESOLVED + [-no-ski/pped] don't list skipped tests + [-no-oth/er] don't list unclassfiable outputs + [-quick] list FAIL only. + + [-runpass ] list only the run pass(es) specified in the + space delimited run pass list (string). + + - the default is to list all + + identifier for the run corresponding to + pathname of gdb.sum file + + - if one pair specified, produce filtered test + result to stdout + - if multiple pairs specified, produce a + difference of filtered test result to stdout + + "; + + exit 1; + }