From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fYW8EBNyUGhiEhEAWB0awg (envelope-from ) for ; Mon, 16 Jun 2025 15:35:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 2F5C91E11C; Mon, 16 Jun 2025 15:35:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9A1421E089 for ; Mon, 16 Jun 2025 15:35:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F02C38D0ABA for ; Mon, 16 Jun 2025 19:35:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F02C38D0ABA Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id ABC8C3893762 for ; Mon, 16 Jun 2025 19:34:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABC8C3893762 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ABC8C3893762 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750102487; cv=none; b=A3YPXFFmQ/JgfEgpE507Pb0hMvSp4o4vxH2fmJNaRO2Guyo0PNg2S38riCH/P2zp1viOiYLHO5LIEi1FAX9Tr7stp1du/iuoiibpcjtQQBAtZkIMjwXSnYXvEQDwA/rrTKKB8i53tfXU9M4L+IlLtfbRygK5c6WtPpHbFEfllLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750102487; c=relaxed/simple; bh=IYlmIIps6zpYFuOSYKCVKVk0HoYP//SlnKYQGSRcBkw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=penAJIlcZxGVaEi/InA86ub7xdhi3tbBQb/DBOA7O1TQ/pyW8uSpc88XqIwr6S553agh5dD5xnNSKWvjH+bUTAUYdRl1bLHxXg/UZvpQOjXev/Tl+53BRC6TCk5xQEWp7+YOjcNHhgDeJJuXxlpH+I+6YiUkq4KK/cI4GHYixig= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABC8C3893762 Received: by simark.ca (Postfix, from userid 112) id 2A6EC1E089; Mon, 16 Jun 2025 15:34:47 -0400 (EDT) Received: from localhost.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 ESMTPSA id 9024F1E089; Mon, 16 Jun 2025 15:34:45 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v3 1/6] gdb/testsuite: check that "info shared" and "info linker-namespaces" before running don't crash Date: Mon, 16 Jun 2025 15:32:59 -0400 Message-ID: <20250616193443.16703-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.49.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 This patch is new in v3. While writing my solib_ops C++ification series, I broke this, and it didn't seem to be caught by the testsuite. Add a test for those. The exact message for "info linker-namespaces" varies depending on the solib_ops of the target architecture (whether ops->num_active_namespaces is nullptr or not). For now, just accept any message (a crash will still be caught). A later patch in this series will make the message consistent and update this test. Change-Id: I6bce2ff317447bbf321fc9cbd2d42c3dcea0c683 --- gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 5 +++++ gdb/testsuite/gdb.base/info-shared.exp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp index 94b4a6e50bcf..8613056a7c8b 100644 --- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp +++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp @@ -169,6 +169,11 @@ proc_with_prefix test_conv_vars {} { proc test_info_linker_namespaces {} { clean_restart $::binfile + # Check that "info linker-namespaces" while the inferior is not running + # doesn't crash. + gdb_test "info linker-namespaces" ".*" \ + "info linker-namespaces before running" + if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp index 6f1b2d6af7e0..e81b28e27a5b 100644 --- a/gdb/testsuite/gdb.base/info-shared.exp +++ b/gdb/testsuite/gdb.base/info-shared.exp @@ -79,6 +79,9 @@ proc check_info_shared { test expect1 expect2 } { } } +# Check that "info shared" before running doesn't crash. +check_info_shared "info sharedlibrary before running" 0 0 + # Start the inferior, and check neither of the libraries are loaded at # the start. if ![runto_main] { base-commit: 62f1dbee49983c1820bc32015d2e8cd2d085c4dd -- 2.49.0