This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Preparing for a GDB 4.17 release


> If you have patches for GDB (e.g. for Fortran support, for some
> OS, whatever) that are in use and well-tested, and you have a GDB
> assignment/disclaimer on file at the FSF (ask me if you're not
> sure), send it in to gdb-patches@cygnus.com.  It would be helpful
> if you could update the patch to the current GDB snapshot, look in
> ftp://ftp.cygnus.com/private/gdb/

I think I fullfill all the conditions.  Here are sysV68-specific
patches for gdb.

Sun Jul  6 02:44:28 1997  Philippe De Muyter  <phdm@macqel.be>

	* m68k/tm-delta68.h (CPLUS_MARKER): Macro deleted.
	(EXTRACT_STRUCT_VALUE_ADDRESS): Macro defined.
	(EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): Macros modified
	because floating-point values return via %fp0.
	(CLEAR_INSN_CACHE): New macro.
	* m68k/tm-m68k.h (REGISTER_CONVERT_TO_VIRTUAL): Macro fixed
	to use DOUBLEST.
	(REGISTER_CONVERT_TO_RAW): Ditto.
	* infptrace.c (child_xfer_memory): If CLEAR_INSN_CACHE is defined,
	call it after having written in child process's memory.

On sysV68, including more than once fcntl.h (as it happens when compiling
all mmalloc/*.c as one file) does not work. fcntl.h does not seem to be needed
my mmalloc/detach.c; I have thus removed it there.

Mon Jul  7 13:06:45 1997  Philippe De Muyter  <phdm@macqel.be>

	* mmalloc/detach.c: Do not include fcntl.h.

Here is a gdb fix for OS's with termio.h, but no termios.h.

Sun Jul  6 02:44:28 1997  Philippe De Muyter  <phdm@macqel.be>

	* inflow.c (PROCESS_GROUP_TYPE): Macro defined if HAVE_TERMIO.
	(gdb_has_a_terminal, terminal_ours_1): Functions fixed for HAVE_TERMIO.

And then, some texinfo patches, but needed as texinfo is included in gdb.
On sysV68, including more than once fcntl.h (as it happens when compiling
texinfo/util/texindex.c) does not work.

Thu Jan 29 19:32:47 1998  Philippe De Muyter  <phdm@macqel.be>

	* texinfo/info/terminal.c (terminal_begin_using_terminal): Mask
	SIGWINCH only #ifdef SIGWINCH.
	(terminal_end_using_terminal): Ditto.
	* texinfo/util/texindex.c: Do not include twice fcntl.h.  It is
	already included via system.h.

--- ./gdb/config/m68k/tm-delta68.h	Thu Jan 29 19:16:30 1998
+++ ./gdb/config/m68k/tm-delta68.h	Thu Jan 29 19:16:15 1998
@@ -1,5 +1,5 @@
 /* Target definitions for delta68.
-   Copyright 1993, 1994 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -22,9 +22,6 @@
 
 #define BPT_VECTOR 0x1
 
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '%'
-
 #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%"
 #define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%"
 
@@ -42,23 +39,51 @@
    a function return value of type TYPE, and copy that, in virtual format,
    into VALBUF.  */
 
+/* When it returns a float/double value, use fp0 in sysV68.  */
 /* When it returns a pointer value, use a0 in sysV68.  */
 
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
-  memcpy ((VALBUF),							\
-	  (char *) ((REGBUF) +						\
-		    (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 :		\
-		     (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \
-	  TYPE_LENGTH(TYPE))
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF)			\
+  if (TYPE_CODE (TYPE) == TYPE_CODE_FLT)				\
+    REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM,				\
+				 REGISTER_VIRTUAL_TYPE (FP0_REGNUM),	\
+				 &REGBUF[REGISTER_BYTE (FP0_REGNUM)],	\
+				 VALBUF);				\
+  else									\
+    memcpy ((VALBUF),							\
+	    (char *) ((REGBUF) +					\
+		      (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 :	\
+		       (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \
+	    TYPE_LENGTH(TYPE))
 
 /* Write into appropriate registers a function return value
    of type TYPE, given in virtual format.  */
 
+/* When it returns a float/double value, use fp0 in sysV68.  */
 /* When it returns a pointer value, use a0 in sysV68.  */
 
 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
-  write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0),	\
-			VALBUF, TYPE_LENGTH (TYPE))
-
+  if (TYPE_CODE (TYPE) == TYPE_CODE_FLT)				\
+      {									\
+	char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)];			\
+	REGISTER_CONVERT_TO_RAW (REGISTER_VIRTUAL_TYPE (FP0_REGNUM),	\
+				 FP0_REGNUM, VALBUF, raw_buf);		\
+	write_register_bytes (FP0_REGNUM,				\
+			      raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
+      }									\
+  else									\
+    write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
+			  VALBUF, TYPE_LENGTH (TYPE))
+
+/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
+   the processor's instruction cache as it should.  */
+#define CLEAR_INSN_CACHE()	clear_insn_cache()
 
 #include "m68k/tm-m68k.h"
+
+/* Extract from an array REGBUF containing the (raw) register state
+   the address in which a function should return its structure value,
+   as a CORE_ADDR (or an expression that can be used as one).  */
+
+#undef EXTRACT_STRUCT_VALUE_ADDRESS
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
+	(*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4))
--- ./gdb/config/m68k/tm-m68k.h	Thu Jan 29 19:16:31 1998
+++ ./gdb/config/m68k/tm-m68k.h	Thu Jan 29 17:54:04 1998
@@ -161,20 +161,23 @@
    to virtual format with type TYPE in buffer TO.  */
 
 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
-{ \
-  double dbl_tmp_val; \
-  floatformat_to_double (&floatformat_m68881_ext, (FROM), &dbl_tmp_val); \
-  store_floating ((TO), TYPE_LENGTH (TYPE), dbl_tmp_val); \
-}
+do									\
+  {									\
+    DOUBLEST dbl_tmp_val;							\
+    floatformat_to_doublest (&floatformat_m68881_ext, (FROM), &dbl_tmp_val); \
+    store_floating ((TO), TYPE_LENGTH (TYPE), dbl_tmp_val);		\
+  } while (0)
 
 /* Convert data from virtual format with type TYPE in buffer FROM
    to raw format for register REGNUM in buffer TO.  */
 
 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)	\
-{ \
-  double dbl_tmp_val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
-  floatformat_from_double (&floatformat_m68881_ext, &dbl_tmp_val, (TO)); \
-}
+do									\
+  {									\
+    DOUBLEST dbl_tmp_val;						\
+    dbl_tmp_val = extract_floating ((FROM), TYPE_LENGTH (TYPE));	\
+    floatformat_from_doublest (&floatformat_m68881_ext, &dbl_tmp_val, (TO)); \
+  } while (0)
 
 /* Return the GDB type object for the "standard" data type of data 
    in register N.  This should be int for D0-D7, double for FP0-FP7,
--- ./gdb/infptrace.c	Thu Jan 29 19:16:32 1998
+++ ./gdb/infptrace.c	Thu Jan 29 02:39:34 1998
@@ -466,6 +466,9 @@ child_xfer_memory (memaddr, myaddr, len,
 	  if (errno)
 	    return 0;
 	}
+#ifdef CLEAR_INSN_CACHE
+      CLEAR_INSN_CACHE();
+#endif
     }
   else
     {
--- ./texinfo/info/terminal.c	Thu Jan 29 19:16:32 1998
+++ ./texinfo/info/terminal.c	Tue Jan 27 18:59:04 1998
@@ -141,7 +141,9 @@ terminal_begin_using_terminal ()
   if (!term_begin_use || !*term_begin_use)
     return;
 
+#ifdef SIGWINCH
   sigsave = signal (SIGWINCH, SIG_IGN); 
+#endif
   send_to_terminal (term_begin_use);
   /* Without this fflush and sleep, running info in a shelltool or
      cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
@@ -149,7 +151,9 @@ terminal_begin_using_terminal ()
      From: strube@physik3.gwdg.de (Hans Werner Strube).  */
   fflush (stdout);
   sleep (1);
+#ifdef SIGWINCH
   signal (SIGWINCH, sigsave);
+#endif
 }
 
 /* Tell the terminal that we will not be doing any more cursor
@@ -165,11 +169,15 @@ terminal_end_using_terminal ()
   if (!term_end_use || !*term_end_use)
     return;
 
+#ifdef SIGWINCH
   sigsave = signal (SIGWINCH, SIG_IGN);
+#endif
   send_to_terminal (term_end_use);
   fflush (stdout);
   sleep (1);
+#ifdef SIGWINCH
   signal (SIGWINCH, sigsave);
+#endif
 }
 
 /* **************************************************************** */
--- ./texinfo/util/texindex.c	Thu Jan 29 19:16:33 1998
+++ ./texinfo/util/texindex.c	Tue Jan 27 18:57:38 1998
@@ -43,6 +43,8 @@
 #  define TI_FATAL_ERROR ((1 << 28) | 4)
 #  define unlink delete
 #else /* !VMS */
+
+#if 0 /* phdm@macqel.be : already included unconditionnaly by system.h */
 #  if defined (HAVE_SYS_FCNTL_H)
 #    include <sys/types.h>
 #    include <sys/fcntl.h>
@@ -55,6 +57,8 @@
 #      include <fcntl.h>
 #    endif /* !HAVE_FCNTL_H */
 #  endif /* !_AIX && _POSIX_VERSION */
+#endif /* 0 */
+
 #  define TI_NO_ERROR 0
 #  define TI_FATAL_ERROR 1
 #endif /* !VMS */
--- ./gdb/inflow.c	Thu Jan 29 19:16:31 1998
+++ ./gdb/inflow.c	Wed Jan 28 14:42:49 1998
@@ -1,5 +1,5 @@
 /* Low level interface to ptrace, for GDB when running under Unix.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1995 Free Software Foundation, Inc.
+   Copyright 1986-87, 1989, 1991-92, 1995, 1998 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -38,6 +38,10 @@
 #define PROCESS_GROUP_TYPE pid_t
 #endif
 
+#ifdef HAVE_TERMIO
+#define PROCESS_GROUP_TYPE int
+#endif
+
 #ifdef HAVE_SGTTY
 #ifdef SHORT_PGRP
 /* This is only used for the ultra.  Does it have pid_t?  */
@@ -138,6 +142,9 @@ gdb_has_a_terminal ()
 #ifdef HAVE_TERMIOS
 	      our_process_group = tcgetpgrp (0);
 #endif
+#ifdef HAVE_TERMIO
+	      our_process_group = getpgrp ();
+#endif
 #ifdef HAVE_SGTTY
 	      ioctl (0, TIOCGPGRP, &our_process_group);
 #endif
@@ -323,6 +330,9 @@ terminal_ours_1 (output_only)
       inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
 #ifdef HAVE_TERMIOS
       inferior_process_group = tcgetpgrp (0);
+#endif
+#ifdef HAVE_TERMIO
+      inferior_process_group = getpgrp ();
 #endif
 #ifdef HAVE_SGTTY
       ioctl (0, TIOCGPGRP, &inferior_process_group);
--- ./mmalloc/detach.c	Thu Jan 29 19:16:33 1998
+++ ./mmalloc/detach.c	Wed Jan 28 00:22:52 1998
@@ -21,7 +21,6 @@
 Boston, MA 02111-1307, USA.  */
 
 #include <sys/types.h>
-#include <fcntl.h> /* After sys/types.h, at least for dpx/2.  */
 #include "mmprivate.h"
 
 /* Terminate access to a mmalloc managed region by unmapping all memory pages