From patchwork Wed Sep 20 17:59:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 76463 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6420D385770D for ; Wed, 20 Sep 2023 18:01:11 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by sourceware.org (Postfix) with ESMTPS id DB1E9385B530 for ; Wed, 20 Sep 2023 18:00:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB1E9385B530 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-f54.google.com with SMTP id 5b1f17b1804b1-403004a96a4so1007245e9.3 for ; Wed, 20 Sep 2023 11:00:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695232828; x=1695837628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fewiU7chP518bzUC7ojuRT22C3B+wwhWNtvWCDrv3g4=; b=FCoUt6kdKU9tgDhYbV+dFLOS6Jz3QIp2vHHCMbXZVkWcmOGqUgmpiXCGtNDiBoaWOw Td5R0UIxt80UelK7/BTJdo2YWOoaFLwlLoDM4hbEG3CEBZy2qNMzLLmHF4NqVAornGWD 7epTtKs2cb108BDadGGWEZ8CWa3+wzqHPixW5P8SdYJcUydnoQKs4yWnHMRczz1UXBXZ UNfnO6ELDSvj20Lf5qoaqpjbl4akpv+ggUDuqHTjeLwpJmWsTCYoBF97EtuZOnzqDGje OOEPMRJA8XUEYk1/3QcKVPVwLom7JAdqYf6IqdDCUSfjLDWntzjOoML4oO+WXMPNGjB7 sqcg== X-Gm-Message-State: AOJu0YyKBQGuCKPaqhR3VApZ2kxqL2ZFI49nKUJcNFm9bydbBgKReDel /IpExhk/syyxIZJBbV5YcU9+lPsJhsXvoA== X-Google-Smtp-Source: AGHT+IFZSlz0ehGWgfXOrzcEXN3l2TYc1XNWTco+6G26I/L8Eb9WyDSlqYd2u4HskeLIQPVoKy9qBA== X-Received: by 2002:adf:f1ca:0:b0:321:705f:7e2c with SMTP id z10-20020adff1ca000000b00321705f7e2cmr3162008wro.1.1695232828189; Wed, 20 Sep 2023 11:00:28 -0700 (PDT) Received: from localhost ([2001:8a0:f939:d200:f66d:9e3b:9c38:4aec]) by smtp.gmail.com with UTF8SMTPSA id l4-20020a5d4bc4000000b0031c3ee933b5sm13866267wrt.108.2023.09.20.11.00.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 11:00:27 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 5/5] Adjust gdb.thread/pthreads.exp for Cygwin Date: Wed, 20 Sep 2023 18:59:59 +0100 Message-Id: <20230920175959.2305271-6-pedro@palves.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920175959.2305271-1-pedro@palves.net> References: <20230920175959.2305271-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The Cygwin runtime spawns a few extra threads, so using hardcoded thread numbers in tests rarely works correctly. Thankfully, this testcase already records the ids of the important threads in globals. It just so happens that they are not used in a few tests. This commit fixes that. With this, the test passes cleanly on Cygwin. Still passes cleanly on x86-64 GNU/Linux. Change-Id: I01bf71fcb44ceddea8bd16b933b10b964749a6af --- gdb/testsuite/gdb.threads/pthreads.exp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index 41a7cb3800f..122172a052b 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -274,21 +274,21 @@ proc check_qcs {} { set number "\[0-9]\+" # Check -c (continue) and -s (silently continue) flags. - gdb_test "thread apply 2-3 p notfound" \ + gdb_test "thread apply $::thread1_id $::thread2_id p notfound" \ [multi_line \ "" \ - "Thread 2 ${any}" \ + "Thread $::thread1_id ${any}" \ "No symbol \\\"notfound\\\" in current context." \ ] \ "run a failing command that aborts thread apply" - gdb_test "thread apply 2-3 -c p notfound" \ + gdb_test "thread apply $::thread1_id $::thread2_id -c p notfound" \ [multi_line \ "" \ - "Thread 2 ${any}" \ + "Thread $::thread1_id ${any}" \ "No symbol \\\"notfound\\\" in current context." \ "" \ - "Thread 3 ${any}" \ + "Thread $::thread2_id ${any}" \ "No symbol \\\"notfound\\\" in current context." \ ] \ "run a failing command, -c to continue" @@ -302,11 +302,11 @@ proc check_qcs {} { gdb_test $cmd \ [multi_line \ "" \ - "Thread 3 ${any}" \ + "Thread $::thread2_id ${any}" \ "#${number}${ws}${any} in thread2 ${any}" \ "\\\$\[0-9]+ = ${number}${any}" \ "" \ - "Thread 2 ${any}" \ + "Thread $::thread1_id ${any}" \ "#${number}${ws}${any} in thread1 ${any}" \ "\\\$\[0-9]+ = ${number}${any}" \ ] \