From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OAiNFAAouWBoIwAAWB0awg (envelope-from ) for ; Thu, 03 Jun 2021 15:05:36 -0400 Received: by simark.ca (Postfix, from userid 112) id 51C6F1F163; Thu, 3 Jun 2021 15:05:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 99BC01E01F for ; Thu, 3 Jun 2021 15:05:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6235F3839C40 for ; Thu, 3 Jun 2021 19:05:35 +0000 (GMT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by sourceware.org (Postfix) with ESMTPS id 0FACB398EC3E for ; Thu, 3 Jun 2021 19:03:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0FACB398EC3E 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-wr1-f41.google.com with SMTP id z8so6872461wrp.12 for ; Thu, 03 Jun 2021 12:03:01 -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=jIcbnU3h0zlDcQp83ITh0Rz/GT0vqfBjlrqEmm+p5Oc/gihYcaVoxVuGeFEZdguvpw CVkLo32shN6Uu7tySqHscd3XJcbJ9f3mJirkHZZIWIXJOcujWBuXD7d8Xgx91pM0BM34 TCZnNvtKNZ9rmskdYdkj0n2GkyGPUNUia4rVgCQYYCYKxkLy2wSadGkRmEkKMVrkiut6 qGNJKEAURiaFmG4e408yjdHn1g9guG+J7RrGQRF4EAyWEwdkX6cUcUE5LDoQf4K5zSfJ YiiV4mumpXyBqg7N0Nu/XfS8tl+HwxE/6ZOWRScCSAqk/tC5MkzhHKEWZGnzc4okeenu QNAA== X-Gm-Message-State: AOAM531PGoc77NrXqF/cZ4gW/f1qsMeO+qUi8XyJXQZgYelcV9+Rf7lG PXfVg3tRF4btD8oPiNb5TJsHytrlFJVN4Q== X-Google-Smtp-Source: ABdhPJwm8I3m6pOOwQa7QlI55zOQRkAvNOe1ItoRE09NI/Uc+XVO2+Hsz7InNu8cKBFHRW99BAF88Q== X-Received: by 2002:a5d:6747:: with SMTP id l7mr444143wrw.220.1622746979511; Thu, 03 Jun 2021 12:02:59 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id l9sm3526389wme.21.2021.06.03.12.02.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 12:02:58 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 06/17] Don't check parent pid in gdb.threads/{ia64-sigill, siginfo-threads, watchthreads-reorder}.c Date: Thu, 3 Jun 2021 20:02:32 +0100 Message-Id: <20210603190243.2609886-7-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210603190243.2609886-1-pedro@palves.net> References: <20210603190243.2609886-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