From: Pedro Alves Date: Thu, 3 Jun 2021 18:39:18 +0000 (+0100) Subject: Don't check parent pid in gdb.threads/{ia64-sigill,siginfo-threads,watchthreads-reord... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=deb9814ee1975503bb2216d464521fb80b949d18;p=thirdparty%2Fbinutils-gdb.git Don't check parent pid in gdb.threads/{ia64-sigill,siginfo-threads,watchthreads-reorder}.c 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 * 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 --- 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