From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6IV+GFnJx2AYUQAAWB0awg (envelope-from ) for ; Mon, 14 Jun 2021 17:25:45 -0400 Received: by simark.ca (Postfix, from userid 112) id 61DBF1F163; Mon, 14 Jun 2021 17:25:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9A39F1E54D for ; Mon, 14 Jun 2021 17:25:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67DAF3973035 for ; Mon, 14 Jun 2021 21:25:44 +0000 (GMT) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id D0A8B397282B for ; Mon, 14 Jun 2021 21:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0A8B397282B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id f16-20020a05600c1550b02901b00c1be4abso323486wmg.2 for ; Mon, 14 Jun 2021 14:24:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mqIEd/81pIEdVIaj3+wg71Ni9s76j1w3Yh4QJ31blT0=; b=E3lppKaQfNd6Cd6qqZf+6nKsydrJBhLNtLr/aVbXHId9dukaPoa+qQTcF6Q1pbnOJi l9CdlnJxLqwjq5SK8uyZ2lLdW8snoZbVEiFDO9mhDh9uSuP4kG+sT+Rai5wNShBw73U2 LOfwzjoGgIGSQQB5PspFMuZZu8FohqwI9hYU8XYdzupyPEuZ3zXPWU5HGeofKak5feMQ jfqFR46VHsixFuPmzg2HodQodi7/7RGqSUcio89VW0QBr23LLkH1YcxYQ0chQuzpUrtw TWoYess5OYGiv6wgYh5JxExwRKZSxeoh0YmCzyB3mRYo5wKENNK6BCIk1cBWW5yF9Kfu Hotg== X-Gm-Message-State: AOAM531bAQQGdxfi74frmgXvIJ5CNDZQpS40EDcfynd2dutus7PtSnBq tN25vD5VJ6EH9uNvypzoHpbc+dpkNntKYg== X-Google-Smtp-Source: ABdhPJxBxiZzQx4Iu9xKhX228ct4BD7xpJT0cc7p4024ZOV2gtRGmvR05yWE3tq5zJDIEkXCKY99VQ== X-Received: by 2002:a1c:6782:: with SMTP id b124mr1145943wmc.159.1623705862431; Mon, 14 Jun 2021 14:24:22 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id 61sm356492wrp.4.2021.06.14.14.24.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 14:24:21 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 05/16] Don't check parent pid in gdb.threads/{ia64-sigill, siginfo-threads, watchthreads-reorder}.c Date: Mon, 14 Jun 2021 22:23:59 +0100 Message-Id: <20210614212410.1612666-6-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210614212410.1612666-1-pedro@palves.net> References: <20210614212410.1612666-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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 --- 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(-) 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 -- 2.26.2