Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: RFA: minor watchpoint code cleanup
       [not found] <200003180006.TAA26919@zwingli.cygnus.com>
@ 2000-03-19  1:45 ` Eli Zaretskii
       [not found]   ` <200003192255.e2JMtcs00643@delius.kettenis.local>
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2000-03-19  1:45 UTC (permalink / raw)
  To: jimb; +Cc: gdb-patches

> This is just a cosmetic change.  Let me know.
> 
> 2000-03-17  Jim Blandy  <jimb@redhat.com>
> 
> 	* i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
> 	two-dimensional array, instead of faking it with explicit index
> 	arithmetic.

While we are talking: someone (H.J. Lu?) suggested to make the
watchpoint insertion code common to all x86 targets.  What's the
current say-so on this?

It seems like a good idea to me.  In particular, i386v-nat.c could use
some of the trickery, bug-fixes and features from go32-nat.c ;-).
For example, note that the function which removes non-aligned
watchpoints, doesn't go through the same routine as the insert
function does (does that mean that nobody has ever tried to use non-
aligned watchpoints on SysV?).

(And go32-nat.c should probably get the same change as you did above.)
From eliz@delorie.com Sun Mar 19 01:46:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: jimb@zwingli.cygnus.com
Cc: john@feith.com, gdb-patches@sourceware.cygnus.com
Subject: Re: GDB 4.17 Patch for stack aligned i386 code
Date: Sun, 19 Mar 2000 01:46:00 -0000
Message-id: <200003190946.EAA07460@indy.delorie.com>
References: <200003062256.RAA10752@jwlab.FEITH.COM> <npk8j187fh.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-03/msg00340.html
Content-length: 1112

> > >> Just curious what the status is of my patch for debugging
> > >> frame pointerless i386 code.  Last we "spoke" (on March 9)
> > >> Jim B was going to look at it.  Is it still in the queue?
> > >> Are there any issues with it that I need to address?
> > >
> > > Yes, I'm still on the spot for this.  It's definitely on my queue, and
> > > towards the top.
> > >
> > > I won't reject it without letting you know why. :)
> > 
> > Figured since it's been a few months it was safe to ping you
> > again regarding the status of this patch. :-)
> 
> Sorry --- I still haven't had a chance to look at it.  Since we have
> more maintainers now, it's more likely the cycles will arise, so I'll
> re-post the patch here.

Is it possible to tell a bit more about the problem, and how is it
solved?  Perhaps even a short test case, before and after the change?

Also, do the original problems affect Solaris alone, or are they
common to all gcc/x86-based architectures?

It's quite difficult to judge a large patch for two different problems
without having a more-or-less clear notion of the issues involved.

Thanks.
From eliz@delorie.com Sun Mar 19 04:10:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] Shut up compiler warnings in ser-go32.c
Date: Sun, 19 Mar 2000 04:10:00 -0000
Message-id: <200003191210.HAA08353@indy.delorie.com>
X-SW-Source: 2000-03/msg00341.html
Content-length: 901

I committed today the following patch:

2000-03-17  Eli Zaretskii  <eliz@is.elta.co.il>

	* ser-go32.c (ports): Make the initializers complete, to pacify
	GCC 2.9X.


--- gdb/ser-go32.c~2	Tue Mar 14 22:12:12 2000
+++ gdb/ser-go32.c	Sat Mar 18 15:23:12 2000
@@ -214,19 +214,19 @@ static struct dos_ttystate
 ports[4] =
 {
   {
-    COM1ADDR, 4
+    COM1ADDR, 4, 0, NULL, 0, 0, "", 0, 0, 0, 0, 0, 0, 0, 0
   }
   ,
   {
-    COM2ADDR, 3
+    COM2ADDR, 3, 0, NULL, 0, 0, "", 0, 0, 0, 0, 0, 0, 0, 0
   }
   ,
   {
-    COM3ADDR, 4
+    COM3ADDR, 4, 0, NULL, 0, 0, "", 0, 0, 0, 0, 0, 0, 0, 0
   }
   ,
   {
-    COM4ADDR, 3
+    COM4ADDR, 3, 0, NULL, 0, 0, "", 0, 0, 0, 0, 0, 0, 0, 0
   }
 };
 
@@ -879,6 +879,7 @@ static struct serial_ops dos_ops =
   dos_setbaudrate,
   dos_setstopbits,
   dos_noop,			/* wait for output to drain */
+  (void (*)(serial_t, int))NULL	/* change into async mode */
 };
 
 
From eliz@delorie.com Sun Mar 19 04:15:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] "make install" in mmalloc to work on MS-DOS
Date: Sun, 19 Mar 2000 04:15:00 -0000
Message-id: <200003191215.HAA08359@indy.delorie.com>
X-SW-Source: 2000-03/msg00342.html
Content-length: 802

The following patch is required so that "make install" would work on
filesystems where libmmalloc.a.n is not a valid file name.

Okay to commit?

2000-03-17  Eli Zaretskii  <eliz@is.elta.co.il>

	* Makefile.in (install): Append "n", not ".n" to libmmalloc.a,
	since the latter loses on DOS 8+3 filesystems.

--- mmalloc/Makefile.i~0	Fri Apr 16 03:55:28 1999
+++ mmalloc/Makefile.in	Fri Mar 17 14:32:50 2000
@@ -121,9 +121,9 @@
 #	./a.out
 
 install:	all
-		$(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n
-		$(RANLIB) $(libdir)/$(TARGETLIB).n
-		mv -f $(libdir)/$(TARGETLIB).n $(libdir)/$(TARGETLIB)
+		$(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB)n
+		$(RANLIB) $(libdir)/$(TARGETLIB)n
+		mv -f $(libdir)/$(TARGETLIB)n $(libdir)/$(TARGETLIB)
 
 $(TARGETLIB):	$(TARGETOBJS)
 		$(RM) -rf $@
From eliz@delorie.com Sun Mar 19 04:19:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] "OVERLAY ON" does not exist.
Date: Sun, 19 Mar 2000 04:19:00 -0000
Message-id: <200003191218.HAA08362@indy.delorie.com>
X-SW-Source: 2000-03/msg00343.html
Content-length: 982

Caught this small glitch while running the test suite.

Okay to commit?

2000-03-16  Eli Zaretskii  <eliz@is.elta.co.il>

	* symfile.c (map_overlay_command, unmap_overlay_command): Fix
	error message: there's no "overlay on" command.

--- gdb/symfile.c~0	Thu Feb  3 06:35:14 2000
+++ gdb/symfile.c	Thu Mar 16 22:57:26 2000
@@ -2912,7 +2912,7 @@
   asection *bfdsec;
 
   if (!overlay_debugging)
-    error ("Overlay debugging not enabled.  Use the 'OVERLAY ON' command.");
+    error ("Overlay debugging not enabled.  Use the 'OVERLAY AUTO' command.");
 
   if (args == 0 || *args == 0)
     error ("Argument required: name of an overlay section");
@@ -2962,7 +2962,7 @@
   struct obj_section *sec;
 
   if (!overlay_debugging)
-    error ("Overlay debugging not enabled.  Use the 'OVERLAY ON' command.");
+    error ("Overlay debugging not enabled.  Use the 'OVERLAY AUTO' command.");
 
   if (args == 0 || *args == 0)
     error ("Argument required: name of an overlay section");
From eliz@delorie.com Sun Mar 19 04:25:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] Support for building with DJGPP
Date: Sun, 19 Mar 2000 04:25:00 -0000
Message-id: <200003191224.HAA08367@indy.delorie.com>
X-SW-Source: 2000-03/msg00344.html
Content-length: 26903

I committed today the following patches which allow to build GDB with
DJGPP tools.

2000-03-17  Eli Zaretskii  <eliz@is.elta.co.il>

	* config/djgpp/djconfig.sh: New file.
	* config/djgpp/config.sed: New file.
	* config/djgpp/README: New file.
	* config/djgpp/fnchange.lst: New file.
	* config/djgpp/djcheck.sh: New file.


--- /dev/null	Fri Mar 17 19:01:45 2000
+++ gdb/config/djgpp/djconfig.sh	Fri Mar 17 11:54:06 2000
@@ -0,0 +1,127 @@
+#!/bin/sh
+# 
+# This shell script is a wrapper to the main configure script when
+# configuring GDB for DJGPP.  99% of it can also be used when
+# configuring other GNU programs for DJGPP.
+#
+# Originally written by Robert Hoehne, revised by Eli Zaretskii.
+#
+# Call it like the main configure script with one exception.  If you
+# want to pass parameters to configure, you have to pass as the first
+# argument the srcdir, even when it is `.' !!!!!
+
+# Where are the sources? If you are used to having the sources
+# in a separate directory and the objects in another, then set
+# here the full path to the source directory and run this script
+# in the directory where you want to build gdb!!
+# You might give the source directory on commandline, but use
+# then only forward slashes (/) in the directories. It should be
+# an absolute path.
+
+if [ x$1 = x ]; then
+  srcdir=`pwd`
+else
+  srcdir=`cd $1 && pwd`
+  shift
+fi
+
+# Make sure they don't have some file names mangled by untarring.
+echo -n "Checking the unpacked distribution..."
+if ( ! test -f ${srcdir}/intl/po2tblsed.in || \
+     ! test -d ${srcdir}/gdb/testsuite/gdb.cxx || \
+     ! test -f ${srcdir}/readline/config.h-in ) ; then
+  echo " FAILED."
+  echo ""
+  echo "You MUST unpack the sources with the DJTAR command, like this:"
+  echo ""
+  echo "         djtar -x -n fnchange.lst gdb-X.YZ.tar.gz"
+  echo ""
+  echo "where X.YZ is the GDB version, and fnchange.lst can be found"
+  echo "in the gdb/config/djgpp/ directory in the GDB distribution."
+  echo "configure FAILED!"
+  exit 1
+else
+  echo " ok."
+fi
+
+# Where is the directory with DJGPP-specific scripts?
+DJGPPDIR=${srcdir}/gdb/config/djgpp
+
+echo "Editing configure scripts for DJGPP..."
+TMPFILE="${TMPDIR-.}/cfg.tmp"
+
+# We need to skip the build directory if it is a subdirectory of $srcdir,
+# otherwise we will have an infinite recursion on our hands...
+if test "`pwd`" == "${srcdir}" ; then
+  SKIPDIR=""
+  SKIPFILES=""
+else
+  SKIPDIR=`pwd | sed -e "s|${srcdir}|.|"`
+  SKIPFILES="${SKIPDIR}/*"
+fi
+for fix_dir in \
+  `cd $srcdir && find . -type d ! -ipath "${SKIPDIR}" ! -ipath "${SKIPFILES}"`
+do
+  if test ! -f ${fix_dir}/configure.orig ; then
+    if test -f ${srcdir}/${fix_dir}/configure ; then
+      mkdir -p ${fix_dir}
+      cp -p ${srcdir}/${fix_dir}/configure ${fix_dir}/configure.orig
+    fi
+  fi
+  if test -f ${fix_dir}/configure.orig ; then
+    sed -f ${DJGPPDIR}/config.sed ${fix_dir}/configure.orig > $TMPFILE
+    update $TMPFILE ${fix_dir}/configure
+    touch ./${fix_dir}/configure -r ${fix_dir}/configure.orig
+    rm -f $TMPFILE
+  fi
+  if test -f ${fix_dir}/INSTALL ; then
+    mv ${fix_dir}/INSTALL ${fix_dir}/INSTALL.txt
+  fi
+done
+
+# Now set the config shell. It is really needed, that the shell
+# points to a shell with full path and also it must conatain the
+# .exe suffix. I assume here, that bash is installed. If not,
+# install it. Additionally, the pathname must not contain a
+# drive letter, so use the /dev/x/foo format supported by versions
+# of Bash 2.03 and later, and by all DJGPP programs compiled with
+# v2.03 (or later) library.
+export CONFIG_SHELL=/dev/env/DJDIR/bin/sh.exe
+
+# force to have the ltmain.sh script to be in DOS text format,
+# otherwise the resulting ltconfig script will have mixed
+# (UNIX/DOS) format and is unusable with Bash ports before v2.03.
+utod $srcdir/ltmain.sh
+
+# Give the configure script some hints:
+export LD=ld
+export CC=gcc
+export RANLIB=ranlib
+export DEFAULT_YACC="bison -y"
+export YACC="bison -y"
+export DEFAULT_LEX=flex
+# Define explicitly the .exe extension because on W95 with LFN=y
+# the check might fail
+export am_cv_exeext=.exe
+
+# The configure script needs to see the `install-sh' script, otherwise
+# it decides the source installation is broken.  But "make install" will
+# fail on 8+3 filesystems if it finds a file `install-', since there
+# are numerous "install-foo" targets in Makefile's.  So we rename the
+# offending file after the configure step is done.
+if test ! -f ${srcdir}/install-sh ; then
+  if test -f ${srcdir}/install-.sh ; then
+    mv ${srcdir}/install-.sh ${srcdir}/install-sh
+  fi
+fi
+
+# Now run the configure script while disabling some things like the NLS
+# support, which is nearly impossible to be supported in the current way,
+# since it relies on file names which will never work on DOS.
+echo "Running the configure script..."
+$srcdir/configure --srcdir="$srcdir" --prefix='${DJDIR}' \
+  --disable-shared --disable-nls --verbose $*
+
+if test -f ${srcdir}/install- ; then
+  mv ${srcdir}/install- ${srcdir}/install-.sh
+fi
--- /dev/null	Fri Mar 17 19:02:11 2000
+++ gdb/config/djgpp/config.sed	Fri Mar 17 17:19:26 2000
@@ -0,0 +1,30 @@
+s|po2tbl\.sed\.in|po2tblsed.in|g
+s|gdb\.c++|gdb.cxx|g
+/ac_rel_source/s|ln -s|cp -p|
+s|\.gdbinit|gdb.ini|g
+
+/ac_given_INSTALL=/,/^CEOF/ {
+  /^s%@prefix@%/a\
+  s,\\([yp*]\\)\\.tab,\\1_tab,g\
+  /^	@rm -f/s,\\$@-\\[0-9\\]\\[0-9\\],&$*.i[1-9] $*[1-9][0-9],\
+  s,\\.info\\*,.inf* *.i[1-9] *.i[1-9][0-9],\
+  s,\\.gdbinit,gdb.ini,g\
+  /TEXINPUTS=/s,:,';',g\
+  /VPATH *=/s,:,;,g\
+  /\\$\\$file-\\[0-9\\]/s,echo,& *.i[1-9] *.i[1-9][0-9],\
+  s,config\\.h\\.in,config.h-in,g\
+  s,po2tbl\\.sed\\.in,po2tblsed.in,g
+}
+
+/^CONFIG_FILES=/,/^EOF/ {
+  s|po/Makefile.in\([^-:]\)|po/Makefile.in:po/Makefile.in-in\1|
+}
+
+/^ *CONFIG_HEADERS=/,/^EOF/ {
+  s|config.h\([^-:]\)|config.h:config.h-in\1|
+}
+
+/^[ 	]*\/\*)/s,/\*,/*|[A-z]:/*,
+/\$]\*) INSTALL=/s,\[/\$\]\*,&|[A-z]:/*,
+/\$]\*) ac_rel_source=/s,\[/\$\]\*,&|[A-z]:/*,
+/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
--- /dev/null	Fri Mar 17 20:41:18 2000
+++ gdb/config/djgpp/README	Fri Mar 17 20:40:54 2000
@@ -0,0 +1,172 @@
+
+       How to build and install the DJGPP native version of GDB
+       ********************************************************
+
+General
+=======
+
+GDB built with DJGPP supports native DJGPP debugging, whereby you run
+gdb.exe and the program being debugged on the same machine.  In
+addition, this version supports remote debugging via a serial port,
+provided that the target machine has a GDB-compatible debugging stub
+which can be linked with the target program (see the section "Remote
+Serial" in the GDB manual for more details).
+
+
+Installation of the binary distribution
+=======================================
+
+Simply unzip the gdbNNNb.zip file (where NNN is the version number)
+from the top DJGPP installation directory.  Be sure to preserve the
+directory structure while you unzip (use -d switch if you do this with
+PKUNZIP).  On Windows 9X and Windows 2000, use an unzip program which
+supports long file names; one such program is unzip32.exe, available
+from the DJGPP sites.
+
+If you need the libraries which are built as part of GDB, install the
+companion file gdbNNNa.zip.  This allows to develop applications which
+use the same functions as GDB.  For example, you can build your own
+front end to the debugger.
+
+
+Rebuilding GDB from sources
+===========================
+
+1. Prerequisites
+   -------------
+To build the package, you will need the DJGPP development environment
+(GCC, header files, and the libraries), and also DJGPP ports of the
+following tools:
+
+	- GNU Make 3.78.1 or later
+	- Bash 2.03 or later
+	- GNU Sed
+	- GNU Fileutils
+	- GNU Textutils 2.0 or later
+	- GNU Sh-utils
+	- GNU Grep 2.4 or later
+	- GNU Findutils
+	- GNU Awk 3.04 or later
+	- GNU Bison (only if you change one of the gdb/*.y files)
+	- Groff (only if you need to format the man pages)
+	- GNU Diffutils (only if you run the test suite)
+
+These programs should be available from the DJGPP sites, in the v2gnu
+directory.  In addition, the configuration script invokes the `update'
+and `utod' utilities which are part of the basic DJGPP development kit
+(djdevNNN.zip).
+
+
+2. Unpacking the sources
+   ---------------------
+If you download the source distribution from one of the DJGPP sites,
+just unzip it while preserving the directory structure (I suggest to
+use unzip32.exe available with the rest of DJGPP), and proceed to the
+section "How to build" below.
+
+Source distributions downloaded from one of the GNU FTP sites need
+some more work to unpack.  First, you MUST use the `djtar' program to
+unzip the package.  That's because some file names in the official
+distributions need to be changed to avoid problems on the various
+platforms supported by DJGPP.  `djtar' can rename files on the fly
+given a file with name mappings; the distribution includes a file
+`gdb/config/djgpp/fnchange.lst' with the necessary mappings.  So you
+need first to retrieve that file, and then invoke `djtar' to unpack
+the distribution.  Here's how:
+
+
+ djtar -x -p -o gdb-5.0/gdb/config/djgpp/fnchange.lst gdb-5.0.tar.gz > lst
+ djtar -x -n lst gdb-5.0.tar.gz
+
+(The name of the distribution archive and the top-level directory will
+be different for versions other than 5.0.)
+
+
+3. How to build
+   ------------
+
+The source distribution available from DJGPP archives is already
+configured for DJGPP v2.x, so if you only want to compile it, just
+invoke Make:
+
+		make
+
+To build a package downloaded from a GNU FTP site, you will need o
+configure it first.  You will also need to configure it if you want to
+change the configuration options (e.g., compile with support for the
+GDBMI interface).  To configure GDB, type this command:
+
+		sh ./gdb/config/djgpp/djconfig.sh
+
+This script checks the unpacked distribution, then edits the configure
+scripts in the various subdirectories, to make them suitable for
+DJGPP, and finally invokes the top-level configure script, which
+recursively configures all the subdirectories.
+
+You may pass optional switches to djconfig.sh.  It accepts all the
+switches accepted by the original GDB configure script.  These
+switches are described in the file gdb/README, and their full list be
+displayed by running the following command:
+
+		sh ./gdb/configure --help
+
+NOTE: if you *do* use optional command-line switches, you MUST pass
+to the script the name of the directory where GDB sources are
+unpacked--even if you are building GDB in-place!  For example:
+
+	sh ./gdb/config/djgpp/djconfig.sh . --enable-gdbmi
+
+It is also possible to build GDB in a directory that is different from
+the one where the sources were unpacked.  In that case, you have to
+pass the source directory as the first argument to the script:
+
+	sh ./gdb/config/djgpp/djconfig.sh d:/gnu/gdb-5.0
+
+You MUST use forward slashes in the first argument.
+
+After the configure script finishes, run Make:
+
+	make
+
+When Make finishes, you can install the package:
+
+	make install INSTALL='/dev/env/DJDIR/bin/ginstall -c'
+
+The above doesn't install the docs; for that you will need to say
+this:
+
+	make -k install-info INSTALL='/dev/env/DJDIR/bin/ginstall -c'
+
+(The -k switch is required, because some unneeded targets that are
+part of the install process fail; -k lets Make run to completion
+nonetheless.)
+
+The test suite has been made to work with DJGPP.  If you make a change
+in some of the programs, or want to be sure you have a fully
+functional GDB executable, it is a good idea to run the test suite.
+You cannot use "make check" for that, since it will want to run the
+`dejagnu' utility which GDB doesn't support.  Instead, use the special
+script gdb/config/djgpp/djcheck.sh, like this:
+
+		cd gdb/testsuite
+		sh ../config/djgpp/djcheck.sh
+
+This will run for a while and should not print anything.  Any test
+that fails to produce the expected output will cause the diffs between
+the expected and the actual output be printed, and in addition will
+leave behind a file SOMETHING.tst (where SOMETHING is the name of one
+of the tests).  You should compare each of the *.tst files with the
+corresponding *.out file and convince yourself that the differences do
+not indicate a real problem.  Examples of differences you can
+disregard are changes in the copyright blurb printed by GDB, values of
+unitialized variables, addresses of global variables like argv[] and
+envp[] (which depend on the size of your environment), etc.
+
+Note that djcheck.sh only recurses into those of the subdirectories of
+the test suite which test features supported by the DJGPP port of GDB.
+For example, the tests in the gdb.gdbtk, gdb.threads, and gdb.hp
+directories are not run.
+
+
+Enjoy,
+                                    Eli Zaretskii <eliz@is.elta.co.il>
--- /dev/null	Fri Mar 17 20:46:50 2000
+++ gdb/config/djgpp/fnchange.lst	Fri Mar 17 20:46:08 2000
@@ -0,0 +1,176 @@
+gdb-0222/gdb/ChangeLog-3.x gdb-0222/gdb/ChangeLog.3-x
+gdb-0222/gdb/ChangeLog-9091 gdb-0222/gdb/ChangeLog.9091
+gdb-0222/gdb/ChangeLog-92 gdb-0222/gdb/ChangeLog.92
+gdb-0222/gdb/ChangeLog-93 gdb-0222/gdb/ChangeLog.93
+gdb-0222/gdb/ChangeLog-94 gdb-0222/gdb/ChangeLog.94
+gdb-0222/gdb/ChangeLog-95 gdb-0222/gdb/ChangeLog.95
+gdb-0222/gdb/ChangeLog-96 gdb-0222/gdb/ChangeLog.96
+gdb-0222/gdb/ChangeLog-97 gdb-0222/gdb/ChangeLog.97
+gdb-0222/gdb/ChangeLog-98 gdb-0222/gdb/ChangeLog.98
+gdb-0222/gdb/ChangeLog-99 gdb-0222/gdb/ChangeLog.99
+gdb-0222/gdb/ppc-linux-tdep.c gdb-0222/gdb/ppc-linx-tdep.c
+gdb-0222/gdb/remote-adapt.c gdb-0222/gdb/rmt-adapt.c
+gdb-0222/gdb/remote-array.c gdb-0222/gdb/rmt-array.c
+gdb-0222/gdb/remote-e7000.c gdb-0222/gdb/rmt-e7000.c
+gdb-0222/gdb/remote-eb.c gdb-0222/gdb/rmt-eb.c
+gdb-0222/gdb/remote-es.c gdb-0222/gdb/rmt-es.c
+gdb-0222/gdb/remote-est.c gdb-0222/gdb/rmt-est.c
+gdb-0222/gdb/remote-mips.c gdb-0222/gdb/emt-mips.c
+gdb-0222/gdb/remote-mm.c gdb-0222/gdb/emt-mm.c
+gdb-0222/gdb/remote-nindy.c gdb-0222/gdb/rmt-nindy.c
+gdb-0222/gdb/remote-nrom.c gdb-0222/gdb/rmt-nrom.c
+gdb-0222/gdb/remote-rdi.c gdb-0222/gdb/rmt-rdi.c
+gdb-0222/gdb/remote-rdp.c gdb-0222/gdb/rmt-rdp.c
+gdb-0222/gdb/remote-sds.c gdb-0222/gdb/rmt-sds.c
+gdb-0222/gdb/remote-sim.c gdb-0222/gdb/rmt-sim.c
+gdb-0222/gdb/remote-st.c gdb-0222/gdb/rmt-st.c
+gdb-0222/gdb/remote-udi.c gdb-0222/gdb/rmt-udi.c
+gdb-0222/gdb/remote-vx.c gdb-0222/gdb/rmt-vx.c
+gdb-0222/gdb/remote-vx29k.c gdb-0222/gdb/rmt-vx29k.c
+gdb-0222/gdb/remote-vx68.c gdb-0222/gdb/rmt-vx68.c
+gdb-0222/gdb/remote-vx960.c gdb-0222/gdb/rmt-vx960.c
+gdb-0222/gdb/remote-vxmips.c gdb-0222/gdb/rmt-vxmips.c
+gdb-0222/gdb/remote-vxsparc.c gdb-0222/gdb/rmt-vxsparc.c
+gdb-0222/gdb/sparclet-rom.c gdb-0222/gdb/splet-rom.c
+gdb-0222/gdb/sparclet-stub.c gdb-0222/gdb/splet-stub.c
+gdb-0222/gdb/config/alpha/alpha-osf1.mh gdb-0222/gdb/config/alpha/alphosf1.mh
+gdb-0222/gdb/config/alpha/alpha-osf2.mh gdb-0222/gdb/config/alpha/alphosf2.mh
+gdb-0222/gdb/config/alpha/alpha-osf3.mh gdb-0222/gdb/config/alpha/alphosf3.mh
+gdb-0222/gdb/config/alpha/tm-alphalinux.h gdb-0222/gdb/config/alpha/tm-alplinux.h
+gdb-0222/gdb/config/alpha/xm-alphalinux.h gdb-0222/gdb/config/alpha/xm-alplinux.h
+gdb-0222/gdb/config/i386/nm-i386sco4.h gdb-0222/gdb/config/i386/nm-sco4.h
+gdb-0222/gdb/config/i386/nm-i386sco5.h gdb-0222/gdb/config/i386/nm-sco5.h
+gdb-0222/gdb/config/i386/nm-i386sol2.h gdb-0222/gdb/config/i386/nm-sol2.h
+gdb-0222/gdb/config/i386/nm-i386v4.h gdb-0222/gdb/config/i386/nm-v4.h
+gdb-0222/gdb/config/i386/nm-i386v42mp.h gdb-0222/gdb/config/i386/nm-v42mp.h
+gdb-0222/gdb/config/i386/tm-i386mk.h gdb-0222/gdb/config/i386/tm-mk.h
+gdb-0222/gdb/config/i386/tm-i386sol2.h gdb-0222/gdb/config/i386/tm-sol2.h
+gdb-0222/gdb/config/i386/tm-i386v4.h gdb-0222/gdb/config/i386/tm-v4.h
+gdb-0222/gdb/config/i386/tm-i386v42mp.h gdb-0222/gdb/config/i386/tm-v42mp.h
+gdb-0222/gdb/config/i386/xm-i386mach.h gdb-0222/gdb/config/i386/xm-mach.h
+gdb-0222/gdb/config/i386/xm-i386mk.h gdb-0222/gdb/config/i386/xm-mk.h
+gdb-0222/gdb/config/i386/xm-i386v32.h gdb-0222/gdb/config/i386/xm-v32.h
+gdb-0222/gdb/config/i386/xm-i386v4.h gdb-0222/gdb/config/i386/xm-v4.h
+gdb-0222/gdb/config/m68k/apollo68v.mh gdb-0222/gdb/config/m68k/apollo-v.mh
+gdb-0222/gdb/config/m68k/nm-apollo68v.h gdb-0222/gdb/config/m68k/nm-apolv.h
+gdb-0222/gdb/config/m68k/nm-hp300hpux.h gdb-0222/gdb/config/m68k/nm-300ux.h
+gdb-0222/gdb/config/m68k/tm-hp300hpux.h gdb-0222/gdb/config/m68k/tm-300ux.h
+gdb-0222/gdb/config/m68k/xm-apollo68v.h gdb-0222/gdb/config/m68k/xm-apolv.h
+gdb-0222/gdb/config/m68k/xm-hp300hpux.h gdb-0222/gdb/config/m68k/xm-300ux.h
+gdb-0222/gdb/config/m88k/tm-delta88v4.h gdb-0222/gdb/config/m88k/tm-d88v4.h
+gdb-0222/gdb/config/m88k/xm-delta88v4.h gdb-0222/gdb/config/m88k/xm-d88v4.h
+gdb-0222/gdb/config/mips/tm-bigmips64.h gdb-0222/gdb/config/mips/tm-bigm64.h
+gdb-0222/gdb/config/mips/tm-embed64.h gdb-0222/gdb/config/mips/tm-emb64.h
+gdb-0222/gdb/config/mips/tm-embedl.h gdb-0222/gdb/config/mips/tm-embdl.h
+gdb-0222/gdb/config/mips/tm-embedl64.h gdb-0222/gdb/config/mips/tm-embl64.h
+gdb-0222/gdb/config/mips/tm-vr4300el.h gdb-0222/gdb/config/mips/tm-v43el.h
+gdb-0222/gdb/config/mips/tm-vr4xxxel.h gdb-0222/gdb/config/mips/tm-v4xel.h
+gdb-0222/gdb/config/mips/tm-vr5000el.h gdb-0222/gdb/config/mips/tm-vr5kel.h
+gdb-0222/gdb/config/pa/nm-hppah11.h gdb-0222/gdb/config/pa/nm-hppa11.h
+gdb-0222/gdb/config/powerpc/tm-ppcle-sim.h gdb-0222/gdb/config/powerpc/tm-ppcl-sim.h
+gdb-0222/gdb/config/rs6000/nm-rs6000ly.h gdb-0222/gdb/config/rs6000/nm-rs6kly.h
+gdb-0222/gdb/config/rs6000/tm-rs6000.h gdb-0222/gdb/config/rs6000/tm-rs6k.h
+gdb-0222/gdb/config/rs6000/tm-rs6000ly.h gdb-0222/gdb/config/rs6000/tm-rs6kly.h
+gdb-0222/gdb/config/rs6000/xm-rs6000ly.h gdb-0222/gdb/config/rs6000/xm-rs6kly.h
+gdb-0222/gdb/config/sparc/tm-sparclet.h gdb-0222/gdb/config/sparc/tm-splet.h
+gdb-0222/gdb/config/sparc/tm-sparclite.h gdb-0222/gdb/config/sparc/tm-splite.h
+gdb-0222/gdb/config/sparc/tm-sparclynx.h gdb-0222/gdb/config/sparc/tm-splynx.h
+gdb-0222/gdb/config/sparc/xm-sparclynx.h gdb-0222/gdb/config/sparc/xm-xplynx.h
+gdb-0222/gdb/config/vax/xm-vaxult2.h gdb-0222/gdb/config/vax/xm-vaxut2.h
+gdb-0222/gdb/gdbtk/generic/gdbtk-varobj.c gdb-0222/gdb/gdbtk/generic/gdbtk-vobj.c
+gdb-0222/gdb/osf-share/cma_stack_int.h gdb-0222/gdb/osf-share/cma_stkint.h
+gdb-0222/gdb/testsuite/gdb.base/coremaker2.c gdb-0222/gdb/testsuite/gdb.base/core2maker.c
+gdb-0222/gdb/tui/tuiSourceWin.c gdb-0222/gdb/tui/tuiWinSource.c
+gdb-0222/gdb/tui/tuiSourceWin.h gdb-0222/gdb/tui/tuiWinSource.h
+gdb-0222/bfd/ChangeLog-9193 gdb-0222/bfd/ChangeLog.9193
+gdb-0222/bfd/ChangeLog-9495 gdb-0222/bfd/ChangeLog.9495
+gdb-0222/bfd/ChangeLog-9697 gdb-0222/bfd/ChangeLog.9697
+gdb-0222/bfd/coff-tic80.c gdb-0222/bfd/coff-tc80.c
+gdb-0222/sim/mips/dv-tx3904irc.c gdb-0222/sim/mips/dv-tx3irc.c
+gdb-0222/sim/mips/dv-tx3904sio.c gdb-0222/sim/mips/dv-tx3sio.c
+gdb-0222/sim/mips/dv-tx3904tmr.c gdb-0222/sim/mips/dv-tx3tmr.c
+gdb-0222/sim/mn10300/dv-mn103int.c gdb-0222/sim/mn10300/dv-mn1int.c
+gdb-0222/sim/mn10300/dv-mn103iop.c gdb-0222/sim/mn10300/dv-mn1iop.c
+gdb-0222/sim/mn10300/dv-mn103ser.c gdb-0222/sim/mn10300/dv-mn1ser.c
+gdb-0222/sim/mn10300/dv-mn103tim.c gdb-0222/sim/mn10300/dv-mn1tim.c
+gdb-0222/sim/ppc/corefile-n.h gdb-0222/sim/ppc/corefle-n.h
+gdb-0222/sim/ppc/idecode_branch.h gdb-0222/sim/ppc/idec_branch.h
+gdb-0222/sim/ppc/idecode_expression.h gdb-0222/sim/ppc/idec_expression.h
+gdb-0222/sim/ppc/idecode_fields.h gdb-0222/sim/ppc/idec_fields.h
+gdb-0222/sim/ppc/sim-endian-n.h gdb-0222/sim/ppc/sim-endn.h
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-d.s gdb-0222/sim/testsuite/d10v-elf/t-ld-d.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-i.s gdb-0222/sim/testsuite/d10v-elf/t-ld-i.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-id.s gdb-0222/sim/testsuite/d10v-elf/t-ld-id.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-im.s gdb-0222/sim/testsuite/d10v-elf/t-ld-im.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-ip.s gdb-0222/sim/testsuite/d10v-elf/t-ld-ip.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-d.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-d.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-i.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-i.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-id.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-id.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-im.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-im.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-ip.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-d.s gdb-0222/sim/testsuite/d10v-elf/t-st-d.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-i.s gdb-0222/sim/testsuite/d10v-elf/t-st-i.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-id.s gdb-0222/sim/testsuite/d10v-elf/t-st-id.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-im.s gdb-0222/sim/testsuite/d10v-elf/t-st-im.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-ip.s gdb-0222/sim/testsuite/d10v-elf/t-st-ip.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st-is.s gdb-0222/sim/testsuite/d10v-elf/t-st-is.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-d.s gdb-0222/sim/testsuite/d10v-elf/t-st2-d.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-i.s gdb-0222/sim/testsuite/d10v-elf/t-st2-i.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-id.s gdb-0222/sim/testsuite/d10v-elf/t-st2-id.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-im.s gdb-0222/sim/testsuite/d10v-elf/t-st2-im.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-ip.s gdb-0222/sim/testsuite/d10v-elf/t-st2-ip.s
+gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-is.s gdb-0222/sim/testsuite/d10v-elf/t-st2-is.s
+gdb-0222/sim/testsuite/d30v-elf/ls-ld4bhu.S gdb-0222/sim/testsuite/d30v-elf/ls-ld4bu.S
+gdb-0222/intl/po2tbl.sed.in gdb-0222/intl/po2tblsed.in
+gdb-0222/intl/intlh.inst.in gdb-0222/intl/intlh_inst.in
+gdb-0222/readline/config.h.in gdb-0222/readline/config.h-in
+gdb-0222/readline/config.h.bot gdb-0222/readline/config.h-bot
+gdb-0222/gdb/nindy-share/b.out.h gdb-0222/gdb/nindy-share/b_out.h
+gdb-0222/gdb/c-exp.tab.c gdb-0222/gdb/c-exp_tab.c
+gdb-0222/gdb/jv-exp.tab.c gdb-0222/gdb/jv-exp_tab.c
+gdb-0222/gdb/f-exp.tab.c gdb-0222/gdb/f-exp_tab.c
+gdb-0222/gdb/m2-exp.tab.c gdb-0222/gdb/m2-exp_tab.c
+gdb-0222/gdb/testsuite/gdb.c++ gdb-0222/gdb/testsuite/gdb.cxx
+gdb-0222/gdb/testsuite/gdb.c++/Makefile.in gdb-0222/gdb/testsuite/gdb.cxx/Makefile.in
+gdb-0222/gdb/testsuite/gdb.c++/ambiguous.cc gdb-0222/gdb/testsuite/gdb.cxx/ambiguous.cc
+gdb-0222/gdb/testsuite/gdb.c++/ambiguous.exp gdb-0222/gdb/testsuite/gdb.cxx/ambiguous.exp
+gdb-0222/gdb/testsuite/gdb.c++/annota2.cc gdb-0222/gdb/testsuite/gdb.cxx/annota2.cc
+gdb-0222/gdb/testsuite/gdb.c++/annota2.exp gdb-0222/gdb/testsuite/gdb.cxx/annota2.exp
+gdb-0222/gdb/testsuite/gdb.c++/anon-union.cc gdb-0222/gdb/testsuite/gdb.cxx/anon-union.cc
+gdb-0222/gdb/testsuite/gdb.c++/anon-union.exp gdb-0222/gdb/testsuite/gdb.cxx/anon-union.exp
+gdb-0222/gdb/testsuite/gdb.c++/classes.exp gdb-0222/gdb/testsuite/gdb.cxx/classes.exp
+gdb-0222/gdb/testsuite/gdb.c++/configure gdb-0222/gdb/testsuite/gdb.cxx/configure
+gdb-0222/gdb/testsuite/gdb.c++/configure.in gdb-0222/gdb/testsuite/gdb.cxx/configure.in
+gdb-0222/gdb/testsuite/gdb.c++/cplusfuncs.cc gdb-0222/gdb/testsuite/gdb.cxx/cplusfuncs.cc
+gdb-0222/gdb/testsuite/gdb.c++/cplusfuncs.exp gdb-0222/gdb/testsuite/gdb.cxx/cplusfuncs.exp
+gdb-0222/gdb/testsuite/gdb.c++/ctti.exp gdb-0222/gdb/testsuite/gdb.cxx/ctti.exp
+gdb-0222/gdb/testsuite/gdb.c++/cttiadd.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd.cc
+gdb-0222/gdb/testsuite/gdb.c++/cttiadd1.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd1.cc
+gdb-0222/gdb/testsuite/gdb.c++/cttiadd2.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd2.cc
+gdb-0222/gdb/testsuite/gdb.c++/cttiadd3.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd3.cc
+gdb-0222/gdb/testsuite/gdb.c++/demangle.exp gdb-0222/gdb/testsuite/gdb.cxx/demangle.exp
+gdb-0222/gdb/testsuite/gdb.c++/derivation.cc gdb-0222/gdb/testsuite/gdb.cxx/derivation.cc
+gdb-0222/gdb/testsuite/gdb.c++/derivation.exp gdb-0222/gdb/testsuite/gdb.cxx/derivation.exp
+gdb-0222/gdb/testsuite/gdb.c++/inherit.exp gdb-0222/gdb/testsuite/gdb.cxx/inherit.exp
+gdb-0222/gdb/testsuite/gdb.c++/local.cc gdb-0222/gdb/testsuite/gdb.cxx/local.cc
+gdb-0222/gdb/testsuite/gdb.c++/local.exp gdb-0222/gdb/testsuite/gdb.cxx/local.exp
+gdb-0222/gdb/testsuite/gdb.c++/member-ptr.cc gdb-0222/gdb/testsuite/gdb.cxx/member-ptr.cc
+gdb-0222/gdb/testsuite/gdb.c++/member-ptr.exp gdb-0222/gdb/testsuite/gdb.cxx/member-ptr.exp
+gdb-0222/gdb/testsuite/gdb.c++/method.cc gdb-0222/gdb/testsuite/gdb.cxx/method.cc
+gdb-0222/gdb/testsuite/gdb.c++/method.exp gdb-0222/gdb/testsuite/gdb.cxx/method.exp
+gdb-0222/gdb/testsuite/gdb.c++/misc.cc gdb-0222/gdb/testsuite/gdb.cxx/misc.cc
+gdb-0222/gdb/testsuite/gdb.c++/misc.exp gdb-0222/gdb/testsuite/gdb.cxx/misc.exp
+gdb-0222/gdb/testsuite/gdb.c++/overload.cc gdb-0222/gdb/testsuite/gdb.cxx/overload.cc
+gdb-0222/gdb/testsuite/gdb.c++/overload.exp gdb-0222/gdb/testsuite/gdb.cxx/overload.exp
+gdb-0222/gdb/testsuite/gdb.c++/ovldbreak.cc gdb-0222/gdb/testsuite/gdb.cxx/ovldbreak.cc
+gdb-0222/gdb/testsuite/gdb.c++/ovldbreak.exp gdb-0222/gdb/testsuite/gdb.cxx/ovldbreak.exp
+gdb-0222/gdb/testsuite/gdb.c++/ref-types.cc gdb-0222/gdb/testsuite/gdb.cxx/ref-types.cc
+gdb-0222/gdb/testsuite/gdb.c++/ref-types.exp gdb-0222/gdb/testsuite/gdb.cxx/ref-types.exp
+gdb-0222/gdb/testsuite/gdb.c++/templates.cc gdb-0222/gdb/testsuite/gdb.cxx/templates.cc
+gdb-0222/gdb/testsuite/gdb.c++/templates.exp gdb-0222/gdb/testsuite/gdb.cxx/templates.exp
+gdb-0222/gdb/testsuite/gdb.c++/userdef.cc gdb-0222/gdb/testsuite/gdb.cxx/userdef.cc
+gdb-0222/gdb/testsuite/gdb.c++/userdef.exp gdb-0222/gdb/testsuite/gdb.cxx/userdef.exp
+gdb-0222/gdb/testsuite/gdb.c++/virtfunc.cc gdb-0222/gdb/testsuite/gdb.cxx/virtfunc.cc
+gdb-0222/gdb/testsuite/gdb.c++/virtfunc.exp gdb-0222/gdb/testsuite/gdb.cxx/virtfunc.exp
+gdb-0222/gdb/testsuite/.gdbinit gdb-0222/gdb/testsuite/gdb.ini
+gdb-0222/sim/ppc/.gdbinit gdb-0222/sim/ppc/gdb.ini
--- /dev/null	Sat Mar 18 17:07:20 2000
+++ gdb/config/djgpp/djcheck.sh	Sat Mar 18 15:44:22 2000
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# A shell script to run the test suite on the DJGPP version of GDB.
+
+ORIGDIR=`pwd`
+GDB=${ORIGDIR}/../gdb.exe
+SUBDIRS=`find $ORIGDIR -type d ! -ipath $ORIGDIR`
+
+for d in $SUBDIRS
+do
+  cd $d
+  echo "Running tests in $d..."
+  for f in *.out
+  do
+    test -f $f || break
+    base=`basename $f .out`
+    if test "${base}" = "dbx" ; then
+	options=-dbx
+    else
+	options=
+    fi
+    $GDB ${options} < ${base}.in 2>&1 \
+      | sed -e '/^GNU gdb /s/ [.0-9][.0-9]*//' \
+            -e '/Starting program: /s|[A-z]:/.*/||' \
+            -e '/main (.*argv=/s/\(argv\|envp\)=0x[0-9a-f][0-9a-f]*/\1=XYZ/g' \
+      > ${base}.tst
+    if diff --binary -u ${base}.out ${base}.tst ; then
+      rm -f ${base}.tst
+    fi
+  done
+done
+
From Stephane.Carrez@worldnet.fr Sun Mar 19 05:56:00 2000
From: Stephane Carrez <Stephane.Carrez@worldnet.fr>
To: gdb-patches@sourceware.cygnus.com
Subject: path for gdb/dwarf2read.c, support 16-bit targets in dwarf-2
Date: Sun, 19 Mar 2000 05:56:00 -0000
Message-id: <38D4DCB0.88313CB2@worldnet.fr>
X-SW-Source: 2000-03/msg00345.html
Content-length: 908

Hi!

One part of the patch for dwarf2 correction with 16-bit target has
been lost. If you are still not convinced by the fix, have a look
at gas/dwarf2dbg.c in out_set_addr() where we obtain the address
size in a good way.

Can you integrate it?

Thanks,
	Stephane

2000-03-19  Stephane Carrez  <stcarrez@worldnet.fr>

	* dwarf2read.c (dwarf2_build_psymtabs_hard): Use
	bfd_arch_bits_per_address to get the size of addresses.
--- /src/gnu/cygnus/gdb/gdb/dwarf2read.c	Sat Mar  4 11:38:38 2000
+++ gdb/dwarf2read.c	Sun Mar 19 14:10:49 2000
@@ -938,7 +938,7 @@ dwarf2_build_psymtabs_hard (objfile, mai
   CORE_ADDR lowpc, highpc;
 
   /* Number of bytes of any addresses that are signficant */
-  address_significant_size = get_elf_backend_data (abfd)->s->arch_size / 8;
+  address_significant_size = bfd_arch_bits_per_address (abfd) / 8;
 
   info_ptr = dwarf_info_buffer;
   abbrev_ptr = dwarf_abbrev_buffer;
From fnasser@redhat.com Sun Mar 19 08:56:00 2000
From: Fernando Nasser <fnasser@redhat.com>
To: Jonathan Larmour <jlarmour@redhat.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: thumb_skip_prologue too adventurous
Date: Sun, 19 Mar 2000 08:56:00 -0000
Message-id: <38D5064B.40AE9470@redhat.com>
References: <38D3FFC8.32082A85@redhat.co.uk> <38D40052.AF731E81@redhat.co.uk>
X-SW-Source: 2000-03/msg00346.html
Content-length: 3183

Jonathan,

Thanks.

I am not sure if there isn't a better solution for this, but for now I
would say that you should check your change in as an emergency fix.  I
am assuming you ran the testsuite and it did not cause any regressions,
right?  (I don't think it will cause any)

I may latter add another change to check first if there is information
about the prologue end in the symbol table.  I don't know why this was
not checked before, I just noticed it now, looking at you patch.

I wrote this thumb prologue scan code to match the new compiler (gcc)
prologue generation.  As everything is new, both Nick and I used the
testsuite results to verify our work. The case you mention does not have
a testsuite case.  I wonder if you could add a test case?

Regards,
Fernando

Jonathan Larmour wrote:
> 
> Jonathan Larmour wrote:
> > 2000-03-18  Jonathan Larmour  <jlarmour@redhat.co.uk>
> >
> >         * arm-tdep.c (thumb_skip_prologue): Take function end addr argument
> >         so that we can stop searching for the prologue past the function end
> >         (arm_skip_prologue): Call thumb_skip_prologue with function end addr
> 
> Doh! Patch attached.
> 
> Jifl
> 
>   ------------------------------------------------------------------------
> Index: arm-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/arm-tdep.c,v
> retrieving revision 1.4
> diff -u -5 -p -r1.4 arm-tdep.c
> --- arm-tdep.c  2000/02/29 07:23:02     1.4
> +++ arm-tdep.c  2000/03/18 22:16:21
> @@ -326,20 +326,20 @@ arm_frameless_function_invocation (struc
>     When we have found at least one of each class we are done with the prolog.
>     Note that the "sub sp, #NN" before the push does not count.
>     */
> 
>  static CORE_ADDR
> -thumb_skip_prologue (CORE_ADDR pc)
> +thumb_skip_prologue (CORE_ADDR pc, CORE_ADDR func_end)
>  {
>    CORE_ADDR current_pc;
>    int findmask = 0;    /* findmask:
>                            bit 0 - push { rlist }
>                            bit 1 - mov r7, sp  OR  add r7, sp, #imm  (setting of r7)
>                            bit 2 - sub sp, #simm  OR  add sp, #simm  (adjusting of sp)
>                         */
> 
> -  for (current_pc = pc; current_pc < pc + 40; current_pc += 2)
> +  for (current_pc = pc; current_pc + 2 < func_end && current_pc < pc + 40; current_pc += 2)
>      {
>        unsigned short insn = read_memory_unsigned_integer (current_pc, 2);
> 
>        if ((insn & 0xfe00) == 0xb400)   /* push { rlist } */
>         {
> @@ -397,11 +397,11 @@ arm_skip_prologue (CORE_ADDR pc)
>         return sal.end;
>      }
> 
>    /* Check if this is Thumb code.  */
>    if (arm_pc_is_thumb (pc))
> -    return thumb_skip_prologue (pc);
> +    return thumb_skip_prologue (pc, func_end);
> 
>    /* Can't find the prologue end in the symbol table, try it the hard way
>       by disassembling the instructions. */
>    skip_pc = pc;
>    inst = read_memory_integer (skip_pc, 4);

-- 
Fernando Nasser
Red Hat, Inc. - Toronto                 E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299
From kevinb@cygnus.com Sun Mar 19 09:48:00 2000
From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH RFA] Another utils.c patch
Date: Sun, 19 Mar 2000 09:48:00 -0000
Message-id: <1000319174817.ZM17637@ocotillo.lan>
References: <1000319072047.ZM14883@ocotillo.lan> <kevinb@cygnus.com>
X-SW-Source: 2000-03/msg00347.html
Content-length: 2222

On Mar 19, 12:20am, Kevin Buettner wrote:
> Subject: [PATCH RFA] Another utils.c patch
> This fixes another bug uncovered by running the testsuite for the
> IA-64...  may I check this one in?
> 
> 	* utils.c (floatformat_from_doublest): Make sure space that we're
> 	writing the float to is completely initialized to zeroes, even
> 	when the number of bits in the float is not evenly divisible
> 	by FLOATFORMAT_CHAR_BIT.
> 
> Index: utils.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/utils.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 utils.c
> --- utils.c	2000/03/04 02:23:06	1.4
> +++ utils.c	2000/03/19 07:12:00
> @@ -2722,7 +2722,8 @@ floatformat_from_doublest (fmt, from, to
>    unsigned char *uto = (unsigned char *) to;
>  
>    memcpy (&dfrom, from, sizeof (dfrom));
> -  memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
> +  memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT
> +                  + ((fmt->totalsize % FLOATFORMAT_CHAR_BIT) == 0 ? 0 : 1));
>    if (dfrom == 0)
>      return;			/* Result is zero */
>    if (dfrom != dfrom)		/* Result is NaN */
> 
>-- End of excerpt from Kevin Buettner

I withdraw the patch above in favor of the one below.  (The patch above
is not as concise as the one below.  But they should both produce the
same results.)

	* utils.c (floatformat_from_doublest): Make sure space that we're
	writing the float to is completely initialized to zeroes, even
	when the number of bits in the float is not evenly divisible
	by FLOATFORMAT_CHAR_BIT.

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.4
diff -u -p -r1.4 utils.c
--- utils.c	2000/03/04 02:23:06	1.4
+++ utils.c	2000/03/19 17:36:49
@@ -2722,7 +2722,8 @@ floatformat_from_doublest (fmt, from, to
   unsigned char *uto = (unsigned char *) to;
 
   memcpy (&dfrom, from, sizeof (dfrom));
-  memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
+  memset (uto, 0, (fmt->totalsize + FLOATFORMAT_CHAR_BIT - 1) 
+                    / FLOATFORMAT_CHAR_BIT);
   if (dfrom == 0)
     return;			/* Result is zero */
   if (dfrom != dfrom)		/* Result is NaN */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: minor watchpoint code cleanup
       [not found]         ` <200003211817.NAA12429@indy.delorie.com>
@ 2000-03-21 15:33           ` Jim Blandy
  2000-04-01  0:00             ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2000-03-21 15:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kettenis, gdb-patches

> The reason is that IMHO we should avoid making a variable (`size')
> serve two puproses at the same time.

Good suggestion --- done.

I'm just waiting for Mark's approval.
From kettenis@wins.uva.nl Tue Mar 21 15:47:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: jtc@redback.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: tm-nbsd.h: define IN_SOLIB_CALL_TRAMPOLINE
Date: Tue, 21 Mar 2000 15:47:00 -0000
Message-id: <200003212346.e2LNklX05555@delius.kettenis.local>
References: <5maejsgjl8.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00448.html
Content-length: 491

   From: jtc@redback.com (J.T. Conklin)
   Date: 21 Mar 2000 12:21:39 -0800

   I submit the enclosed patch for approval.  This allows programs linked
   with shared libraries to be debugged on a.out-based NetBSD targets.

   2000-03-21  J.T. Conklin  <jtc@redback.com>

	   * tm-nbsd.h (IN_SOLIB_CALL_TRAMPOLINE): Define if not
	   SVR4_SHARED_LIBS.

Keeping in mind that one day we'll multi-arch the i386, wouldn't it be
better to have a function that does the trampoline detection?

Mark
From dan@cgsoftware.com Tue Mar 21 15:49:00 2000
From: Daniel Berlin <dan@cgsoftware.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: jtc@redback.com, gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: i386/nbsd.mt, i386nbsd-nat.c
Date: Tue, 21 Mar 2000 15:49:00 -0000
Message-id: <Pine.LNX.4.10.10003211547370.15517-100000@propylaea.anduin.com>
References: <38D7F75F.522996A3@cygnus.com>
X-SW-Source: 2000-03/msg00449.html
Content-length: 975

Actually, i have patches to make FreeBSD build native just fine.
I merged the patches freebsd uses against 4.18 into the current gdb.
It fails some shared lib tests, but past that, it's fine.
I can submit them if you like.


On Wed, 22 Mar 2000, Andrew Cagney wrote:

> "J.T. Conklin" wrote:
> > 
> > I submit the enclosed patch for approval.  This change splits out
> > NetBSD native support from the FreeBSD, BSDI, and 386BSD support.  The
> > changes I submitted earlier today convert the NetBSD target to use the
> > generic floating point register support, which conflicts with i386b-nat.c
> > 
> >         --jtc
> > 
> > 2000-03-21  J.T. Conklin  <jtc@redback.com>
> > 
> >         * i386/nbsd.mh (NATDEPFILES): Changed i386b-nat.c to i386nbsd-nat.c.
> >         * i386nbsd-nat.c: New file.
> 
> Ok.  (The naming schema *-nat.c files is AWAL.  Your consistent with
> other *bsd targets :-)
> Last time I tried FreeBSD couldn't build GDB native anyway.
> 
> 	Andrew
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: minor watchpoint code cleanup
  2000-04-01  0:00             ` Mark Kettenis
@ 2000-03-21 15:57               ` Mark Kettenis
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Kettenis @ 2000-03-21 15:57 UTC (permalink / raw)
  To: jimb; +Cc: eliz, gdb-patches

   From: Jim Blandy <jimb@cygnus.com>
   Date: 21 Mar 2000 18:33:30 -0500

   > The reason is that IMHO we should avoid making a variable (`size')
   > serve two puproses at the same time.

   Good suggestion --- done.

   I'm just waiting for Mark's approval.

Approved.

Mark
From ac131313@cygnus.com Tue Mar 21 15:58:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Discussion <gdb@sourceware.cygnus.com>, GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [MAINT] More additions
Date: Tue, 21 Mar 2000 15:58:00 -0000
Message-id: <38D80C7E.BF2217E8@cygnus.com>
X-SW-Source: 2000-03/msg00451.html
Content-length: 537

Hello,


Michael and Jim are going to share breakpoint code between themselves:

breakpoint.c		Michael Snyder		msnyder@cygnus.com
			Jim Blandy		jimb@cygnus.com


Jonathan Larmour's just managed to exceed his quota of good patch
submissions :-). He's happy to join the write aver approval list:

Jonathan Larmour				jlarmour@redhat.co.uk


David has stepped forward as the SPARC/Solaris and target maintainer:

sparc target		David Taylor		taylor@cygnus.com
Solaris/SPARC native & host
			David Taylor		taylor@cygnus.com


enjoy,
	Andrew
From ac131313@cygnus.com Tue Mar 21 16:10:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: jtc@redback.com, gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: i386/nbsd.mt, i386nbsd-nat.c
Date: Tue, 21 Mar 2000 16:10:00 -0000
Message-id: <38D80F23.799B5F41@cygnus.com>
References: <Pine.LNX.4.10.10003211547370.15517-100000@propylaea.anduin.com>
X-SW-Source: 2000-03/msg00452.html
Content-length: 516

Daniel Berlin wrote:
> 
> Actually, i have patches to make FreeBSD build native just fine.
> I merged the patches freebsd uses against 4.18 into the current gdb.
> It fails some shared lib tests, but past that, it's fine.
> I can submit them if you like.

The problem I have with the FreeBSD patches is that they have never been
assigned to the FSF by the original author.
I'd have otherwize done the same thing (they are also pretty scrappy)
:-(

Many of the NetBSD changes have the same problem.

	sorry,
		Andrew
From shebs@apple.com Tue Mar 21 17:48:00 2000
From: Stan Shebs <shebs@apple.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Michael Snyder <msnyder@cygnus.com>, gdb-patches@sourceware.cygnus.com
Subject: Re: gdb.texinfo broken?
Date: Tue, 21 Mar 2000 17:48:00 -0000
Message-id: <38D82684.89633B0B@apple.com>
References: <38D6CF69.6844@cygnus.com> <200003211819.NAA12435@indy.delorie.com> <38D7C977.FA3@cygnus.com> <5mitygglxs.fsf@jtc.redbacknetworks.com> <38D7FDD1.D54DE1D8@cygnus.com>
X-SW-Source: 2000-03/msg00453.html
Content-length: 483

Andrew Cagney wrote:
> 
> "J.T. Conklin" wrote:
> 
> > It looks like the changes to the directory entry require the latest
> > makeinfo.  I tried to use makeinfo from texinfo-3.2 and it failed,
> > makeinfo from texinfo-4.0 works.
> 
> >From memory, the possibility of requiring texinfo 4.0 as part of
> building GDB 5 was considered and rejected :-(

Yeah, I have to revert - tried it on one of Apple's MkLinux systems,
which claims to have texinfo 3.9, and it fell down too.

Stan
From jtc@redback.com Tue Mar 21 19:07:00 2000
From: jtc@redback.com (J.T. Conklin)
To: gdb-patches@sourceware.cygnus.com
Subject: RFA: call-ar-st.exp, relax patterns
Date: Tue, 21 Mar 2000 19:07:00 -0000
Message-id: <5mog87g0sx.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00454.html
Content-length: 8945

I submit the enclosed patch for approval.  As I mentioned some months
ago ( http://sourceware.cygnus.com/ml/gdb/1999-q3/msg00162.html ), the
default pty attributes on NetBSD systems has tabs expanding to spaces
but some of the tests explicitly check for tabs.  I fixed some of the
tests then, but didn't have time to go through all of the failures.
This change relaxes more of expect patterns in call-ar-st.exp.

        --jtc

2000-03-21  J.T. Conklin  <jtc@redback.com> 
 
        * gdb.base/call-ar-st.exp: relax patterns matching tab
          characters.

Index: call-ar-st.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-ar-st.exp,v
retrieving revision 1.1.1.7
diff -c -3 -p -r1.1.1.7 call-ar-st.exp
*** call-ar-st.exp	1999/08/23 22:37:37	1.1.1.7
--- call-ar-st.exp	2000/03/22 02:59:09
*************** gdb_expect {
*** 366,372 ****
  if {![target_info exists gdb,skip_float_tests]} {
    send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
    gdb_expect {
!     -re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:.*-3.340000\[\t\r\n \]+Contents of one_double_t:.*675.091230\[\t\r\n \]+Contents of two_floats_t:.*45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:.*78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:.*-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
        pass "print print_small_structs"
      }
      -re ".*$gdb_prompt $" { fail "print print_small_structs" }
--- 366,372 ----
  if {![target_info exists gdb,skip_float_tests]} {
    send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
    gdb_expect {
!     -re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y.*ch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a.*b.*c\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l.*m.*n.*o.*p\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:.*-3.340000\[\t\r\n \]+Contents of one_double_t:.*675.091230\[\t\r\n \]+Contents of two_floats_t:.*45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:.*78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:.*-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
        pass "print print_small_structs"
      }
      -re ".*$gdb_prompt $" { fail "print print_small_structs" }
*************** if {![target_info exists gdb,skip_float_
*** 461,467 ****
      setup_xfail "sparc*-*-solaris*"
      send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
      gdb_expect {
! 	-re ".*alpha${ws}gamma${ws}epsilon${ws}alpha${ws}gamma${ws}epsilon${ws}ch1: y\tch2: n${ws}Contents of three_char_t:${ws}a\tb\tc${ws}Contents of five_char_t:${ws}l\tm\tn\to\tp${ws}Contents of int_char_combo_t:${ws}123.*z${ws}Sum of the 4 struct values and seed :${ws}52${ws}Contents of struct1:${ws}6.*0${ws}Contents of struct2:${ws}10.*0${ws}Contents of struct3:${ws}12.*0${ws}Contents of one_double_t:${ws}10.500000${ws}Contents of one_double_t:${ws}-3.340000${ws}Contents of one_double_t:${ws}675.091230${ws}Contents of two_floats_t:${ws}45.234001.*43.599998${ws}Contents of two_floats_t:${ws}78.010002.*122.099998${ws}Contents of two_floats_t:${ws}-1232.344971.*-199.210007${ws}.*$gdb_prompt $" {
  	    pass "print print_small_structs from print_long_arg_list"
  	}
  	-re ".*$gdb_prompt $" { fail "print print_small_structs from print_long_arg_list" }
--- 461,467 ----
      setup_xfail "sparc*-*-solaris*"
      send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
      gdb_expect {
! 	-re ".*alpha${ws}gamma${ws}epsilon${ws}alpha${ws}gamma${ws}epsilon${ws}ch1: y.*ch2: n${ws}Contents of three_char_t:${ws}a.*b.*c${ws}Contents of five_char_t:${ws}l.*m.*n.*o.*p${ws}Contents of int_char_combo_t:${ws}123.*z${ws}Sum of the 4 struct values and seed :${ws}52${ws}Contents of struct1:${ws}6.*0${ws}Contents of struct2:${ws}10.*0${ws}Contents of struct3:${ws}12.*0${ws}Contents of one_double_t:${ws}10.500000${ws}Contents of one_double_t:${ws}-3.340000${ws}Contents of one_double_t:${ws}675.091230${ws}Contents of two_floats_t:${ws}45.234001.*43.599998${ws}Contents of two_floats_t:${ws}78.010002.*122.099998${ws}Contents of two_floats_t:${ws}-1232.344971.*-199.210007${ws}.*$gdb_prompt $" {
  	    pass "print print_small_structs from print_long_arg_list"
  	}
  	-re ".*$gdb_prompt $" { fail "print print_small_structs from print_long_arg_list" }
*************** init_bit_flags_combo \\(bit_flags_combo=
*** 491,497 ****
  #call print_bit_flags_combo(*bit_flags_combo)
  send_gdb "print print_bit_flags_combo(*bit_flags_combo)\n"
  gdb_expect {
!     -re ".*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*$gdb_prompt $" {
          pass "print print_bit_flags_combo from init_bit_flags_combo"
        }
      -re ".*$gdb_prompt $" { fail "print print_bit_flags_combo from init_bit_flags_combo" }
--- 491,497 ----
  #call print_bit_flags_combo(*bit_flags_combo)
  send_gdb "print print_bit_flags_combo(*bit_flags_combo)\n"
  gdb_expect {
!     -re ".*alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*$gdb_prompt $" {
          pass "print print_bit_flags_combo from init_bit_flags_combo"
        }
      -re ".*$gdb_prompt $" { fail "print print_bit_flags_combo from init_bit_flags_combo" }
*************** if {$hp_aCC_compiler} {setup_xfail "hppa
*** 518,524 ****
  if {![target_info exists gdb,skip_float_tests]} {
    send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
    gdb_expect {
!     -re ".*double : 22.220000.*double : 33.333000.*int : 0.*int : -25.*int : 100.*int : 2345.*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*Contents of three_char_t:.*x\ty\tz.*Contents of five_char_t:.*h\te\tl\tl\to.*Contents of int_char_combo_t:.*123\tz.*Sum of the 4 struct values and seed :.*52.*Contents of struct1:.*6\[ \]+0.*Contents of struct2:.*10\[ \]+0.*Contents of struct3:.*12.*0.*Contents of one_double_t:\[ \n\r\t\]+1.111110\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+-345.340000\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+546464.200000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+0.234000\t453.100006\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+78.345001\t23.090000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+-2.345000\t1.000000.*$gdb_prompt $" {
        pass "print print_long_arg_list"
      }
      -re ".*$gdb_prompt $" { fail "print print_long_arg_list" }
--- 518,524 ----
  if {![target_info exists gdb,skip_float_tests]} {
    send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
    gdb_expect {
!     -re ".*double : 22.220000.*double : 33.333000.*int : 0.*int : -25.*int : 100.*int : 2345.*alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*Contents of three_char_t:.*x.*y.*z.*Contents of five_char_t:.*h.*e.*l.*l.*o.*Contents of int_char_combo_t:.*123.*z.*Sum of the 4 struct values and seed :.*52.*Contents of struct1:.*6\[ \]+0.*Contents of struct2:.*10\[ \]+0.*Contents of struct3:.*12.*0.*Contents of one_double_t:\[ \n\r\t\]+1.111110\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+-345.340000\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+546464.200000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+0.234000.*453.100006\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+78.345001.*23.090000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+-2.345000.*1.000000.*$gdb_prompt $" {
        pass "print print_long_arg_list"
      }
      -re ".*$gdb_prompt $" { fail "print print_long_arg_list" }


-- 
J.T. Conklin
RedBack Networks
From ac131313@cygnus.com Tue Mar 21 20:21:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Jimmy Guo <guo@cup.hp.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Initialization of hpux_threads
Date: Tue, 21 Mar 2000 20:21:00 -0000
Message-id: <38D849A1.F5F706A@cygnus.com>
References: <Pine.LNX.4.10.10003211552360.31590-100000@hpcll168.cup.hp.com>
X-SW-Source: 2000-03/msg00455.html
Content-length: 1125

Jimmy Guo wrote:
> 
> I was looking at an old source tree and didn't see its 'revival'.
> Yes it is some setup to solve the kinds of problem you mentioned.
> But any other usage of it will only introduce multiple calls to
> a _initialize_* routine.
> 
> The initializer in hpux-thread.c is just one of these cases.  They're
> mostly fixed as of today's tree except for a remaining one -
> remote-nrom.c.

Thanks,  I've applied the attatched.

	Andrew
Wed Mar 22 15:09:34 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* configure.in (CONFIG_INITS): Do not append remote-nrom.c

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.12
diff -p -r1.12 configure.in
*** configure.in	2000/03/20 06:41:24	1.12
--- configure.in	2000/03/22 04:15:36
*************** esac])
*** 447,453 ****
  if test "${enable_netrom}" = "yes"; then
  	CONFIG_OBS="${CONFIG_OBS} remote-nrom.o" 
          CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
- 	CONFIG_INITS="${CONFIG_INITS} remote-nrom.c"
  fi
  
  AC_ARG_ENABLE(build-warnings,
--- 447,452 ----
From ac131313@cygnus.com Tue Mar 21 20:25:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Cc: GDB Discussion <gdb@sourceware.cygnus.com>
Subject: [Maint] Second testsuite maintainer
Date: Tue, 21 Mar 2000 20:25:00 -0000
Message-id: <38D84B37.B90E15AB@cygnus.com>
X-SW-Source: 2000-03/msg00456.html
Content-length: 282

Another addition:

Add Fernando to list of testsuite maintainers.

testsuite	 	Stan Shebs		shebs@apple.com
			Fernando Nasser		fnasser@cygnus.com
  hp tests (gdb.hp)	*Jimmy Guo	 adl-debugger-wdb-merge-guru@cup.hp.com
  Java tests (gdb.java)	Anthony Green 		green@cygnus.com

Andrew
From ac131313@cygnus.com Tue Mar 21 21:38:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Document the ThreadInfo remote protocol queries
Date: Tue, 21 Mar 2000 21:38:00 -0000
Message-id: <38D85C2F.FF89881D@cygnus.com>
References: <200003202316.PAA07888@cleaver.cygnus.com> <38D6FCE2.EBD9830F@cygnus.com> <38D7C38C.6CB0@cygnus.com>
X-SW-Source: 2000-03/msg00457.html
Content-length: 2117

Michael Snyder wrote:

> > An additional note on these versions of thread queries.  While
> > significantly better than the ``qL'' packet these commands still have
> > problems.  I'll add notes expanding on this.  Briefly, however:
> >
> >         o       Per the query packet spec, they should be
> >                 prefixed with a UCASE letter if they
> >                 are to be official GDB packets.
> >
> >         o       The ``sThread..'' command assumes
> >                 that the GDB protocol is reliable
> >                 which it is not.  GDB can re-issue
> >                 a ``sThread'' request and this can
> >                 lead to GDB and the target falling
> >                 out of sync.
> 
> How about if the 'sThread' request were to be suffixed with
> the last thread ID received?

I was thinking of deprecating fThreadInfo and sThreadInfo and having gdb
try:

	qThreadInfo
	qThreadInfo,<sentinal>

Where sentinal could be <last-thread-id> index (counting from zero) for
next threads, or anything else.

Given ``sThreadInfo'' is in the field, we can't change it.


> > with regard to ``qfThreadExtraInfo''.  As far as I know its not been
> > deployed in the field.  Is there any reason to not name it correctly
> > from the start  (``qThreadExtraInfo'')?
> 
> Only that it conflicts with the tracepoint messages,
> which all begin with qT (see tracepoint.c).

I don't think that is a problem.  The protocol requires:

@tab @code{q}@var{query}
@tab
Request info about @var{query}.  In general @value{GDBN} @var{query}'s
have a leading upper case letter.  Custom vendor queries should use a
company prefix (in lower case) ex: @samp{qfsf.var}.  @var{query} may
optionally be followed by a @samp{,} or @samp{;} separated list.  Stubs
must ensure that they match the full @var{query} name.

The last sentence is ment to ensure that the target's query handling
code matches using something like:
	strcmp (packet, "qThreadInfo")
instead of
	packet[0] == 'q' && packet[1] == 'T' && packet[7] == 'I'


Should ``C'' also be suceeded by something like ``qThread''?  Is ``C''
still used?

	Andrew
From eliz@delorie.com Wed Mar 22 00:58:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Mark Kettenis <kettenis@wins.uva.nl>, gdb-patches@sourceware.cygnus.com
Subject: Re: Linux sigtramp detection code moved to its proper place
Date: Wed, 22 Mar 2000 00:58:00 -0000
Message-id: <200003220858.DAA12990@indy.delorie.com>
References: <200003201529.KAA10589@indy.delorie.com> <38D73C78.4B2B3562@cygnus.com>
X-SW-Source: 2000-03/msg00458.html
Content-length: 2641

> Is there anything that the nightly snapshots (short term) and/or
> testsuite (medium/long term) can do to ensure that the relevant
> djgpp files are always up-to-date?

As a matter of fact, there is.  I have todo items for the following
issues:

  - The file config/djgpp/fnchange.lst needs to be updated to include
    the exact version in the file names it maps.  Specifically, that
    file consists of lines which look like this:

      gdb-0321/foo/bar/long-name-foo.c gdb-0321/foo/bar/short-foo.c

    (When DJTAR sees this line, it renames the file whose name is on
    the left to what's on the right.)

    The "gdb-0312" part should be replaced with the actual name of the
    directory which the distribution creates when unpacked, and that
    name includes the version of the snapshot/release.

    What I was thinking was to provide a template whose lines will say
    this:

      gdb-@VER@/foo/bar/long-name-foo.c gdb-@VER@/foo/bar/short-foo.c

    and run Sed on it inside the commands used to tar the
    distribution, to replace that with the actual version (taken from
    the Makefile, for example).

  - If the long names which clash after 8+3 truncation are to stay
    with us for Quite A While (tm), it might make sense to have some
    script or program that will update fnchange.lst whenever a new
    file is added that clashes with some other file name, but is not
    yet covered in fnchange.lst.  Assuming that the files which get
    added are not required for the DJGPP build (since those must
    *never* clash with other file names), what we need is to add an
    entry like this:

      gdb-@VER@/foo/bar/new-long-name-foo.bar

    When DJTAR sees such a line, it skips the named file.

    This looks like a job for a Perl script.  Unfortunately, Perl for
    me is a read-only language.  I could write a C program to do this,
    if this is acceptable, though.

Comments and ideas are welcome.

> As a suggestion from left field, I've wondered if gdb.base/selftest.exp
> should be moved to gdb.wb/selftest.exp (wb == white box) so that people
> can freely add additional white box tests to GDB.  Checking consistency
> between config/djgpp/<that-file> and the GDB sources could be part of
> that testsuite.

Does that mean that you always run the test suite before preparing the
snapshots?  If so, how do you know whether a certain new failure is
grave enough to prevent you from making the snapshot?  I mean, if the
test for consistency in config/djgpp/<that-file> were added, and it
failed, how would you know that this is not some minor regression
(which I assume do happen in other parts of GDB)?
From eliz@delorie.com Wed Mar 22 01:30:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: msnyder@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Running the inferior from breakpoint commands
Date: Wed, 22 Mar 2000 01:30:00 -0000
Message-id: <200003220930.EAA13024@indy.delorie.com>
References: <200003120759.CAA24402@indy.delorie.com> <200003151624.LAA01228@indy.delorie.com> <38D7F31D.1827@cygnus.com>
X-SW-Source: 2000-03/msg00459.html
Content-length: 2020

> 	Any
> 	other commands in the command list are ignored, after
> 	a command that resumes execution.
> 
> Note the last sentence.  So despite the fact that the 
> testsuite seems to imply that this should work, it is
> not expected to.  I have no idea what that test is 
> doing in there.  The commands-on-breakpoint behavior
> is NOT intended to be recursive.

Yes, somebody already pointed out that this appears to be a documented
limitation.  Unfortunately, this info came after I already did the
changes and posted them; my original question when I first discovered
the problem remained unanswered...

(I did look in the manual, but since the snippet you cited isn't
indexed, I didn't find it.  [Yes, I will submit a manual change to add
an index entry.])

To me, the fact that the test suite tried to do this was a sign that
it was supposed to work.

As an aside: is there any place I can find the list of tests which
fail, and on what systems do they fail?

> If you seriously want to undertake this project, we can
> work on a list of criteria that should be tested (things
> that can go wrong).

I will put it on my todo (thanks for the list of things to test; some
of them were already tested, I just didn't report it).  I would like
at least to probe the issues, to get a feeling how badly broken is
what I did ;-).

> On top of that, I have grave concerns about being able
> to correctly save and restore all of the internal
> debugger state necessary to make this work (the
> infrun execution state, the expression chain, etc.)

Err... I'm not sure this should be of concern here (but perhaps I
don't see the subtle issues clearly enough): if the breakpoint
commands change any of these global entities, I think the user expects
the changes to be visible after these commands are processed.  For
example, if the commands delete the breakpoint where you stopped, the
user will expect the breakpoint to remain deleted after that (the
changes I submitted do handle this specific case).  Am I missing
something?
From kettenis@wins.uva.nl Wed Mar 22 01:49:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sourceware.cygnus.com
Cc: jtc@redback.com
Subject: [PATCH] Restructuring i386-tdep.c:i386_extract_return_value()
Date: Wed, 22 Mar 2000 01:49:00 -0000
Message-id: <200003220949.e2M9nl001746@delius.kettenis.local>
X-SW-Source: 2000-03/msg00460.html
Content-length: 6153

Hi,

I checked in the attached patch.  This is one of the patches I
discussed two weeks ago, which makes i386_extract_return_value() do
the right thing for most of the supported i386 targets.  Some targets
(for example those that use tm-i386v.h) still redefine
EXTRACT_RETURN_VALUE, so they don't take advantage of this
improvement.  I'll deal with that later.

Mark


2000-03-22  Mark Kettenis  <kettenis@gnu.org>

	* config/i386/tm-i386aix.h (I386_AIX_TARGET): Remove.
	* config/i386/tm-linux.h (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM):
	Remove
	* i386-tdep.c (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM): New defines.
	(i386_extract_return_value): Rewritten.  Correctly support all
	floating-point types and large integer types on targets that use
	the standard i386 GDB register layout and return floating-point
	values in the FPU.


Index: config/i386/tm-i386aix.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386aix.h,v
retrieving revision 1.2
diff -u -p -r1.2 tm-i386aix.h
--- config/i386/tm-i386aix.h	2000/03/02 15:44:27	1.2
+++ config/i386/tm-i386aix.h	2000/03/22 09:41:10
@@ -30,14 +30,6 @@
 #define I386 1
 #endif
 
-/* FIXME: kettenis/2000-03-02: This is used in
-   i386-tdep.c:i386_extract_return_value(), and will be remove once
-   I've fixed that.  Meanwhile don't use it for any other purpose
-   please!  */
-#ifndef I386_AIX_TARGET
-#define I386_AIX_TARGET 1
-#endif
-
 /* AIX/i386 has FPU support.  However, the native configuration (which
    is the only supported configuration) doesn't make the FPU control
    registers available.  Override the appropriate symbols such that
Index: config/i386/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v
retrieving revision 1.4
diff -u -p -r1.4 tm-linux.h
--- config/i386/tm-linux.h	2000/03/16 22:46:30	1.4
+++ config/i386/tm-linux.h	2000/03/22 09:41:10
@@ -30,9 +30,6 @@
 #include "i386/tm-i386.h"
 #include "tm-linux.h"
 
-#define LOW_RETURN_REGNUM 0	/* holds low four bytes of result */
-#define HIGH_RETURN_REGNUM 2	/* holds high four bytes of result */
-
 /* This should probably move to tm-i386.h.  */
 #define TARGET_LONG_DOUBLE_BIT 80
 
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.7
diff -u -p -r1.7 i386-tdep.c
--- i386-tdep.c	2000/03/16 22:46:26	1.7
+++ i386-tdep.c	2000/03/22 09:41:10
@@ -698,56 +698,66 @@ get_longjmp_target (pc)
 
 #endif /* GET_LONGJMP_TARGET */
 
+/* These registers are used for returning integers (and on some
+   targets also for returning `struct' and `union' values when their
+   size and alignment match an integer type.  */
+#define LOW_RETURN_REGNUM 0	/* %eax */
+#define HIGH_RETURN_REGNUM 2	/* %edx */
+
+/* Extract from an array REGBUF containing the (raw) register state, a
+   function return value of TYPE, and copy that, in virtual format,
+   into VALBUF.  */
+
 void
-i386_extract_return_value (type, regbuf, valbuf)
-     struct type *type;
-     char regbuf[REGISTER_BYTES];
-     char *valbuf;
+i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
 {
-  /* On AIX, i386 GNU/Linux and DJGPP, floating point values are
-     returned in floating point registers.  */
-  /* FIXME: cagney/2000-02-29: This function needs to be rewritten
-     using multi-arch. Please don't keep adding to this #ifdef
-     spaghetti. */
-#if defined(I386_AIX_TARGET) || defined(I386_GNULINUX_TARGET) || defined(I386_DJGPP_TARGET)
+  int len = TYPE_LENGTH (type);
+
   if (TYPE_CODE_FLT == TYPE_CODE (type))
     {
-      double d;
-      /* 387 %st(0), gcc uses this */
-      floatformat_to_double (&floatformat_i387_ext,
-#if defined(FPDATA_REGNUM)
-			     &regbuf[REGISTER_BYTE (FPDATA_REGNUM)],
-#else /* !FPDATA_REGNUM */
-			     &regbuf[REGISTER_BYTE (FP0_REGNUM)],
-#endif /* FPDATA_REGNUM */
+      if (NUM_FREGS == 0)
+	{
+	  warning ("Cannot find floating-point return value.");
+	  memset (valbuf, 0, len);
+	}
 
-			     &d);
-      store_floating (valbuf, TYPE_LENGTH (type), d);
+      /* Floating-point return values can be found in %st(0).  */
+      if (len == TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT
+	  && TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext)
+	{
+	  /* Copy straight over, but take care of the padding.  */
+	  memcpy (valbuf, &regbuf[REGISTER_BYTE (FP0_REGNUM)],
+		  FPU_REG_RAW_SIZE);
+	  memset (valbuf + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE);
+	}
+      else
+	{
+	  /* Convert the extended floating-point number found in
+             %st(0) to the desired type.  This is probably not exactly
+             how it would happen on the target itself, but it is the
+             best we can do.  */
+	  DOUBLEST val;
+	  floatformat_to_doublest (&floatformat_i387_ext,
+				   &regbuf[REGISTER_BYTE (FP0_REGNUM)], &val);
+	  store_floating (valbuf, TYPE_LENGTH (type), val);
+	}
     }
   else
-#endif /* I386_AIX_TARGET || I386_GNULINUX_TARGET || I386_DJGPP_TARGET */
     {
-#if defined(LOW_RETURN_REGNUM)
-      int len = TYPE_LENGTH (type);
       int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
       int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
 
       if (len <= low_size)
-	memcpy (valbuf, regbuf + REGISTER_BYTE (LOW_RETURN_REGNUM), len);
+	memcpy (valbuf, &regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)], len);
       else if (len <= (low_size + high_size))
 	{
 	  memcpy (valbuf,
-		  regbuf + REGISTER_BYTE (LOW_RETURN_REGNUM),
-		  low_size);
+		  &regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)], low_size);
 	  memcpy (valbuf + low_size,
-		  regbuf + REGISTER_BYTE (HIGH_RETURN_REGNUM),
-		  len - low_size);
+		  &regbuf[REGISTER_BYTE (HIGH_RETURN_REGNUM)], len - low_size);
 	}
       else
-	error ("GDB bug: i386-tdep.c (i386_extract_return_value): Don't know how to find a return value %d bytes long", len);
-#else /* !LOW_RETURN_REGNUM */
-      memcpy (valbuf, regbuf, TYPE_LENGTH (type));
-#endif /* LOW_RETURN_REGNUM */
+	internal_error ("Cannot extract return value of %d bytes long.", len);
     }
 }
 
From eliz@delorie.com Wed Mar 22 02:32:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: jtc@redback.com
Cc: msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: gdb.texinfo broken?
Date: Wed, 22 Mar 2000 02:32:00 -0000
Message-id: <200003221032.FAA13070@indy.delorie.com>
References: <38D6CF69.6844@cygnus.com> <200003211819.NAA12435@indy.delorie.com> <38D7C977.FA3@cygnus.com> <5mitygglxs.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00461.html
Content-length: 488

> It looks like the changes to the directory entry require the latest
> makeinfo.  I tried to use makeinfo from texinfo-3.2 and it failed,
> makeinfo from texinfo-4.0 works.

What directory entry?  If you mean @direntry and @dircategory, then
they were introduced in Texinfo 3.8, so they are not the problem.

I have several old versions of Texinfo on my machine, so will look
into these problems ASAP (since it might be my fault: the error
messages mention some of the lines I changed).
From ac131313@cygnus.com Wed Mar 22 03:23:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: Mark Kettenis <kettenis@wins.uva.nl>, gdb-patches@sourceware.cygnus.com
Subject: Re: Linux sigtramp detection code moved to its proper place
Date: Wed, 22 Mar 2000 03:23:00 -0000
Message-id: <38D8ACDE.DA82F9E6@cygnus.com>
References: <200003201529.KAA10589@indy.delorie.com> <38D73C78.4B2B3562@cygnus.com> <200003220858.DAA12990@indy.delorie.com>
X-SW-Source: 2000-03/msg00462.html
Content-length: 1013

Eli Zaretskii wrote:

> > As a suggestion from left field, I've wondered if gdb.base/selftest.exp
> > should be moved to gdb.wb/selftest.exp (wb == white box) so that people
> > can freely add additional white box tests to GDB.  Checking consistency
> > between config/djgpp/<that-file> and the GDB sources could be part of
> > that testsuite.
> 
> Does that mean that you always run the test suite before preparing the
> snapshots?  If so, how do you know whether a certain new failure is
> grave enough to prevent you from making the snapshot?  I mean, if the
> test for consistency in config/djgpp/<that-file> were added, and it
> failed, how would you know that this is not some minor regression
> (which I assume do happen in other parts of GDB)?

No a snapshot is just that.  No guarentee that it will even build :-/

The reason for suggesting a check in the testsuite was that someone
adding a new file would hopefully run the testsuite after adding their
badly named file and notice the failure.

	Andrew
From fnasser@redhat.com Wed Mar 22 05:09:00 2000
From: Fernando Nasser <fnasser@redhat.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [Maint] Second testsuite maintainer
Date: Wed, 22 Mar 2000 05:09:00 -0000
Message-id: <38D8C5BA.20C4B77@redhat.com>
References: <38D84B37.B90E15AB@cygnus.com>
X-SW-Source: 2000-03/msg00463.html
Content-length: 772

Are you still going from the backlog from the Linux conference? :-)

Ben said it was OK and that he met the RedHat mkting people from the
North of Australia...

Andrew Cagney wrote:
> 
> Another addition:
> 
> Add Fernando to list of testsuite maintainers.
> 
> testsuite               Stan Shebs              shebs@apple.com
>                         Fernando Nasser         fnasser@cygnus.com
>   hp tests (gdb.hp)     *Jimmy Guo       adl-debugger-wdb-merge-guru@cup.hp.com
>   Java tests (gdb.java) Anthony Green           green@cygnus.com
> 
> Andrew

-- 
Fernando Nasser
Red Hat, Inc. - Toronto                 E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299
From fnasser@redhat.com Wed Mar 22 05:11:00 2000
From: Fernando Nasser <fnasser@redhat.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [Maint] Second testsuite maintainer
Date: Wed, 22 Mar 2000 05:11:00 -0000
Message-id: <38D8C648.3FE00B1C@redhat.com>
References: <38D84B37.B90E15AB@cygnus.com> <38D8C5BA.20C4B77@redhat.com>
X-SW-Source: 2000-03/msg00464.html
Content-length: 307

Sorry folks.

That was a personal message and I pressed the wrong button by mistake. 
:-(


-- 
Fernando Nasser
Red Hat, Inc. - Toronto                 E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299
From eliz@delorie.com Wed Mar 22 08:55:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: jtc@redback.com (J.T. Conklin), gdb-patches@sourceware.cygnus.com
Subject: Re: gdb.texinfo broken? 
Date: Wed, 22 Mar 2000 08:55:00 -0000
Message-id: <200003221655.LAA14175@indy.delorie.com>
References: <38D6CF69.6844@cygnus.com> <200003211819.NAA12435@indy.delorie.com> <5mitygglxs.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00465.html
Content-length: 4870

< 38D7C977.FA3@cygnus.com > < 5mitygglxs.fsf@jtc.redbacknetworks.com >

> >>>>> "Michael" == Michael Snyder <msnyder@cygnus.com> writes:
> Michael> %] msnyder<2>% make gdb.info
> Michael> makeinfo -I
> Michael> /cleaver/blade/msnyder/sourceware/src/gdb/doc/../../readline/doc -I
> Michael> /cleaver/blade/msnyder/sourceware/src/gdb/doc -o ./gdb.info gdb.texinfo
> Michael> Making info file `./gdb.info' from `gdb.texinfo'.
> Michael> gdb.texinfo:113: No matching `@end ifnottex'.
> Michael> gdb.texinfo:156: Unmatched `@end'.
> 
> It looks like the changes to the directory entry require the latest
> makeinfo.  I tried to use makeinfo from texinfo-3.2 and it failed,
> makeinfo from texinfo-4.0 works.

Okay, I think I know what's going on with gdb.texinfo and old versions
of Texinfo.

First, I'm guessing that Michael Snyder didn't "cvs up annotate.texi".
The old version was written as a separate manual, so it had its own
Top node etc.  The new gdb.texinfo @include's annotate.texi, so
Michael gets error messages about multiple Top nodes etc..  When I
introduced the changes into gdb.texinfo to include the Annotations
chapter, I changed annotate.texi accordingly, to avoid all these
problems.

This leaves us with two error messages cited above:

 gdb.texinfo:113: No matching `@end ifnottex'.
 gdb.texinfo:156: Unmatched `@end'.

These come from Texinfo 3.11 and later (I tried 3.12; I don't have
3.11 on my disk), which is where @ifnottex was introduced.  Texinfo
3.9 and earlier doesn't grok @ifnottex at all, and Texinfo 4.0
converts the file without any problems.

The problem with @ifnottex in Texinfo 3.12 are actually a
bug/misfeature in that version: conditionals such as @ifnottex cannot
span node boundaries.  Here's a ChangeLog entry from the latest
Texinfo distribution:

  Sun Nov 29 17:12:35 1998  Karl Berry  <karl@gnu.org>

	  [...]
	  * makeinfo/insertion.c (discard_insertions): Let any conditional
	  cross node boundary.  (So the @top node can be wrapped
	  in @ifnottex, for example.)

This was done during the (long) pretest of Texinfo 4.0.

Since we decided not to depend on Texinfo 4.0, it seems we have 2
alternatives:

  - Toss @ifnottex and go back to using @ifinfo.  This will disallow
    producing the manual in the HTML format (only possible with
    Texinfo 4.0).

  - Duplicate the offending Top node, once wrapped with @ifinfo, the
    other time wrapped with @ifhtml.  This works for me with Texinfo
    3.12 and 4.0.  The patch for this alternative is below.

I recommend to use the second alternative, even though it's kludgey.

Note that if we use @ifnottex, we need to require Texinfo 3.11 or
later; Texinfo 3.9 will not work.

--- gdb/doc/gdb.t~2	Wed Mar 22 12:49:54 2000
+++ gdb/doc/gdb.texinfo	Wed Mar 22 18:02:48 2000
@@ -110,7 +110,7 @@
 @end titlepage
 @page
 
-@ifnottex
+@ifinfo
 @node Top
 @top Debugging with @value{GDBN}
 
@@ -153,7 +153,52 @@
 * Index::                       Index
 @end menu
 
-@end ifnottex
+@end ifinfo
+
+@ifhtml
+@node Top
+@top Debugging with @value{GDBN}
+
+This file describes @value{GDBN}, the @sc{gnu} symbolic debugger.
+
+This is the @value{EDITION} Edition, @value{DATE}, for @value{GDBN} Version 
+@value{GDBVN}.
+
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
+@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} files
+* Targets::                     Specifying a debugging target
+* Configurations::              Configuration-specific information
+* Controlling GDB::             Controlling @value{GDBN}
+* Sequences::                   Canned sequences of commands
+* Emacs::                       Using @value{GDBN} under @sc{gnu} Emacs
+* Annotations::                 @value{GDBN}'s annotations interface.
+
+* GDB Bugs::                    Reporting bugs in @value{GDBN}
+* Formatting Documentation::    How to format and print @value{GDBN} documentation
+
+* Command Line Editing::        Command Line Editing
+* Using History Interactively:: Using History Interactively
+* Installing GDB::              Installing GDB
+* Index::                       Index
+@end menu
+
+@end ifhtml
 
 @node Summary
 @unnumbered Summary of @value{GDBN}
From eliz@delorie.com Wed Mar 22 10:10:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: Jim Blandy <jimb@zwingli.cygnus.com>
Cc: hjl@lucon.org, gdb@sourceware.cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Problems with hardware watchpoint on ia32.
Date: Wed, 22 Mar 2000 10:10:00 -0000
Message-id: <200003221806.NAA14225@indy.delorie.com>
References: <20000307132401.A20282@valinux.com> <200003081008.FAA16481@indy.delorie.com> <20000308084304.A3150@lucon.org> <200003091210.HAA19857@indy.delorie.com> <npya7c6zn7.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-03/msg00466.html
Content-length: 724

> Eli's test of the value's type is incorrect if the watch expression
> contains a structure comparison, like (foo == bar) || (something
> else), where foo and bar are structures.  In that case, there will be
> a value of type "struct", not at the end of the value list, but which
> should be watched in its entirety.

Errr... do you have an actual example program where this happens?

I seem to be unable to reproduce the problem, at least in a C program:
whenever I say "watch foo == bar" (where foo and bar are structs), GDB
curses thusly:

	Structure has no component named operator==.

Am I missing something?

In case it matters, I tested this with a DJGPP-compiled program; DJGPP
by default uses COFF debugging info.
From msnyder@cygnus.com Wed Mar 22 10:11:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Document the ThreadInfo remote protocol queries
Date: Wed, 22 Mar 2000 10:11:00 -0000
Message-id: <38D90CE6.4D18@cygnus.com>
References: <200003202316.PAA07888@cleaver.cygnus.com> <38D6FCE2.EBD9830F@cygnus.com> <38D7C38C.6CB0@cygnus.com> <38D85C2F.FF89881D@cygnus.com>
X-SW-Source: 2000-03/msg00467.html
Content-length: 130

Andrew Cagney wrote:

> Should ``C'' also be suceeded by something like ``qThread''?  Is ``C''
> still used?

'qC' is still used.
From msnyder@cygnus.com Wed Mar 22 10:20:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Running the inferior from breakpoint commands
Date: Wed, 22 Mar 2000 10:20:00 -0000
Message-id: <38D90EEC.1566@cygnus.com>
References: <200003120759.CAA24402@indy.delorie.com> <200003151624.LAA01228@indy.delorie.com> <38D7F31D.1827@cygnus.com> <200003220930.EAA13024@indy.delorie.com>
X-SW-Source: 2000-03/msg00468.html
Content-length: 2019

Eli Zaretskii wrote:

> (I did look in the manual, but since the snippet you cited isn't
> indexed, I didn't find it.  [Yes, I will submit a manual change to add
> an index entry.])

http://sourceware.cygnus.com/gdb/onlinedocs/gdb_6.html#SEC34
four or five paragraphs down.

> To me, the fact that the test suite tried to do this was a sign that
> it was supposed to work.

Not a very reliable guide, I'm afraid.  That test was added in
1995, but as far as I know it did not work even then.  Perhaps
no one knew that it didn't.

> As an aside: is there any place I can find the list of tests which
> fail, and on what systems do they fail?

I'm afraid not.  Such a list would change daily.

> > If you seriously want to undertake this project, we can
> > work on a list of criteria that should be tested (things
> > that can go wrong).
> 
> I will put it on my todo (thanks for the list of things to test; 

Remember it was just a partial list off the top of my head.
I'm sure there are lots more issues to consider.

> > On top of that, I have grave concerns about being able
> > to correctly save and restore all of the internal
> > debugger state necessary to make this work (the
> > infrun execution state, the expression chain, etc.)
> 
> Err... I'm not sure this should be of concern here (but perhaps I
> don't see the subtle issues clearly enough): if the breakpoint
> commands change any of these global entities, I think the user expects
> the changes to be visible after these commands are processed.  For
> example, if the commands delete the breakpoint where you stopped, the
> user will expect the breakpoint to remain deleted after that (the
> changes I submitted do handle this specific case).  Am I missing
> something?

I'm not talking about anything user-visible -- I'm talking about
GDB's internal state.  All the variables with which it keeps 
track of what it's doing and what the child program is doing.
I don't have anything specific in mind, I just know there is
a lot to think about.

Michael
From dima@Chg.RU Wed Mar 22 11:48:00 2000
From: Dmitry Sivachenko <dima@Chg.RU>
To: gdb-patches@sourceware.cygnus.com
Subject: typo in gdb.texinfo
Date: Wed, 22 Mar 2000 11:48:00 -0000
Message-id: <200003221948.WAA31796@netserv1.chg.ru>
X-SW-Source: 2000-03/msg00469.html
Content-length: 1030

Please swap these two lines in the @menu.  This is how these chapters
actually appear in the manual.

Thank you in advance,
Dima.

--- gdb.1.4.texinfo	Wed Mar 22 22:45:32 2000
+++ gdb.1.4.texinfo.new	Wed Mar 22 22:44:43 2000
@@ -142,13 +142,13 @@
 * Controlling GDB::             Controlling @value{GDBN}
 * Sequences::                   Canned sequences of commands
 * Emacs::                       Using @value{GDBN} under @sc{gnu} Emacs
-* Annotations::                 @value{GDBN}'s annotations interface.
+* Annotations::                 @value{GDBN}'s annotations interface
 
 * GDB Bugs::                    Reporting bugs in @value{GDBN}
-* Formatting Documentation::    How to format and print @value{GDBN} documentation
 
 * Command Line Editing::        Command Line Editing
 * Using History Interactively:: Using History Interactively
+* Formatting Documentation::    How to format and print @value{GDBN} documentation
 * Installing GDB::              Installing GDB
 * Index::                       Index
 @end menu
From assign@gnu.org Wed Mar 22 12:14:00 2000
From: assignments <assign@gnu.org>
To: gdb-patches@sourceware.cygnus.com
Subject: GDB assigns/disclaims
Date: Wed, 22 Mar 2000 12:14:00 -0000
Message-id: <200003222013.PAA12928@delysid.gnu.org>
X-SW-Source: 2000-03/msg00470.html
Content-length: 1183

The following disclaimers and/or assignments concerning GDB
have recently been added to the file copyright.list here at the 
Free Software Foundation.  If you have any questions or corrections,
please send them to my general work address, 3diff@gnu.org.
                                     Thanks!
                                     Brian Youmans
                                     Assignments Clerk

GDB     David Whedon    US 1975 2000-02-25
Assigns past and future changes. (ser-tcp.c, command.[ch], top.c,
commands.exp, gdbint.texinfo)
dwhedon@gordian.com

GDB     Gordian 2000-03-01
Disclaims changes by David Whedon in the past and for one year.

GDB Andreas Jaeger      Germany 1969    2000-02-16
Assigns past and future changes.
aj@suse.de

GDB     Serge V. Vakulenko      Russia 1966     2000-01-31
Assigns past and future changes.  (patch for remote debugging of
Atmel AVR microcontrollers via the serial port)
vak@cronyx.ru

GDB     Techniche Universita:t Mu:nchen, Institute for Real-Time Computer Systems       2000-02-17
Disclaims changes by Gunter Magin and Linux BDM device driver by Michael Schraut
and Gunter Magin.
Georg.Faerber@rcs.ei.tum.de (Georg Fa:rber)
From msnyder@cygnus.com Wed Mar 22 12:41:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: Jim Blandy <jimb@cygnus.com>, hjl@lucon.org, gdb@sourceware.cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Problems with hardware watchpoint on ia32.
Date: Wed, 22 Mar 2000 12:41:00 -0000
Message-id: <38D92F29.A3D@cygnus.com>
References: <20000307132401.A20282@valinux.com> <200003081008.FAA16481@indy.delorie.com> <20000308084304.A3150@lucon.org> <200003091210.HAA19857@indy.delorie.com> <npya7c6zn7.fsf@zwingli.cygnus.com> <200003221806.NAA14225@indy.delorie.com>
X-SW-Source: 2000-03/msg00471.html
Content-length: 759

Eli Zaretskii wrote:
> 
> > Eli's test of the value's type is incorrect if the watch expression
> > contains a structure comparison, like (foo == bar) || (something
> > else), where foo and bar are structures.  In that case, there will be
> > a value of type "struct", not at the end of the value list, but which
> > should be watched in its entirety.
> 
> Errr... do you have an actual example program where this happens?
> 
> I seem to be unable to reproduce the problem, at least in a C program:
> whenever I say "watch foo == bar" (where foo and bar are structs), GDB
> curses thusly:
> 
>         Structure has no component named operator==.

Argh... gdb does not seem to know that struct compare
is permitted.  I'll publish a patch.

				Michael Snyder
From msnyder@cygnus.com Wed Mar 22 12:43:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH]: Allow struct compare in expressions.
Date: Wed, 22 Mar 2000 12:43:00 -0000
Message-id: <200003222043.MAA10512@cleaver.cygnus.com>
X-SW-Source: 2000-03/msg00472.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  <msnyder@cleaver.cygnus.com>

        * 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  <msnyder@cleaver.cygnus.com>
+ 
+ 	* 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  <kettenis@gnu.org>
  
  	* 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 gkm@cygnus.com Wed Mar 22 12:45:00 2000
From: gkm@cygnus.com (glen mccready)
To: Elena Zannoni <ezannoni@cygnus.com>, gdb-patches@sourceware.cygnus.com
Cc: Fernando Nasser <fnasser@redhat.com>, Chris Faylor <cgf@cygnus.com>
Subject: sim/arm/wrapper.c fix.
Date: Wed, 22 Mar 2000 12:45:00 -0000
Message-id: <200003222045.MAA03959@cygint.cygnus.com>
X-SW-Source: 2000-03/msg00473.html
Content-length: 1457

Index: ChangeLog
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/arm/ChangeLog,v
retrieving revision 1.77
diff -c -b -r1.77 ChangeLog
*** ChangeLog	1998/09/14 17:04:36	1.77
--- ChangeLog	2000/03/22 20:27:15
***************
*** 1,3 ****
--- 1,7 ----
+ Wed Mar 22 15:24:21 2000  glen mccready  <gkm@pobox.com>
+ 
+ 	* wrapper.c (sim_open,sim_close): Copy into myname, free myname
+ 
  Mon Sep 14 09:00:05 1998  Nick Clifton  <nickc@cygnus.com>
  
  	* wrapper.c (sim_open): Set endianness according to BFD or command
Index: wrapper.c
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/arm/wrapper.c,v
retrieving revision 1.24
diff -c -b -r1.24 wrapper.c
*** wrapper.c	1998/09/14 17:04:36	1.24
--- wrapper.c	2000/03/22 20:27:15
***************
*** 347,353 ****
       char **argv;
  {
    sim_kind = kind;
!   myname = argv[0];
    sim_callback = ptr;
    
    /* Decide upon the endian-ness of the processor.
--- 347,354 ----
       char **argv;
  {
    sim_kind = kind;
!   if (myname) free(myname);
!   myname = xstrdup(argv[0]);
    sim_callback = ptr;
    
    /* Decide upon the endian-ness of the processor.
***************
*** 405,411 ****
       SIM_DESC sd;
       int quitting;
  {
!   /* nothing to do */
  }
  
  SIM_RC
--- 406,413 ----
       SIM_DESC sd;
       int quitting;
  {
!   if (myname) free(myname);
!   myname = 0;
  }
  
  SIM_RC
From Peter.Schauer@regent.e-technik.tu-muenchen.de Wed Mar 22 12:57:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] printcmd.c: Truncate output width of p/a and x/a if necessary
Date: Wed, 22 Mar 2000 12:57:00 -0000
Message-id: <200003222057.VAA24195@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-03/msg00474.html
Content-length: 1272

FYI,

I checked in the attached patch. It gets rid of the
gdb.base/long_long.exp: x/a &oct
testsuite failure on Solaris 2.7 sparc. For more information see

http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00555.html


2000-03-22  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>

	* printcmd.c (print_scalar_formatted):  Truncate addresses to the
	size of a target pointer before passing them to print_address.


Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.1.1.8
diff -u -p -r1.1.1.8 printcmd.c
--- printcmd.c	2000/02/05 07:29:47	1.1.1.8
+++ printcmd.c	2000/03/22 20:48:31
@@ -443,7 +443,14 @@ print_scalar_formatted (valaddr, type, f
       break;
 
     case 'a':
-      print_address (unpack_pointer (type, valaddr), stream);
+      {
+	/* Truncate address to the size of a target pointer, avoiding
+	   shifts larger or equal than the width of a CORE_ADDR.  */
+	CORE_ADDR addr = unpack_pointer (type, valaddr);
+	if (TARGET_PTR_BIT < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+	  addr &= ((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1;
+	print_address (addr, stream);
+      }
       break;
 
     case 'c':

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From taylor@cygnus.com Wed Mar 22 12:58:00 2000
From: David Taylor <taylor@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Allow struct compare in expressions.
Date: Wed, 22 Mar 2000 12:58:00 -0000
Message-id: <200003222057.PAA23063@texas.cygnus.com>
X-SW-Source: 2000-03/msg00476.html
Content-length: 5148

    From: Michael Snyder <msnyder@cygnus.com>
    Date: Wed, 22 Mar 2000 12:43:56 -0800 (PST)

    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  <msnyder@cleaver.cygnus.com>

	    * 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.

Approved.

    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  <msnyder@cleaver.cygnus.com>
    + 
    +       * 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  <kettenis@gnu.org>

	    * 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 *));


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: minor watchpoint code cleanup
  2000-03-21 15:33           ` Jim Blandy
@ 2000-04-01  0:00             ` Mark Kettenis
  2000-03-21 15:57               ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2000-04-01  0:00 UTC (permalink / raw)
  To: jimb; +Cc: eliz, gdb-patches

   From: Jim Blandy <jimb@cygnus.com>
   Date: 21 Mar 2000 18:33:30 -0500

   > The reason is that IMHO we should avoid making a variable (`size')
   > serve two puproses at the same time.

   Good suggestion --- done.

   I'm just waiting for Mark's approval.

Approved.

Mark
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: Philippe De Muyter <phdm@macqel.be>, "gdb-patches@sourceware.cygnus.com" <gdb-patches@sourceware.cygnus.com>
Subject: Re: HAVE_POLL is not enough
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38BCBC3F.56354ECB@cygnus.com>
References: <200002211141.MAA05937@mail.macqel.be> <14513.24286.123785.77651@kwikemart.cygnus.com>
X-SW-Source: 2000-q1/msg00438.html
Content-length: 1724

Elena Zannoni wrote:
> 
> Philippe De Muyter writes:
>  > With the gdb cvs tree of 2000-02-19, on m68k-motorola-sys, configure
>  > correctly detect  that we have `poll', but gdb incorrectly assumes that
>  > `poll' can be used to wait for `stdin'.  On m68k-motorola-sysv, tty's
>  > are not stream-based and not `poll'able.  Should the configure test
>  > be enhanced ? I don't think so if we need to run a target program to check
>  > that, because it would fail if we cross-compile gdb, but if it can be
>  > determined by other ways, like the presence of some constants in some
>  > header files then I would agree.  We could also always compile in the `poll'
>  > version if HAVE_POLL, but switch to the the fall-back method at run time if
>  > poll fails with POLLNVAL.
>  >
> 
> Right now the decision on whether to run gdb with or without the event
> loop is determined by the user as start up, and it is not detected
> neither by configure or at run time. The easiest thing to do for now
> is probably tell the user what happened and switch to
> non-event-loop mode.  Maybe some configury work could be done to
> determine whether the tty's can be pollable, I am not familiar with
> your system enough to know whether this is anything feasible.  Sorry I
> cannot be of more help here.
> How about the 'target async' part, would that work?

As far as I know, this problem is still present.

Following on from Elena's comment.  Is there any known work around or
other hack available?

If we get really desparate there is always the option of putting:

	HOST_POLL_BROKEN

in

	config/m68k/xm-m68kv4.h

:-( (And yes, I'm about to get really desperate).

Philippe, if GDB is forced to use select, does it work?

	Andrew
From jimb@cygnus.com Sat Apr 01 00:00:00 2000
From: Jim Blandy <jimb@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: RFA: Improved C++ type printing
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200002041447.JAA29317@zwingli.cygnus.com>
X-SW-Source: 2000-q1/msg00075.html
Content-length: 8402

These changes tighten up some of the munging of C++ names GDB does
when printing class methods.  They remove a number of test suite
failures that appear when using Dwarf 2 debugging information (due to
permissible variation between GCC's stabs and Dwarf 2 output).

Specifically:

- In some circumstances, GDB's symbol tables hold qualified names
  of operators or methods ("classname::methodname"), but since GDB is
  printing them out as part of the class definition, the qualifiers
  are redundant (and incorrect, I think).  GDB used to try to peel off
  all the qualifiers using strrchr to scan for colons, but this would
  reach inside template arguments or the function's argument list
  itself, generating garbage.  (In other words, exactly the kind of
  failure you'd expect when using simple-minded string hacking to
  operate on structured data like C++ qualified names.)
  Unfortunately, GDB only has this data in string form, so every
  solution involves some on-the-fly parsing.  My change simply does it
  better.

- C++ supports `type conversion operators', which are operators that
  allow you to specify conversions from user-defined types to basic
  types.  They have names that look like `operator int ()'.  GDB wants
  to avoid printing out the return types for such operators, because
  they are redundant.  However, it has no good way to recognize such
  operators, other than by looking at their name.  Without this
  change, GDB uses the rather reckless heuristic of checking for a
  space after the word "operator".  This assumes that the debug info
  will never provide names like "operator =", and is flat-out wrong
  for things like "operator new" and "operator delete".  Again, my
  change replaces an inadequate parser with something that actually
  does the job according to the C++ grammar.


 
2000-02-04  Jim Blandy  <jimb@redhat.com>

	* c-typeprint.c (remove_qualifiers): New function.
	(c_type_print_base): Use it to remove qualifiers from C++
	qualified names, not strrchr.

	* c-typeprint.c (c_type_print_base): Recognize type conversion
 	operators by calling is_type_conversion_operator.
	(is_type_conversion_operator): New function.
	
Index: c-typeprint.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/c-typeprint.c,v
retrieving revision 2.41
diff -c -r2.41 c-typeprint.c
*** c-typeprint.c	2000/02/01 03:09:00	2.41
--- c-typeprint.c	2000/02/04 14:31:18
***************
*** 433,438 ****
--- 433,567 ----
    fprintf_filtered (stream, ")");
  }
  
+ 
+ /* Return true iff the j'th overloading of the i'th method of TYPE
+    is a type conversion operator, like `operator int () { ... }'.
+    When listing a class's methods, we don't print the return type of
+    such operators.  */
+ static int
+ is_type_conversion_operator (struct type *type, int i, int j)
+ {
+   /* I think the whole idea of recognizing type conversion operators
+      by their name is pretty terrible.  But I don't think our present
+      data structure gives us any other way to tell.  If you know of
+      some other way, feel free to rewrite this function.  */
+   char *name = TYPE_FN_FIELDLIST_NAME (type, i);
+ 
+   if (strncmp (name, "operator", 8) != 0)
+     return 0;
+ 
+   name += 8;
+   if (! strchr (" \t\f\n\r", *name))
+     return 0;
+ 
+   while (strchr (" \t\f\n\r", *name))
+     name++;
+ 
+   if (strncmp (name, "new", 3) == 0)
+     name += 3;
+   else if (strncmp (name, "delete", 6) == 0)
+     name += 6;
+   else
+     return 0;
+ 
+   /* Is that really the end of the name?  */
+   if (('a' <= *name && *name <= 'z')
+       || ('A' <= *name && *name <= 'Z')
+       || ('0' <= *name && *name <= '9')
+       || *name == '_')
+     /* No, so the identifier following "operator" must be a type name,
+        and this is a type conversion operator.  */
+     return 1;
+ 
+   /* That was indeed the end of the name, so it was `operator new' or
+      `operator delete', neither of which are type conversion operators.  */
+   return 0;
+ }
+ 
+ 
+ /* Given a C++ qualified identifier QID, strip off the qualifiers,
+    yielding the unqualified name.  The return value is a pointer into
+    the original string.
+ 
+    It's a pity we don't have this information in some more structured
+    form.  Even the author of this function feels that writing little
+    parsers like this everywhere is stupid.  */
+ static char *
+ remove_qualifiers (char *qid)
+ {
+   int quoted = 0;		/* zero if we're not in quotes;
+ 				   '"' if we're in a double-quoted string;
+ 				   '\'' if we're in a single-quoted string.  */
+   int depth = 0;		/* number of unclosed parens we've seen */
+   char *parenstack = (char *) alloca (strlen (qid));
+   char *scan;
+   char *last = 0;		/* The character after the rightmost
+ 				   `::' token we've seen so far.  */
+ 
+   for (scan = qid; *scan; scan++)
+     {
+       if (quoted)
+ 	{
+ 	  if (*scan == quoted)
+ 	    quoted = 0;
+ 	  else if (*scan == '\\' && *(scan + 1))
+ 	    scan++;
+ 	}
+       else if (scan[0] == ':' && scan[1] == ':')
+ 	{
+ 	  /* If we're inside parenthesis (i.e., an argument list) or
+ 	     angle brackets (i.e., a list of template arguments), then
+ 	     we don't record the position of this :: token, since it's
+ 	     not relevant to the top-level structure we're trying
+ 	     to operate on.  */
+ 	  if (depth == 0)
+ 	    {
+ 	      last = scan + 2;
+ 	      scan++;
+ 	    }
+ 	}
+       else if (*scan == '"' || *scan == '\'')
+ 	quoted = *scan;
+       else if (*scan == '(')
+ 	parenstack[depth++] = ')';
+       else if (*scan == '[')
+ 	parenstack[depth++] = ']';
+       /* We're going to treat <> as a pair of matching characters,
+ 	 since we're more likely to see those in template id's than
+ 	 real less-than characters.  What a crock.  */
+       else if (*scan == '<')
+ 	parenstack[depth++] = '>';
+       else if (*scan == ')' || *scan == ']' || *scan == '>')
+ 	{
+ 	  if (depth > 0 && parenstack[depth - 1] == *scan)
+ 	    depth--;
+ 	  else
+ 	    {
+ 	      /* We're going to do a little error recovery here.  If we
+ 		 don't find a match for *scan on the paren stack, but
+ 		 there is something lower on the stack that does match, we
+ 		 pop the stack to that point.  */
+ 	      int i;
+ 
+ 	      for (i = depth - 1; i >= 0; i--)
+ 		if (parenstack[i] == *scan)
+ 		  {
+ 		    depth = i;
+ 		    break;
+ 		  }
+ 	    }
+ 	}
+     }
+ 
+   if (last)
+     return last;
+   else
+     /* We didn't find any :: tokens at the top level, so declare the
+        whole thing an unqualified identifier.  */
+     return qid;
+ }
+ 
+ 
  /* Print any array sizes, function arguments or close parentheses
     needed after the variable name (to describe its type).
     Args work like c_type_print_varspec_prefix.  */
***************
*** 896,903 ****
  		    }
  		  else if (!is_constructor &&	/* constructors don't have declared types */
  			   !is_full_physname_constructor &&	/*    " "  */
! 			   !strstr (method_name, "operator "))	/* Not a type conversion operator */
! 		    /* (note space -- other operators don't have it) */
  		    {
  		      type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
  				  "", stream, -1);
--- 1025,1031 ----
  		    }
  		  else if (!is_constructor &&	/* constructors don't have declared types */
  			   !is_full_physname_constructor &&	/*    " "  */
! 			   !is_type_conversion_operator (type, i, j))
  		    {
  		      type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
  				  "", stream, -1);
***************
*** 931,945 ****
  		  else
  		    {
  		      char *p;
! 		      char *demangled_no_class = strrchr (demangled_name, ':');
  
!                       if (demangled_no_class == NULL)
!                         demangled_no_class = demangled_name;
!                       else
!                         {
!                           ++demangled_no_class; /* skip over last ':' */
! 			}
! 		      /* get rid of the static word appended by the demangler */
  		      p = strstr (demangled_no_class, " static");
  		      if (p != NULL)
  			{
--- 1059,1068 ----
  		  else
  		    {
  		      char *p;
! 		      char *demangled_no_class
! 			= remove_qualifiers (demangled_name);
  
! 		      /* get rid of the `static' appended by the demangler */
  		      p = strstr (demangled_no_class, " static");
  		      if (p != NULL)
  			{
From scottb@netwinder.org Sat Apr 01 00:00:00 2000
From: Scott Bambrough <scottb@netwinder.org>
To: Nick Clifton <nickc@cygnus.com>
Cc: rearnsha@arm.com, pb@futuretv.com, gcc-patches@gcc.gnu.org, binutils@sourceware.cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Incompatability between APCS and ATPCS
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38C0442A.1991F3AE@netwinder.org>
References: <200003032226.OAA16432@elmo.cygnus.com>
X-SW-Source: 2000-q1/msg00486.html
Content-length: 584

Nick Clifton wrote:
 
> One thing that this patch does not do is implement the GDB side of
> things, maybe somebody else would like to do that ?
> 
> What do you think - should we go with this patch ?

Thanks for taking the time to look into this problem.  I haven't had time to
evaluate the patch yet, but I will volunteer to implement the GDB side of things
once we have agreed on the patch.  I'm trying to get some other problems fixed
up before GDB 5.0 ships.

Scott

-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org
From dima@Chg.RU Sat Apr 01 00:00:00 2000
From: Dmitry Sivachenko <dima@Chg.RU>
To: eliz@is.elta.co.il
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Patch to gdb.texinfo
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003130944.MAA64255@netserv1.chg.ru>
References: <200003130906.MAA63437@netserv1.chg.ru> <200003121611.TAA45044@netserv1.chg.ru> <200003130859.DAA25938@indy.delorie.com> <200003130933.EAA25971@indy.delorie.com>
X-SW-Source: 2000-q1/msg00663.html
Content-length: 771

   >    > -For complicated cases, you can specify an arbitrary number of @r{-T}@var{section} @var{address}                                               
   >    > +For complicated cases, you can specify an arbitrary number of @samp{@r{-T}@var{section} @var{address}}                                        

   >    I don't see the rationale for this change.  Could you please explain?
   >
   > Look at the printable copy.  Single quotes around `-Tsection address'
   > looks better.

   You don't need a @samp to add the quotes.

   What I wanted to point out was that a @samp whose effect is
   effectively undone by @r and @var is not necessary.

   I'll let Stan decide on this one.

OK, may be it is better to replace @samp with explicit quotes (`.....').

--dima
From eliz@delorie.com Sat Apr 01 00:00:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: shebs@shebs.cnchost.com
Cc: gdb-patches@sourceware.cygnus.com, 3diff@gnu.org
Subject: Re: GDB manual changes
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003312310.SAA07152@indy.delorie.com>
References: <38E0E672.478B088F@shebs.cnchost.com>
X-SW-Source: 2000-q1/msg01143.html
Content-length: 1283

> ! @c below produces an acceptable overful hbox. --mew 13aug1993
>   @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.)
>   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
> --- 3661,3675 ----
>   they are assigned by @value{GDBN} to give you a way of designating stack
>   frames in @value{GDBN} commands.
>   
> ! @c The -fomit-frame-pointer below perennially causes hbox overflow
> ! @c underflow problems.
>   @cindex frameless execution
>   Some compilers provide a way to compile functions so that they operate
> ! without stack frames.  (For example, the @value{GCC} option
> ! @example
> ! @samp{-fomit-frame-pointer}
> ! @end example
> ! generates functions without a frame.)

Ouch!  Isn't there a better way of avoiding overflow?  I usually put
in some slack words to do that.  Do you want me to try to find a
better solution?

Anyway, you probably want @noindent after the @example, if this is
left alone.
From msnyder@cygnus.com Sat Apr 01 00:00:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Running the inferior from breakpoint commands
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38D7F31D.1827@cygnus.com>
References: <200003120759.CAA24402@indy.delorie.com> <200003151624.LAA01228@indy.delorie.com>
X-SW-Source: 2000-q1/msg00875.html
Content-length: 8368

Eli Zaretskii wrote:
> 
> This is about the problem described in the following message:
> 
>   http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00684.html
> 
> The relevant test cases are in gdb/testsuite/gdb.base/commands.exp.

Eli, 

While this is intriguing, I don't think it's as simple as
you suppose.  In the first place, it is a documented limitation
that GDB only partially handles breakpoint command lists if they
contain commands that run the target.  The GDB manual states:

	You can use breakpoint commands to start your program
	up again.  Simply use the continue command, or step,
	or any other command that resumes execution.  Any
	other commands in the command list are ignored, after
	a command that resumes execution.

Note the last sentence.  So despite the fact that the 
testsuite seems to imply that this should work, it is
not expected to.  I have no idea what that test is 
doing in there.  The commands-on-breakpoint behavior
is NOT intended to be recursive.

Therefore what you are trying to do is more of an 
enhancement than a bug fix.  As such, I would need to
see some new tests; and given the difficulty of solving
this problem correctly, they would have to be pretty
thorough.  I would have to see tests for every kind of
execution command (step, next, call, finish, return, etc.)
combined with a wide variety of "things that could go
wrong (expression evaluation using globals, locals, 
recursive vs. non-recursive functions, multiple 
breakpoints on mutually recursive functions...)

If you seriously want to undertake this project, we can
work on a list of criteria that should be tested (things
that can go wrong).  Off the top of my head, I can think
of:

    * What happens if we continue and hit another BP?
    * What happens if we continue and hit the same
      BP, eg. in a recursive function?
    * What happens if we continue and switch threads?
    * What happens if we continue and the program terminates?
    * What happens if we continue, hit another BP, 
      then that BP continues and we hit the first BP?
    * What happens if the program isn't continuable?

On top of that, I have grave concerns about being able
to correctly save and restore all of the internal
debugger state necessary to make this work (the
infrun execution state, the expression chain, etc.)
Not to discourage you from trying it, but I would be 
very suspicious of any effort that only took a few days
to complete.

				Sincerely,
				Michael Snyder

> Here are the patches which correct the problems I described in the
> original message.  After applying them, the test program works as I'd
> expect (and as commands.exp seems to want).
> 
> I didn't see any replies to my message, so I still don't know whether
> the original code works for other platforms (I think it shouldn't).
> Could someone please try commands.exp and tell what you get?
> 
> Please tell if it's okay to commit these changes.  If they are
> accepted, I will also send changes for the docs, since I think there
> are some limitations on what breakpoint commands can do that should be
> documented.
> 
> 2000-03-14  Eli Zaretskii  <eliz@is.elta.co.il>
> 
>         * breakpoint.c (breakpoint_alive_p): New function.
>         (bpstat_do_actions): Allow recursive invocation, provided that the
>         argument isn't identical to the one last seen.  Stop executing
>         commands if their breakpoint no longer exists (e.g., was deleted
>         by the previous command).  Save and restore the bpstat chain if
>         the command proceeded the inferior.  Invoke bpstat_do_actions
>         recursively to process the new bpstat produced when the proceeding
>         inferior stops.
> 
> --- gdb/breakpoint.c~3  Wed Mar  8 20:02:20 2000
> +++ gdb/breakpoint.c    Tue Mar 14 18:17:50 2000
> @@ -1820,6 +1820,20 @@ bpstat_clear_actions (bs)
>      }
>  }
> 
> +/* Is the breakpoint BPT still defined?  */
> +static int
> +breakpoint_alive_p (bpt)
> +     struct breakpoint *bpt;
> +{
> +  struct breakpoint *b;
> +
> +  ALL_BREAKPOINTS (b)
> +    if (b == bpt)
> +      return 1;
> +
> +  return 0;
> +}
> +
>  /* Stub for cleaning up our state if we error-out of a breakpoint command */
>  /* ARGSUSED */
>  static void
> @@ -1838,19 +1852,23 @@ void
>  bpstat_do_actions (bsp)
>       bpstat *bsp;
>  {
> -  bpstat bs;
> +  static bpstat last_bpstat;
> +  bpstat bs, saved_bs;
>    struct cleanup *old_chain;
>    struct command_line *cmd;
> +  int bs_idx, cmd_idx;
> 
>    /* Avoid endless recursion if a `source' command is contained
>       in bs->commands.  */
> -  if (executing_breakpoint_commands)
> +  if (executing_breakpoint_commands
> +      && memcmp (bsp, &last_bpstat, sizeof (*bsp)) == 0)
>      return;
> 
> +  last_bpstat = *bsp;
> +
>    executing_breakpoint_commands = 1;
>    old_chain = make_cleanup (cleanup_executing_breakpoints, 0);
> 
> -top:
>    /* Note that (as of this writing), our callers all appear to
>       be passing us the address of global stop_bpstat.  And, if
>       our calls to execute_control_command cause the inferior to
> @@ -1863,26 +1881,78 @@ top:
>    bs = *bsp;
> 
>    breakpoint_proceeded = 0;
> -  for (; bs != NULL; bs = bs->next)
> +  for (bs_idx = 0; bs != NULL; bs = bs->next, bs_idx++)
>      {
> +      /* If someone deleted the breakpoint associated with this
> +        bpstat, we cannot run its commands, since deleting a
> +        breakpoint nukes its command lines.  */
> +      if (!breakpoint_alive_p (bs->breakpoint_at))
> +       continue;
>        cmd = bs->commands;
> +      cmd_idx = 0;
>        while (cmd != NULL)
>         {
> +         struct cleanup *pchain;
> +         int idx;
> +
> +         saved_bs = bpstat_copy (*bsp);
> +         pchain = make_cleanup ((make_cleanup_func)bpstat_clear, &saved_bs);
>           execute_control_command (cmd);
> 
>           if (breakpoint_proceeded)
> +           {
> +             /* The inferior is proceeded by the command.  We cannot
> +                continue, as the bpstat chain has been blown away by
> +                wait_for_inferior.  But since execution has stopped
> +                again, there is a new bpstat to look at, so start
> +                over.  */
> +             bpstat_do_actions (bsp);
> +
> +             /* Now we need to proceed with any actions of the old
> +                bpstat chain which are still not done.  But first, we
> +                need to restore the old chain, since it was blown
> +                away.  */
> +             *bsp = saved_bs;
> +             bs = *bsp;
> +             last_bpstat = *bsp;
> +
> +             /* Recursive invocation of bpstat_do_actions could reset
> +                breakpoint_proceeded and
> +                executing_breakpoint_commands, so restore their
> +                values.  */
> +             breakpoint_proceeded = 1;
> +             executing_breakpoint_commands = 1;
> +
> +             /* Skip all the actions that were already done.  */
> +             for (idx = 0; idx < bs_idx; idx++)
> +               {
> +                 bs->commands = NULL;
> +                 bs = bs->next;
> +               }
> +             cmd = bs->commands;
> +           }
> +         else
> +           {
> +             bpstat_clear (&saved_bs);
> +             discard_cleanups (pchain);
> +           }
> +         cmd_idx++;
> +         /* The command we just ran could have deleted the
> +            breakpoint.  This nukes the command lines for this
> +            breakpoint, so we cannot continue them.  */
> +         if (!breakpoint_alive_p (bs->breakpoint_at))
>             break;
> +         if (breakpoint_proceeded)
> +           {
> +             /* Skip the commands we already ran.  */
> +             for (idx = 0; idx < cmd_idx; idx++)
> +               cmd = cmd->next;
> +             breakpoint_proceeded = 0;
> +           }
>           else
>             cmd = cmd->next;
>         }
> -      if (breakpoint_proceeded)
> -       /* The inferior is proceeded by the command; bomb out now.
> -          The bpstat chain has been blown away by wait_for_inferior.
> -          But since execution has stopped again, there is a new bpstat
> -          to look at, so start over.  */
> -       goto top;
> -      else
> -       bs->commands = NULL;
> +      bs->commands = NULL;
>      }
> 
>    executing_breakpoint_commands = 0;
From hjl@lucon.org Sat Apr 01 00:00:00 2000
From: "H . J . Lu" <hjl@lucon.org>
To: Jim Kingdon <kingdon@redhat.com>
Cc: kettenis@wins.uva.nl, msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: GDB 5.0 2000-03-05
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <20000307205233.A1573@lucon.org>
References: <38C2320A.E2134B29@cygnus.com> <20000305094341.A10426@lucon.org> <br9dojaan.fsf@rtl.cygnus.com> <200003061753.MAA14567@devserv.devel.redhat.com> <20000307161242.A485@lucon.org> <200003080049.e280nAs00441@delius.kettenis.local> <200003080406.XAA02076@devserv.devel.redhat.com>
X-SW-Source: 2000-q1/msg00583.html
Content-length: 1024

On Tue, Mar 07, 2000 at 11:06:49PM -0500, Jim Kingdon wrote:
> > I like this approach.  Then we can simply enable thread_db when we've
> > fixed all critical bugs.
> 
> Agreed.  There just isn't time to get thread_db working for 5.0
> (IMHO).  I'd be interested in hearing reports of how much disabling
> thread_db helps, though (e.g. with mozilla).  The spurious SIGTRAP bug
> is not specific to thread_db but we have at least one report (HJ's)
> that it is worse with thread_db.
> 
> > But the patch looks wrong to me.  Seems to *enable* thread_db by
> > default, end what's up with LIN_CTHREAD_CFLAGS?
> 
> The patch looks OK to me.  If you don't specify --enable-lin-thread
> then thread_db doesn't get set, so LIN_THREAD gets set to empty.  I'm
> not enough of a configure.in person to know whether there is an easier
> way.  Agreed about LIN_CTHREAD_CFLAGS though, I don't see that being
> used anywhere.

I put it there just in case that thread_db requires some changes
in source code which break the old one.


H.J.
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH RFA] Makefile.in, configure.tgt changes for linux/ppc
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38B1EF63.1353F096@cygnus.com>
References: <1000221204205.ZM8213@ocotillo.lan> <38B1CDEA.7191A16A@cygnus.com> <1000222003256.ZM9245@ocotillo.lan>
X-SW-Source: 2000-q1/msg00294.html
Content-length: 599

Kevin Buettner wrote:
> 
> On Feb 22, 10:44am, Andrew Cagney wrote:
> 
> > Kevin, I'd suggest doing it the other way - adding the missing
> > definition of language_h and then commiting that as a separate
> > check-in.  Defining language_h appears to be the adopted convention.
> 
> Okay.  Will do.  (Though I'm not sure I see the point.  Is it our
> goal to wind up with $(foo_h) instead of foo.h for all foo?)

Well, the final goal is to use automake :-)
Fixing the occasional header dependency by using $(foo_h) is, hopefully,
just a way of making our intervening lives easier.

	enjoy,
		Andrew
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [Fwd: Updated tools]
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38BCD5C9.9DCFDBCA@cygnus.com>
References: <38BBD180.5EBCF466@cygnus.com> <200002291440.PAA05054@landau.wins.uva.nl>
X-SW-Source: 2000-q1/msg00439.html
Content-length: 625

Mark Kettenis wrote:
> 
>    Date: Wed, 01 Mar 2000 01:02:40 +1100
>    From: Andrew Cagney <ac131313@cygnus.com>
> 
>    Now what this means for GDB I'm not sure.
> 
> I propose that we stich with stock autoconf 2.13 for the parts of the
> repository that are only used by GDB as long as we do not encounter
> any problems.

Yes, that is what we've been doing.  I've added the below to the
contribute notes.

	Andrew


o	If ``gdb/configure.in'' is modified then you don't
	need to include patches to the regenerated file
	``configure''.

	The maintainer will re-generate those files
	using autoconf (2.13 as of 2000-02-29).
From shebs@apple.com Sat Apr 01 00:00:00 2000
From: Stan Shebs <shebs@apple.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: "H . J . Lu" <hjl@valinux.com>, gdb-patches@sourceware.cygnus.com
Subject: Re: A new revised patch for dlclose
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38C7F8F2.3C4AE23C@apple.com>
References: <20000307120800.A27315@valinux.com> <20000307122129.A3568@valinux.com> <38C7C7C7.CD90829D@cygnus.com>
X-SW-Source: 2000-q1/msg00633.html
Content-length: 537

Andrew Cagney wrote:

> H.J., I'm curious.  Who is Sam Lantinga, they don't show up in GDB's
> copyright assignment file.

Sam is the main genius behind all those commercial Linux games you
can see on store shelves these days.  He also maintains the SDL
library, which is the LGPL cross-platform library that makes those
game ports possible.  (Dig under lokigames.com's open source pages
to see more.)  Sam thus qualifies as a key GDB user who should be
taken seriously, and who is clearly not afraid to hack GDB if it
needs it...

Stan
From akale@fermat.vxindia.veritas.com Sat Apr 01 00:00:00 2000
From: "Amit S. Kale" <akale@fermat.vxindia.veritas.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [Patch] option -noreloc in add-symbol-file (linux module debugging)
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <00032414220200.18476@fermat.vxindia.veritas.com>
X-SW-Source: 2000-q1/msg00982.html
Content-length: 564

Hi,

Following patch adds an option -noreloc to command add-symbol-file.
This will allow working around reloction problems if an object file can be
relocated using ld.

linux kernel module debugging:
Buid a relocated file from module file using ld. Get text, data and bss
addresses by generating a module map. Then load it using add-symbol-file with
-noreloc flag which will load it without performing relocations.

This patch includes changes for x86-elf only.

Can this patch be included in gdb?
Thanks.
-- 
Amit Kale
Veritas Software ( http://www.veritas.com )
From kingdon@redhat.com Sat Apr 01 00:00:00 2000
From: Jim Kingdon <kingdon@redhat.com>
To: kettenis@wins.uva.nl
Cc: hjl@lucon.org, msnyder@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: GDB 5.0 2000-03-05
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003080406.XAA02076@devserv.devel.redhat.com>
References: <38C2320A.E2134B29@cygnus.com> <20000305094341.A10426@lucon.org> <br9dojaan.fsf@rtl.cygnus.com> <200003061753.MAA14567@devserv.devel.redhat.com> <20000307161242.A485@lucon.org> <200003080049.e280nAs00441@delius.kettenis.local>
X-SW-Source: 2000-q1/msg00581.html
Content-length: 816

> I like this approach.  Then we can simply enable thread_db when we've
> fixed all critical bugs.

Agreed.  There just isn't time to get thread_db working for 5.0
(IMHO).  I'd be interested in hearing reports of how much disabling
thread_db helps, though (e.g. with mozilla).  The spurious SIGTRAP bug
is not specific to thread_db but we have at least one report (HJ's)
that it is worse with thread_db.

> But the patch looks wrong to me.  Seems to *enable* thread_db by
> default, end what's up with LIN_CTHREAD_CFLAGS?

The patch looks OK to me.  If you don't specify --enable-lin-thread
then thread_db doesn't get set, so LIN_THREAD gets set to empty.  I'm
not enough of a configure.in person to know whether there is an easier
way.  Agreed about LIN_CTHREAD_CFLAGS though, I don't see that being
used anywhere.
From msnyder@cygnus.com Sat Apr 01 00:00:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: breakpoint.c: Minor output fixes for hardware watchpoints
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38E1067A.119C@cygnus.com>
References: <200003072114.WAA26280@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-q1/msg01090.html
Content-length: 5447

Peter.Schauer wrote:
> 
> During implementation of hardware watchpoints on Solaris, I noticed the
> following inconsistencies in breakpoint.c output between software and
> hardware breakpoints.
> 
> 1) insert_breakpoints and do_enable_breakpoint now use select_and_print_frame
>   to reselect frames after frame selection for watchpoint evaluation.
>   Up to gdb-4.18 GDB used select_frame to reselect frames.
>   I have no idea why this was done (I am unable to find a ChangeLog entry,
>   perhaps this was a side effect of the HP merge), and it causes the following
>   confusing output from the recurse.exp testcase:

This change did indeed come in with the HP merge, which was so 
massive that we did not get justifications for every little
change.  I'm going to approve backing this change out.  If 
the folks at HP really need it, let's get a justification 
and a change that doesn't have unpleasant side effects.

Checking in this patch.

> continue
> Continuing.
> #0  recurse (a=10) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:15
> 15        if (a == 1)
> Hardware watchpoint 2: b
> 
> Old value = 0
> New value = 10
> recurse (a=10) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:19
> 19        b *= recurse (a - 1);
> (gdb) PASS: gdb.base/recurse.exp: continue to first instance watchpoint, first time
> 
> Note the extra frame output before the watchpoint trigger. This is still
> worse in other cases, where we have even more frame output (see below).
> 
> 2) insert_breakpoints tries to reinsert watchpoints even if they are already
>   marked for deletion at next stop, causing the following redundant output,
>   again from the recurse.exp testcase:
> 
> continue
> Continuing.
> #0  recurse (a=5) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:20
> 20        return b;
> #0  recurse (a=5) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:20
> 20        return b;
> Watchpoint 4 deleted because the program has left the block in
> which its expression is valid.
> #0  0x8048a71 in recurse (a=6) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:19
> 19        b *= recurse (a - 1);
> Hardware watchpoint 4 deletedbecause the program has left the block
> in which its expression is valid.
> 0x8048a70 in recurse (a=6) at /users/pes/gdbnd/devo/gdb/testsuite/gdb.base/recurse.c:19
> 19        b *= recurse (a - 1);
> (gdb) PASS: gdb.base/recurse.exp: second instance watchpoint deleted when leaving scope
> 
> Here is a patch for both problems:
> 
> 2000-03-07  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
> 
>         * breakpoint.c (insert_breakpoints, do_enable_breakpoint):  Reselect
>         the saved frame silently after frame selection for watchpoint
>         evaluation.
>         (insert_breakpoints):  Add missing space in `Hardware watchpoint
>         deleted' message.  Do not reinsert hardware watchpoint if it is
>         already marked for deletion at next stop.
> 
> *** gdb/breakpoint.c.orig       Thu Feb 24 13:41:33 2000
> --- gdb/breakpoint.c    Sat Mar  4 11:42:48 2000
> ***************
> *** 918,923 ****
> --- 918,924 ----
>               b->type == bp_read_watchpoint ||
>               b->type == bp_access_watchpoint)
>              && b->enable == enabled
> +            && b->disposition != del_at_next_stop
>              && !b->inserted
>              && !b->duplicate)
>         {
> ***************
> *** 1005,1011 ****
>           }
>         else
>           {
> !           printf_filtered ("Hardware watchpoint %d deleted", b->number);
>             printf_filtered ("because the program has left the block \n");
>             printf_filtered ("in which its expression is valid.\n");
>             if (b->related_breakpoint)
> --- 1006,1012 ----
>           }
>         else
>           {
> !           printf_filtered ("Hardware watchpoint %d deleted ", b->number);
>             printf_filtered ("because the program has left the block \n");
>             printf_filtered ("in which its expression is valid.\n");
>             if (b->related_breakpoint)
> ***************
> *** 1016,1022 ****
>         /* Restore the frame and level.  */
>         if ((saved_frame != selected_frame) ||
>             (saved_level != selected_frame_level))
> !         select_and_print_frame (saved_frame, saved_level);
> 
>         if (val)
>           return_val = val;     /* remember failure */
> --- 1017,1023 ----
>         /* Restore the frame and level.  */
>         if ((saved_frame != selected_frame) ||
>             (saved_level != selected_frame_level))
> !         select_frame (saved_frame, saved_level);
> 
>         if (val)
>           return_val = val;     /* remember failure */
> ***************
> *** 7536,7543 ****
>         }
> 
>         if (save_selected_frame_level >= 0)
> !       select_and_print_frame (save_selected_frame,
> !                               save_selected_frame_level);
>         value_free_to_mark (mark);
>       }
>     if (modify_breakpoint_hook)
> --- 7558,7564 ----
>         }
> 
>         if (save_selected_frame_level >= 0)
> !       select_frame (save_selected_frame, save_selected_frame_level);
>         value_free_to_mark (mark);
>       }
>     if (modify_breakpoint_hook)
> 
> --
> Peter Schauer                   pes@regent.e-technik.tu-muenchen.de
From geoffk@cygnus.com Sat Apr 01 00:00:00 2000
From: Geoff Keating <geoffk@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: patch to psim for denormal values
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003250008.QAA31192@localhost.cygnus.com>
X-SW-Source: 2000-q1/msg01012.html
Content-length: 1148

gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.c was sending the
sim into a very long (perhaps infinite) loop, because of this typo.

My copy of the ppc 601 user's manual correctly uses '+' here (on page
F-2).

OK to commit?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/sim-ppc-denormal.patch=============
2000-03-23  Geoff Keating  <geoffk@cygnus.com>

	* ppc-instructions (Disabled_Exponent_Underflow): Increment
	the exponent when denormalizing.

Index: ppc-instructions
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/ppc/ppc-instructions,v
retrieving revision 1.46
diff -p -u -u -p -r1.46 ppc-instructions
--- ppc-instructions	2000/03/02 09:24:10	1.46
+++ ppc-instructions	2000/03/24 01:53:30
@@ -4282,7 +4282,7 @@ void::function::invalid_zero_divide_oper
 	  }
 	    /* G|R|X == zero from above */
 	    while (exp < -126) {
-	      exp = exp - 1;
+	      exp = exp + 1;
 	      frac_grx = (INSERTED64(EXTRACTED64(frac_grx, 0, 54), 1, 55)
 	                  | MASKED64(frac_grx, 55, 55));
 	    }
============================================================
From Peter.Schauer@regent.e-technik.tu-muenchen.de Sat Apr 01 00:00:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: gdb-patches@sourceware.cygnus.com
Subject: Problem with gdb/objfiles.c and --with-mmalloc + fix
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200002232157.WAA26169@reisser.regent.e-technik.tu-muenchen.de>
X-SW-Source: 2000-q1/msg00341.html
Content-length: 1678

I have used --with-mmalloc with GDB configure for a long time to get sort of
a poor man's purify. Unfortunately gdb/objfiles.c suffered some bitrot
during the last year, here is a fix:


2000-02-23  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>

	* objfiles.c (open_mapped_file):  Fix obsolete references to `mapped'
	parameter.


*** ./gdb/objfiles.c.orig	Tue Dec  7 04:56:03 1999
--- ./gdb/objfiles.c	Thu Feb 17 10:56:51 2000
***************
*** 865,871 ****
      {
        free (symsfilename);
        symsfilename = concat (filename, ".syms", (char *) NULL);
!       fd = open_existing_mapped_file (symsfilename, mtime, mapped);
      }
  
    /* If we don't have an open file by now, then either the file does not
--- 865,871 ----
      {
        free (symsfilename);
        symsfilename = concat (filename, ".syms", (char *) NULL);
!       fd = open_existing_mapped_file (symsfilename, mtime, flags);
      }
  
    /* If we don't have an open file by now, then either the file does not
***************
*** 877,883 ****
       By default the file is rw for everyone, with the user's umask taking
       care of turning off the permissions the user wants off. */
  
!   if ((fd < 0) && mapped)
      {
        free (symsfilename);
        symsfilename = concat ("./", basename (filename), ".syms",
--- 877,883 ----
       By default the file is rw for everyone, with the user's umask taking
       care of turning off the permissions the user wants off. */
  
!   if ((fd < 0) && (flags & OBJF_MAPPED))
      {
        free (symsfilename);
        symsfilename = concat ("./", basename (filename), ".syms",

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From eliz@delorie.com Sat Apr 01 00:00:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] Patches to go32-nat.c
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003151619.LAA01221@indy.delorie.com>
X-SW-Source: 2000-q1/msg00710.html
Content-length: 17903

These were committed a couple of days ago, but my message about them
somehow didn't make it.

2000-03-13  Eli Zaretskii  <eliz@is.elta.co.il>

	* go32-nat.c (struct env387): Remove declaration.
	(print_387_status, i386_go32_float_info): Remove redundant
	functions.
	(regno_mapping, sig_map, excepn_map): Add braces around inner
	initializers.
	(many functions): Use ATTRIBUTE_UNUSED to shut up the compiler;
	fix code which mixed signed with unsigned.
	(go32_resume): Use TARGET_SIGNAL_LAST instead of -1.
	(go32_wait): Initialize INT3_addr.
	(go32_fetch_registers): Extend all FP registers that are shorter
	than 4 bytes to 32 bits.  Support 32 standard FP registers defined
	on config/i386/tm-i386.h.
	(store_register): Support 32 FP registers.
	(go32_create_inferior): Don't crash if handed a NULL pointer
	instead of exec file name.
	(ignore): Remove unused function.
	(go32_insert_hw_breakpoint): Remove unused variables.
	(init_go32_ops): Set value of processing_gcc_compilation to 2.

--- ../gdb5-pre/gdb/go32-nat.c	Wed Feb  9 11:13:24 2000
+++ ./gdb/go32-nat.c	Fri Mar 10 22:22:56 2000
@@ -22,13 +22,12 @@
 #include <fcntl.h>
 
 #include "defs.h"
-#include "frame.h"		/* required by inferior.h */
 #include "inferior.h"
-#include "target.h"
 #include "gdb_wait.h"
 #include "gdbcore.h"
 #include "command.h"
 #include "floatformat.h"
+#include "buildsym.h"
 
 #include <stdio.h>		/* required for __DJGPP_MINOR__ */
 #include <stdlib.h>
@@ -137,23 +136,6 @@ int redir_debug_init (cmdline_t *ptr) { 
 
 extern void _initialize_go32_nat (void);
 
-struct env387
-  {
-    unsigned short control;
-    unsigned short r0;
-    unsigned short status;
-    unsigned short r1;
-    unsigned short tag;
-    unsigned short r2;
-    unsigned long eip;
-    unsigned short code_seg;
-    unsigned short opcode;
-    unsigned long operand;
-    unsigned short operand_seg;
-    unsigned short r3;
-    unsigned char regs[8][10];
-  };
-
 typedef enum { wp_insert, wp_remove, wp_count } wp_op;
 
 /* This holds the current reference counts for each debug register.  */
@@ -164,7 +146,6 @@ extern char **environ;
 #define SOME_PID 42
 
 static int prog_has_started = 0;
-static void print_387_status (unsigned short status, struct env387 *ep);
 static void go32_open (char *name, int from_tty);
 static void go32_close (int quitting);
 static void go32_attach (char *args, int from_tty);
@@ -184,8 +165,6 @@ static void go32_create_inferior (char *
 static void cleanup_dregs (void);
 static void go32_mourn_inferior (void);
 static int go32_can_run (void);
-static void ignore (void);
-static void ignore2 (char *a, int b);
 static int go32_insert_aligned_watchpoint (CORE_ADDR waddr, CORE_ADDR addr,
 					   int len, int rw);
 static int go32_remove_aligned_watchpoint (CORE_ADDR waddr, CORE_ADDR addr,
@@ -198,92 +177,6 @@ static void go32_terminal_init (void);
 static void go32_terminal_inferior (void);
 static void go32_terminal_ours (void);
 
-static void
-print_387_status (unsigned short status, struct env387 *ep)
-{
-  int i;
-  int bothstatus;
-  int top;
-  int fpreg;
-
-  bothstatus = ((status != 0) && (ep->status != 0));
-  if (status != 0)
-    {
-      if (bothstatus)
-	printf_unfiltered ("u: ");
-      print_387_status_word (status);
-    }
-
-  if (ep->status != 0)
-    {
-      if (bothstatus)
-	printf_unfiltered ("e: ");
-      print_387_status_word (ep->status);
-    }
-
-  print_387_control_word (ep->control & 0xffff);
-  /* Other platforms say "last exception", but that's not true: the
-     FPU stores the last non-control instruction there.  */
-  printf_unfiltered ("last FP instruction: ");
-  /* The ORing with D800h restores the upper 5 bits of the opcode that
-     are not stored by the FPU (since these bits are the same for all
-     floating-point instructions).  */
-  printf_unfiltered ("opcode %s; ",
-		     local_hex_string (ep->opcode ? (ep->opcode|0xd800) : 0));
-  printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg));
-  printf_unfiltered ("%s; ", local_hex_string (ep->eip));
-  printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg));
-  printf_unfiltered (":%s\n", local_hex_string (ep->operand));
-
-  top = (ep->status >> 11) & 7;
-
-  printf_unfiltered ("regno tag     msb              lsb  value\n");
-  for (fpreg = 7; fpreg >= 0; fpreg--)
-    {
-      /* FNSAVE saves the FP registers in their logical TOP-relative
-	 order, beginning with ST(0).  Since we need to print them in
-	 their physical order, we have to remap them.  */
-      int  regno = fpreg - top;
-      long double val;
-
-      if (regno < 0)
-	regno += 8;
-
-      printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
-
-      switch ((ep->tag >> (fpreg * 2)) & 3)
-	{
-	case 0:
-	  printf_unfiltered ("valid   ");
-	  break;
-	case 1:
-	  printf_unfiltered ("zero    ");
-	  break;
-	case 2:
-	  /* All other versions of print_387_status use TRAP here, but I
-	     think this is misleading, since Intel manuals say SPECIAL.  */
-	  printf_unfiltered ("special ");
-	  break;
-	case 3:
-	  printf_unfiltered ("empty   ");
-	  break;
-	}
-      for (i = 9; i >= 0; i--)
-	printf_unfiltered ("%02x", ep->regs[regno][i]);
-
-      REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM+regno, builtin_type_long_double,
-				   &ep->regs[regno], &val);
-
-      printf_unfiltered ("  %.19LG\n", val);
-    }
-}
-
-void
-i386_go32_float_info (void)
-{
-  print_387_status (0, (struct env387 *) &npx);
-}
-
 #define r_ofs(x) (offsetof(TSS,x))
 
 static struct
@@ -293,110 +186,111 @@ static struct
 }
 regno_mapping[] =
 {
-  r_ofs (tss_eax), 4,	/* normal registers, from a_tss */
-    r_ofs (tss_ecx), 4,
-    r_ofs (tss_edx), 4,
-    r_ofs (tss_ebx), 4,
-    r_ofs (tss_esp), 4,
-    r_ofs (tss_ebp), 4,
-    r_ofs (tss_esi), 4,
-    r_ofs (tss_edi), 4,
-    r_ofs (tss_eip), 4,
-    r_ofs (tss_eflags), 4,
-    r_ofs (tss_cs), 2,
-    r_ofs (tss_ss), 2,
-    r_ofs (tss_ds), 2,
-    r_ofs (tss_es), 2,
-    r_ofs (tss_fs), 2,
-    r_ofs (tss_gs), 2,
-    0, 10,		/* 8 FP registers, from npx.reg[] */
-    1, 10,
-    2, 10,
-    3, 10,
-    4, 10,
-    5, 10,
-    6, 10,
-    7, 10,
+  {r_ofs (tss_eax), 4},	/* normal registers, from a_tss */
+  {r_ofs (tss_ecx), 4},
+  {r_ofs (tss_edx), 4},
+  {r_ofs (tss_ebx), 4},
+  {r_ofs (tss_esp), 4},
+  {r_ofs (tss_ebp), 4},
+  {r_ofs (tss_esi), 4},
+  {r_ofs (tss_edi), 4},
+  {r_ofs (tss_eip), 4},
+  {r_ofs (tss_eflags), 4},
+  {r_ofs (tss_cs), 2},
+  {r_ofs (tss_ss), 2},
+  {r_ofs (tss_ds), 2},
+  {r_ofs (tss_es), 2},
+  {r_ofs (tss_fs), 2},
+  {r_ofs (tss_gs), 2},
+  {0, 10},		/* 8 FP registers, from npx.reg[] */
+  {1, 10},
+  {2, 10},
+  {3, 10},
+  {4, 10},
+  {5, 10},
+  {6, 10},
+  {7, 10},
 	/* The order of the next 7 registers must be consistent
-	   with their numbering in config/i386/tm-go32.h, which see.  */
-  0, 2,			/* control word, from npx */
-  4, 2,			/* status word, from npx */
-  8, 2,			/* tag word, from npx */
-  16, 2,		/* last FP exception CS from npx */
-  24, 2,		/* last FP exception operand selector from npx */
-  12, 4,		/* last FP exception EIP from npx */
-  20, 4			/* last FP exception operand offset from npx */
+	   with their numbering in config/i386/tm-i386.h, which see.  */
+  {0, 2},		/* control word, from npx */
+  {4, 2},		/* status word, from npx */
+  {8, 2},		/* tag word, from npx */
+  {16, 2},		/* last FP exception CS from npx */
+  {12, 4},		/* last FP exception EIP from npx */
+  {24, 2},		/* last FP exception operand selector from npx */
+  {20, 4},		/* last FP exception operand offset from npx */
+  {18, 2}		/* last FP opcode from npx */
 };
 
 static struct
   {
     int go32_sig;
-    int gdb_sig;
+    enum target_signal gdb_sig;
   }
 sig_map[] =
 {
-  0, TARGET_SIGNAL_FPE,
-    1, TARGET_SIGNAL_TRAP,
+  {0, TARGET_SIGNAL_FPE},
+  {1, TARGET_SIGNAL_TRAP},
   /* Exception 2 is triggered by the NMI.  DJGPP handles it as SIGILL,
      but I think SIGBUS is better, since the NMI is usually activated
      as a result of a memory parity check failure.  */
-    2, TARGET_SIGNAL_BUS,
-    3, TARGET_SIGNAL_TRAP,
-    4, TARGET_SIGNAL_FPE,
-    5, TARGET_SIGNAL_SEGV,
-    6, TARGET_SIGNAL_ILL,
-    7, TARGET_SIGNAL_EMT,	/* no-coprocessor exception */
-    8, TARGET_SIGNAL_SEGV,
-    9, TARGET_SIGNAL_SEGV,
-    10, TARGET_SIGNAL_BUS,
-    11, TARGET_SIGNAL_SEGV,
-    12, TARGET_SIGNAL_SEGV,
-    13, TARGET_SIGNAL_SEGV,
-    14, TARGET_SIGNAL_SEGV,
-    16, TARGET_SIGNAL_FPE,
-    17, TARGET_SIGNAL_BUS,
-    31, TARGET_SIGNAL_ILL,
-    0x1b, TARGET_SIGNAL_INT,
-    0x75, TARGET_SIGNAL_FPE,
-    0x78, TARGET_SIGNAL_ALRM,
-    0x79, TARGET_SIGNAL_INT,
-    0x7a, TARGET_SIGNAL_QUIT,
-    -1, -1
+  {2, TARGET_SIGNAL_BUS},
+  {3, TARGET_SIGNAL_TRAP},
+  {4, TARGET_SIGNAL_FPE},
+  {5, TARGET_SIGNAL_SEGV},
+  {6, TARGET_SIGNAL_ILL},
+  {7, TARGET_SIGNAL_EMT},	/* no-coprocessor exception */
+  {8, TARGET_SIGNAL_SEGV},
+  {9, TARGET_SIGNAL_SEGV},
+  {10, TARGET_SIGNAL_BUS},
+  {11, TARGET_SIGNAL_SEGV},
+  {12, TARGET_SIGNAL_SEGV},
+  {13, TARGET_SIGNAL_SEGV},
+  {14, TARGET_SIGNAL_SEGV},
+  {16, TARGET_SIGNAL_FPE},
+  {17, TARGET_SIGNAL_BUS},
+  {31, TARGET_SIGNAL_ILL},
+  {0x1b, TARGET_SIGNAL_INT},
+  {0x75, TARGET_SIGNAL_FPE},
+  {0x78, TARGET_SIGNAL_ALRM},
+  {0x79, TARGET_SIGNAL_INT},
+  {0x7a, TARGET_SIGNAL_QUIT},
+  {-1, TARGET_SIGNAL_LAST}
 };
 
 static struct {
   enum target_signal gdb_sig;
   int djgpp_excepno;
 } excepn_map[] = {
-  TARGET_SIGNAL_0, -1,
-  TARGET_SIGNAL_ILL, 6,		/* Invalid Opcode */
-  TARGET_SIGNAL_EMT, 7,		/* triggers SIGNOFP */
-  TARGET_SIGNAL_SEGV, 13,	/* GPF */
-  TARGET_SIGNAL_BUS, 17,	/* Alignment Check */
+  {TARGET_SIGNAL_0, -1},
+  {TARGET_SIGNAL_ILL, 6},	/* Invalid Opcode */
+  {TARGET_SIGNAL_EMT, 7},	/* triggers SIGNOFP */
+  {TARGET_SIGNAL_SEGV, 13},	/* GPF */
+  {TARGET_SIGNAL_BUS, 17},	/* Alignment Check */
   /* The rest are fake exceptions, see dpmiexcp.c in djlsr*.zip for
      details.  */
-  TARGET_SIGNAL_TERM, 0x1b,	/* triggers Ctrl-Break type of SIGINT */
-  TARGET_SIGNAL_FPE, 0x75,
-  TARGET_SIGNAL_INT, 0x79,
-  TARGET_SIGNAL_QUIT, 0x7a,
-  TARGET_SIGNAL_ALRM, 0x78,	/* triggers SIGTIMR */
-  TARGET_SIGNAL_PROF, 0x78,
-  -1, -1
+  {TARGET_SIGNAL_TERM, 0x1b},	/* triggers Ctrl-Break type of SIGINT */
+  {TARGET_SIGNAL_FPE, 0x75},
+  {TARGET_SIGNAL_INT, 0x79},
+  {TARGET_SIGNAL_QUIT, 0x7a},
+  {TARGET_SIGNAL_ALRM, 0x78},	/* triggers SIGTIMR */
+  {TARGET_SIGNAL_PROF, 0x78},
+  {TARGET_SIGNAL_LAST, -1}
 };
 
 static void
-go32_open (char *name, int from_tty)
+go32_open (char *name ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
 {
   printf_unfiltered ("Done.  Use the \"run\" command to run the program.\n");
 }
 
 static void
-go32_close (int quitting)
+go32_close (int quitting ATTRIBUTE_UNUSED)
 {
 }
 
 static void
-go32_attach (char *args, int from_tty)
+go32_attach (char *args ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
 {
   error ("\
 You cannot attach to a running program on this platform.\n\
@@ -404,7 +298,7 @@ Use the `run' command to run DJGPP progr
 }
 
 static void
-go32_detach (char *args, int from_tty)
+go32_detach (char *args ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
 {
 }
 
@@ -412,7 +306,7 @@ static int resume_is_step;
 static int resume_signal = -1;
 
 static void
-go32_resume (int pid, int step, enum target_signal siggnal)
+go32_resume (int pid ATTRIBUTE_UNUSED, int step, enum target_signal siggnal)
 {
   int i;
 
@@ -420,7 +314,8 @@ go32_resume (int pid, int step, enum tar
 
   if (siggnal != TARGET_SIGNAL_0 && siggnal != TARGET_SIGNAL_TRAP)
   {
-    for (i = 0, resume_signal = -1; excepn_map[i].gdb_sig != -1; i++)
+    for (i = 0, resume_signal = -1;
+	 excepn_map[i].gdb_sig != TARGET_SIGNAL_LAST; i++)
       if (excepn_map[i].gdb_sig == siggnal)
       {
 	resume_signal = excepn_map[i].djgpp_excepno;
@@ -435,11 +330,11 @@ go32_resume (int pid, int step, enum tar
 static char child_cwd[FILENAME_MAX];
 
 static int
-go32_wait (int pid, struct target_waitstatus *status)
+go32_wait (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *status)
 {
   int i;
   unsigned char saved_opcode;
-  unsigned long INT3_addr;
+  unsigned long INT3_addr = 0;
   int stepping_over_INT = 0;
 
   a_tss.tss_eflags &= 0xfeff;	/* reset the single-step flag (TF) */
@@ -566,9 +461,31 @@ go32_fetch_registers (int regno)
       else if (regno < 24)
 	supply_register (regno,
 			 (char *) &npx.reg[regno_mapping[regno].tss_ofs]);
-      else if (regno < 31)
-	supply_register (regno,
-			 (char *) &npx + regno_mapping[regno].tss_ofs);
+      else if (regno < 32)
+	{
+	  unsigned regval;
+
+	  switch (regno_mapping[regno].size)
+	    {
+	      case 2:
+		regval = *(unsigned short *)
+		  ((char *) &npx + regno_mapping[regno].tss_ofs);
+		regval &= 0xffff;
+		if (regno == FOP_REGNUM && regval)
+		  /* Feature: restore the 5 bits of the opcode
+		     stripped by FSAVE/FNSAVE.  */
+		  regval |= 0xd800;
+		break;
+	      case 4:
+		regval = *(unsigned *)
+		  ((char *) &npx + regno_mapping[regno].tss_ofs);
+		break;
+	      default:
+		internal_error ("\
+Invalid native size for register no. %d in go32_fetch_register.", regno);
+	    }
+	  supply_register (regno, (char *) &regval);
+	}
       else
 	internal_error ("Invalid register no. %d in go32_fetch_register.",
 			regno);
@@ -585,17 +502,19 @@ store_register (int regno)
     rp = (char *) &a_tss + regno_mapping[regno].tss_ofs;
   else if (regno < 24)
     rp = (char *) &npx.reg[regno_mapping[regno].tss_ofs];
-  else if (regno < 31)
+  else if (regno < 32)
     rp = (char *) &npx + regno_mapping[regno].tss_ofs;
   else
     internal_error ("Invalid register no. %d in store_register.", regno);
   memcpy (rp, v, regno_mapping[regno].size);
+  if (regno == FOP_REGNUM)
+    *(short *)rp &= 0x07ff; /* strip high 5 bits, in case they added them */
 }
 
 static void
 go32_store_registers (int regno)
 {
-  int r;
+  unsigned r;
 
   if (regno >= 0)
     store_register (regno);
@@ -613,7 +532,7 @@ go32_prepare_to_store (void)
 
 static int
 go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-		  struct target_ops *target)
+		  struct target_ops *target ATTRIBUTE_UNUSED)
 {
   if (write)
     {
@@ -642,7 +561,7 @@ go32_xfer_memory (CORE_ADDR memaddr, cha
 static cmdline_t child_cmd;	/* parsed child's command line kept here */
 
 static void
-go32_files_info (struct target_ops *target)
+go32_files_info (struct target_ops *target ATTRIBUTE_UNUSED)
 {
   printf_unfiltered ("You are running a DJGPP V2 program.\n");
 }
@@ -672,6 +591,11 @@ go32_create_inferior (char *exec_file, c
   char *cmdline;
   char **env_save = environ;
 
+  /* If no exec file handed to us, get it from the exec-file command -- with
+     a good, common error message if none is specified.  */
+  if (exec_file == 0)
+    exec_file = get_exec_file (1);
+
   if (prog_has_started)
     {
       go32_stop ();
@@ -743,11 +667,6 @@ go32_can_run (void)
   return 1;
 }
 
-static void
-ignore (void)
-{
-}
-
 /* Hardware watchpoint support.  */
 
 #define DR_STATUS 6
@@ -849,7 +768,8 @@ cleanup_dregs (void)
 /* Insert a watchpoint.  */
 
 int
-go32_insert_watchpoint (int pid, CORE_ADDR addr, int len, int rw)
+go32_insert_watchpoint (int pid ATTRIBUTE_UNUSED, CORE_ADDR addr,
+			int len, int rw)
 {
   int ret = go32_insert_aligned_watchpoint (addr, addr, len, rw);
 
@@ -891,7 +811,7 @@ go32_insert_aligned_watchpoint (CORE_ADD
   for (i = 0; i < 4; i++)
   {
     if (!IS_REG_FREE (i) && D_REGS[i] == addr
-	&& DR_DEF (i) == (len_bits | read_write_bits))
+	&& DR_DEF (i) == (unsigned)(len_bits | read_write_bits))
     {
       dr_ref_count[i]++;
       return 0;
@@ -980,7 +900,8 @@ go32_handle_nonaligned_watchpoint (wp_op
 /* Remove a watchpoint.  */
 
 int
-go32_remove_watchpoint (int pid, CORE_ADDR addr, int len, int rw)
+go32_remove_watchpoint (int pid ATTRIBUTE_UNUSED, CORE_ADDR addr,
+			int len, int rw)
 {
   int ret = go32_remove_aligned_watchpoint (addr, addr, len, rw);
 
@@ -1034,7 +955,7 @@ go32_remove_aligned_watchpoint (CORE_ADD
   for (i = 0; i <= 3; i++)
     {
       if (!IS_REG_FREE (i) && D_REGS[i] == addr
-	  && DR_DEF (i) == (len_bits | read_write_bits))
+	  && DR_DEF (i) == (unsigned)(len_bits | read_write_bits))
 	{
 	  dr_ref_count[i]--;
 	  if (dr_ref_count[i] == 0)
@@ -1064,7 +985,7 @@ go32_region_ok_for_watchpoint (CORE_ADDR
    whose access triggered the watchpoint.  */
 
 CORE_ADDR
-go32_stopped_by_watchpoint (int pid, int data_watchpoint)
+go32_stopped_by_watchpoint (int pid ATTRIBUTE_UNUSED, int data_watchpoint)
 {
   int i, ret = 0;
   int status;
@@ -1086,7 +1007,7 @@ go32_stopped_by_watchpoint (int pid, int
 /* Remove a breakpoint.  */
 
 int
-go32_remove_hw_breakpoint (CORE_ADDR addr, CORE_ADDR shadow)
+go32_remove_hw_breakpoint (CORE_ADDR addr, void *shadow ATTRIBUTE_UNUSED)
 {
   int i;
   for (i = 0; i <= 3; i++)
@@ -1103,12 +1024,9 @@ go32_remove_hw_breakpoint (CORE_ADDR add
 }
 
 int
-go32_insert_hw_breakpoint (CORE_ADDR addr, CORE_ADDR shadow)
+go32_insert_hw_breakpoint (CORE_ADDR addr, void *shadow ATTRIBUTE_UNUSED)
 {
   int i;
-  int read_write_bits, len_bits;
-  int free_debug_register;
-  int register_number;
 
   /* Look for an occupied debug register with the same address and the
      same RW and LEN definitions.  If we find one, we can use it for
@@ -1192,7 +1110,7 @@ go32_terminal_init (void)
 }
 
 static void
-go32_terminal_info (char *args, int from_tty)
+go32_terminal_info (char *args ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED)
 {
   printf_unfiltered ("Inferior's terminal is in %s mode.\n",
 		     !inf_mode_valid
@@ -1313,6 +1231,9 @@ init_go32_ops (void)
   /* Initialize child's command line storage.  */
   if (redir_debug_init (&child_cmd) == -1)
     internal_error ("Cannot allocate redirection storage: not enough memory.\n");
+
+  /* We are always processing GCC-compiled programs.  */
+  processing_gcc_compilation = 2;
 }
 
 void
From fnasser@redhat.com Sat Apr 01 00:00:00 2000
From: Fernando Nasser <fnasser@redhat.com>
To: Scott Bambrough <scottb@netwinder.org>
Cc: GDB Patches Mail List <gdb-patches@sourceware.cygnus.com>
Subject: Re: Patch fallen through the cracks?
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38C7BD11.9A8188CF@redhat.com>
References: <38C7ADD4.A6697C36@netwinder.org>
X-SW-Source: 2000-q1/msg00621.html
Content-length: 746

Scott Bambrough wrote:
> 
> Can someone approve this patch please.  It shouldn't be a problem.
> 
> http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00367.html
> 

I would rather have it xfail'ed.  It means that we know this test won't
work on this platform but it is not ding what we want (this is what pass
would mean).

Could you please add a small comment before the "if" as well, explaining
why it won't work on ARM?

After these changes there is no need to resubmit the patch though, just
post what went in.

Thanks.


-- 
Fernando Nasser
Red Hat, Inc. - Toronto                 E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299
From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Replace ../include/wait.h with gdb_wait.h.
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200002091429.e19ETk916570@delius.kettenis.local>
References: <38A12872.13D194C4@cygnus.com>
X-SW-Source: 2000-q1/msg00102.html
Content-length: 4250

   Date: Wed, 09 Feb 2000 19:42:26 +1100
   From: Andrew Cagney <ac131313@cygnus.com>

   FYI,

   I've just checked in the attatched patch.  It replaces the sometimes
   convoluted sequence:

   [snip]

Great!

   So far this has only been verified on for the d10v-elf target.  Please
   report / submit patches for other targets.

There is a problem with `linux-thread.c', where `gdb_wait.h' is included
before config.h.  This means that HAVE_SYS_WAIT_H and HAVE_WAIT_H are
still undefined and the system headers are never used.

Since `linux-thread.c' uses __W_STOPCODE, and `gdb_wait.h' doesn't
provide a fallback macro I get a linker failure.  Moving up the
include for `defs.h' solves this problem.

The rest of GDB seems to be using WSETSTOP, so it seems appropriate to
use that macro instead of __W_STOPCODE in `linux-thread.c'.  I changed
the definition of WSETSTOP and WSETEXIT in `gdb_wait.h' to use
W_STOPCODE and W_EXITCODE if they are available.  All BSD-derived
systems and systems that try to be source-compatible with BSD (like
Linux and the Hurd) should have those macros.  The change is merely
cosmetic but there might be systems out there that really use a
different way to store this information.

Feel free to do with this patch what you want as long as you make sure
that `gdb_wait.h' is included after `config.h' in `linux-thread.c' :-).

Mark


PS Andrew, concering coding-style, current practice in a lot of GNU
packages is to use extra whitespace after `#' like in the following
example:

#ifndef foobar
# ifdef foo
#  define foobar foo
# else
#  define foobar bar
# endif
#endif

This makes things a bit more readable.  The patch below doesn't do
this, but is it OK to use this style in GDB in the future?  


2000-02-09  Mark Kettenis  <kettenis@gnu.org>

	* linux-thread.c: Include defs.h before gdb_wait.h.
	(linuxthreads_attach): Use WSETSTOP instead of __W_STOPCODE.
	(linuxthreads_create_inferior): Likewise.

	* gdb_wait.h (WSETEXIT): Define in terms of W_EXITCODE if defined.
	(WSETSTOP): Define in terms of W_STOPCODE if defined.


Index: gdb/linux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread.c,v
retrieving revision 1.2
diff -u -r1.2 linux-thread.c
--- gdb/linux-thread.c	2000/02/09 08:52:46	1.2
+++ gdb/linux-thread.c	2000/02/09 14:23:02
@@ -47,13 +47,13 @@
    linuxthreads package heavily relies on wait() synchronization to keep
    them correct.  */
 
+#include "defs.h"
 #include <sys/types.h> /* for pid_t */
 #include <sys/ptrace.h> /* for PT_* flags */
 #include "gdb_wait.h" /* for WUNTRACED and __WCLONE flags */
 #include <signal.h> /* for struct sigaction and NSIG */
 #include <sys/utsname.h>
 
-#include "defs.h"
 #include "target.h"
 #include "inferior.h"
 #include "gdbcore.h"
@@ -1129,7 +1129,7 @@
   linuxthreads_breakpoints_inserted = 1;
   linuxthreads_breakpoint_last = -1;
   linuxthreads_wait_last = -1;
-  linuxthreads_exit_status = __W_STOPCODE(0);
+  WSETSTOP (linuxthreads_exit_status, 0);
 
   child_ops.to_attach (args, from_tty);
 
@@ -1189,7 +1189,7 @@
 	  linuxthreads_find_trap (inferior_pid, 1);
 
 	  linuxthreads_wait_last = -1;
-	  linuxthreads_exit_status = __W_STOPCODE(0);
+	  WSETSTOP (linuxthreads_exit_status, 0);
 	}
 
       linuxthreads_inferior_pid = 0;
@@ -1601,7 +1601,7 @@
   linuxthreads_breakpoints_inserted = 1;
   linuxthreads_breakpoint_last = -1;
   linuxthreads_wait_last = -1;
-  linuxthreads_exit_status = __W_STOPCODE(0);
+  WSETSTOP (linuxthreads_exit_status, 0);
   
   if (linuxthreads_max)
     linuxthreads_attach_pending = 1;
Index: gdb/gdb_wait.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_wait.h,v
retrieving revision 1.1
diff -u -r1.1 gdb_wait.h
--- gdb/gdb_wait.h	2000/02/09 08:52:45	1.1
+++ gdb/gdb_wait.h	2000/02/09 14:23:07
@@ -86,11 +86,19 @@
 #endif
 
 #ifndef	WSETEXIT
+#ifdef W_EXITCODE
+#define WSETEXIT(w,status) ((w) = W_EXITCODE(status, 0))
+#else
 #define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
 #endif
+#endif
 
 #ifndef	WSETSTOP
+#ifndef W_STOPCODE
+#define WSETSTOP(w,sig)    ((w) = W_STOPCODE(sig))
+#else
 #define WSETSTOP(w,sig)	   ((w) = (0177 | ((sig) << 8)))
+#endif
 #endif
 
 /*
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [MAINT] Add Glen McCready
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38DFF9A8.43C81352@cygnus.com>
X-SW-Source: 2000-q1/msg01071.html
Content-length: 84

FYI, 

To the write after approval list.

	Andrew

Glen McCready					gkm@cygnus.com
From eliz@delorie.com Sat Apr 01 00:00:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: cgf@cygnus.com
Cc: kettenis@wins.uva.nl, kevinb@cygnus.com, jimb@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Linux sigtramp detection code moved to its proper place
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003182227.RAA07055@indy.delorie.com>
References: <200003162241.RAA19616@zwingli.cygnus.com> <jimb@cygnus.com> <1000316225504.ZM3009@ocotillo.lan> <20000316180048.A30640@cygnus.com> <200003162311.e2GNBUH00362@delius.kettenis.local> <20000316193609.D30640@cygnus.com>
X-SW-Source: 2000-q1/msg00772.html
Content-length: 1122

> I would be in favor of just creating an i386-linux-tdep.c and working
> out the 8.3 issues later.  Since there are already 8.3 issues in
> the gdb source directory, adding one more is not going to aggravate
> the problem unduly.

I beg to disagree ;-).  Let me explain why.

What I intend to do to resolve the problem of file names clashing in
the 8+3 namespace is to use the feature of DJTAR, an untar utility
which comes with DJGPP, to rename files on the fly.  To this end, I
created a name-mapping file which specifies what files to rename and
how; this file needs to be submitted to DJTAR when unpacking the
distribution.  I will make the file itself part of the distribution
(so DJGPP users will need to unpack that special file first, and then
the rest).

I already spent a frustrating evening creating this name-mapping file;
adding any new files that clash with existing files would require me
to reproduce that file, possibly affecting other files as well.

I respect the decision not to change any names before GDB 5.0 is
released, but in the meantime could we please not add any new files
whose names clash?
From shebs@apple.com Sat Apr 01 00:00:00 2000
From: Stan Shebs <shebs@apple.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Eli Zaretskii <eliz@is.elta.co.il>, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Fix texinfo problems...
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38E1171F.7651C329@apple.com>
References: <38DB1875.4B504618@cygnus.com> <38DBB937.126C95E@apple.com> <38DC6763.563424A2@cygnus.com> <200003260443.XAA26499@mescaline.gnu.org> <38E05161.9707ED26@cygnus.com>
X-SW-Source: 2000-q1/msg01091.html
Content-length: 462

Andrew Cagney wrote:

> The attatched converts my botch into your patch.
> I've also dropped a copy of texinfo-3.12 into the snapshots directory.
> 
>         sorry,
>                 Andrew
> 
> Stan, ok?

I didn't see your message before doing my big commit this morning,
so some of the changes are redundant.  I would suggest updating
from cvs over your patched file and seeing what's left over after
the merge - the remainder should be much smaller...

Stan
From grante@visi.com Sat Apr 01 00:00:00 2000
From: Grant Edwards <grante@visi.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Patch for RDI target code to allow user-specified devices
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <20000221141155.A31206@visi.com>
X-SW-Source: 2000-q1/msg00284.html
Content-length: 1026

Hello,

The attached patch against 4.18 sources modifies the RDI target
unix comm code to allow users to specify any device they please
to be used for serial and/or parallel communication with the
target.

The current routines limit the user to a certain set of devices
(which never seems to include the one I want).  I've tripped
over this many times.  With the patch applied, the target
commands like

 target rdi s=/whatever/flipping/device/the/user/wants
 target rdi s=/serial/device/name,p=/parallel/device/name

Will accept whatever the user specifies (I think the path is
limited to 64 characters).  After all it's _my_ computer and I
do, in fact, know which serial port is hooked to the target!
The fact that the ARM Ltd. code won't believe me has always
been annoying...

Yes, I know, the patched code uses a different indenting style
that the rest of the file -- if this is a problem, feel free to
re-indent it however you please.  I simply can not easily grok
the existing style.

-- 
Grant Edwards
grante@visi.com
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [patch] Stop MI testsuite falling on its face
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38C07D7C.2B6EBFFC@cygnus.com>
X-SW-Source: 2000-q1/msg00494.html
Content-length: 1031

The attatched (from PeterS) stops the MI testsuite falling on its face
when the MI interface wasn't enabled.

	Andrew
Sat Mar  4 13:55:08 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	From Fri 3 Mar 2000 Peter Schauer:
	* mi-support.exp (mi_gdb_start): When GDB doesn't recongize -i=mi
 	option, assume no MI support present.

Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.1
diff -p -r1.1 mi-support.exp
*** mi-support.exp	2000/02/23 00:25:43	1.1
--- mi-support.exp	2000/03/04 02:59:53
*************** proc mi_gdb_start { } {
*** 130,135 ****
--- 130,140 ----
  	    remote_close host;
  	    return -1;
  	}
+ 	-re ".*unrecognized option.*for a complete list of options." {
+ 	    untested "Skip mi tests (not compiled with mi support)."
+ 	    remote_close host;
+ 	    return -1;
+ 	}
  	timeout {
  	    perror "(timeout) GDB never initialized after 10 seconds."
  	    remote_close host;
From msnyder@cygnus.com Sat Apr 01 00:00:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Fernando Nasser <fnasser@redhat.com>
Cc: Eli Zaretskii <eliz@is.elta.co.il>, Daniel Berlin <dan@cgsoftware.com>, gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: add set/show debug, move gdb debugging flags into it
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38CFB57A.1900@cygnus.com>
References: <Pine.LNX.4.10.10003130852170.6968-200000@localhost.localdomain> <200003150919.EAA29966@indy.delorie.com> <r9dctixc.fsf@dan.resnet.rochester.edu> <200003151430.JAA01149@indy.delorie.com> <38CFAE9E.39D1C081@redhat.com>
X-SW-Source: 2000-q1/msg00709.html
Content-length: 561

Fernando Nasser wrote:

> The documentation problem may not be restricted to the debug command but
> also to other maintenance class commands.  They have been considered to
> be restricted to wizards that read source code instead of manuals and so
> they have not been documented in the user's manual.

I always consider it questionable whether maintenance commands
SHOULD be documented in the user's guide.  If they should, 
perhaps it should be in a separate section clearly identified
as being for the maintenance and debugging of the debugger.

				Michael
From kingdon@redhat.com Sat Apr 01 00:00:00 2000
From: Jim Kingdon <kingdon@redhat.com>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Clean up compiler warnings
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200002080452.XAA30493@devserv.devel.redhat.com>
References: <200002071950.OAA29599@devserv.devel.redhat.com> <389F583E.65831CE5@cygnus.com>
X-SW-Source: 2000-q1/msg00092.html
Content-length: 706

> As for the actual changes, they all look pretty good - especially the
> bit where you delete ``extern''s from .c files :-)

I'll take that as approval :-).  Checked in.

> So you know and don't start doing unnecessary work, the suggested list
> of warning flags for 5.0 is no more than:

I didn't mess with any warning flags.  I just used the defaults that
come with "./configure; make".  If you are saying that this will not
get cleaned up until after 5.0 I guess I'm not going to argue.

As for switches on enums, in this particular case using "default"
makes sense to me, but feel free to change it to the other way if you
want.  I'm having trouble getting very excited about it one way or the
other.
From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sourceware.cygnus.com
Subject: [Conversion of the GNU Hurd to the new i386 register layout]
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200001271357.e0RDvJ100750@delius.kettenis.local>
X-SW-Source: 2000-q1/msg00036.html
Content-length: 23898

Last month I sent the following patch to gdb-patches.  Could somebody
please apply this?

Mark

------- Start of forwarded message -------
Date: 20 Dec 1999 23:38:24 +0100
To: gdb-patches@sourceware.cygnus.com
Subject: Conversion of the GNU Hurd to the new i386 register layout

The following patch converts the GNU Hurd to the new i386 register
layout.

Mark


1999-12-20  Mark Kettenis  <kettenis@gnu.org>

	* config/i386/tm-i386gnu.h (THREAD_STATE_FLAVOR): Define to
	i386_REGS_SEGS_STATE.
	(HAVE_I387_REGS): Define.
	(FLOAT_INFO): Remove.
	* i386gnu-nat.c: Almost completely rewritten to use new i386
	register layout and `float info' implementation.
	* gnu-nat.c (inf_update_procs, proc_get_state, proc_string):
	Move prototypes from here.
	* gnu-nat.h: To here.


Index: gdb/gdb/config/i386/tm-i386gnu.h
===================================================================
RCS file: /var/cvsroot/gdb/gdb/config/i386/tm-i386gnu.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tm-i386gnu.h
- --- gdb/gdb/config/i386/tm-i386gnu.h	1999/07/19 17:23:27	1.1.1.2
+++ gdb/gdb/config/i386/tm-i386gnu.h	1999/12/20 21:06:55
@@ -1,4 +1,4 @@
- -/* Macro definitions for i386, GNU Hurd
+/* Macro definitions for i386 running the GNU Hurd.
    Copyright (C) 1992, 1999 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -21,26 +21,26 @@
 #ifndef TM_I386GNU_H
 #define TM_I386GNU_H 1
 
- -/* Include common definitions for gnu systems */
+/* Include common definitions for GNU systems.
+   FIXME: This does not belong here since this is supposed to contain
+   only native-dependent information.  */
 #include "nm-gnu.h"
 
 /* Thread flavors used in re-setting the T bit.
- - * @@ this is also bad for cross debugging.
- - */
- -#define THREAD_STATE_FLAVOR		i386_THREAD_STATE
+   FIXME: This is native-dependent.  */
+#define THREAD_STATE_FLAVOR		i386_REGS_SEGS_STATE
 #define THREAD_STATE_SIZE		i386_THREAD_STATE_COUNT
 #define THREAD_STATE_SET_TRACED(state) \
   	((struct i386_thread_state *)state)->efl |= 0x100
 #define THREAD_STATE_CLEAR_TRACED(state) \
   	((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
 
- -/* we can do it */
+/* We can attach and detach.
+   FIXME: This is probably native-dependent too.  */
 #define ATTACH_DETACH 1
 
+#define HAVE_I387_REGS
 #include "i386/tm-i386.h"
- -
- -#undef FLOAT_INFO
- -#define FLOAT_INFO { i386_mach3_float_info (); }
 
 /* Offset to saved PC in sigcontext.  */
 #define SIGCONTEXT_PC_OFFSET 68
Index: gdb/gdb/i386gnu-nat.c
===================================================================
RCS file: /var/cvsroot/gdb/gdb/i386gnu-nat.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 i386gnu-nat.c
- --- gdb/gdb/i386gnu-nat.c	1999/07/19 17:22:27	1.1.1.2
+++ gdb/gdb/i386gnu-nat.c	1999/12/20 20:31:13
@@ -1,4 +1,4 @@
- -/* Low level interface to I386 running the GNU Hurd
+/* Low level interface to i386 running the GNU Hurd.
    Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -22,36 +22,41 @@
 #include "inferior.h"
 #include "floatformat.h"
 
+#include <assert.h>
 #include <stdio.h>
 #include <errno.h>
 
 #include <mach.h>
+#include <mach_error.h>
 #include <mach/message.h>
 #include <mach/exception.h>
- -#include <mach_error.h>
 
 #include "gnu-nat.h"
+
+/* The FPU hardware state.  */
+struct env387
+{
+  unsigned short control;
+  unsigned short r0;
+  unsigned short status;
+  unsigned short r1;
+  unsigned short tag;
+  unsigned short r2;
+  unsigned long eip;
+  unsigned short code_seg;
+  unsigned short opcode;
+  unsigned long operand;
+  unsigned short operand_seg;
+  unsigned short r3;
+  unsigned char regs[8][10];
+};
 
- -/* Hmmm... Should this not be here?
- - * Now for i386_float_info() target_has_execution
- - */
- -#include <target.h>
- -
- -/* @@@ Should move print_387_status() to i387-tdep.c */
- -extern void print_387_control_word ();	/* i387-tdep.h */
- -extern void print_387_status_word ();
 \f
- -/* Find offsets to thread states at compile time.
- - * If your compiler does not grok this, calculate offsets
- - * offsets yourself and use them (or get a compatible compiler :-)
- - */
- -
- -#define  REG_OFFSET(reg) (int)(&((struct i386_thread_state *)0)->reg)
- -
- -/* at reg_offset[i] is the offset to the i386_thread_state
- - * location where the gdb registers[i] is stored.
- - */
+/* Offset to the thread_state_t location where REG is stored.  */
+#define REG_OFFSET(reg) offsetof (struct i386_thread_state, reg)
 
+/* At reg_offset[i] is the offset to the thread_state_t location where
+   the gdb registers[i] is stored.  */
 static int reg_offset[] =
 {
   REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx),
@@ -60,309 +65,268 @@
   REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs)
 };
 
- -#define REG_ADDR(state,regnum) ((char *)(state)+reg_offset[regnum])
+#define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
 
- -/* Fetch COUNT contiguous registers from thread STATE starting from REGNUM
- - * Caller knows that the regs handled in one transaction are of same size.
- - */
- -#define FETCH_REGS(state, regnum, count) \
- -  memcpy (&registers[REGISTER_BYTE (regnum)], \
- -	  REG_ADDR (state, regnum), \
- -	  count * REGISTER_RAW_SIZE (regnum))
- -
- -/* Store COUNT contiguous registers to thread STATE starting from REGNUM */
- -#define STORE_REGS(state, regnum, count) \
- -  memcpy (REG_ADDR (state, regnum), \
- -	  &registers[REGISTER_BYTE (regnum)], \
- -	  count * REGISTER_RAW_SIZE (regnum))
 \f
- -/*
- - * Fetch inferiors registers for gdb.
- - * REG specifies which (as gdb views it) register, -1 for all.
- - */
- -void
- -gnu_fetch_registers (int reg)
+/* Get the whole floating-point state of THREAD and record the
+   values of the corresponding (pseudo) registers.  */
+static void
+fetch_fpregs (struct proc *thread)
 {
- -  struct proc *thread;
- -  thread_state_t state;
- -
- -  inf_update_procs (current_inferior);	/* Make sure we know about new threads.  */
- -
- -  thread = inf_tid_to_thread (current_inferior, inferior_pid);
- -  if (!thread)
- -    error ("fetch inferior registers: %d: Invalid thread", inferior_pid);
- -
- -  state = proc_get_state (thread, 0);
+  mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT;
+  struct i386_float_state state;
+  struct env387 *ep = (struct env387 *) state.hw_state;
+  error_t err;
+  int i;
 
- -  if (!state)
- -    warning ("Couldn't fetch register %s from %s (invalid thread).",
- -	     REGISTER_NAME (reg), proc_string (thread));
- -  else if (reg >= 0)
+  err = thread_get_state (thread->port, i386_FLOAT_STATE,
+			  (thread_state_t) &state, &count);
+  if (err)
     {
- -      proc_debug (thread, "fetching register: %s", REGISTER_NAME (reg));
- -      supply_register (reg, REG_ADDR (state, reg));
- -      thread->fetched_regs |= (1 << reg);
+      warning ("Couldn't fetch floating-point state from %s",
+	       proc_string (thread));
+      return;
     }
- -  else
+
+  if (! state.initialized)
+    /* The floating-point state isn't initialized.  */
     {
- -      proc_debug (thread, "fetching all registers");
- -      for (reg = 0; reg < NUM_REGS; reg++)
- -	supply_register (reg, REG_ADDR (state, reg));
- -      thread->fetched_regs = ~0;
+      for (i = FP0_REGNUM; i <= FP7_REGNUM; i++)
+	supply_register (i, NULL);
+      for (i = FIRST_FPU_CTRL_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++)
+	supply_register (i, NULL);
+
+      return;
     }
+
+  /* Supply the floating-point registers.  */
+  for (i = 0; i < 8; i++)
+    supply_register (FP0_REGNUM + i, ep->regs[i]);
+
+  supply_register (FCTRL_REGNUM, (char *) &ep->control);
+  supply_register (FSTAT_REGNUM, (char *) &ep->status);
+  supply_register (FTAG_REGNUM,  (char *) &ep->tag);
+  supply_register (FCOFF_REGNUM, (char *) &ep->eip);
+  supply_register (FDS_REGNUM,   (char *) &ep->operand_seg);
+  supply_register (FDOFF_REGNUM, (char *) &ep->operand);
+
+  /* Store the code segment and opcode pseudo registers.  */
+  {
+    long l;
+
+    l = ep->code_seg;
+    supply_register (FCS_REGNUM, (char *) &l);
+    l = ep->opcode & ((1 << 11) - 1);
+    supply_register (FOP_REGNUM, (char *) &l);
+  }
 }
- -\f
- -/* Store our register values back into the inferior.
- - * If REG is -1, do this for all registers.
- - * Otherwise, REG specifies which register
- - *
- - * On mach3 all registers are always saved in one call.
- - */
+
+/* Fetch register REGNO, or all regs if REGNO is -1.  */
 void
- -gnu_store_registers (reg)
- -     int reg;
+gnu_fetch_registers (int regno)
 {
   struct proc *thread;
- -  int was_aborted, was_valid;
- -  thread_state_t state;
- -  thread_state_data_t old_state;
 
- -  inf_update_procs (current_inferior);	/* Make sure we know about new threads.  */
+  /* Make sure we know about new threads.  */
+  inf_update_procs (current_inferior);
 
   thread = inf_tid_to_thread (current_inferior, inferior_pid);
   if (!thread)
- -    error ("store inferior registers: %d: Invalid thread", inferior_pid);
- -
- -  proc_debug (thread, "storing register %s.", REGISTER_NAME (reg));
- -
- -  was_aborted = thread->aborted;
- -  was_valid = thread->state_valid;
- -  if (!was_aborted && was_valid)
- -    bcopy (&thread->state, &old_state, sizeof (old_state));
+    error ("Can't fetch registers from thread %d: No such thread",
+	   inferior_pid);
 
- -  state = proc_get_state (thread, 1);
- -
- -  if (!state)
- -    warning ("Couldn't store register %s from %s (invalid thread).",
- -	     REGISTER_NAME (reg), proc_string (thread));
- -  else
+  if (regno < NUM_GREGS || regno == -1)
     {
- -      if (!was_aborted && was_valid)
- -	/* See which registers have changed after aborting the thread.  */
+      thread_state_t state;
+      
+      /* This does the dirty work for us.  */
+      state = proc_get_state (thread, 0);
+      if (!state)
 	{
- -	  int check_reg;
- -	  for (check_reg = 0; check_reg < NUM_REGS; check_reg++)
- -	    if ((thread->fetched_regs & (1 << check_reg))
- -		&& bcmp (REG_ADDR (&old_state, check_reg),
- -			 REG_ADDR (state, check_reg),
- -			 REGISTER_RAW_SIZE (check_reg)))
- -	      /* Register CHECK_REG has changed!  Ack!  */
- -	      {
- -		warning ("Register %s changed after thread was aborted.",
- -			 REGISTER_NAME (check_reg));
- -		if (reg >= 0 && reg != check_reg)
- -		  /* Update gdb's copy of the register.  */
- -		  supply_register (check_reg, REG_ADDR (state, check_reg));
- -		else
- -		  warning ("... also writing this register!  Suspicious...");
- -	      }
+	  warning ("Couldn't fetch registers from %s",
+		   proc_string (thread));
+	  return;
 	}
 
- -      if (reg >= 0)
+      if (regno == -1)
 	{
- -	  proc_debug (thread, "storing register: %s", REGISTER_NAME (reg));
- -	  STORE_REGS (state, reg, 1);
+	  int i;
+	  
+	  proc_debug (thread, "fetching all register");
+	  
+	  for (i = 0; i < NUM_GREGS; i++)
+	    supply_register (i, REG_ADDR (state, i));
+	  thread->fetched_regs = ~0;
 	}
       else
 	{
- -	  proc_debug (thread, "storing all registers");
- -	  for (reg = 0; reg < NUM_REGS; reg++)
- -	    STORE_REGS (state, reg, 1);
+	  proc_debug (thread, "fetching register %s", REGISTER_NAME (regno));
+	  
+	  supply_register (regno, REG_ADDR (state, regno));
+	  thread->fetched_regs |= (1 << regno);
 	}
     }
+
+  if (regno >= NUM_GREGS || regno == -1)
+    {
+      proc_debug (thread, "fetching floating-point registers");
+      
+      fetch_fpregs (thread);
+    }
 }
+
 \f
- -/* jtv@hut.fi: I copied and modified this 387 code from
- - * gdb/i386-xdep.c. Modifications for Mach 3.0.
- - *
- - * i387 status dumper. See also i387-tdep.c
- - */
- -struct env387
+/* Fill the i387 hardware state EP with selected data from the set of
+   (pseudo) registers specified by REGS and VALID.  VALID is an array
+   indicating which registers in REGS are valid.  If VALID is zero,
+   all registers are assumed to be valid.  */
+static void
+convert_to_env387 (struct env387 *ep, char *regs, signed char *valid)
 {
- -  unsigned short control;
- -  unsigned short r0;
- -  unsigned short status;
- -  unsigned short r1;
- -  unsigned short tag;
- -  unsigned short r2;
- -  unsigned long eip;
- -  unsigned short code_seg;
- -  unsigned short opcode;
- -  unsigned long operand;
- -  unsigned short operand_seg;
- -  unsigned short r3;
- -  unsigned char regs[8][10];
- -};
- -/* This routine is machine independent?
- - * Should move it to i387-tdep.c but you need to export struct env387
- - */
- -static
- -print_387_status (status, ep)
- -     unsigned short status;
- -     struct env387 *ep;
- -{
   int i;
- -  int bothstatus;
- -  int top;
- -  int fpreg;
- -  unsigned char *p;
 
- -  bothstatus = ((status != 0) && (ep->status != 0));
- -  if (status != 0)
- -    {
- -      if (bothstatus)
- -	printf_unfiltered ("u: ");
- -      print_387_status_word (status);
- -    }
+  /* Fill in the floating-point registers.  */
+  for (i = 0; i < 8; i++)
+    if (!valid || valid[i])
+      memcpy (ep->regs[i], &regs[REGISTER_BYTE (FP0_REGNUM + i)],
+	      REGISTER_RAW_SIZE (FP0_REGNUM + i));
+
+#define fill(member, regno)                                              \
+  if (!valid || valid[(regno)])                                          \
+    memcpy (&ep->member, &regs[REGISTER_BYTE (regno)],                   \
+            sizeof (ep->member));
+
+  fill (control, FCTRL_REGNUM);
+  fill (status, FSTAT_REGNUM);
+  fill (tag, FTAG_REGNUM);
+  fill (eip, FCOFF_REGNUM);
+  fill (operand, FDOFF_REGNUM);
+  fill (operand_seg, FDS_REGNUM);
+
+#undef fill
+
+  if (!valid || valid[FCS_REGNUM])
+    ep->code_seg =
+      (* (int *) &registers[REGISTER_BYTE (FCS_REGNUM)] & 0xffff);
+  
+  if (!valid || valid[FOP_REGNUM])
+    ep->opcode =
+      ((* (int *) &registers[REGISTER_BYTE (FOP_REGNUM)] & ((1 << 11) - 1)));
+}
 
- -  if (ep->status != 0)
+/* Store the whole floating-point state into THREAD using information
+   from the corresponding (pseudo) registers.  */
+static void
+store_fpregs (struct proc *thread)
+{
+  mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT;
+  struct i386_float_state state;
+  error_t err;
+
+  err = thread_get_state (thread->port, i386_FLOAT_STATE,
+			  (thread_state_t) &state, &count);
+  if (err)
     {
- -      if (bothstatus)
- -	printf_unfiltered ("e: ");
- -      print_387_status_word (ep->status);
+      warning ("Couldn't fetch floating-point state from %s",
+	       proc_string (thread));
+      return;
     }
 
- -  print_387_control_word (ep->control);
- -  printf_unfiltered ("last exception: ");
- -  printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode));
- -  printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg));
- -  printf_unfiltered ("%s; ", local_hex_string (ep->eip));
- -  printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg));
- -  printf_unfiltered (":%s\n", local_hex_string (ep->operand));
- -
- -  top = (ep->status >> 11) & 7;
- -
- -  printf_unfiltered ("regno  tag  msb              lsb  value\n");
- -  for (fpreg = 7; fpreg >= 0; fpreg--)
+  convert_to_env387 ((struct env387 *) state.hw_state,
+		     registers, register_valid);
+    
+  err = thread_set_state (thread->port, i386_FLOAT_STATE,
+			  (thread_state_t) &state, i386_FLOAT_STATE_COUNT);
+  if (err)
     {
- -      double val;
- -
- -      printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
- -
- -      switch ((ep->tag >> (fpreg * 2)) & 3)
- -	{
- -	case 0:
- -	  printf_unfiltered ("valid ");
- -	  break;
- -	case 1:
- -	  printf_unfiltered ("zero  ");
- -	  break;
- -	case 2:
- -	  printf_unfiltered ("trap  ");
- -	  break;
- -	case 3:
- -	  printf_unfiltered ("empty ");
- -	  break;
- -	}
- -      for (i = 9; i >= 0; i--)
- -	printf_unfiltered ("%02x", ep->regs[fpreg][i]);
- -
- -      floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg],
- -			     &val);
- -      printf_unfiltered ("  %g\n", val);
+      warning ("Couldn't store floating-point state into %s",
+	       proc_string (thread));
+      return;
     }
- -  if (ep->r0)
- -    printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string (ep->r0));
- -  if (ep->r1)
- -    printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string (ep->r1));
- -  if (ep->r2)
- -    printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string (ep->r2));
- -  if (ep->r3)
- -    printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string (ep->r3));
 }
- -
- -/*
- - * values that go into fp_kind (from <i386/fpreg.h>)
- - */
- -#define FP_NO   0		/* no fp chip, no emulator (no fp support)      */
- -#define FP_SW   1		/* no fp chip, using software emulator          */
- -#define FP_HW   2		/* chip present bit                             */
- -#define FP_287  2		/* 80287 chip present                           */
- -#define FP_387  3		/* 80387 chip present                           */
 
- -typedef struct fpstate
+/* Store at least register REGNO, or all regs if REGNO == -1.  */
+void
+gnu_store_registers (int regno)
 {
- -#if 1
- -  unsigned char state[FP_STATE_BYTES];	/* "hardware" state */
- -#else
- -  struct env387 state;		/* Actually this */
- -#endif
- -  int status;			/* Duplicate status */
- -}
- - *fpstate_t;
+  struct proc *thread;
 
- -/* Mach 3 specific routines.
- - */
- -static int
- -get_i387_state (fstate)
- -     struct fpstate *fstate;
- -{
- -  error_t err;
- -  thread_state_data_t state;
- -  unsigned int fsCnt = i386_FLOAT_STATE_COUNT;
- -  struct i386_float_state *fsp;
- -  struct proc *thread = inf_tid_to_thread (current_inferior, inferior_pid);
+  /* Make sure we know about new threads.  */
+  inf_update_procs (current_inferior);
 
+  thread = inf_tid_to_thread (current_inferior, inferior_pid);
   if (!thread)
- -    error ("get_i387_state: Invalid thread");
- -
- -  proc_abort (thread, 0);	/* Make sure THREAD's in a reasonable state. */
+    error ("Couldn't store registers into thread %d: No such thread",
+	   inferior_pid);
 
- -  err = thread_get_state (thread->port, i386_FLOAT_STATE, state, &fsCnt);
- -  if (err)
+  if (regno < NUM_GREGS || regno == -1)
     {
- -      warning ("Can not get live floating point state: %s",
- -	       mach_error_string (err));
- -      return 0;
- -    }
+      thread_state_t state;
+      thread_state_data_t old_state;
+      int was_aborted = thread->aborted;
+      int was_valid = thread->state_valid;
 
- -  fsp = (struct i386_float_state *) state;
- -  /* The 387 chip (also 486 counts) or a software emulator? */
- -  if (!fsp->initialized || (fsp->fpkind != FP_387 && fsp->fpkind != FP_SW))
- -    return 0;
+      if (!was_aborted && was_valid)
+	memcpy (&old_state, &thread->state, sizeof (old_state));
 
- -  /* Clear the target then copy thread's float state there.
- -     Make a copy of the status word, for some reason?
- -   */
- -  memset (fstate, 0, sizeof (struct fpstate));
+      state = proc_get_state (thread, 1);
+      if (!state)
+	{
+	  warning ("Couldn't store registers into %s", proc_string (thread));
+	  return;
+	}
 
- -  fstate->status = fsp->exc_status;
+      if (!was_aborted && was_valid)
+	/* See which registers have changed after aborting the thread.  */
+	{
+	  int check_regno;
 
- -  memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES);
+	  for (check_regno = 0; check_regno < NUM_GREGS; check_regno++)
+	    if ((thread->fetched_regs & (1 << check_regno))
+		&& memcpy (REG_ADDR (&old_state, check_regno),
+			   REG_ADDR (state, check_regno),
+			   REGISTER_RAW_SIZE (check_regno)))
+	      /* Register CHECK_REGNO has changed!  Ack!  */
+	      {
+		warning ("Register %s changed after the thread was aborted",
+			 REGISTER_NAME (check_regno));
+		if (regno >= 0 && regno != check_regno)
+		  /* Update gdb's copy of the register.  */
+		  supply_register (check_regno, REG_ADDR (state, check_regno));
+		else
+		  warning ("... also writing this register!  Suspicious...");
+	      }
+	}
 
- -  return 1;
- -}
+#define fill(state, regno)                                               \
+  memcpy (REG_ADDR(state, regno), &registers[REGISTER_BYTE (regno)],     \
+          REGISTER_RAW_SIZE (regno))
 
- -/*
- - * This is called by "info float" command
- - */
- -void
- -i386_mach3_float_info ()
- -{
- -  char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
- -  int valid = 0;
- -  fpstate_t fps;
+      if (regno == -1)
+	{
+	  int i;
+	  
+	  proc_debug (thread, "storing all registers");
 
- -  if (target_has_execution)
- -    valid = get_i387_state (buf);
+	  for (i = 0; i < NUM_GREGS; i++)
+	    if (register_valid[i])
+	      fill (state, i);
+	}
+      else
+	{
+	  proc_debug (thread, "storing register %s", REGISTER_NAME (regno));
 
- -  if (!valid)
- -    {
- -      warning ("no floating point status saved");
- -      return;
+	  assert (register_valid[regno]);
+	  fill (state, regno);
+	}
     }
 
- -  fps = (fpstate_t) buf;
+#undef fill
 
- -  print_387_status (fps->status, (struct env387 *) fps->state);
+  if (regno >= NUM_GREGS || regno == -1)
+    {
+      proc_debug (thread, "storing floating-point registers");
+      
+      store_fpregs (thread);
+    }
 }
Index: gdb/gdb/gnu-nat.c
===================================================================
RCS file: /var/cvsroot/gdb/gdb/gnu-nat.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 gnu-nat.c
- --- gdb/gdb/gnu-nat.c	1999/10/16 15:27:26	1.1.1.5
+++ gdb/gdb/gnu-nat.c	1999/12/20 20:43:12
@@ -1,4 +1,4 @@
- -/* Interface GDB to the GNU Hurd
+/* Interface GDB to the GNU Hurd.
    Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -88,7 +88,6 @@
 
 extern struct target_ops gnu_ops;
 
- -int inf_update_procs (struct inf *inf);
 struct inf *make_inf ();
 void inf_clear_wait (struct inf *inf);
 void inf_cleanup (struct inf *inf);
@@ -116,7 +115,6 @@
        debug ("{inf %d %p}: " msg, __inf->pid, __inf , ##args); } while (0)
 
 void proc_abort (struct proc *proc, int force);
- -thread_state_t proc_get_state (struct proc *proc, int force);
 struct proc *make_proc (struct inf *inf, mach_port_t port, int tid);
 struct proc *_proc_free (struct proc *proc);
 int proc_update_sc (struct proc *proc);
@@ -126,7 +124,6 @@
 void proc_steal_exc_port (struct proc *proc, mach_port_t exc_port);
 void proc_restore_exc_port (struct proc *proc);
 int proc_trace (struct proc *proc, int set);
- -char *proc_string (struct proc *proc);
 
 /* Evaluate RPC_EXPR in a scope with the variables MSGPORT and REFPORT bound
    to INF's msg port and task port respectively.  If it has no msg port,
Index: gdb/gdb/gnu-nat.h
===================================================================
RCS file: /var/cvsroot/gdb/gdb/gnu-nat.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 gnu-nat.h
- --- gdb/gdb/gnu-nat.h	1999/07/19 17:22:22	1.1.1.3
+++ gdb/gdb/gnu-nat.h	1999/12/20 20:38:32
@@ -31,6 +31,9 @@
 /* Converts a GDB pid to a struct proc.  */
 struct proc *inf_tid_to_thread (struct inf *inf, int tid);
 
+/* Makes sure that INF's thread list is synced with the actual process.  */
+int inf_update_procs (struct inf *inf);
+
 /* A proc is either a thread, or the task (there can only be one task proc
    because it always has the same TID, PROC_TID_TASK).  */
 struct proc
@@ -75,7 +78,14 @@
 
 extern int __proc_pid (struct proc *proc);
 
+/* Make sure that the state field in PROC is up to date, and return a
+   pointer to it, or 0 if something is wrong.  If WILL_MODIFY is true,
+   makes sure that the thread is stopped and aborted first, and sets
+   the state_changed field in PROC to true.  */
 extern thread_state_t proc_get_state (struct proc *proc, int will_modify);
+
+/* Return printable description of proc.  */
+extern char *proc_string (struct proc *proc);
 
 #define proc_debug(_proc, msg, args...) \
   do { struct proc *__proc = (_proc); \
------- End of forwarded message -------
From eliz@delorie.com Sat Apr 01 00:00:00 2000
From: Eli Zaretskii <eliz@delorie.com>
To: ezannoni@cygnus.com
Cc: phdm@macqel.be, ac131313@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: HAVE_POLL is not enough - RFA
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003211815.NAA12423@indy.delorie.com>
References: <200003181028.LAA30913@mail.macqel.be> <200003182226.RAA07052@indy.delorie.com> <14550.33984.488206.90007@kwikemart.cygnus.com>
X-SW-Source: 2000-q1/msg00862.html
Content-length: 257

> I committed Eli's patch below. 

Thanks!

It seems apology is in order: my previous message implied that I
posted that patch some time ago, while in reality I simply forgot to
post it.  So there was nothing wrong with Elena not taking care of it.

Sorry!
From fnasser@cygnus.com Sat Apr 01 00:00:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Dave Vogel <dave@lightsurf.com>
Cc: Insight mail-list <insight@sourceware.cygnus.com>, gdb-patches@sourceware.cygnus.com, grante@visi.com
Subject: Re: ARM - RDI ethernet support
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <387295B5.CBBF5807@cygnus.com>
References: <386A5B50.EFBCA961@lightsurf.com>
X-SW-Source: 2000-q1/msg00010.html
Content-length: 2459

Hi Dave,

Thank you for your patches.

I will incorporate the Tcl part of it soon, so we will be able to select
RDI over UDP on Insight.
As soon as I find some time, I will try to figure why pressing the STOP
button does not work.  Note that it will be somewhat difficult for me as
I don't have an interruptible target on hands, but I will at least check
if interrupt_target() gets called.

With regards to the interrupt patch to ardi.c, we have already
incorporated a patch from Grant Edwards that does the same thing.  Due
to my vacations and the difficulties I have to test (lack of ICE
target), I had no time to incorporate it in the snapshots, which I was
planning to do this week.

I am attaching the current patch and I would appreciate if you give it a
spin.  If you have any problems please let us know.  We can try to merge
the two patches (I don't think it will be necessary though).

Regards,
Fernando

-- 
Fernando Nasser
Cygnus Solutions - Toronto Office       E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299


Index: ardi.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/rdi-share/ardi.c,v
retrieving revision 1.5
diff -c -r1.5 ardi.c
*** ardi.c      1999/11/01 15:29:56     1.5
--- ardi.c      1999/12/13 22:31:16
***************
*** 392,397 ****
--- 392,398 ----
  #endif
  
  static bool boot_interrupted = FALSE;
+ static volatile bool interrupt_request = FALSE;
  
  static void ardi_sigint_handler(int sig) {
  #ifdef DEBUG
***************
*** 401,406 ****
--- 402,408 ----
      IGNORE(sig);
  #endif
      boot_interrupted = TRUE;
+     interrupt_request = TRUE;
  #ifndef __unix
      signal(SIGINT, ardi_sigint_handler);
  #endif
***************
*** 1306,1312 ****
    return RDIError_NoError;
  }
  
- static volatile bool interrupt_request = FALSE;
  
  static void interrupt_target( void )
  {
--- 1308,1313 ----
***************
*** 1397,1402 ****
--- 1398,1404 ----
    angel_DebugPrint("Waiting for program to finish...\n");
  #endif
  
+   signal(SIGINT, ardi_sigint_handler);
    while( executing )
    {
        if (interrupt_request)
***************
*** 1406,1411 ****
--- 1408,1415 ----
        }
        Adp_AsynchronousProcessing( async_block_on_nothing );
    }
+   signal(SIGINT, SIG_IGN);
+ 
  
  #ifdef TEST_DC_APPL
    Adp_Install_DC_Appl_Handler( NULL );
From kingdon@redhat.com Sat Apr 01 00:00:00 2000
From: Jim Kingdon <kingdon@redhat.com>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com, blizzard@mozilla.org
Subject: Re: dlclose()
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003020552.AAA07061@devserv.devel.redhat.com>
References: <200002161953.OAA07411@devserv.devel.redhat.com> <38BD058E.51313D7D@cygnus.com>
X-SW-Source: 2000-q1/msg00454.html
Content-length: 5974

> One fix, and some extra random noise:

OK, I've changed assert() to internal_error() and reworded the
comment.  PTR is also gone.

I don't know how the WITHDRAWN thing is supposed to work, but this
patch supercedes the two that I already posted under the subject line
"dlclose()".

> JimB's got the final say.

Well, any reactions, JimB?  We don't have any other solib.c
maintainers yet.  I also haven't heard from Mark Kettenis recently on
this issue - I know he was talking about an solib.c rewrite (not
something I disagree with, really), but that was in the context of a
rather different patch (even if it addressed the same problem).

2000-02-20  Jim Kingdon  <kingdon@redhat.com>

	* solib.c (find_solib): New argument recheck.
	* solib.c (solib_add): Pass it as 1, and add logic to delete
	shared libraries which aren't still in the inferior.
	(struct so_list): New field found_me, for solib_add.
	* solib.c (other find_solib callers): Pass recheck as 0.

Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.1.1.10
diff -u -r1.1.1.10 solib.c
--- solib.c	1999/11/17 02:30:28	1.1.1.10
+++ solib.c	2000/03/02 05:19:21
@@ -143,6 +143,11 @@
     char so_name[MAX_PATH_SIZE];	/* shared object lib name (FIXME) */
     char symbols_loaded;	/* flag: symbols read in yet? */
     char from_tty;		/* flag: print msgs? */
+
+    /* Flag for use within solib_add: have we seen this library actually
+       still mapped in the inferior this pass?  */
+    char found_me;
+
     struct objfile *objfile;	/* objfile for loaded lib */
     struct section_table *sections;
     struct section_table *sections_end;
@@ -181,8 +186,7 @@
 
 static int symbol_add_stub PARAMS ((PTR));
 
-static struct so_list *
-  find_solib PARAMS ((struct so_list *));
+static struct so_list *find_solib (struct so_list *, int);
 
 static struct link_map *
   first_link_map_member PARAMS ((void));
@@ -975,8 +979,10 @@
  */
 
 static struct so_list *
-find_solib (so_list_ptr)
-     struct so_list *so_list_ptr;	/* Last lm or NULL for first one */
+find_solib (struct so_list *so_list_ptr,
+	    /* Nonzero if we should read all the entries from the inferior,
+	       not just the ones at the end of the list.  */
+	    int recheck)
 {
   struct so_list *so_list_next = NULL;
   struct link_map *lm = NULL;
@@ -985,7 +991,9 @@
   if (so_list_ptr == NULL)
     {
       /* We are setting up for a new scan through the loaded images. */
-      if ((so_list_next = so_list_head) == NULL)
+      so_list_next = so_list_head;
+      if (so_list_next == NULL
+	  || recheck)
 	{
 	  /* We have not already read in the dynamic linking structures
 	     from the inferior, lookup the address of the base structure. */
@@ -1002,7 +1010,8 @@
     {
       /* We have been called before, and are in the process of walking
          the shared library list.  Advance to the next shared object. */
-      if ((lm = LM_NEXT (so_list_ptr)) == NULL)
+      lm = LM_NEXT (so_list_ptr);
+      if (recheck || lm == NULL)
 	{
 	  /* We have hit the end of the list, so check to see if any were
 	     added, but be quiet if we can't read from the target any more. */
@@ -1020,7 +1029,7 @@
 	}
       so_list_next = so_list_ptr->next;
     }
-  if ((so_list_next == NULL) && (lm != NULL))
+  if ((so_list_next == NULL || recheck) && (lm != NULL))
     {
       /* Get next link map structure from inferior image and build a local
          abbreviated load_map structure */
@@ -1188,7 +1197,7 @@
       /* Count how many new section_table entries there are.  */
       so = NULL;
       count = 0;
-      while ((so = find_solib (so)) != NULL)
+      while ((so = find_solib (so, 0)) != NULL)
 	{
 	  if (so->so_name[0] && !match_main (so->so_name))
 	    {
@@ -1201,7 +1210,7 @@
 	  
 	  /* Add these section table entries to the target's table.  */
 	  old = target_resize_to_sections (target, count);
-	  while ((so = find_solib (so)) != NULL)
+	  while ((so = find_solib (so, 0)) != NULL)
 	    {
 	      if (so->so_name[0])
 		{
@@ -1215,9 +1224,13 @@
 	}
     }
 
+  for (so = so_list_head; so != NULL; so = so->next)
+    so->found_me = 0;
+
   /* Now add the symbol files.  */
-  while ((so = find_solib (so)) != NULL)
+  while ((so = find_solib (so, 1)) != NULL)
     {
+      so->found_me = 1;
       if (so->so_name[0] && re_exec (so->so_name) &&
 	  !match_main (so->so_name))
 	{
@@ -1240,6 +1253,44 @@
 	}
     }
 
+  {
+    struct so_list *prev;
+    prev = NULL;
+    for (so = so_list_head; so != NULL; so = so->next)
+      {
+	if (!so->found_me)
+	  {
+	    /* If there were an analogue to
+	       disable_breakpoints_in_shlibs but just for this one
+	       struct so_list, we'd call it.  */
+
+	    if (so->sections != NULL)
+	      free (so->sections);
+
+	    free_objfile (so->objfile);
+
+	    /* Punt the issue of the section tables that we put in the
+	       target vector.  The excuse is that they are basically
+	       used for coredumps rather than running programs, and
+	       with coredumps we don't unload shared libraries.  */
+
+	    if (so->abfd == NULL)
+	      internal_error ("no bfd in solib_add");
+	    if (!bfd_close (so->abfd))
+	      warning ("cannot close \"%s\": %s",
+		       so->so_name, bfd_errmsg (bfd_get_error ()));
+
+	    if (prev == NULL)
+	      so_list_head = so->next;
+	    else
+	      prev->next = so->next;
+
+	    free (so);
+	  }
+	prev = so;
+      }
+  }
+
   /* Getting new symbols may change our opinion about what is
      frameless.  */
   if (so_last)
@@ -1289,7 +1340,7 @@
   addr_fmt = "016l";
 #endif
 
-  while ((so = find_solib (so)) != NULL)
+  while ((so = find_solib (so, 0)) != NULL)
     {
       if (so->so_name[0])
 	{
@@ -1347,7 +1398,7 @@
 {
   register struct so_list *so = 0;	/* link map state variable */
 
-  while ((so = find_solib (so)) != NULL)
+  while ((so = find_solib (so, 0)) != NULL)
     {
       if (so->so_name[0])
 	{
From ezannoni@cygnus.com Sat Apr 01 00:00:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: ezannoni@cygnus.com, ac131313@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: GDB-5 2000-03-03
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <14543.59234.407028.669194@kwikemart.cygnus.com>
References: <38BFBD74.79263683@cygnus.com> <200003040702.CAA08162@indy.delorie.com> <38C0E240.FC02154E@cygnus.com> <14531.54961.880860.662139@kwikemart.cygnus.com> <200003151417.JAA01137@indy.delorie.com>
X-SW-Source: 2000-q1/msg00723.html
Content-length: 19022

Eli Zaretskii writes:
 > 
 > > Andrew Cagney writes:
 > >  > Eli Zaretskii wrote:
 > >  > 
 > >  > > But there's a similar issue with Readline.  The current version in the
 > >  > > GDB CVS tree has bugs in the DJGPP-specific code, one of which simply
 > >  > > prevents GDB from linking.  I see that most of these problems are
 > >  > > solved in the current beta version of Readline, but will you be
 > >  > > synchronizing the GDB tree with that version before release?  If not,
 > >  > > I don't see any solution but a local patch.  Please advise.
 > >  > 
 > >  > Consider yourself the maintainer of the DJGPP specific readline stuff
 > >  > (like mmalloc).  (I'll add a note to MAINTAINERS.)
 > >  > 
 > >  > The main thing is to make certain that the true readline sources have
 > >  > the fix as well.  I wasn't planning on importing readline (I'll add a
 > >  > note stateing that this is something that won't make it).
 > >  > 
 > >  > 	Andrew
 > > 
 > > Eli, yes, please check in you fix to readline, I have no time this
 > > week to do another import.
 > 
 > I just committed the changes below.
 > 
 > (It seems the readline directory doesn't have a ChangeLog file, 'cause
 > CVS won't check it out for me.  Am I missing something?)
 > 

There is ChangeLog.Cygnus file. You can use that for the time
being. The readline package doesn't include a ChangeLog. I wonder
though if this makes any sense anymore, I mean, the name 'Cygnus'.

Elena

 > --- readline/support/shobj-conf.~	Tue Aug  3 02:08:42 1999
 > +++ readline/support/shobj-conf	Sat Feb 26 15:07:52 2000
 > @@ -305,6 +305,12 @@
 >  
 >  	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
 >  	;;
 > +
 > +msdosdjgpp*)
 > +	SHOBJ_STATUS=unsupported
 > +	SHLIB_STATUS=unsupported
 > +	;;
 > +
 >  #
 >  # Rely on correct gcc configuration for everything else
 >  #
 > --- readline/bind.c~	Tue Aug  3 02:08:36 1999
 > +++ readline/bind.c	Wed Feb 23 16:05:52 2000
 > @@ -62,6 +62,10 @@ extern int errno;
 >  extern char *strchr (), *strrchr ();
 >  #endif /* !strchr && !__STDC__ */
 >  
 > +#ifndef O_BINARY
 > +# define O_BINARY 0
 > +#endif
 > +
 >  extern int _rl_horizontal_scroll_mode;
 >  extern int _rl_mark_modified_lines;
 >  extern int _rl_bell_preference;
 > @@ -646,7 +650,7 @@ _rl_read_file (filename, sizep)
 >    char *buffer;
 >    int i, file;
 >  
 > -  if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0)
 > +  if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY | O_BINARY, 0666)) < 0)
 >      return ((char *)NULL);
 >  
 >    file_size = (size_t)finfo.st_size;
 > @@ -667,7 +671,7 @@ _rl_read_file (filename, sizep)
 >    i = read (file, buffer, file_size);
 >    close (file);
 >  
 > -#if 0
 > +#if 1
 >    if (i < file_size)
 >  #else
 >    if (i < 0)
 > @@ -678,6 +682,30 @@ _rl_read_file (filename, sizep)
 >      }
 >  
 >    buffer[file_size] = '\0';
 > +
 > +#if O_BINARY
 > +  {
 > +    /* Systems which distinguish between text and binary files need
 > +       to strip the CR characters before each Newline, otherwise the
 > +       parsing functions won't work.  */
 > +    char *s, *d;
 > +    size_t removed = 0;
 > +
 > +    for (s = buffer, d = buffer; s < buffer + file_size; s++)
 > +      {
 > +	if (removed)
 > +	  *d = *s;
 > +	if (*s != '\r' || s[1] != '\n')
 > +	  d++;
 > +	else
 > +	  removed++;
 > +      }
 > +
 > +    file_size -= removed;
 > +    buffer[file_size] = '\0';
 > +  }
 > +#endif
 > +
 >    if (sizep)
 >      *sizep = file_size;
 >    return (buffer);
 > @@ -699,6 +728,7 @@ rl_re_read_init_file (count, ignore)
 >       1. the filename used for the previous call
 >       2. the value of the shell variable `INPUTRC'
 >       3. ~/.inputrc
 > +     4. (for __MSDOS__ only) ~/_inputrc
 >     If the file existed and could be opened and read, 0 is returned,
 >     otherwise errno is returned. */
 >  int
 > @@ -718,6 +748,20 @@ rl_read_init_file (filename)
 >    if (*filename == 0)
 >      filename = DEFAULT_INPUTRC;
 >  
 > +#ifdef __MSDOS__
 > +  {
 > +    /* DOS doesn't allow leading dots in file names.  If the original
 > +       name fails (it could work if we are on Windows), fall back to
 > +       ~/_inputrc.  */
 > +    int retval = _rl_read_init_file (filename, 0);
 > +
 > +    if (retval == 0)
 > +      return retval;
 > +    else if (strcmp (filename, "~/.inputrc") == 0)
 > +      filename = "~/_inputrc";
 > +  }
 > +#endif
 > +
 >    return (_rl_read_init_file (filename, 0));
 >  }
 >  
 > --- readline/complete.c~	Tue Aug  3 02:08:36 1999
 > +++ readline/complete.c	Wed Feb 23 18:02:32 2000
 > @@ -1407,9 +1410,9 @@ username_completion_function (text, stat
 >       char *text;
 >       int state;
 >  {
 > -#if defined (__GO32__) || defined (__WIN32__) || defined (__OPENNT)
 > +#if defined (__WIN32__) || defined (__OPENNT)
 >    return (char *)NULL;
 > -#else /* !__GO32__ */
 > +#else /* !__WIN32__ && !__OPENNT */
 >    static char *username = (char *)NULL;
 >    static struct passwd *entry;
 >    static int namelen, first_char, first_char_loc;
 > @@ -1499,6 +1502,14 @@ filename_completion_function (text, stat
 >  	  strcpy (filename, ++temp);
 >  	  *temp = '\0';
 >  	}
 > +#if defined (__WIN32__) || defined (__OPENNT) || defined (__MSDOS__)
 > +      /* Handle the drive-relative names "d:foo/bar".  */
 > +      else if (dirname[1] == ':')
 > +	{
 > +	  strcpy (filename, dirname + 2);
 > +	  dirname[2] = '\0';
 > +	}
 > +#endif
 >        else
 >  	{
 >  	  dirname[0] = '.';
 > --- readline/display.c~	Tue Aug  3 02:08:36 1999
 > +++ readline/display.c	Wed Feb 23 16:13:52 2000
 > @@ -1126,8 +1126,10 @@ _rl_move_vert (to)
 >    {
 >      int row, col;
 >  
 > +    i = fflush (rl_outstream);	/* make sure the cursor pos is current! */
 >      ScreenGetCursor (&row, &col);
 >      ScreenSetCursor ((row + to - _rl_last_v_pos), col);
 > +    delta = i;
 >    }
 >  #else /* !__GO32__ */
 >  
 > @@ -1377,7 +1379,10 @@ space_to_eol (count)
 >  void
 >  _rl_clear_screen ()
 >  {
 > -#if !defined (__GO32__)
 > +#if defined (__GO32__)
 > +  ScreenClear ();	/* FIXME: only works in text modes */
 > +  ScreenSetCursor (0, 0);  /* term_clrpag is "cl" which homes the cursor */
 > +#else
 >    if (term_clrpag)
 >      tputs (term_clrpag, 1, _rl_output_character_function);
 >    else
 > @@ -1392,6 +1397,7 @@ insert_some_chars (string, count)
 >       int count;
 >  {
 >  #if defined (__GO32__)
 > +#ifndef __DJGPP__
 >    int row, col, width;
 >    char *row_start;
 >  
 > @@ -1400,7 +1406,7 @@ insert_some_chars (string, count)
 >    row_start = ScreenPrimary + (row * width);
 >  
 >    memcpy (row_start + col + count, row_start + col, width - col - count);
 > -
 > +#endif /* !__DJGPP__ */
 >    /* Place the text on the screen. */
 >    _rl_output_some_chars (string, count);
 >  #else /* !_GO32 */
 > @@ -1445,6 +1451,7 @@ static void
 >  delete_chars (count)
 >       int count;
 >  {
 > +#if !defined (__DJGPP__)
 >  #if defined (__GO32__)
 >    int row, col, width;
 >    char *row_start;
 > @@ -1473,6 +1480,7 @@ delete_chars (count)
 >  	  tputs (term_dc, 1, _rl_output_character_function);
 >      }
 >  #endif /* !__GO32__ */
 > +#endif /* !__DJGPP__ */
 >  }
 >  
 >  void
 > --- readline/histfile.c~	Tue Aug  3 02:08:38 1999
 > +++ readline/histfile.c	Wed Feb 23 18:11:46 2000
 > @@ -140,6 +140,16 @@ read_history_range (filename, from, to)
 >    input = history_filename (filename);
 >    file = open (input, O_RDONLY|O_BINARY, 0666);
 >  
 > +
 > +#ifdef __MSDOS__
 > +  /* MSDOS doesn't allow leading dots in file names.  Try again
 > +     with the dot replaced by an underscore.  */
 > +  if (file < 0 && !filename)
 > +    {
 > +      input[strlen (input) - 8] = '_';
 > +      file = open (input, O_RDONLY|O_BINARY, 0666);
 > +    }
 > +#endif
 >    if ((file < 0) || (fstat (file, &finfo) == -1))
 >      goto error_and_exit;
 >  
 > @@ -233,6 +243,16 @@ history_truncate_file (fname, lines)
 >    filename = history_filename (fname);
 >    file = open (filename, O_RDONLY|O_BINARY, 0666);
 >  
 > +#ifdef __MSDOS__
 > +  /* MSDOS doesn't allow leading dots in file names.  Try again
 > +     with the dot replaced by an underscore.  */
 > +  if (file < 0 && !fname)
 > +    {
 > +      filename[strlen (filename) - 8] = '_';
 > +      file = open (filename, O_RDONLY|O_BINARY, 0666);
 > +    }
 > +#endif
 > +
 >    if (file == -1 || fstat (file, &finfo) == -1)
 >      goto truncate_exit;
 >  
 > @@ -314,8 +334,23 @@ history_do_write (filename, nelements, o
 >  
 >    if ((file = open (output, mode, 0600)) == -1)
 >      {
 > +#ifdef __MSDOS__
 > +      /* MSDOS doesn't allow leading dots in file names.  If this is
 > +	 the default file name, try again with the dot replaced by an
 > +	 underscore.  */
 > +      if (!filename)
 > +	{
 > +	  output[strlen (output) - 8] = '_';
 > +	  if ((file = open (output, mode, 0600)) == -1)
 > +	    {
 > +	      FREE (output);
 > +	      return (errno);
 > +	    }
 > +	}
 > +#else
 >        FREE (output);
 >        return (errno);
 > +#endif
 >      }
 >  
 >    if (nelements > history_length)
 > --- readline/input.c~	Tue Aug  3 02:08:38 1999
 > +++ readline/input.c	Wed Feb 23 16:25:20 2000
 > @@ -96,7 +96,7 @@ extern Keymap _rl_keymap;
 >  
 >  extern int _rl_convert_meta_chars_to_ascii;
 >  
 > -#if defined (__GO32__)
 > +#if defined (__GO32__) && !defined (HAVE_SELECT)
 >  #  include <pc.h>
 >  #endif /* __GO32__ */
 >  
 > @@ -176,7 +176,7 @@ rl_unget_char (key)
 >  static void
 >  rl_gather_tyi ()
 >  {
 > -#if defined (__GO32__)
 > +#if defined (__GO32__) && !defined (HAVE_SELECT)
 >    char input;
 >  
 >    if (isatty (0) && kbhit () && ibuffer_space ())
 > @@ -397,7 +397,7 @@ rl_getc (stream)
 >    int result, flags;
 >    unsigned char c;
 >  
 > -#if defined (__GO32__)
 > +#if defined (__GO32__) && !defined (HAVE_TERMIOS_H)
 >    if (isatty (0))
 >      return (getkey () & 0x7F);
 >  #endif /* __GO32__ */
 > @@ -448,7 +448,7 @@ rl_getc (stream)
 >  	}
 >  #endif /* _POSIX_VERSION && EAGAIN && O_NONBLOCK */
 >  
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >        /* If the error that we received was SIGINT, then try again,
 >  	 this is simply an interrupted system call to read ().
 >  	 Otherwise, some error ocurred, also signifying EOF. */
 > --- readline/readline.c~	Tue Aug  3 02:08:38 1999
 > +++ readline/readline.c	Wed Feb 23 17:58:46 2000
 > @@ -163,14 +163,16 @@ static void readline_initialize_everythi
 >  static void start_using_history ();
 >  static void bind_arrow_keys ();
 >  
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >  static void readline_default_bindings ();
 >  #endif /* !__GO32__ */
 >  
 >  #if defined (__GO32__)
 >  #  include <go32.h>
 >  #  include <pc.h>
 > -#  undef HANDLE_SIGNALS
 > +#  if !defined (__DJGPP__)
 > +#    undef HANDLE_SIGNALS
 > +#  endif /* !__DJGPP__ */
 >  #endif /* __GO32__ */
 >  
 >  extern char *xmalloc (), *xrealloc ();
 > @@ -745,10 +747,10 @@ readline_initialize_everything ()
 >    /* Initialize the terminal interface. */
 >    _rl_init_terminal_io ((char *)NULL);
 >  
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >    /* Bind tty characters to readline functions. */
 >    readline_default_bindings ();
 > -#endif /* !__GO32__ */
 > +#endif /* !__GO32__ || HAVE_TERMIOS_H */
 >  
 >    /* Initialize the function names. */
 >    rl_initialize_funmap ();
 > @@ -1272,7 +1279,7 @@ rl_refresh_line (ignore1, ignore2)
 >    _rl_move_vert (curr_line);
 >    _rl_move_cursor_relative (0, the_line);   /* XXX is this right */
 >  
 > -#if defined (__GO32__)
 > +#if defined (__GO32__) && !defined (__DJGPP__)
 >    {
 >      int row, col, width, row_start;
 >  
 > @@ -1281,9 +1288,9 @@ rl_refresh_line (ignore1, ignore2)
 >      row_start = ScreenPrimary + (row * width);
 >      memset (row_start + col, 0, (width - col) * 2);
 >    }
 > -#else /* !__GO32__ */
 > +#else /* !__GO32__ || __DJGPP__ */
 >    _rl_clear_to_eol (0);		/* arg of 0 means to not use spaces */
 > -#endif /* !__GO32__ */
 > +#endif /* !__GO32__ || __DJGPP__ */
 >  
 >    rl_forced_update_display ();
 >    rl_display_fixed = 1;
 > --- readline/rltty.c~	Mon Aug 16 22:17:56 1999
 > +++ readline/rltty.c	Wed Feb 23 15:56:42 2000
 > @@ -57,7 +57,9 @@ extern void _rl_control_keypad ();
 >  
 >  #if defined (__GO32__)
 >  #  include <pc.h>
 > -#  undef HANDLE_SIGNALS
 > +#  if !defined (__DJGPP__)
 > +#    undef HANDLE_SIGNALS
 > +#  endif /* !__DJGPP__ */
 >  #endif /* __GO32__ */
 >  
 >  /* Indirect functions to allow apps control over terminal management. */
 > @@ -260,7 +262,7 @@ prepare_terminal_settings (meta_flag, ot
 >       int meta_flag;
 >       TIOTYPE otio, *tiop;
 >  {
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >    readline_echoing_p = (otio.sgttyb.sg_flags & ECHO);
 >  
 >    /* Copy the original settings to the structure we're going to use for
 > @@ -326,7 +328,7 @@ prepare_terminal_settings (meta_flag, ot
 >    tiop->ltchars.t_dsuspc = -1;	/* C-y */
 >    tiop->ltchars.t_lnextc = -1;	/* C-v */
 >  #endif /* TIOCGLTC */
 > -#endif /* !__GO32__ */
 > +#endif /* !__GO32__ || HAVE_TERMIOS_H */
 >  }
 >  
 >  #else  /* !defined (NEW_TTY_DRIVER) */
 > @@ -524,7 +526,7 @@ void
 >  rl_prep_terminal (meta_flag)
 >       int meta_flag;
 >  {
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >    int tty;
 >    TIOTYPE tio;
 >  
 > @@ -559,14 +561,14 @@ rl_prep_terminal (meta_flag)
 >    terminal_prepped = 1;
 >  
 >    release_sigint ();
 > -#endif /* !__GO32__ */
 > +#endif /* !__GO32__ || HAVE_TERMIOS_H */
 >  }
 >  
 >  /* Restore the terminal's normal settings and modes. */
 >  void
 >  rl_deprep_terminal ()
 >  {
 > -#if !defined (__GO32__)
 > +#if !defined (__GO32__) || defined (HAVE_TERMIOS_H)
 >    int tty;
 >  
 >    if (!terminal_prepped)
 > @@ -591,7 +593,7 @@ rl_deprep_terminal ()
 >    terminal_prepped = 0;
 >  
 >    release_sigint ();
 > -#endif /* !__GO32__ */
 > +#endif /* !__GO32__ || HAVE_TERMIOS_H */
 >  }
 >  \f
 >  /* **************************************************************** */
 > --- readline/signals.c~	Tue Aug  3 02:08:38 1999
 > +++ readline/signals.c	Wed Feb 23 18:04:20 2000
 > @@ -40,9 +40,9 @@
 >  #  include <sys/ioctl.h>
 >  #endif /* GWINSZ_IN_SYS_IOCTL */
 >  
 > -#if defined (__GO32__)
 > +#if defined (__GO32__) && !defined(__DJGPP__)
 >  #  undef HANDLE_SIGNALS
 > -#endif /* __GO32__ */
 > +#endif /* __GO32__  && !__DJGPP__ */
 >  
 >  #if defined (HANDLE_SIGNALS)
 >  /* Some standard library routines. */
 > @@ -93,7 +93,9 @@ int rl_catch_sigwinch = 1;
 >  #endif
 >  
 >  static int signals_set_flag;
 > +#ifdef SIGWINCH
 >  static int sigwinch_set_flag;
 > +#endif
 >  
 >  /* **************************************************************** */
 >  /*					        		    */
 > --- readline/terminal.c~	Tue Aug  3 02:08:38 1999
 > +++ readline/terminal.c	Wed Feb 23 18:07:12 2000
 > @@ -57,6 +57,10 @@
 >  #  include <sys/ioctl.h>
 >  #endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
 >  
 > +#if defined (__GO32__)
 > +#  include <pc.h>
 > +#endif
 > +
 >  #include "rltty.h"
 >  #include "tcap.h"
 >  
 > @@ -77,19 +81,24 @@ extern void _rl_bind_if_unbound ();
 >  extern void set_lines_and_columns ();
 >  extern char *get_env_value ();
 >  
 > +/* Functions imported from display.c */
 > +extern void _rl_redisplay_after_sigwinch ();
 > +
 >  /* **************************************************************** */
 >  /*								    */
 >  /*			Terminal and Termcap			    */
 >  /*								    */
 >  /* **************************************************************** */
 >  
 > +#ifndef __DJGPP__
 >  static char *term_buffer = (char *)NULL;
 >  static char *term_string_buffer = (char *)NULL;
 >  
 > -static int tcap_initialized;
 > -
 >  /* Non-zero means this terminal can't really do anything. */
 >  static int dumb_term;
 > +#endif
 > +
 > +static int tcap_initialized;
 >  
 >  #if !defined (__linux__)
 >  #  if defined (__EMX__) || defined (NEED_EXTERN_PC)
 > @@ -186,7 +195,11 @@ _rl_get_screen_size (tty, ignore_env)
 >        if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
 >  	screenwidth = atoi (ss);
 >  
 > -#if !defined(__DJGPP__)
 > +#if defined(__DJGPP__)
 > +      tty = tty;
 > +      if (screenwidth <= 0)
 > +	screenwidth = ScreenCols ();
 > +#else
 >        if (screenwidth <= 0 && term_string_buffer)
 >  	screenwidth = tgetnum ("co");
 >  #endif
 > @@ -199,7 +212,10 @@ _rl_get_screen_size (tty, ignore_env)
 >        if (ignore_env == 0 && (ss = get_env_value ("LINES")))
 >  	screenheight = atoi (ss);
 >  
 > -#if !defined(__DJGPP__)
 > +#if defined(__DJGPP__)
 > +      if (screenheight <= 0)
 > +	screenheight = ScreenRows ();
 > +#else
 >        if (screenheight <= 0 && term_string_buffer)
 >  	screenheight = tgetnum ("li");
 >  #endif
 > @@ -291,7 +307,9 @@ static void
 >  get_term_capabilities (bp)
 >       char **bp;
 >  {
 > -#if !defined(__DJGPP__)
 > +#if defined(__DJGPP__)
 > +  bp = bp;
 > +#else
 >    register int i;
 >  
 >    for (i = 0; i < NUM_TC_STRINGS; i++)
 > @@ -305,9 +323,10 @@ _rl_init_terminal_io (terminal_name)
 >       char *terminal_name;
 >  {
 >  #if defined (__GO32__)
 > -  screenwidth = ScreenCols ();
 > -  screenheight = ScreenRows ();
 > -  screenchars = screenwidth * screenheight;
 > +  terminal_name = terminal_name;
 > +  screenwidth = screenheight = 0;
 > +  _rl_get_screen_size (rl_instream ? fileno (rl_instream) : 0, 0);
 > +
 >    term_cr = "\r";
 >    term_im = term_ei = term_ic = term_IC = (char *)NULL;
 >    term_up = term_dc = term_DC = visible_bell = (char *)NULL;
 > @@ -323,7 +342,7 @@ _rl_init_terminal_io (terminal_name)
 >    term_forward_char = (char *)NULL;
 >  #endif /* HACK_TERMCAP_MOTION */
 >    terminal_can_insert = _rl_term_autowrap = 0;
 > -  return;
 > +  return 0;
 >  #else /* !__GO32__ */
 >  
 >    char *term, *buffer;
 > @@ -510,28 +529,28 @@ ding ()
 >  {
 >    if (readline_echoing_p)
 >      {
 > -#if !defined (__GO32__)
 >        switch (_rl_bell_preference)
 >          {
 >  	case NO_BELL:
 >  	default:
 >  	  break;
 >  	case VISIBLE_BELL:
 > +#if defined (__GO32__)
 > +	  ScreenVisualBell ();
 > +	  break;
 > +#else
 >  	  if (visible_bell)
 >  	    {
 >  	      tputs (visible_bell, 1, _rl_output_character_function);
 >  	      break;
 >  	    }
 > +#endif
 >  	  /* FALLTHROUGH */
 >  	case AUDIBLE_BELL:
 >  	  fprintf (stderr, "\007");
 >  	  fflush (stderr);
 >  	  break;
 >          }
 > -#else /* __GO32__ */
 > -      fprintf (stderr, "\007");
 > -      fflush (stderr);
 > -#endif /* __GO32__ */
 >        return (0);
 >      }
 >    return (-1);
 > @@ -556,7 +575,9 @@ void
 >  _rl_control_keypad (on)
 >       int on;
 >  {
 > -#if !defined(__DJGPP__)
 > +#if defined(__DJGPP__)
 > +  on = on;
 > +#else
 >    if (on && term_ks)
 >      tputs (term_ks, 1, _rl_output_character_function);
 >    else if (!on && term_ke)
From phdm@macqel.be Sat Apr 01 00:00:00 2000
From: "Philippe De Muyter" <phdm@macqel.be>
To: ac131313@cygnus.com (Andrew Cagney)
Cc: ezannoni@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: HAVE_POLL is not enough - RFA
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200003211559.QAA16996@mail.macqel.be>
References: <38D5BE1D.7BB02C99@cygnus.com>
X-SW-Source: 2000-q1/msg00858.html
Content-length: 18695

Andrew Cagney wrote :
> 	if (use_poll)
> 	  {
> #if HAVE_POLL
> 	    ...
> #else
> 	    internal_error (...);
> #endif
> 	  }
> 	else
> 	  {
> 	  }
I have done that.  OK to commit ?

Tue Mar 21 16:49:38 2000  Philippe De Muyter  <phdm@macqel.be>

	* event-loop.c (sys/types.h): File now included unconditionally.
	(use_poll): New variable, initialized to HAVE_POLL.
	(gdb_notifier): poll- and select-versions merged.
	(add_file_handler): If HAVE_POLL, check whether poll is usable,
	and reset `use_poll' if not.
	(create_file_handler): Select poll- or select-version according to
	`use_poll'.
	(delete_file_handler, handle_file_event): Likewise.
	(gdb_wait_for_event, poll_timers): Likewise.

Index: gdb/event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.4
diff -u -p -r1.4 event-loop.c
--- event-loop.c	2000/03/20 19:59:38	1.4
+++ event-loop.c	2000/03/21 15:39:29
@@ -25,10 +25,9 @@
 #include "event-top.h"
 #ifdef HAVE_POLL
 #include <poll.h>
-#else
+#endif
 #include <sys/types.h>
 #include <string.h>
-#endif
 #include <errno.h>
 #include <setjmp.h>
 #include <sys/time.h>
@@ -166,36 +165,21 @@ event_queue;
 /* As of 1999-04-30 only the input file descriptor is registered with the
    event loop. */
 
-#ifdef HAVE_POLL
-/* Poll based implementation of the notifier. */
+/* Do we use poll or select ? */
+static unsigned char use_poll = HAVE_POLL;
 
 static struct
   {
     /* Ptr to head of file handler list. */
     file_handler *first_file_handler;
 
+#ifdef HAVE_POLL
     /* Ptr to array of pollfd structures. */
     struct pollfd *poll_fds;
 
-    /* Number of file descriptors to monitor. */
-    int num_fds;
-
     /* Timeout in milliseconds for calls to poll(). */
-    int timeout;
-
-    /* Flag to tell whether the timeout value shuld be used. */
-    int timeout_valid;
-  }
-gdb_notifier;
-
-#else /* ! HAVE_POLL */
-
-/* Select based implementation of the notifier. */
-
-static struct
-  {
-    /* Ptr to head of file handler list. */
-    file_handler *first_file_handler;
+    int poll_timeout;
+#endif
 
     /* Masks to be used in the next call to select.
        Bits are set in response to calls to create_file_handler. */
@@ -204,19 +188,18 @@ static struct
     /* What file descriptors were found ready by select. */
     fd_set ready_masks[3];
 
-    /* Number of valid bits (highest fd value + 1). */
+    /* Number of file descriptors to monitor. (for poll) */
+    /* Number of valid bits (highest fd value + 1). (for select) */
     int num_fds;
 
     /* Time structure for calls to select(). */
-    struct timeval timeout;
+    struct timeval select_timeout;
 
-    /* Flag to tell whether the timeout struct should be used. */
+    /* Flag to tell whether the timeout should be used. */
     int timeout_valid;
   }
 gdb_notifier;
 
-#endif /* HAVE_POLL */
-
 /* Structure associated with a timer. PROC will be executed at the
    first occasion after WHEN. */
 struct gdb_timer
@@ -384,7 +367,7 @@ process_event (void)
 	}
       free ((char *) event_ptr);
 
-      /* Now call the procedure associted with the event. */
+      /* Now call the procedure associated with the event. */
       (*proc) (fd);
       return 1;
     }
@@ -473,10 +456,30 @@ void
 add_file_handler (int fd, handler_func * proc, gdb_client_data client_data)
 {
 #ifdef HAVE_POLL
-  create_file_handler (fd, POLLIN, proc, client_data);
+  struct pollfd fds;
+#endif
+
+  if (use_poll)
+    {
+#ifdef HAVE_POLL
+    fds.fd = fd;
+    fds.events = POLLIN;
+    if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL))
+      use_poll = 0;
 #else
-  create_file_handler (fd, GDB_READABLE | GDB_EXCEPTION, proc, client_data);
+    internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+    }
+  if (use_poll)
+    {
+#ifdef HAVE_POLL
+      create_file_handler (fd, POLLIN, proc, client_data);
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
 #endif
+    }
+  else
+    create_file_handler (fd, GDB_READABLE | GDB_EXCEPTION, proc, client_data);
 }
 
 /* Add a file handler/descriptor to the list of descriptors we are
@@ -512,48 +515,49 @@ create_file_handler (int fd, int mask, h
       file_ptr->ready_mask = 0;
       file_ptr->next_file = gdb_notifier.first_file_handler;
       gdb_notifier.first_file_handler = file_ptr;
-#ifdef HAVE_POLL
-      gdb_notifier.num_fds++;
-#endif
     }
   file_ptr->proc = proc;
   file_ptr->client_data = client_data;
   file_ptr->mask = mask;
 
+  if (use_poll)
+    {
 #ifdef HAVE_POLL
-
-  if (gdb_notifier.poll_fds)
-    gdb_notifier.poll_fds =
-      (struct pollfd *) realloc (gdb_notifier.poll_fds,
-			   (gdb_notifier.num_fds) * sizeof (struct pollfd));
-  else
-    gdb_notifier.poll_fds =
-      (struct pollfd *) xmalloc (sizeof (struct pollfd));
-  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
-  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
-  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
-
-#else /* ! HAVE_POLL */
-
-  if (mask & GDB_READABLE)
-    FD_SET (fd, &gdb_notifier.check_masks[0]);
-  else
-    FD_CLR (fd, &gdb_notifier.check_masks[0]);
-
-  if (mask & GDB_WRITABLE)
-    FD_SET (fd, &gdb_notifier.check_masks[1]);
+      gdb_notifier.num_fds++;
+      if (gdb_notifier.poll_fds)
+	gdb_notifier.poll_fds =
+	  (struct pollfd *) realloc (gdb_notifier.poll_fds,
+			       (gdb_notifier.num_fds) * sizeof (struct pollfd));
+      else
+	gdb_notifier.poll_fds =
+	  (struct pollfd *) xmalloc (sizeof (struct pollfd));
+      (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
+      (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
+      (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+    }
   else
-    FD_CLR (fd, &gdb_notifier.check_masks[1]);
+    {
+      if (mask & GDB_READABLE)
+	FD_SET (fd, &gdb_notifier.check_masks[0]);
+      else
+	FD_CLR (fd, &gdb_notifier.check_masks[0]);
 
-  if (mask & GDB_EXCEPTION)
-    FD_SET (fd, &gdb_notifier.check_masks[2]);
-  else
-    FD_CLR (fd, &gdb_notifier.check_masks[2]);
+      if (mask & GDB_WRITABLE)
+	FD_SET (fd, &gdb_notifier.check_masks[1]);
+      else
+	FD_CLR (fd, &gdb_notifier.check_masks[1]);
 
-  if (gdb_notifier.num_fds <= fd)
-    gdb_notifier.num_fds = fd + 1;
+      if (mask & GDB_EXCEPTION)
+	FD_SET (fd, &gdb_notifier.check_masks[2]);
+      else
+	FD_CLR (fd, &gdb_notifier.check_masks[2]);
 
-#endif /* HAVE_POLL */
+      if (gdb_notifier.num_fds <= fd)
+	gdb_notifier.num_fds = fd + 1;
+    }
 }
 
 /* Remove the file descriptor FD from the list of monitored fd's: 
@@ -580,51 +584,56 @@ delete_file_handler (int fd)
   if (file_ptr == NULL)
     return;
 
+  if (use_poll)
+    {
 #ifdef HAVE_POLL
-  /* Create a new poll_fds array by copying every fd's information but the
-     one we want to get rid of. */
+      /* Create a new poll_fds array by copying every fd's information but the
+	 one we want to get rid of. */
 
-  new_poll_fds =
-    (struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
+      new_poll_fds =
+	(struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
 
-  for (i = 0, j = 0; i < gdb_notifier.num_fds; i++)
-    {
-      if ((gdb_notifier.poll_fds + i)->fd != fd)
+      for (i = 0, j = 0; i < gdb_notifier.num_fds; i++)
 	{
-	  (new_poll_fds + j)->fd = (gdb_notifier.poll_fds + i)->fd;
-	  (new_poll_fds + j)->events = (gdb_notifier.poll_fds + i)->events;
-	  (new_poll_fds + j)->revents = (gdb_notifier.poll_fds + i)->revents;
-	  j++;
+	  if ((gdb_notifier.poll_fds + i)->fd != fd)
+	    {
+	      (new_poll_fds + j)->fd = (gdb_notifier.poll_fds + i)->fd;
+	      (new_poll_fds + j)->events = (gdb_notifier.poll_fds + i)->events;
+	      (new_poll_fds + j)->revents = (gdb_notifier.poll_fds + i)->revents;
+	      j++;
+	    }
 	}
+      free (gdb_notifier.poll_fds);
+      gdb_notifier.poll_fds = new_poll_fds;
+      gdb_notifier.num_fds--;
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
     }
-  free (gdb_notifier.poll_fds);
-  gdb_notifier.poll_fds = new_poll_fds;
-  gdb_notifier.num_fds--;
-
-#else /* ! HAVE_POLL */
-
-  if (file_ptr->mask & GDB_READABLE)
-    FD_CLR (fd, &gdb_notifier.check_masks[0]);
-  if (file_ptr->mask & GDB_WRITABLE)
-    FD_CLR (fd, &gdb_notifier.check_masks[1]);
-  if (file_ptr->mask & GDB_EXCEPTION)
-    FD_CLR (fd, &gdb_notifier.check_masks[2]);
+  else
+    {
+      if (file_ptr->mask & GDB_READABLE)
+	FD_CLR (fd, &gdb_notifier.check_masks[0]);
+      if (file_ptr->mask & GDB_WRITABLE)
+	FD_CLR (fd, &gdb_notifier.check_masks[1]);
+      if (file_ptr->mask & GDB_EXCEPTION)
+	FD_CLR (fd, &gdb_notifier.check_masks[2]);
 
-  /* Find current max fd. */
+      /* Find current max fd. */
 
-  if ((fd + 1) == gdb_notifier.num_fds)
-    {
-      gdb_notifier.num_fds--;
-      for (i = gdb_notifier.num_fds; i; i--)
+      if ((fd + 1) == gdb_notifier.num_fds)
 	{
-	  if (FD_ISSET (i - 1, &gdb_notifier.check_masks[0])
-	      || FD_ISSET (i - 1, &gdb_notifier.check_masks[1])
-	      || FD_ISSET (i - 1, &gdb_notifier.check_masks[2]))
-	    break;
+	  gdb_notifier.num_fds--;
+	  for (i = gdb_notifier.num_fds; i; i--)
+	    {
+	      if (FD_ISSET (i - 1, &gdb_notifier.check_masks[0])
+		  || FD_ISSET (i - 1, &gdb_notifier.check_masks[1])
+		  || FD_ISSET (i - 1, &gdb_notifier.check_masks[2]))
+		break;
+	    }
+	  gdb_notifier.num_fds = i;
 	}
-      gdb_notifier.num_fds = i;
     }
-#endif /* HAVE_POLL */
 
   /* Deactivate the file descriptor, by clearing its mask, 
      so that it will not fire again. */
@@ -676,36 +685,43 @@ handle_file_event (int event_file_desc)
 	  /* See if the desired events (mask) match the received
 	     events (ready_mask). */
 
-#ifdef HAVE_POLL
-	  error_mask = POLLHUP | POLLERR | POLLNVAL;
-	  mask = (file_ptr->ready_mask & file_ptr->mask) |
-	    (file_ptr->ready_mask & error_mask);
-	  error_mask_returned = mask & error_mask;
-
-	  if (error_mask_returned != 0)
+	  if (use_poll)
 	    {
-	      /* Work in progress. We may need to tell somebody what
-	         kind of error we had. */
-	      if (error_mask_returned & POLLHUP)
-		printf_unfiltered ("Hangup detected on fd %d\n", file_ptr->fd);
-	      if (error_mask_returned & POLLERR)
-		printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
-	      if (error_mask_returned & POLLNVAL)
-		printf_unfiltered ("Invalid or non-`poll'able fd %d\n", file_ptr->fd);
-	      file_ptr->error = 1;
+#ifdef HAVE_POLL
+	      error_mask = POLLHUP | POLLERR | POLLNVAL;
+	      mask = (file_ptr->ready_mask & file_ptr->mask) |
+		(file_ptr->ready_mask & error_mask);
+	      error_mask_returned = mask & error_mask;
+
+	      if (error_mask_returned != 0)
+		{
+		  /* Work in progress. We may need to tell somebody what
+		     kind of error we had. */
+		  if (error_mask_returned & POLLHUP)
+		    printf_unfiltered ("Hangup detected on fd %d\n", file_ptr->fd);
+		  if (error_mask_returned & POLLERR)
+		    printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
+		  if (error_mask_returned & POLLNVAL)
+		    printf_unfiltered ("Invalid or non-`poll'able fd %d\n", file_ptr->fd);
+		  file_ptr->error = 1;
+		}
+	      else
+		file_ptr->error = 0;
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
 	    }
 	  else
-	    file_ptr->error = 0;
-#else /* ! HAVE_POLL */
-	  if (file_ptr->ready_mask & GDB_EXCEPTION)
 	    {
-	      printf_unfiltered ("Exception condition detected on fd %d\n", file_ptr->fd);
-	      file_ptr->error = 1;
+	      if (file_ptr->ready_mask & GDB_EXCEPTION)
+		{
+		  printf_unfiltered ("Exception condition detected on fd %d\n", file_ptr->fd);
+		  file_ptr->error = 1;
+		}
+	      else
+		file_ptr->error = 0;
+	      mask = file_ptr->ready_mask & file_ptr->mask;
 	    }
-	  else
-	    file_ptr->error = 0;
-	  mask = file_ptr->ready_mask & file_ptr->mask;
-#endif /* HAVE_POLL */
 
 	  /* Clear the received events for next time around. */
 	  file_ptr->ready_mask = 0;
@@ -731,9 +747,7 @@ gdb_wait_for_event (void)
   file_handler *file_ptr;
   gdb_event *file_event_ptr;
   int num_found = 0;
-#ifdef HAVE_POLL
   int i;
-#endif
 
   /* Make sure all output is done before getting another event. */
   gdb_flush (gdb_stdout);
@@ -742,108 +756,114 @@ gdb_wait_for_event (void)
   if (gdb_notifier.num_fds == 0)
     return -1;
 
+  if (use_poll)
+    {
 #ifdef HAVE_POLL
-  num_found =
-    poll (gdb_notifier.poll_fds,
-	  (unsigned long) gdb_notifier.num_fds,
-	  gdb_notifier.timeout_valid ? gdb_notifier.timeout : -1);
-
-  /* Don't print anything if we get out of poll because of a
-     signal. */
-  if (num_found == -1 && errno != EINTR)
-    perror_with_name ("Poll");
-
-#else /* ! HAVE_POLL */
-
-  gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0];
-  gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1];
-  gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2];
-
-  num_found = select (gdb_notifier.num_fds,
-		      & gdb_notifier.ready_masks[0],
-		      & gdb_notifier.ready_masks[1],
-		      & gdb_notifier.ready_masks[2],
-		      gdb_notifier.timeout_valid
-		      ? &gdb_notifier.timeout : NULL);
-
-  /* Clear the masks after an error from select. */
-  if (num_found == -1)
-    {
-      FD_ZERO (&gdb_notifier.ready_masks[0]);
-      FD_ZERO (&gdb_notifier.ready_masks[1]);
-      FD_ZERO (&gdb_notifier.ready_masks[2]);
-      /* Dont print anything is we got a signal, let gdb handle it. */
-      if (errno != EINTR)
-	perror_with_name ("Select");
-    }
+      num_found =
+	poll (gdb_notifier.poll_fds,
+	      (unsigned long) gdb_notifier.num_fds,
+	      gdb_notifier.timeout_valid ? gdb_notifier.poll_timeout : -1);
+
+      /* Don't print anything if we get out of poll because of a
+	 signal. */
+      if (num_found == -1 && errno != EINTR)
+	perror_with_name ("Poll");
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
 #endif /* HAVE_POLL */
+    }
+  else
+    {
+      gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0];
+      gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1];
+      gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2];
+      num_found = select (gdb_notifier.num_fds,
+			  & gdb_notifier.ready_masks[0],
+			  & gdb_notifier.ready_masks[1],
+			  & gdb_notifier.ready_masks[2],
+			  gdb_notifier.timeout_valid
+			  ? &gdb_notifier.select_timeout : NULL);
 
+      /* Clear the masks after an error from select. */
+      if (num_found == -1)
+	{
+	  FD_ZERO (&gdb_notifier.ready_masks[0]);
+	  FD_ZERO (&gdb_notifier.ready_masks[1]);
+	  FD_ZERO (&gdb_notifier.ready_masks[2]);
+	  /* Dont print anything is we got a signal, let gdb handle it. */
+	  if (errno != EINTR)
+	    perror_with_name ("Select");
+	}
+    }
+
   /* Enqueue all detected file events. */
 
+  if (use_poll)
+    {
 #ifdef HAVE_POLL
+      for (i = 0; (i < gdb_notifier.num_fds) && (num_found > 0); i++)
+	{
+	  if ((gdb_notifier.poll_fds + i)->revents)
+	    num_found--;
+	  else
+	    continue;
 
-  for (i = 0; (i < gdb_notifier.num_fds) && (num_found > 0); i++)
-    {
-      if ((gdb_notifier.poll_fds + i)->revents)
-	num_found--;
-      else
-	continue;
+	  for (file_ptr = gdb_notifier.first_file_handler;
+	       file_ptr != NULL;
+	       file_ptr = file_ptr->next_file)
+	    {
+	      if (file_ptr->fd == (gdb_notifier.poll_fds + i)->fd)
+		break;
+	    }
+
+	  if (file_ptr)
+	    {
+	      /* Enqueue an event only if this is still a new event for
+		 this fd. */
+	      if (file_ptr->ready_mask == 0)
+		{
+		  file_event_ptr = create_file_event (file_ptr->fd);
+		  async_queue_event (file_event_ptr, TAIL);
+		}
+	    }
 
+	  file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents;
+	}
+#else
+      internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+    }
+  else
+    {
       for (file_ptr = gdb_notifier.first_file_handler;
-	   file_ptr != NULL;
+	   (file_ptr != NULL) && (num_found > 0);
 	   file_ptr = file_ptr->next_file)
 	{
-	  if (file_ptr->fd == (gdb_notifier.poll_fds + i)->fd)
-	    break;
-	}
+	  int mask = 0;
 
-      if (file_ptr)
-	{
+	  if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[0]))
+	    mask |= GDB_READABLE;
+	  if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[1]))
+	    mask |= GDB_WRITABLE;
+	  if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[2]))
+	    mask |= GDB_EXCEPTION;
+
+	  if (!mask)
+	    continue;
+	  else
+	    num_found--;
+
 	  /* Enqueue an event only if this is still a new event for
 	     this fd. */
+
 	  if (file_ptr->ready_mask == 0)
 	    {
 	      file_event_ptr = create_file_event (file_ptr->fd);
 	      async_queue_event (file_event_ptr, TAIL);
 	    }
+	  file_ptr->ready_mask = mask;
 	}
-
-      file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents;
     }
-
-#else /* ! HAVE_POLL */
-
-  for (file_ptr = gdb_notifier.first_file_handler;
-       (file_ptr != NULL) && (num_found > 0);
-       file_ptr = file_ptr->next_file)
-    {
-      int mask = 0;
-
-      if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[0]))
-	mask |= GDB_READABLE;
-      if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[1]))
-	mask |= GDB_WRITABLE;
-      if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[2]))
-	mask |= GDB_EXCEPTION;
-
-      if (!mask)
-	continue;
-      else
-	num_found--;
-
-      /* Enqueue an event only if this is still a new event for
-         this fd. */
-
-      if (file_ptr->ready_mask == 0)
-	{
-	  file_event_ptr = create_file_event (file_ptr->fd);
-	  async_queue_event (file_event_ptr, TAIL);
-	}
-      file_ptr->ready_mask = mask;
-    }
-
-#endif /* HAVE_POLL */
-
   return 0;
 }
 \f
@@ -1125,12 +1145,19 @@ poll_timers (void)
 
       /* Now we need to update the timeout for select/ poll, because we
          don't want to sit there while this timer is expiring. */
+      if (use_poll)
+	{
 #ifdef HAVE_POLL
-      gdb_notifier.timeout = delta.tv_sec * 1000;
+	  gdb_notifier.poll_timeout = delta.tv_sec * 1000;
 #else
-      gdb_notifier.timeout.tv_sec = delta.tv_sec;
-      gdb_notifier.timeout.tv_usec = delta.tv_usec;
-#endif
+	  internal_error ("event-loop.c : use_poll without HAVE_POLL");
+#endif /* HAVE_POLL */
+	}
+      else
+	{
+	  gdb_notifier.select_timeout.tv_sec = delta.tv_sec;
+	  gdb_notifier.select_timeout.tv_usec = delta.tv_usec;
+	}
       gdb_notifier.timeout_valid = 1;
     }
   else
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@delorie.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: DJGPP build and cleanup
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38BB7BDD.39EEFE54@cygnus.com>
References: <200002232229.RAA18809@indy.delorie.com>
X-SW-Source: 2000-q1/msg00421.html
Content-length: 851

Eli Zaretskii wrote:

> 2000-02-23  Eli Zaretskii  <eliz@is.elta.co.il>
> 
>         * config/i386/nm-go32.h (FLOAT_INFO): Remove macro definition.
>         (top level): Add prototypes for go32_* functions.
> 
>         * config/i386/tm-go32.h (I386_DJGPP_TARGET): Define.
>         (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC):
>         Override definitions from tm-i386.h.
>         (REGISTER_VIRTUAL_TYPE): Remove macro definition.
> 
>         * i386-tdep.c (i386_extract_return_value)
>         [I386_AIX_TARGET || I386_GNULINUX_TARGET]: Add I386_DJGPP_TARGET
>         to the list of targets which return FP values in FP registers.

FYI,

I've checked this in.  The only mod I made was to add a FIXME to
i386_extract_return_value() pointing out that the function should be
multi-arched.

Hope it matches what you had,

	Andrew
From fnasser@cygnus.com Sat Apr 01 00:00:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: RFA: set unwindonsignal (as promissed)
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38ADFA6A.A45CC83A@cygnus.com>
X-SW-Source: 2000-q1/msg00247.html
Content-length: 7513

This patch makes everybody happy.  Just set the flag as you like.

The default behavior is what gdb used to do before: stay in the frame
where the signal occurred.


2000-02-18  Fernando Nasser  <fnasser@cygnus.com>

        * top.c (init_main): Add command set unwindonsignal.
        * infcmd.c (run_stack_dummy): Do not pop frame on random signal.
        * valops.c (hand_function_call): Test for unwind_on_signal and
        act accordingly.


-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299



Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.2
diff -c -p -r1.2 top.c
*** top.c       2000/02/09 03:28:18     1.2
--- top.c       2000/02/19 01:57:16
*************** int linesize = 100;
*** 298,304 ****
--- 298,311 ----
     from the user, and have the user not notice that the user interface
     is issuing commands too.  */
  int server_command;
+  
+ /* This boolean tells what gdb should do if a signal is received while
in
+    a function called from gdb (call dummy).  If set, gdb unwinds the
stack
+    and restore the context to what as it was before the call.
+    The default is to stop in the frame where the signal was received.
*/
  
+ int unwind_on_signal_p = 0;
+ 
  /* Baud rate specified for talking to serial target systems.  Default
     is left as -1, so targets can choose their own defaults.  */
  /* FIXME: This means that "show remotebaud" and gr_files_info can
print -1
*************** The conditional expression must follow t
*** 4266,4271 ****
--- 4273,4288 ----
  followed by a new line.  The nested commands must be entered one per
line,\n\
  and should be terminated by the word 'else' or `end'.  If an else
clause\n\
  is used, the same rules apply to its nested commands as to the first
ones.");
+ 
+   add_show_from_set (
+   add_set_cmd ("unwindonsignal", no_class, var_boolean,
+              (char *) &unwind_on_signal_p,
+ "Set unwinding of stack if a signal is received while in a call
dummy.\n\
+ The unwindonsignal lets the user determine what gdb should do if a
signal\n\
+ is received while in a function called from gdb (call dummy).  If set,
gdb\n\
+ unwinds the stack and restore the context to what as it was before the
call.\n\
+ The default is to stop in the frame where the signal was received.",
&setlist),
+                    &showlist);
  
    /* If target is open when baud changes, it doesn't take effect until
the
       next open (I think, not sure).  */
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.1.1.11
diff -c -p -r1.1.1.11 valops.c
*** valops.c    2000/02/01 03:19:12     1.1.1.11
--- valops.c    2000/02/19 01:57:17
***************
*** 47,52 ****
--- 47,57 ----
     value operations with HP aCC code/runtime. */
  extern int hp_som_som_object_present;
  
+ /* This boolean tells what gdb should do if a signal is received while
in
+    a function called from gdb (call dummy).  If set, gdb unwinds the
stack
+    and restore the context to what as it was before the call.
+    The default is to stop in the frame where the signal was received.
*/
+ extern int unwind_on_signal_p;
  
  /* Local functions.  */
  
*************** You must use a pointer to function type 
*** 1695,1710 ****
        /* We stopped inside the FUNCTION because of a random signal.
           Further execution of the FUNCTION is not allowed. */
  
!       /* In this case, we must do the cleanups because we don't
!          want the dummy anymore (the dummy frame has been poped
already. */
!       do_cleanups (old_chain);
! 
!       /* FIXME: Insert a bunch of wrap_here; name can be very long if
it's
!          a C++ name with arguments and stuff.  */
!       error ("\
! The program being debugged stopped while in a function called from
GDB.\n\
  Evaluation of the expression containing the function (%s) will be
abandoned.",
!              name);
        }
  
      if (rc == 2)
--- 1700,1745 ----
        /* We stopped inside the FUNCTION because of a random signal.
           Further execution of the FUNCTION is not allowed. */
  
!         if (unwind_on_signal_p)
!         {
!           /* The user wants the context restored. */
! 
!             /* We must get back to the frame we were before the dummy
call. */
!             POP_FRAME;
! 
!           /* In this case, we must do the cleanups because we don't
!              want the dummy anymore */
!           do_cleanups (old_chain);
! 
!           /* FIXME: Insert a bunch of wrap_here; name can be very long
if it's
!              a C++ name with arguments and stuff.  */
!           error ("\
! The program being debugged was signaled while in a function called
from GDB.\n\
! GDB has restored the context to what it was before the call.\n\
! To change this behavior use \"set unwindonsignal off\"\n\
  Evaluation of the expression containing the function (%s) will be
abandoned.",
!                  name);
!         }
!       else
!         {
!           /* The user wants to stay in the frame where we stopped
(default).*/
! 
!           /* If we did the cleanups, we would print a spurious error
!              message (Unable to restore previously selected frame),
!              would write the registers from the inf_status (which is
!              wrong), and would do other wrong things.  */
!           discard_cleanups (old_chain);
!           discard_inferior_status (inf_status);
! 
!           /* FIXME: Insert a bunch of wrap_here; name can be very long
if it's
!              a C++ name with arguments and stuff.  */
!           error ("\
! The program being debugged was signaled while in a function called
from GDB.\n\
! GDB remains in the frame where the signal was received.\n\
! To change this behavior use \"set unwindonsignal on\"\n\
! Evaluation of the expression containing the function (%s) will be
abandoned.",
!                  name);
!         }
        }
  
      if (rc == 2)
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.1.1.17
diff -c -p -r1.1.1.17 infcmd.c
*** infcmd.c    2000/02/03 04:14:31     1.1.1.17
--- infcmd.c    2000/02/19 01:57:18
*************** run_stack_dummy (addr, buffer)
*** 926,945 ****
  
    discard_cleanups (old_cleanups);
  
    if (stopped_by_random_signal)
!     {
!       /* If the inferior execution fails we need to restore our
!          stack.  It is not done by proceed() in this case. */
!       /* Pop the empty frame that contains the stack dummy.
!          POP_FRAME ends with a setting of the current frame, so we
!          can use that next. */
!       POP_FRAME;
!       return 1;
!     }
      
    /* We may also stop prematurely because we hit a breakpoint in the
!      called routine.  We do not pop the frame as the user may wish
!      to single step or continue from there. */
    if (!stop_stack_dummy)
      return 2;
  
--- 926,937 ----
  
    discard_cleanups (old_cleanups);
  
+   /* We can stop during an inferior call because a signal is received.
*/
    if (stopped_by_random_signal)
!     return 1;
      
    /* We may also stop prematurely because we hit a breakpoint in the
!      called routine. */
    if (!stop_stack_dummy)
      return 2;
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: rearnsha@arm.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Recommend directory update
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <38B3C390.214B8988@cygnus.com>
References: <200002231000.KAA27985@cam-mail2.cambridge.arm.com>
X-SW-Source: 2000-q1/msg00332.html
Content-length: 630

Richard Earnshaw wrote:
> 
> > (I just don't recommend using cvs update -d.  You will get far more than
> > you ever planned)
> >
> > The sequence:
> >       test -d src/gdb && echo cvs -d `cat src/CVS/Root` co gdb
> > works pretty well.  Insight people should s/gdb/insight/.
> >
> > Several new directories (libiberty/testsuite, gdb/mi
> > gdb/testsuite/gdb.mi) have been created.
> >
> >       Andrew
> 
> Any chance that we can crib the contrib structure from gcc and have
> contrib/update_{gdb,binutils,...}?  This would then ensure that configure
> files didn't get mangled either.

Um, I'm not sure what you mean.

	Andrew
From ac131313@cygnus.com Sat Apr 01 00:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: What happened to: [RFC] Move/Rename include/wait.h ("wait.h")
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <389F6523.CBD40BE3@cygnus.com>
References: <200002072347.e17NlFI26317@delius.kettenis.local>
X-SW-Source: 2000-q1/msg00091.html
Content-length: 645

Mark Kettenis wrote:
> 
> Hi Andrew,
> 
> What happened to the proposal mentioned in the subject of this
> message?  The issue about confusing "wait.h" and <wait.h> is now
> biting me on Linux with glibc 2.1.3-to-be, where we have both <wait.h>
> and <sys/wait.h>.  Happened somehow when I moved over to using the new
> CVS repository :-(.

Its not forgotten.  It's sitting in an internal (to Red Hat) bug
tracking database (Please don't restart the bug tracking discussion) and
will be processed as part of this two week purge.

Part of the change involves deleting src/include/wait.h (part of
binutils) but that is now been approved.

	Andrew
From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: ac131313@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: What happened to: [RFC] Move/Rename include/wait.h ("wait.h")
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <200002072347.e17NlFI26317@delius.kettenis.local>
X-SW-Source: 2000-q1/msg00088.html
Content-length: 308

Hi Andrew,

What happened to the proposal mentioned in the subject of this
message?  The issue about confusing "wait.h" and <wait.h> is now
biting me on Linux with glibc 2.1.3-to-be, where we have both <wait.h>
and <sys/wait.h>.  Happened somehow when I moved over to using the new
CVS repository :-(.

Mark
From fnasser@cygnus.com Sat Apr 01 00:00:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Dave Vogel <dave@lightsurf.com>, Insight mail-list <insight@sourceware.cygnus.com>, gdb-patches@sourceware.cygnus.com, grante@visi.com, James Ingham <jingham@cygnus.com>
Subject: RDI debugging
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <3873A126.2171803D@cygnus.com>
References: <386A5B50.EFBCA961@lightsurf.com> <387295B5.CBBF5807@cygnus.com>
X-SW-Source: 2000-q1/msg00011.html
Content-length: 912

The following patches have been commited and will show up in the next
snapshot:

Thank you Dave, Grant and Thomas.


2000-01-05  Fernando Nasser  <fnasser@totem.to.cygnus.com>

	From Dave Vogel (dave@lightsurf.com):
	* targetselection.itb (init_target_db, config_dialog): Add support
	for selecting a target running the Angel monitor (RDI protocol)
	over an UDP connection.
	* interface.tcl (set_target_name): Set hostname when target is RDI
	over UDP (see previous entry).

2000-01-05  Fernando Nasser  <fnasser@totem.to.cygnus.com>

	From Grant Edwards <grante@visi.com> (original patch from Thomas
	Zenker ):
	* rdi-share/ardi.c: Allow interruption of interruptible
	targets with a <CNTL-C>.


-- 
Fernando Nasser
Cygnus Solutions - Toronto Office       E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299
From ezannoni@cygnus.com Sat Apr 01 00:00:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: nsd@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Patch: catch_errors() bug fixes and speedups
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <14514.63567.180178.977613@kwikemart.cygnus.com>
References: <200002112031.UAA02868@nog.bosbc.com> <200002222010.UAA05801@nog.bosbc.com>
X-SW-Source: 2000-q1/msg00307.html
Content-length: 9277

Looks great. Thanks Nick, for taking the time to fix this.
It can certainly go in, unless Andrew has some objections.

Elena

nsd@cygnus.com writes:
 > The appended patch is an improved version of the "catch_errors() cleanup
 > chain restore" patch I posted on 11-Feb.
 > 
 > It fixes these bugs:
 > 
 >   1. If a quit happened within catch_errors(RETURN_MASK_ERROR) or vice
 >      versa, the cleanup chain got lost.
 > 
 >   2. A catch_errors(RETURN_MASK_ERROR) within a
 >      catch_errors(RETURN_MASK_QUIT) or vice versa could have resulted in a
 >      garbled jump buffer.
 > 
 >   3. Some comments were out of date.
 > 
 > It also improves efficiency by avoiding a few memcpy()s.
 > 
 > Comments welcome,
 > 
 > Nick Duffek
 > nsd@cygnus.com
 > 
 > [patch follows]
 > 
 > Index: top.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/top.c,v
 > retrieving revision 1.2
 > diff -u -r1.2 top.c
 > --- top.c	2000/02/09 03:28:18	1.2
 > +++ top.c	2000/02/22 19:59:14
 > @@ -482,8 +482,8 @@
 >  PARAMS ((void)) ATTR_NORETURN;
 >  \f
 >  
 > -/* Generally one should use catch_errors rather than manipulating these
 > -   directly.  The exception is main().  */
 > +/* One should use catch_errors rather than manipulating these
 > +   directly.  */
 >  #if defined(HAVE_SIGSETJMP)
 >  #define SIGJMP_BUF		sigjmp_buf
 >  #define SIGSETJMP(buf)		sigsetjmp(buf, 1)
 > @@ -494,13 +494,10 @@
 >  #define SIGLONGJMP(buf,val)	longjmp(buf,val)
 >  #endif
 >  
 > -/* Where to go for return_to_top_level (RETURN_ERROR).  */
 > -static SIGJMP_BUF error_return;
 > -/* Where to go for return_to_top_level (RETURN_QUIT).  */
 > -static SIGJMP_BUF quit_return;
 > +/* Where to go for return_to_top_level.  */
 > +static SIGJMP_BUF *catch_return;
 >  
 > -/* Return for reason REASON.  This generally gets back to the command
 > -   loop, but can be caught via catch_errors.  */
 > +/* Return for reason REASON to the nearest containing catch_errors().  */
 >  
 >  NORETURN void
 >  return_to_top_level (reason)
 > @@ -531,8 +528,11 @@
 >  	break;
 >        }
 >  
 > -  (NORETURN void) SIGLONGJMP
 > -    (reason == RETURN_ERROR ? error_return : quit_return, 1);
 > +  /* Jump to the containing catch_errors() call, communicating REASON
 > +     to that call via setjmp's return value.  Note that REASON can't
 > +     be zero, by definition in defs.h. */
 > +
 > +  (NORETURN void) SIGLONGJMP (*catch_return, (int)reason);
 >  }
 >  
 >  /* Call FUNC with arg ARGS, catching any errors.  If there is no
 > @@ -562,13 +562,6 @@
 >     code also randomly used a SET_TOP_LEVEL macro that directly
 >     initialize the longjmp buffers. */
 >  
 > -/* MAYBE: cagney/1999-11-05: Since the SET_TOP_LEVEL macro has been
 > -   eliminated it is now possible to use the stack to directly store
 > -   each longjmp buffer.  The global code would just need to update a
 > -   pointer (onto the stack - ulgh!?) indicating the current longjmp
 > -   buffers. It would certainly improve the performance of the longjmp
 > -   code since the memcpy's would be eliminated. */
 > -
 >  /* MAYBE: cagney/1999-11-05: Should the catch_erros and cleanups code
 >     be consolidated into a single file instead of being distributed
 >     between utils.c and top.c? */
 > @@ -580,61 +573,89 @@
 >       char *errstring;
 >       return_mask mask;
 >  {
 > -  SIGJMP_BUF saved_error;
 > -  SIGJMP_BUF saved_quit;
 > -  SIGJMP_BUF tmp_jmp;
 > +  SIGJMP_BUF *saved_catch;
 > +  SIGJMP_BUF catch;
 >    int val;
 >    struct cleanup *saved_cleanup_chain;
 >    char *saved_error_pre_print;
 >    char *saved_quit_pre_print;
 >  
 > -  saved_cleanup_chain = save_cleanups ();
 > +  /* Return value from SIGSETJMP(): enum return_reason if error or
 > +     quit caught, 0 otherwise. */
 > +  int caught;
 > +
 > +  /* Override error/quit messages during FUNC. */
 > +
 >    saved_error_pre_print = error_pre_print;
 >    saved_quit_pre_print = quit_pre_print;
 >  
 >    if (mask & RETURN_MASK_ERROR)
 > -    {
 > -      memcpy ((char *) saved_error, (char *) error_return, sizeof (SIGJMP_BUF));
 > -      error_pre_print = errstring;
 > -    }
 > +    error_pre_print = errstring;
 >    if (mask & RETURN_MASK_QUIT)
 > -    {
 > -      memcpy (saved_quit, quit_return, sizeof (SIGJMP_BUF));
 > -      quit_pre_print = errstring;
 > -    }
 > -
 > -  if (SIGSETJMP (tmp_jmp) == 0)
 > -    {
 > -      if (mask & RETURN_MASK_ERROR)
 > -	memcpy (error_return, tmp_jmp, sizeof (SIGJMP_BUF));
 > -      if (mask & RETURN_MASK_QUIT)
 > -	memcpy (quit_return, tmp_jmp, sizeof (SIGJMP_BUF));
 > -      val = (*func) (args);
 > -      /* FIXME: cagney/1999-11-05: A correct FUNC implementaton will
 > -         clean things up (restoring the cleanup chain) to the state
 > -         they were just prior to the call.  Technically, this means
 > -         that the below restore_cleanups call is redundant.
 > -         Unfortunatly, many FUNC's are not that well behaved.
 > -         restore_cleanups should either be replaced with a do_cleanups
 > -         call (to cover the problem) or an assertion check to detect
 > -         bad FUNCs code. */
 > -    }
 > -  else
 > -    val = 0;
 > +    quit_pre_print = errstring;
 > +
 > +  /* Prevent error/quit during FUNC from calling cleanups established
 > +     prior to here. */
 >  
 > +  saved_cleanup_chain = save_cleanups ();
 > +
 > +  /* Call FUNC, catching error/quit events. */
 > +
 > +  saved_catch = catch_return;
 > +  catch_return = &catch;
 > +  caught = SIGSETJMP (catch);
 > +  if (!caught)
 > +    val = (*func) (args);
 > +  catch_return = saved_catch;
 > +
 > +  /* FIXME: cagney/1999-11-05: A correct FUNC implementaton will
 > +     clean things up (restoring the cleanup chain) to the state they
 > +     were just prior to the call.  Unfortunatly, many FUNC's are not
 > +     that well behaved.  This could be fixed by adding either a
 > +     do_cleanups call (to cover the problem) or an assertion check to
 > +     detect bad FUNCs code. */
 > +
 > +  /* Restore the cleanup chain and error/quit messages to their
 > +     original states. */
 > +
 >    restore_cleanups (saved_cleanup_chain);
 >  
 > -  if (mask & RETURN_MASK_ERROR)
 > -    {
 > -      memcpy (error_return, saved_error, sizeof (SIGJMP_BUF));
 > -      error_pre_print = saved_error_pre_print;
 > -    }
 >    if (mask & RETURN_MASK_QUIT)
 > -    {
 > -      memcpy (quit_return, saved_quit, sizeof (SIGJMP_BUF));
 > -      quit_pre_print = saved_quit_pre_print;
 > -    }
 > -  return val;
 > +    quit_pre_print = saved_quit_pre_print;
 > +  if (mask & RETURN_MASK_ERROR)
 > +    error_pre_print = saved_error_pre_print;
 > +
 > +  /* Return normally if no error/quit event occurred. */
 > +
 > +  if (!caught)
 > +    return val;
 > +
 > +  /* If the caller didn't request that the event be caught, relay the
 > +     event to the next containing catch_errors(). */
 > +
 > +  if (!(mask & RETURN_MASK (caught)))
 > +    return_to_top_level (caught);
 > +
 > +  /* Tell the caller that an event was caught.
 > +
 > +     FIXME: nsd/2000-02-22: When MASK is RETURN_MASK_ALL, the caller
 > +     can't tell what type of event occurred.
 > +
 > +     A possible fix is to add a new interface, catch_event(), that
 > +     returns enum return_reason after catching an error or a quit.
 > +
 > +     When returning normally, i.e. without catching an error or a
 > +     quit, catch_event() could return RETURN_NORMAL, which would be
 > +     added to enum return_reason.  FUNC would return information
 > +     exclusively via ARGS.
 > +
 > +     Alternatively, normal catch_event() could return FUNC's return
 > +     value.  The caller would need to be aware of potential overlap
 > +     with enum return_reason, which could be publicly restricted to
 > +     negative values to simplify return value processing in FUNC and
 > +     in the caller. */
 > +
 > +  return 0;
 >  }
 >  
 >  struct captured_command_args
 > Index: defs.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/defs.h,v
 > retrieving revision 1.2
 > diff -u -r1.2 defs.h
 > --- defs.h	2000/02/10 20:06:32	1.2
 > +++ defs.h	2000/02/22 19:59:14
 > @@ -801,21 +801,24 @@
 >  
 >  extern NORETURN void nomem (long) ATTR_NORETURN;
 >  
 > -/* Reasons for calling return_to_top_level.  */
 > +/* Reasons for calling return_to_top_level.  Note: enum value 0 is
 > +   reserved for internal use as the return value from an initial
 > +   setjmp().  */
 >  
 >  enum return_reason
 >    {
 >      /* User interrupt.  */
 > -    RETURN_QUIT,
 > +    RETURN_QUIT = 1,
 >      /* Any other error.  */
 >      RETURN_ERROR
 >    };
 >  
 >  #define	ALL_CLEANUPS	((struct cleanup *)0)
 >  
 > -#define RETURN_MASK_QUIT (1 << (int)RETURN_QUIT)
 > -#define RETURN_MASK_ERROR (1 << (int)RETURN_ERROR)
 > -#define RETURN_MASK_ALL (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
 > +#define RETURN_MASK(reason)	(1 << (int)(reason))
 > +#define RETURN_MASK_QUIT	RETURN_MASK (RETURN_QUIT)
 > +#define RETURN_MASK_ERROR	RETURN_MASK (RETURN_ERROR)
 > +#define RETURN_MASK_ALL		(RETURN_MASK_QUIT | RETURN_MASK_ERROR)
 >  typedef int return_mask;
 >  
 >  extern NORETURN void return_to_top_level (enum return_reason) ATTR_NORETURN;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: minor watchpoint code cleanup
       [not found]     ` <200003200958.EAA09356@indy.delorie.com>
@ 2000-04-01  0:00       ` Jim Blandy
       [not found]         ` <200003211817.NAA12429@indy.delorie.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kettenis, gdb-patches

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 <kingdon@redhat.com>
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: <bog96dqqq.fsf@rtl.cygnus.com>
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 <msnyder@cygnus.com>
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  <msnyder@cleaver.cygnus.com>

        * 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  <msnyder@cleaver.cygnus.com>
+ 
+ 	* 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  <kettenis@gnu.org>
  
  	* 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 <kingdon@redhat.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: Remaining GNU C isms.
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <b66vk60dr.fsf@rtl.cygnus.com>
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  <kingdon@redhat.com> 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 <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
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  <cagney@b1.cygnus.com>

	* 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 <dima@Chg.RU>
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(<QUOTE>foo<UNQUOTE>))}
 @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(<parameter list>)
-<return mode> EXCEPTIONS (<exception list>)}. The @code{<parameter
+<return mode> EXCEPTIONS (<exception list>)}.  The @code{<parameter
 list>} is a list of the parameter modes.  @code{<return mode>} 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{<exception list>}
+lists all possible exceptions which can be raised by the procedure.
 
 @ignore
 @item @r{@emph{Instance mode}}
@@ -6762,7 +6762,7 @@
 list>)}.  The @code{<field list>} consists of names and modes of fields
 of the structure.  Variant structures have the keyword @code{CASE <field>
 OF <variant fields> 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 <eliz@delorie.com>
To: Dmitry Sivachenko <dima@Chg.RU>
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" <phdm@macqel.be>
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 <guo@cup.hp.com>
To: gdb-patches@sourceware.cygnus.com
Subject: regression analysis: gdb.sum postprocessing script
Date: Sat, 01 Apr 2000 00:00:00 -0000
Message-id: <Pine.LNX.4.10.10003241103440.15236-100000@hpcll168.cup.hp.com>
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 [<options>] <string label> <gdb.sum> [<string label> <gdb.sum> ...]
+ #
+ #    <options>:
+ #        [-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 <string>] list only the run pass(es) specified in the
+ #                            space delimited run pass list (string).
+ #
+ #        - the default is to list all
+ #
+ #    <string label>       identifier for the run corresponding to <gdb.sum>
+ #    <gdb.sum>            pathname of gdb.sum file
+ #
+ #    - if one <string label> <gdb.sum> pair specified, produce filtered test
+ #      result to stdout
+ #    - if multiple <string label> <gdb.sum> 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 <sum_seq>
+   # value is space-delimited string of pass names
+   @passes = ();
+ 
+   # array of all tests seen
+   # indexed by '<sum_seq>'
+   # value is space-delimited list of test pathnames
+   #
+   @tests = ();
+ 
+   # hash of test point entries and outcome
+   # keyed by '<sum_seq> <pass> <test>'
+   # value is '<pcode> <entry_name>'
+   #
+   %entries = ();
+ 
+   # hash of unclassifiable errors
+   # keyed by '<sum_seq> <pass> <test>'
+   # value is multiline output
+   #
+   %others = ();
+ 
+   # hash of test point entries and outcome for all passes
+   # keyed by '<test>'
+   # value is '(<pcode> )+<entry_name>'
+   #
+   %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 '<sum_seq>'
+   # value is count
+   #
+   @p_cnts = ();
+ 
+   # array of counts of all FAIL for a gdb.sum file
+   # indexed by '<sum_seq>'
+   # value is count
+   #
+   @f_cnts = ();
+ 
+   # array of counts of all XPASS for a gdb.sum file
+   # indexed by '<sum_seq>'
+   # value is count
+   #
+   @xpa_cnts = ();
+ 
+   # array of counts of all XFAIL for a gdb.sum file
+   # indexed by '<sum_seq>'
+   # value is count
+   #
+   @xfa_cnts = ();
+ 
+   # array of counts of all UNRESOLVED tests for a gdb.sum file
+   # indexed by '<sum_seq>'
+   # value is count
+   #
+   @unr_cnts = ();
+ 
+   # array of counts of all skipped (unsupported) tests for a gdb.sum file
+   # indexed by '<sum_seq>'
+   # 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 <string> argument pair")
+ 	if ($#ARGV == -1);
+       $runpass = shift @ARGV;
+       $runpass = ' '.$runpass.' ';
+     } else {
+       &usage("(error): need <string label> <gdb.sum> 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 <string label> <gdb.sum> 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 (<SUMFILE>) {
+     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 (<SUMFILE>) {
+     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 "<TEST NOT RUN>\n";
+ 	    }
+ 	  } elsif ($others{"$sum_seq $pass $test"} eq '') {
+ 	    if ($do_diff) {
+ 	      print " <$sum_seq>:";
+ 	      print &listPcodes($pass);
+ 	      print "<NO UNKNOWN OUTPUT>\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 '|<pass_id>|: <multi-line output>';
+   }
+ 
+   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 [<options>] <string label> <gdb.sum> [<string label> <gdb.sum> ...]
+ 
+    <options>:
+        [-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 <string>] list only the run pass(es) specified in the
+                            space delimited run pass list (string).
+ 
+        - the default is to list all
+ 
+    <string label>       identifier for the run corresponding to <gdb.sum>
+    <gdb.sum>            pathname of gdb.sum file
+ 
+    - if one <string label> <gdb.sum> pair specified, produce filtered test
+      result to stdout
+    - if multiple <string label> <gdb.sum> pairs specified, produce a
+      difference of filtered test result to stdout
+ 
+ ";
+ 
+   exit 1;
+ }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200003180006.TAA26919@zwingli.cygnus.com>
2000-03-19  1:45 ` RFA: minor watchpoint code cleanup Eli Zaretskii
     [not found]   ` <200003192255.e2JMtcs00643@delius.kettenis.local>
     [not found]     ` <200003200958.EAA09356@indy.delorie.com>
2000-04-01  0:00       ` Jim Blandy
     [not found]         ` <200003211817.NAA12429@indy.delorie.com>
2000-03-21 15:33           ` Jim Blandy
2000-04-01  0:00             ` Mark Kettenis
2000-03-21 15:57               ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox