public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove some stale testsuite bits
@ 2020-07-02 18:31 Pedro Alves
  2020-07-02 18:31 ` [PATCH 1/2] Remove stale overlay testcase bits Pedro Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pedro Alves @ 2020-07-02 18:31 UTC (permalink / raw)
  To: gdb-patches

From: Pedro Alves <palves@redhat.com>

I noticed some stale bits in the testsuite while reviewing a patch.

Pedro Alves (2):
  Remove stale overlay testcase bits
  Remove stale -DNO_PROTOTYPES bits from gdb testsuite

 gdb/testsuite/gdb.base/call-sc.exp  |  15 +--
 gdb/testsuite/gdb.base/d10vovly.c   | 225 ------------------------------------
 gdb/testsuite/gdb.base/m32rovly.c   | 225 ------------------------------------
 gdb/testsuite/gdb.base/overlays.c   |   8 +-
 gdb/testsuite/gdb.base/ovlymgr.c    | 133 ---------------------
 gdb/testsuite/gdb.base/ovlymgr.h    |  11 +-
 gdb/testsuite/gdb.base/reread.exp   |   2 -
 gdb/testsuite/gdb.base/structs.exp  |  15 +--
 gdb/testsuite/gdb.base/structs2.exp |  26 +----
 gdb/testsuite/gdb.base/varargs.exp  |   2 -
 10 files changed, 12 insertions(+), 650 deletions(-)
 delete mode 100644 gdb/testsuite/gdb.base/d10vovly.c
 delete mode 100644 gdb/testsuite/gdb.base/m32rovly.c


base-commit: c2ecccb33c307faa21f4d2f47348e7346b032d94
-- 
2.14.5


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

* [PATCH 1/2] Remove stale overlay testcase bits
  2020-07-02 18:31 [PATCH 0/2] Remove some stale testsuite bits Pedro Alves
@ 2020-07-02 18:31 ` Pedro Alves
  2020-07-02 18:31 ` [PATCH 2/2] Remove stale -DNO_PROTOTYPES bits from gdb testsuite Pedro Alves
  2020-07-03  0:18 ` [PATCH 0/2] Remove some stale testsuite bits Simon Marchi
  2 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2020-07-02 18:31 UTC (permalink / raw)
  To: gdb-patches

From: Pedro Alves <palves@redhat.com>

D10V support was removed years ago, but the gdb.base/d10vovly.c file
stayed behind.  Looking a bit closer, I can't find anywhere that
references gdb.base/m32rovly.c either.

Both gdb.base/m32rovly.c and gdb.base/d10vovly.c seem to be older
copies of gdb.base/ovlymgr.c, that are exactly the same, except for
some cosmetic differences, and for missing _ovly_debug_event.  Note
that gdb.base/ovlymgr.c has the #ifdef __M32R__ bits too.  Note also
that gdb.base/overlays.exp is currently only supported on m32r, and
that uses ovlymgr.c not gdb.base/m32rovly.c.

gdb/testsuite/ChangeLog:

	* gdb.base/d10vovly.c: Delete.
	* gdb.base/m32rovly.c: Delete.
	* gdb.base/ovlymgr.c: Remove all code guarded by __D10V__.
---
 gdb/testsuite/gdb.base/d10vovly.c | 225 --------------------------------------
 gdb/testsuite/gdb.base/m32rovly.c | 225 --------------------------------------
 gdb/testsuite/gdb.base/ovlymgr.c  | 133 ----------------------
 3 files changed, 583 deletions(-)
 delete mode 100644 gdb/testsuite/gdb.base/d10vovly.c
 delete mode 100644 gdb/testsuite/gdb.base/m32rovly.c

diff --git a/gdb/testsuite/gdb.base/d10vovly.c b/gdb/testsuite/gdb.base/d10vovly.c
deleted file mode 100644
index bdb90feae6b..00000000000
--- a/gdb/testsuite/gdb.base/d10vovly.c
+++ /dev/null
@@ -1,225 +0,0 @@
-
-/*
- * Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
- */
-
-#include "ovlymgr.h"
-
-/* Local functions and data: */
-
-extern unsigned long _ovly_table[][4];
-extern unsigned long _novlys __attribute__ ((section (".data")));
-enum ovly_index { VMA, SIZE, LMA, MAPPED};
-
-static void ovly_copy (unsigned long dst, unsigned long src, long size);
-
-/* Flush the data and instruction caches at address START for SIZE bytes.
-   Support for each new port must be added here.  */
-/* FIXME: Might be better to have a standard libgloss function that
-   ports provide that we can then use.  Use libgloss instead of newlib
-   since libgloss is the one intended to handle low level system issues.
-   I would suggest something like _flush_cache to avoid the user's namespace
-   but not be completely obscure as other things may need this facility.  */
- 
-static void
-FlushCache (void)
-{
-#ifdef __M32R__
-  volatile char *mspr = (char *) 0xfffffff7;
-  *mspr = 1;
-#endif
-}
-
-/* OverlayLoad:
- * Copy the overlay into its runtime region,
- * and mark the overlay as "mapped".
- */
-
-bool
-OverlayLoad (unsigned long ovlyno)
-{
-  unsigned long i;
-
-  if (ovlyno < 0 || ovlyno >= _novlys)
-    exit (-1);	/* fail, bad ovly number */
-
-  if (_ovly_table[ovlyno][MAPPED])
-    return TRUE;	/* this overlay already mapped -- nothing to do! */
-
-  for (i = 0; i < _novlys; i++)
-    if (i == ovlyno)
-      _ovly_table[i][MAPPED] = 1;	/* this one now mapped */
-    else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
-      _ovly_table[i][MAPPED] = 0;	/* this one now un-mapped */
-
-  ovly_copy (_ovly_table[ovlyno][VMA], 
-	     _ovly_table[ovlyno][LMA], 
-	     _ovly_table[ovlyno][SIZE]);
-
-  FlushCache ();
-
-  return TRUE;
-}
-
-/* OverlayUnload:
- * Copy the overlay back into its "load" region.
- * Does NOT mark overlay as "unmapped", therefore may be called
- * more than once for the same mapped overlay.
- */
- 
-bool
-OverlayUnload (unsigned long ovlyno)
-{
-  if (ovlyno < 0 || ovlyno >= _novlys)
-    exit (-1);  /* fail, bad ovly number */
- 
-  if (!_ovly_table[ovlyno][MAPPED])
-    exit (-1);  /* error, can't copy out a segment that's not "in" */
- 
-  ovly_copy (_ovly_table[ovlyno][LMA], 
-	     _ovly_table[ovlyno][VMA],
-	     _ovly_table[ovlyno][SIZE]);
-
-  return TRUE;
-}
-
-#ifdef __D10V__
-#define IMAP0       (*(short *)(0xff00))
-#define IMAP1       (*(short *)(0xff02))
-#define DMAP        (*(short *)(0xff04))
-
-static void
-D10VTranslate (unsigned long logical,
-	       short *dmap,
-	       unsigned long **addr)
-{
-  unsigned long physical;
-  unsigned long seg;
-  unsigned long off;
-
-  /* to access data, we use the following mapping 
-     0x00xxxxxx: Logical data address segment        (DMAP translated memory)
-     0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
-     0x10xxxxxx: Physical data memory segment        (On-chip data memory)
-     0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
-     0x12xxxxxx: Phisical unified memory segment     (Unified memory)
-     */
-
-  /* Addresses must be correctly aligned */
-  if (logical & (sizeof (**addr) - 1))
-    exit (-1);
-
-  /* If the address is in one of the two logical address spaces, it is
-     first translated into a physical address */
-  seg = (logical >> 24);
-  off = (logical & 0xffffffL);
-  switch (seg) 
-      {
-      case 0x00: /* in logical data address segment */
-	if (off <= 0x7fffL)
-	  physical = (0x10L << 24) + off;
-	else
-	  /* Logical address out side of on-chip segment, not
-             supported */
-	  exit (-1);
-	break;
-      case 0x01: /* in logical instruction address segment */
-	{
-	  short map;
-	  if (off <= 0x1ffffL)
-	    map = IMAP0;
-	  else if (off <= 0x3ffffL)
-	    map = IMAP1;
-	  else
-	    /* Logical address outside of IMAP[01] segment, not
-	       supported */
-	    exit (-1);
-	  if (map & 0x1000L)
-	    {
-	    /* Instruction memory */
-	      physical = (0x11L << 24) | off;
-	    }
-	  else
-	    {
-	    /* Unified memory */
-	      physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
-	      if (physical > 0xffffffL)
-		/* Address outside of unified address segment */
-		exit (-1);
-	      physical |= (0x12L << 24);
-	    }
-	  break;
-	}
-      case 0x10:
-      case 0x11:
-      case 0x12:
-	physical = logical;
-	break;
-      default:
-	exit (-1);	/* error */
-      }
-
-  seg = (physical >> 24);
-  off = (physical & 0xffffffL);
-  switch (seg) 
-    {
-    case 0x10:	/* dst is a 15 bit offset into the on-chip memory */
-      *dmap = 0;
-      *addr = (long *) (0x0000 + ((short)off & 0x7fff));
-      break;
-    case 0x11:	/* dst is an 18-bit offset into the on-chip
-		   instruction memory */
-      *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    case 0x12:	/* dst is a 24-bit offset into unified memory */
-      *dmap = off >> 14;
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    default:
-      exit (-1);	/* error */
-    }
-}
-#endif /* __D10V__ */
-
-static void
-ovly_copy (unsigned long dst, unsigned long src, long size)
-{
-#ifdef  __M32R__
-  memcpy ((void *) dst, (void *) src, size);
-  return;
-#endif /* M32R */
-
-#ifdef  __D10V__
-  unsigned long *s, *d, tmp;
-  short dmap_src, dmap_dst;
-  short dmap_save;
-
-  /* all section sizes should by multiples of 4 bytes */
-  dmap_save = DMAP;
-
-  D10VTranslate (src, &dmap_src, &s);
-  D10VTranslate (dst, &dmap_dst, &d);
-
-  while (size > 0)
-    {
-      /* NB: Transfer 4 byte (long) quantites, problems occure
-	 when only two bytes are transfered */
-      DMAP = dmap_src;
-      tmp = *s;
-      DMAP = dmap_dst;
-      *d = tmp; 
-      d++;
-      s++;
-      size -= sizeof (tmp);
-      src += sizeof (tmp);
-      dst += sizeof (tmp);
-      if ((src & 0x3fff) == 0)
-	D10VTranslate (src, &dmap_src, &s);
-      if ((dst & 0x3fff) == 0)
-	D10VTranslate (dst, &dmap_dst, &d);
-    }
-  DMAP = dmap_save;
-#endif /* D10V */
-}
-
diff --git a/gdb/testsuite/gdb.base/m32rovly.c b/gdb/testsuite/gdb.base/m32rovly.c
deleted file mode 100644
index bdb90feae6b..00000000000
--- a/gdb/testsuite/gdb.base/m32rovly.c
+++ /dev/null
@@ -1,225 +0,0 @@
-
-/*
- * Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
- */
-
-#include "ovlymgr.h"
-
-/* Local functions and data: */
-
-extern unsigned long _ovly_table[][4];
-extern unsigned long _novlys __attribute__ ((section (".data")));
-enum ovly_index { VMA, SIZE, LMA, MAPPED};
-
-static void ovly_copy (unsigned long dst, unsigned long src, long size);
-
-/* Flush the data and instruction caches at address START for SIZE bytes.
-   Support for each new port must be added here.  */
-/* FIXME: Might be better to have a standard libgloss function that
-   ports provide that we can then use.  Use libgloss instead of newlib
-   since libgloss is the one intended to handle low level system issues.
-   I would suggest something like _flush_cache to avoid the user's namespace
-   but not be completely obscure as other things may need this facility.  */
- 
-static void
-FlushCache (void)
-{
-#ifdef __M32R__
-  volatile char *mspr = (char *) 0xfffffff7;
-  *mspr = 1;
-#endif
-}
-
-/* OverlayLoad:
- * Copy the overlay into its runtime region,
- * and mark the overlay as "mapped".
- */
-
-bool
-OverlayLoad (unsigned long ovlyno)
-{
-  unsigned long i;
-
-  if (ovlyno < 0 || ovlyno >= _novlys)
-    exit (-1);	/* fail, bad ovly number */
-
-  if (_ovly_table[ovlyno][MAPPED])
-    return TRUE;	/* this overlay already mapped -- nothing to do! */
-
-  for (i = 0; i < _novlys; i++)
-    if (i == ovlyno)
-      _ovly_table[i][MAPPED] = 1;	/* this one now mapped */
-    else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
-      _ovly_table[i][MAPPED] = 0;	/* this one now un-mapped */
-
-  ovly_copy (_ovly_table[ovlyno][VMA], 
-	     _ovly_table[ovlyno][LMA], 
-	     _ovly_table[ovlyno][SIZE]);
-
-  FlushCache ();
-
-  return TRUE;
-}
-
-/* OverlayUnload:
- * Copy the overlay back into its "load" region.
- * Does NOT mark overlay as "unmapped", therefore may be called
- * more than once for the same mapped overlay.
- */
- 
-bool
-OverlayUnload (unsigned long ovlyno)
-{
-  if (ovlyno < 0 || ovlyno >= _novlys)
-    exit (-1);  /* fail, bad ovly number */
- 
-  if (!_ovly_table[ovlyno][MAPPED])
-    exit (-1);  /* error, can't copy out a segment that's not "in" */
- 
-  ovly_copy (_ovly_table[ovlyno][LMA], 
-	     _ovly_table[ovlyno][VMA],
-	     _ovly_table[ovlyno][SIZE]);
-
-  return TRUE;
-}
-
-#ifdef __D10V__
-#define IMAP0       (*(short *)(0xff00))
-#define IMAP1       (*(short *)(0xff02))
-#define DMAP        (*(short *)(0xff04))
-
-static void
-D10VTranslate (unsigned long logical,
-	       short *dmap,
-	       unsigned long **addr)
-{
-  unsigned long physical;
-  unsigned long seg;
-  unsigned long off;
-
-  /* to access data, we use the following mapping 
-     0x00xxxxxx: Logical data address segment        (DMAP translated memory)
-     0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
-     0x10xxxxxx: Physical data memory segment        (On-chip data memory)
-     0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
-     0x12xxxxxx: Phisical unified memory segment     (Unified memory)
-     */
-
-  /* Addresses must be correctly aligned */
-  if (logical & (sizeof (**addr) - 1))
-    exit (-1);
-
-  /* If the address is in one of the two logical address spaces, it is
-     first translated into a physical address */
-  seg = (logical >> 24);
-  off = (logical & 0xffffffL);
-  switch (seg) 
-      {
-      case 0x00: /* in logical data address segment */
-	if (off <= 0x7fffL)
-	  physical = (0x10L << 24) + off;
-	else
-	  /* Logical address out side of on-chip segment, not
-             supported */
-	  exit (-1);
-	break;
-      case 0x01: /* in logical instruction address segment */
-	{
-	  short map;
-	  if (off <= 0x1ffffL)
-	    map = IMAP0;
-	  else if (off <= 0x3ffffL)
-	    map = IMAP1;
-	  else
-	    /* Logical address outside of IMAP[01] segment, not
-	       supported */
-	    exit (-1);
-	  if (map & 0x1000L)
-	    {
-	    /* Instruction memory */
-	      physical = (0x11L << 24) | off;
-	    }
-	  else
-	    {
-	    /* Unified memory */
-	      physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
-	      if (physical > 0xffffffL)
-		/* Address outside of unified address segment */
-		exit (-1);
-	      physical |= (0x12L << 24);
-	    }
-	  break;
-	}
-      case 0x10:
-      case 0x11:
-      case 0x12:
-	physical = logical;
-	break;
-      default:
-	exit (-1);	/* error */
-      }
-
-  seg = (physical >> 24);
-  off = (physical & 0xffffffL);
-  switch (seg) 
-    {
-    case 0x10:	/* dst is a 15 bit offset into the on-chip memory */
-      *dmap = 0;
-      *addr = (long *) (0x0000 + ((short)off & 0x7fff));
-      break;
-    case 0x11:	/* dst is an 18-bit offset into the on-chip
-		   instruction memory */
-      *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    case 0x12:	/* dst is a 24-bit offset into unified memory */
-      *dmap = off >> 14;
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    default:
-      exit (-1);	/* error */
-    }
-}
-#endif /* __D10V__ */
-
-static void
-ovly_copy (unsigned long dst, unsigned long src, long size)
-{
-#ifdef  __M32R__
-  memcpy ((void *) dst, (void *) src, size);
-  return;
-#endif /* M32R */
-
-#ifdef  __D10V__
-  unsigned long *s, *d, tmp;
-  short dmap_src, dmap_dst;
-  short dmap_save;
-
-  /* all section sizes should by multiples of 4 bytes */
-  dmap_save = DMAP;
-
-  D10VTranslate (src, &dmap_src, &s);
-  D10VTranslate (dst, &dmap_dst, &d);
-
-  while (size > 0)
-    {
-      /* NB: Transfer 4 byte (long) quantites, problems occure
-	 when only two bytes are transfered */
-      DMAP = dmap_src;
-      tmp = *s;
-      DMAP = dmap_dst;
-      *d = tmp; 
-      d++;
-      s++;
-      size -= sizeof (tmp);
-      src += sizeof (tmp);
-      dst += sizeof (tmp);
-      if ((src & 0x3fff) == 0)
-	D10VTranslate (src, &dmap_src, &s);
-      if ((dst & 0x3fff) == 0)
-	D10VTranslate (dst, &dmap_dst, &d);
-    }
-  DMAP = dmap_save;
-#endif /* D10V */
-}
-
diff --git a/gdb/testsuite/gdb.base/ovlymgr.c b/gdb/testsuite/gdb.base/ovlymgr.c
index f4958ed14a3..5d087ad90a2 100644
--- a/gdb/testsuite/gdb.base/ovlymgr.c
+++ b/gdb/testsuite/gdb.base/ovlymgr.c
@@ -93,141 +93,8 @@ OverlayUnload (unsigned long ovlyno)
   return TRUE;
 }
 
-#ifdef __D10V__
-#define IMAP0       (*(short *)(0xff00))
-#define IMAP1       (*(short *)(0xff02))
-#define DMAP        (*(short *)(0xff04))
-
-static void
-D10VTranslate (unsigned long logical,
-	       short *dmap,
-	       unsigned long **addr)
-{
-  unsigned long physical;
-  unsigned long seg;
-  unsigned long off;
-
-  /* to access data, we use the following mapping 
-     0x00xxxxxx: Logical data address segment        (DMAP translated memory)
-     0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
-     0x10xxxxxx: Physical data memory segment        (On-chip data memory)
-     0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
-     0x12xxxxxx: Phisical unified memory segment     (Unified memory)
-     */
-
-  /* Addresses must be correctly aligned */
-  if (logical & (sizeof (**addr) - 1))
-    exit (-1);
-
-  /* If the address is in one of the two logical address spaces, it is
-     first translated into a physical address */
-  seg = (logical >> 24);
-  off = (logical & 0xffffffL);
-  switch (seg) 
-      {
-      case 0x00: /* in logical data address segment */
-	if (off <= 0x7fffL)
-	  physical = (0x10L << 24) + off;
-	else
-	  /* Logical address out side of on-chip segment, not
-             supported */
-	  exit (-1);
-	break;
-      case 0x01: /* in logical instruction address segment */
-	{
-	  short map;
-	  if (off <= 0x1ffffL)
-	    map = IMAP0;
-	  else if (off <= 0x3ffffL)
-	    map = IMAP1;
-	  else
-	    /* Logical address outside of IMAP[01] segment, not
-	       supported */
-	    exit (-1);
-	  if (map & 0x1000L)
-	    {
-	    /* Instruction memory */
-	      physical = (0x11L << 24) | off;
-	    }
-	  else
-	    {
-	    /* Unified memory */
-	      physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
-	      if (physical > 0xffffffL)
-		/* Address outside of unified address segment */
-		exit (-1);
-	      physical |= (0x12L << 24);
-	    }
-	  break;
-	}
-      case 0x10:
-      case 0x11:
-      case 0x12:
-	physical = logical;
-	break;
-      default:
-	exit (-1);	/* error */
-      }
-
-  seg = (physical >> 24);
-  off = (physical & 0xffffffL);
-  switch (seg) 
-    {
-    case 0x10:	/* dst is a 15 bit offset into the on-chip memory */
-      *dmap = 0;
-      *addr = (long *) (0x0000 + ((short)off & 0x7fff));
-      break;
-    case 0x11:	/* dst is an 18-bit offset into the on-chip
-		   instruction memory */
-      *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    case 0x12:	/* dst is a 24-bit offset into unified memory */
-      *dmap = off >> 14;
-      *addr = (long *) (0x8000 + ((short)off & 0x3fff));
-      break;
-    default:
-      exit (-1);	/* error */
-    }
-}
-#endif /* __D10V__ */
-
 static void
 ovly_copy (unsigned long dst, unsigned long src, long size)
 {
-#ifdef  __D10V__
-  unsigned long *s, *d, tmp;
-  short dmap_src, dmap_dst;
-  short dmap_save;
-
-  /* all section sizes should by multiples of 4 bytes */
-  dmap_save = DMAP;
-
-  D10VTranslate (src, &dmap_src, &s);
-  D10VTranslate (dst, &dmap_dst, &d);
-
-  while (size > 0)
-    {
-      /* NB: Transfer 4 byte (long) quantites, problems occure
-	 when only two bytes are transfered */
-      DMAP = dmap_src;
-      tmp = *s;
-      DMAP = dmap_dst;
-      *d = tmp; 
-      d++;
-      s++;
-      size -= sizeof (tmp);
-      src += sizeof (tmp);
-      dst += sizeof (tmp);
-      if ((src & 0x3fff) == 0)
-	D10VTranslate (src, &dmap_src, &s);
-      if ((dst & 0x3fff) == 0)
-	D10VTranslate (dst, &dmap_dst, &d);
-    }
-  DMAP = dmap_save;
-#else
   memcpy ((void *) dst, (void *) src, size);
-#endif /* D10V */
-  return;
 }
-
-- 
2.14.5


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

* [PATCH 2/2] Remove stale -DNO_PROTOTYPES bits from gdb testsuite
  2020-07-02 18:31 [PATCH 0/2] Remove some stale testsuite bits Pedro Alves
  2020-07-02 18:31 ` [PATCH 1/2] Remove stale overlay testcase bits Pedro Alves
@ 2020-07-02 18:31 ` Pedro Alves
  2020-07-03  0:18 ` [PATCH 0/2] Remove some stale testsuite bits Simon Marchi
  2 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2020-07-02 18:31 UTC (permalink / raw)
  To: gdb-patches

From: Pedro Alves <palves@redhat.com>

The gdb.base/call-sc.exp, gdb.base/structs.exp and
gdb.base/structs2.exp testcases still try compiling the sources with
-DNO_PROTOTYPES, but the corresponding sources don't have any #ifdef
NO_PROTOTYPES any longer.  Those were removed throughout years ago.

OTOH, gdb.base/ovlymgr.h does check for NO_PROTOTYPES, but no .exp
file compiles it with -DNO_PROTOTYPES.

gdb.base/reread.exp and gdb.base/varargs.exp set a 'prototypes'
global, which is a stale bit left behind when the "try-compiling
without and then with -DNO_PROTOTYPES" logic was around.

gdb/testsuite/ChangeLog:

	* gdb.base/call-sc.exp (start_scalars_test): Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	* gdb.base/overlays.c: Remove references to PARAMS.
	* gdb.base/ovlymgr.h (PARAMS): Delete, and remove all references.
	* gdb.base/reread.exp: Don't set 'prototypes' global.
	* gdb.base/structs.exp (start_structs_test): Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	* gdb.base/structs2.exp: Don't set 'prototypes' global.  Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	Don't issue "set width 0".  Remove gdb_stop_suppressing_tests
	call.
	* gdb.base/varargs.exp: Don't set 'prototypes' global.
---
 gdb/testsuite/gdb.base/call-sc.exp  | 15 ++-------------
 gdb/testsuite/gdb.base/overlays.c   |  8 ++++----
 gdb/testsuite/gdb.base/ovlymgr.h    | 11 ++---------
 gdb/testsuite/gdb.base/reread.exp   |  2 --
 gdb/testsuite/gdb.base/structs.exp  | 15 ++-------------
 gdb/testsuite/gdb.base/structs2.exp | 26 ++------------------------
 gdb/testsuite/gdb.base/varargs.exp  |  2 --
 7 files changed, 12 insertions(+), 67 deletions(-)

diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index 719000435a7..9544dcc4049 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -55,21 +55,10 @@ proc start_scalars_test { type } {
     set testfile "call-sc-${type}"
 
     set binfile [standard_output_file ${testfile}]
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
-	# built the second test case since we can't use prototypes
-	warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-	if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
-	    untested "failed to compile"
-	    return -1
-	}
+    if { [prepare_for_testing "failed to prepare" $binfile $srcfile $flags] } {
+	return -1
     }
 
-    # Start with a fresh gdb.
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
     # Make certain that the output is consistent
     with_test_prefix "testfile=$testfile" {
 	gdb_test_no_output "set print sevenbit-strings"
diff --git a/gdb/testsuite/gdb.base/overlays.c b/gdb/testsuite/gdb.base/overlays.c
index d02ed707cd1..e9dc9a0b586 100644
--- a/gdb/testsuite/gdb.base/overlays.c
+++ b/gdb/testsuite/gdb.base/overlays.c
@@ -3,10 +3,10 @@
 
 #include "ovlymgr.h"
 
-extern int foo PARAMS((int));
-extern int bar PARAMS((int));
-extern int baz PARAMS((int));
-extern int grbx PARAMS((int));
+extern int foo (int);
+extern int bar (int);
+extern int baz (int);
+extern int grbx (int);
 
 int main ()
 {
diff --git a/gdb/testsuite/gdb.base/ovlymgr.h b/gdb/testsuite/gdb.base/ovlymgr.h
index bd0d40a2640..16335056724 100644
--- a/gdb/testsuite/gdb.base/ovlymgr.h
+++ b/gdb/testsuite/gdb.base/ovlymgr.h
@@ -2,16 +2,9 @@
  * Sample runtime overlay manager.
  */
 
-#ifdef NO_PROTOTYPES
-#define PARAMS(paramlist) ()
-#else
-#define PARAMS(paramlist) paramlist
-#endif
-
 typedef enum { FALSE, TRUE } bool;
 
 /* Entry Points: */
 
-bool OverlayLoad   PARAMS((unsigned long ovlyno));
-bool OverlayUnload PARAMS((unsigned long ovlyno));
-
+bool OverlayLoad (unsigned long ovlyno);
+bool OverlayUnload (unsigned long ovlyno);
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
index e38a5f200d5..f824156cc39 100644
--- a/gdb/testsuite/gdb.base/reread.exp
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -13,8 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set prototypes 1
-
 # Build programs in PIE mode, to reproduce PR 21555.
 foreach_with_prefix opts {
     { "" "" }
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 8eaa36512f2..db258f9c7c7 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -66,21 +66,10 @@ proc start_structs_test { types } {
     }
 
     set binfile [standard_output_file ${testfile}]
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
-	# built the second test case since we can't use prototypes
-	warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-	if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
-	    untested "failed to compile"
-	    return -1
-	}
+    if { [prepare_for_testing "failed to prepare" $binfile $srcfile $flags] } {
+	return -1
     }
 
-    # Start with a fresh gdb.
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
     # Make certain that the output is consistent
     with_test_prefix "types=$types" {
 	gdb_test_no_output "set print sevenbit-strings"
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index 84920c446ad..8a7d9c69378 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -13,7 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set prototypes 1
 standard_testfile .c
 
 # Create and source the file that provides information about the compiler
@@ -22,30 +21,15 @@ if [get_compiler_info] {
     return -1
 }
 
-# build the first test case
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    # built the second test case since we can't use prototypes
-    warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
-	untested "failed to compile"
-	return -1
-    }
-    set prototypes 0
+if { [prepare_for_testing "failed to prepare" $binfile $srcfile {debug}] } {
+    return -1
 }
 
-# Start with a fresh gdb.
-
-clean_restart ${binfile}
-
-gdb_test_no_output "set width 0"
-
 if ![runto_main] then {
     fail "can't run to main"
     return 0
 }
 
-# Ok, we're finally ready to actually do our tests.
-
 gdb_test "f" \
     ".*bkpt = 0.*" \
     "structs2 sanity check"
@@ -67,9 +51,3 @@ if [test_compiler_info gcc-3-*] {
 gdb_test "continue" \
     ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
     "structs2 continue2"
-
-# End of tests.
-
-gdb_stop_suppressing_tests
-
-return 0
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index f6f4f659653..40dcd087a6f 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -29,8 +29,6 @@
 
 
 
-set prototypes 0
-
 standard_testfile .c
 
 if [get_compiler_info] {
-- 
2.14.5


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

* Re: [PATCH 0/2] Remove some stale testsuite bits
  2020-07-02 18:31 [PATCH 0/2] Remove some stale testsuite bits Pedro Alves
  2020-07-02 18:31 ` [PATCH 1/2] Remove stale overlay testcase bits Pedro Alves
  2020-07-02 18:31 ` [PATCH 2/2] Remove stale -DNO_PROTOTYPES bits from gdb testsuite Pedro Alves
@ 2020-07-03  0:18 ` Simon Marchi
  2020-07-03 13:59   ` Pedro Alves
  2 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2020-07-03  0:18 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 2020-07-02 2:31 p.m., Pedro Alves wrote:
> From: Pedro Alves <palves@redhat.com>
> 
> I noticed some stale bits in the testsuite while reviewing a patch.

Nice cleanup, that LGTM.

Simon

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

* Re: [PATCH 0/2] Remove some stale testsuite bits
  2020-07-03  0:18 ` [PATCH 0/2] Remove some stale testsuite bits Simon Marchi
@ 2020-07-03 13:59   ` Pedro Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2020-07-03 13:59 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 7/3/20 1:18 AM, Simon Marchi wrote:
> On 2020-07-02 2:31 p.m., Pedro Alves wrote:
>> From: Pedro Alves <palves@redhat.com>
>>
>> I noticed some stale bits in the testsuite while reviewing a patch.
> 
> Nice cleanup, that LGTM.

Thanks, I merged it.

Pedro Alves



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

end of thread, other threads:[~2020-07-03 13:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 18:31 [PATCH 0/2] Remove some stale testsuite bits Pedro Alves
2020-07-02 18:31 ` [PATCH 1/2] Remove stale overlay testcase bits Pedro Alves
2020-07-02 18:31 ` [PATCH 2/2] Remove stale -DNO_PROTOTYPES bits from gdb testsuite Pedro Alves
2020-07-03  0:18 ` [PATCH 0/2] Remove some stale testsuite bits Simon Marchi
2020-07-03 13:59   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).