From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5cdyDKNBKGqWDj4AWB0awg (envelope-from ) for ; Tue, 09 Jun 2026 12:38:59 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=B5RbhTqR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 215071E070; Tue, 09 Jun 2026 12:38:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 88F201E070 for ; Tue, 09 Jun 2026 12:38:58 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E9494C31860 for ; Tue, 9 Jun 2026 16:38:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E9494C31860 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=B5RbhTqR Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 0D64E4BA2E30 for ; Tue, 9 Jun 2026 16:38:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D64E4BA2E30 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D64E4BA2E30 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781023112; cv=none; b=epaeOUOilfcSrEJK+Y95NrQJqI/CYaj3vbaCCiCEI35AO37Rc9p07eR/522/SXvGpeamx3GU/FnaBrbWbpU9SHlUWTFrXQe8qX+3tg22v0CGsXxAR3M3Lwz7fzz2mz5IxN89b0aZ9OuL/y5gcfXOv5ihSUJsdPI8ujnWIhicxG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781023112; c=relaxed/simple; bh=wB0uVC2GKB06iDZnKHEnfUeHp2nSOpu5xx+aE3LIYgo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kpSTofJHWCSvHU4DeCFttqBCF/j92dYK/MUFFUzIIJIaMuPyv6cNyjLr+EHde/yxVe1xiGUvZUsCBIUhbNHhZYr/8TQ6/cnFQHURAawW3ZjPZUtZiXs1TLC/FwQhFFCe1pUKKCgs3VoWOtogcSu56LtejBHx0gcN7OsjOCIB0sk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=B5RbhTqR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D64E4BA2E30 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-68bfcf11050so10561652a12.0 for ; Tue, 09 Jun 2026 09:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1781023111; x=1781627911; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7JZ/ytOx7rqN02BQ9ZkfPy7qJOtJQFdso2OJTjJpMIs=; b=B5RbhTqRMKnDLOp8zPZQMuO/VRgIC5tf9nRsFL/z3MscFD6vg33z/gFDSz4ZYhbJId /koq7yqBZq4pRvBhmYvZpHAHO3Tdv2BHB2A39/mJPHHuwGzx1EcsWOexOqlYhokmQ3/k Y2EvQHKb/olizTl10u9rjoMhZMkfZQEhLS9NkJ38q0LAyLPmpvNizLddlUtIkW0Hr1Dm vgryTQJXAQfsAJeW6V/KvY0PcQYmjePBo7eFmuxk/ev/usYX8gjGaPE2KWn4qiiHTtg8 mokNGBALbC0WAHENAuAq5Uxe/Py2MxLQ07cxNGMh+InvSH8rYh1L2B16O4eeREdPqlZe Qa6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781023111; x=1781627911; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7JZ/ytOx7rqN02BQ9ZkfPy7qJOtJQFdso2OJTjJpMIs=; b=H25C8aP4vZ6cFkSCyz1KHuLnwa12oxKG/YsqGIG1XjJtiLL5nl4uYDFjy0oBQ7JG4X +M8vusqxtl3ROEXcl2NprwRDYjE8RUuZ1ZoBaYHaagnZSpavm0NcONngUvlEp0awlJ6I X1QsSMA9OhhGwLNp3SXGDbGc1jiQRHXPeGW+zqsao5wAWQixGKJ5prH6JuHmxXatxIEg vO0wF0Hsq0G4HE0TJFpEsBb1CktfK9jzqqQANM0IHNq7EskCcfxgpgXwyq1y4IXy3axq M17BRvm7DEKYktOmy+p64vJRUGH/zA1ru7yZV+JoWRuc3I7p84vkTSIXRHHNUwvv/Wk+ tXIQ== X-Gm-Message-State: AOJu0YwVRNF8yAcz4SL2ZrORq9Ripl4bI8nCkTP7KDg8EfIQ1F8wkpA2 C2bNuhi+zA0oMKZTA1qgrJauN7vBaoFCubt/QOjrwXQN8xE4gO5ygYRm8K7Ci23ZWDw+ovK4dfU t9Bk= X-Gm-Gg: Acq92OEzmRRE8xoYz8eaX9rz2giX8k/onAC69DUvpkzcjX2+E5qff0SMWtoT5N9Gv9j XJ0HGNXQTUXtI73PXx9ICcxFK0zXc9/qtgi4GzQqUMka5tnPdL19BU83Mo0OtP6+bcoGVQQKjbI WwL1SbmqACxMbSNwtlshYGZYMUU85yHQ8zyOKUXF2wQI0eDAX1nvhOcyHdc1gFm7JN4SDmrUoJQ 5JAOAUQ6OyXHGkU2ScnseMCWCoJsEHfiRpeitlM36bBn13iCczskpCPFhxYd8q7INwrLx9SybwV cW8lOkieJgxk2Z2L9UybnBUNzgG8AGeNdqOxgxlzGuKdhyMDKs8Io9dZMyHaPvEYSb88KL4FHpx I2CuwqN6K5mG/wbZAtTD3pL1+M2p5ENf42QJrVdDx1h4WGyfXoNsC8oZNqCTl4GlekeURuMRf2n 2gmrDPzoHATRVnJObZK+oA10JFMsWbE8QNcXrfsHK89SaWBnE6d6uH4A== X-Received: by 2002:a17:907:b59a:b0:bef:12f:347e with SMTP id a640c23a62f3a-bf938e242eemr143442366b.24.1781023110831; Tue, 09 Jun 2026 09:38:30 -0700 (PDT) Received: from bapiya (75-166-225-82.hlrn.qwest.net. [75.166.225.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf04e9e3847sm1077949766b.0.2026.06.09.09.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 09:38:30 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Make two Ada tests more robust Date: Tue, 9 Jun 2026 10:38:25 -0600 Message-ID: <20260609163825.3452764-1-tromey@adacore.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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~public-inbox=simark.ca@sourceware.org tasks.exp and task_watch.exp were failing when run with gnat-llvm. Investigating these showed the same problem (which makes sense because the tests use the same program). In this code: for J in Task_List'Range loop -- STOP_HERE Task_List (J).Call_Break_Me; end loop; ... with GCC, the breakpoint set on the 'for' line is only hit a single time. However, with gnat-llvm, the breakpoint is hit on every iteration of the loop. IMO this is a GCC bug. Similarly, at the end of the function: null; -- STOP_HERE_2 ... with gnat-llvm, a breakpoint set here was not being hit. It seems perhaps somewhat strange to set a breakpoint on a null statement at the end of a function; and while this might possibly be a gnat-llvm bug, this isn't really the point of this test. This patch makes these tests more robust by arranging for the breakpoints to be set before the loop and on a call, respectively. Because this is Ada-specific, was reviewed internally, and is just a minor test case adjustment, I am checking it in. --- gdb/testsuite/gdb.ada/task_watch.exp | 3 ++- gdb/testsuite/gdb.ada/task_watch/foo.adb | 10 ++++++++-- gdb/testsuite/gdb.ada/tasks.exp | 3 ++- gdb/testsuite/gdb.ada/tasks/foo.adb | 10 ++++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/task_watch.exp index a39773f4925..7031abf41ff 100644 --- a/gdb/testsuite/gdb.ada/task_watch.exp +++ b/gdb/testsuite/gdb.ada/task_watch.exp @@ -82,4 +82,5 @@ gdb_test "info tasks" \ # running to completion. set bp_location [gdb_get_line_number "STOP_HERE_2" ${testdir}/foo.adb] gdb_breakpoint foo.adb:$bp_location -gdb_continue_to_breakpoint second ".*foo.adb:$bp_location.*null; -- STOP_HERE_2" +gdb_continue_to_breakpoint second \ + ".*foo.adb:$bp_location.*Do_Nothing; -- STOP_HERE_2" diff --git a/gdb/testsuite/gdb.ada/task_watch/foo.adb b/gdb/testsuite/gdb.ada/task_watch/foo.adb index 7db4565022b..c8ae2f389ba 100644 --- a/gdb/testsuite/gdb.ada/task_watch/foo.adb +++ b/gdb/testsuite/gdb.ada/task_watch/foo.adb @@ -24,6 +24,11 @@ procedure Foo is end Caller; type Caller_Ptr is access Caller; + procedure Do_Nothing is + begin + null; + end Do_Nothing; + procedure Break_Me is begin Value := Value + 1; @@ -59,7 +64,8 @@ begin -- Next, call their Call_Break_Me entry of each task, using the same -- order as the order used to create them. - for J in Task_List'Range loop -- STOP_HERE + Do_Nothing; -- STOP_HERE + for J in Task_List'Range loop Task_List (J).Call_Break_Me; end loop; @@ -68,6 +74,6 @@ begin Task_List (J).Finalize; end loop; - null; -- STOP_HERE_2 + Do_Nothing; -- STOP_HERE_2 end Foo; diff --git a/gdb/testsuite/gdb.ada/tasks.exp b/gdb/testsuite/gdb.ada/tasks.exp index 9862663d566..b37cf0cadd1 100644 --- a/gdb/testsuite/gdb.ada/tasks.exp +++ b/gdb/testsuite/gdb.ada/tasks.exp @@ -178,7 +178,8 @@ gdb_test "info tasks" \ # running to completion. set bp_location [gdb_get_line_number "STOP_HERE_2" ${testdir}/foo.adb] gdb_breakpoint foo.adb:$bp_location -gdb_continue_to_breakpoint second ".*foo.adb:$bp_location.*null; -- STOP_HERE_2" +gdb_continue_to_breakpoint second \ + ".*foo.adb:$bp_location.*Do_Nothing; -- STOP_HERE_2" # A regression test for a crash caused by trying to find the thread # for a terminated task. diff --git a/gdb/testsuite/gdb.ada/tasks/foo.adb b/gdb/testsuite/gdb.ada/tasks/foo.adb index f19672d6ae4..dfc6664130e 100644 --- a/gdb/testsuite/gdb.ada/tasks/foo.adb +++ b/gdb/testsuite/gdb.ada/tasks/foo.adb @@ -22,6 +22,11 @@ procedure Foo is end Caller; type Caller_Ptr is access Caller; + procedure Do_Nothing is + begin + null; + end Do_Nothing; + procedure Break_Me is begin null; @@ -57,7 +62,8 @@ begin -- Next, call their Call_Break_Me entry of each task, using the same -- order as the order used to create them. - for J in Task_List'Range loop -- STOP_HERE + Do_Nothing; -- STOP_HERE + for J in Task_List'Range loop Task_List (J).Call_Break_Me; end loop; @@ -66,6 +72,6 @@ begin Task_List (J).Finalize; end loop; - null; -- STOP_HERE_2 + Do_Nothing; -- STOP_HERE_2 end Foo; base-commit: 1eed06ae51d73a195b78ce0903ada9c9c2c14cfb -- 2.54.0