From patchwork Tue Jan 30 09:30:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 84910 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 D0C353857C5C for ; Tue, 30 Jan 2024 09:36:41 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 47D263858021 for ; Tue, 30 Jan 2024 09:36:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47D263858021 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47D263858021 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706607368; cv=none; b=MrGPeCW7JG+JgUrJDK6sh/yWBePqoBbUynIrSqxGX5B9kVbR8u8vu0JOCyWsIloIPFZTsezSNk5clX0syt66Ptworoe8mDTwFhh+qpXUK1zk/sd6nRluNRkAABnXStVKEw/tiwQTnZuJ0PXADi0Te8VYNstnQpIJwyWUmie6Bhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706607368; c=relaxed/simple; bh=d7ZHURdY8yyBn9vY9dBhlH0fQ3xbCpq7yWmcH22RCRM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Cg7HGOSBuFYFaG8lLbO/v2Z9zsTZnVFbDaXf7tsgvC3QoBZbAcmR7iguCtqDYGG8d7gGB+dQHoHV8XKlB6JWT/fF0rVI4H8PQ7nR9qdf3uEIEGJ/4aDXORU8EztvGNVl+nZNsHqUQ3Ik1IPUUBvAIs+pYwYP3i1v5OfuLBCHtBE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706607366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVVds4CiEv+yfyjT3vtVXNjoQUQOUE6NIa9pES9Xcn0=; b=WfXi9erCVQlpPNPrM07RNQ544GYINpIn3/1DvnGqv8A10xtqm1afT/UilpGwzCfCkyKJHK w6bQeVyslOweEzhEEaznWEOYequKNp2DiBeORpw1B3bGVh2UZtDrosONh3G9CJWQflf/Yd 6UEEMvot1IMwT563AqbaKDQ5qDxyXM0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-PDwC3vh7NDmnD8y5ak9gnQ-1; Tue, 30 Jan 2024 04:36:03 -0500 X-MC-Unique: PDwC3vh7NDmnD8y5ak9gnQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6EB4D83722C for ; Tue, 30 Jan 2024 09:36:03 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA2B240C1231; Tue, 30 Jan 2024 09:36:02 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb/testsuite: make gdb.base/list-nodebug.exp pass without libc symbols Date: Tue, 30 Jan 2024 10:30:30 +0100 Message-ID: <20240130093029.170544-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 Simon noticed that the test gdb.base/list-nodebug.exp would fail if the system doesn't have debug symbols for the standard library, and filed it as PR gdb/31290. The issue is that, if GDB finds no symbols at all for, it takes a different exit than if it finds some symbols, but nothing for the current location. This patch changes the test to accept any message, since the important thing we're testing at this point is if GDB would crash, not what the message is. --- Email only: I tried to condense the errors instead of changing the testcase, but I couldn't find a good way to check if there were no symbols. My best idea was to check if the symtab that was found has a linetable, and exit error out if no linetable is present. However, I worry that a user may want, for example, to list a specific function and I couldn't convince myself that the linetable was required for that, so I decided to go this safe route instead. If the linetable is required, or it is at least reasonable ot require it for listing a file, I can send the other patch instead. --- gdb/testsuite/gdb.base/list-nodebug.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/list-nodebug.exp b/gdb/testsuite/gdb.base/list-nodebug.exp index 08de05423af..df2761f89e4 100644 --- a/gdb/testsuite/gdb.base/list-nodebug.exp +++ b/gdb/testsuite/gdb.base/list-nodebug.exp @@ -30,8 +30,8 @@ if {![runto_main]} { # Check that GDB doesn't crash when we use list . on an inferior with # no debug information -gdb_test "list ." "No debug.*" "first 'list .'" +gdb_test "list ." ".*" "first 'list .'" # This should be called twice because the first list invocation since # printing a frame may take a different codepath, which wouldn't # trigger the crash. -gdb_test "list ." "No debug.*" "second 'list .'" +gdb_test "list ." ".*" "second 'list .'"