]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't check parent pid in gdb.threads/{ia64-sigill,siginfo-threads,watchthreads-reord...
authorPedro Alves <pedro@palves.net>
Thu, 3 Jun 2021 18:39:18 +0000 (19:39 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 14 Jun 2021 20:31:28 +0000 (21:31 +0100)
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
gdb/testsuite/gdb.threads/siginfo-threads.c
gdb/testsuite/gdb.threads/watchthreads-reorder.c

index ef224f49f08a7239bbfe5f1f86918432fb0b86d3..f3d7014dbbf021b657bc97a1062984af3aa8ab7b 100644 (file)
@@ -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
index adaa7583e78b968aeb0c7115102b41985059c08b..762f53ad6849c5872b983b26a7ad388000875642 100644 (file)
@@ -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
index ff8ca9afe7c4bda7e76ac43837d1a10129067069..789dc7ac7410c27229bbc4f02d423819afcaa2b1 100644 (file)
@@ -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