[v2,05/16] Don't check parent pid in gdb.threads/{ia64-sigill, siginfo-threads, watchthreads-reorder}.c

Message ID 20210614212410.1612666-6-pedro@palves.net
State New
Headers show
Series
  • Interrupting programs that block/ignore SIGINT
Related show

Commit Message

Pedro Alves June 14, 2021, 9:23 p.m.
A following patch will make GDB always put spawned inferiors in their
own terminal session.  To do that, GDB forks twice, creating an extra
"session leader" process between gdb and the inferior process.

gdb.threads/{ia64-sigill,siginfo-threads,watchthreads-reorder}.c all
check whether the parent process is GDB.  If it isn't, they just bail,
and the testcase fails.  After the changes mentioned above, this
parent check will fail if GDB is putting inferiors in their own
terminal session, because in that case, the test's parent is the extra
"session leader" process between gdb and the test process.  The tracer
will be the test process's grandparent, not the direct parent.

Since the test programs already check whether there's a ptracer
attached, there's no real need for this parent pid check.  Just remove
it.

gdb/testsuite/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* gdb.threads/ia64-sigill.c (main): Don't check whether the parent
	pid is the tracer.
	* gdb.threads/siginfo-threads.c (main): Don't check whether the
	parent pid is the tracer.
	* gdb.threads/watchthreads-reorder.c (main): Don't check whether
	the parent pid is the tracer.

Change-Id: Iea0b06fb93c31bde1a0993c52b3fe8a5f408aec7
---
 gdb/testsuite/gdb.threads/ia64-sigill.c          | 5 -----
 gdb/testsuite/gdb.threads/siginfo-threads.c      | 5 -----
 gdb/testsuite/gdb.threads/watchthreads-reorder.c | 5 -----
 3 files changed, 15 deletions(-)

-- 
2.26.2

Patch

diff --git a/gdb/testsuite/gdb.threads/ia64-sigill.c b/gdb/testsuite/gdb.threads/ia64-sigill.c
index ef224f49f08..f3d7014dbbf 100644
--- a/gdb/testsuite/gdb.threads/ia64-sigill.c
+++ b/gdb/testsuite/gdb.threads/ia64-sigill.c
@@ -292,11 +292,6 @@  main (int argc, char **argv)
 	  fprintf (stderr, "The testcase must be run by GDB!\n");
 	  exit (EXIT_FAILURE);
 	}
-      if (tracer != getppid ())
-	{
-	  fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
-	  exit (EXIT_FAILURE);
-	}
     }
 
   /* SIGCONT our debugger in the case of our crash as we would deadlock
diff --git a/gdb/testsuite/gdb.threads/siginfo-threads.c b/gdb/testsuite/gdb.threads/siginfo-threads.c
index adaa7583e78..762f53ad684 100644
--- a/gdb/testsuite/gdb.threads/siginfo-threads.c
+++ b/gdb/testsuite/gdb.threads/siginfo-threads.c
@@ -376,11 +376,6 @@  main (int argc, char **argv)
 	  fprintf (stderr, "The testcase must be run by GDB!\n");
 	  exit (EXIT_FAILURE);
 	}
-      if (tracer != getppid ())
-	{
-	  fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
-	  exit (EXIT_FAILURE);
-	}
     }
 
   /* SIGCONT our debugger in the case of our crash as we would deadlock
diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.c b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
index ff8ca9afe7c..789dc7ac741 100644
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
@@ -301,11 +301,6 @@  main (int argc, char **argv)
 	  fprintf (stderr, "The testcase must be run by GDB!\n");
 	  exit (EXIT_FAILURE);
 	}
-      if (tracer != getppid ())
-	{
-	  fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
-	  exit (EXIT_FAILURE);
-	}
     }
 
   /* SIGCONT our debugger in the case of our crash as we would deadlock