From patchwork Tue Apr 30 01:53:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 793299 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:54f:b0:34d:5089:5a9e with SMTP id b15csp37490wrf; Mon, 29 Apr 2024 18:54:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3Tan0Zb9GY73AmmpsQly9AGcTPYFMLdITOXtfikoz9CTi3fB6xypW/3F4WivJxqG+/u+b3uuvVLdtgggqUm+j X-Google-Smtp-Source: AGHT+IFMrg6u0k8sgSFgnEYFs+1DjKgnX8AqfL5uzIvsQFEo/GzZh8mCMEfoP+IKCMoyAtydX11R X-Received: by 2002:a05:690c:7009:b0:61a:7d6e:80e8 with SMTP id jf9-20020a05690c700900b0061a7d6e80e8mr13752928ywb.36.1714442045702; Mon, 29 Apr 2024 18:54:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714442045; cv=pass; d=google.com; s=arc-20160816; b=jPPfuMQxcQvX6iiWgYqkCXloHsmbPVp8d/3nmLwXPncLXr/1DbsGo52r7JzFMk+h4h ngFaOUf6aV6jEc7N6s122/NSnp4NWB1VZPcxEP+C15+TuLk/ylgjTqvFfQti1yvrHNVy qUnT+zgt/ro4BDTRgc/xhGZwpkL8D7j3hXMdvj/q9dXq8cjK6j3C4zpGEGMVtCfbU3TY iJoGqBqnBypHPFoGBXfrA1yyTaTzyVeKAQKyNnqZ+jxuiZuQBcXHciPGerPnklMjDvuQ cjcwUJIS3n2cnG0hYzjZQAu/O3DeGIJDYXycdchziSW49xF/WHQwXyS4t97gj62dNtXI jv8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Hv+3TQWtz+l9v301xql/bYc7jYbklH0Do6Y20HlR1yg=; fh=D+CYjNeNNCwKnMdhx8STS1KBIHLcH+d6WPH4mXJjOqQ=; b=fJaJzn3DQyIaUhMpsMGQoricj9Hxodf8JABANjjH10qz00h7f3U1m27t++Xc5O1J0P L4a2pKDjYOsd25cAYgbIk17fJ5hVY72xeKjAXEspUnZO4CJxvoZkVHSuS5DCiOpnEyU2 HcFbUh6xusPHTV05HhXaqGb5Jz3GgkOdZ4UQplMNWlhAxSnYKZ7znds5cQzRyHLU5vdg PMvtl8FY6wz7I8BfvMZ1dH9JP/nH19zdoXlb5vEvatAmTpQv5iNeG4rUOawUh1yeqG5O 50RVVp/i/rLihBFpXuvOVZYLumNrzXDMsOdvXGZdbBhEax22qekrYvYWUQR6Pnes9Cxg Mozg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E/vuBeUB"; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t20-20020a05622a149400b0043ad0f21d07si5027324qtx.424.2024.04.29.18.54.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 18:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E/vuBeUB"; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 593813857C4F for ; Tue, 30 Apr 2024 01:54:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id CD0853858D3C for ; Tue, 30 Apr 2024 01:53:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD0853858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CD0853858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::536 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714442027; cv=none; b=fvc/tF2Pi67KqCI4wwdGn72+RHTBTCsHXy3Iv73ny4MHCoAhjI/nith+p/R6/10HfI9QO7c467iSRbyqByQtedC6RKMEx3prWjpvmie8DJ6Orp01/UNLOfrRSieeWFSM2L+ivqSqSr/98hPDtNL3xJRrUi9ImVtD4PPwf5LNE5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714442027; c=relaxed/simple; bh=noS7tonNvcpQLMOhHG2fUzmmo1TUyQKboLNbrnE+GaM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Rl1nlFVrAYD5B+JWNhiwV5j3tAGRz1NO0xt0GQBUd4JTD7m/tO8Mg3MSBJUCPcTLVWyErxeLoyGumoNoaYnspXvEC2hFWYG1xDer7chJ4EB4qxkx01kULMDUYRWrStIf55WyJoI7BnvUIYAQcC1I4sQY/6akD6wabyGZe7lIn10= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5f807d941c4so4008579a12.0 for ; Mon, 29 Apr 2024 18:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714442010; x=1715046810; 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=Hv+3TQWtz+l9v301xql/bYc7jYbklH0Do6Y20HlR1yg=; b=E/vuBeUBoXwOCPgQH3CrN1z4oRrhl4NYlpSiiaRSgBqxdizp4Y/mWJnT5Ib/pCkQFV EHReDOnCuh5izOl6xMvgKQm891vXYS3HIB0m0CbX/XzQxuX6RxYLAK45C005Ru26z/Ch FyQERuIZFQLe08cqcMMrau+5NnjyS9mnwx/KiXWN0QlOLaLWcxlZgncL408acL/XZdOQ i5N6p+YCPclxBbfXdLfe7uU4JXETxHXko134tfXYGeHtINkTy8Utn1zuxzzDKxoBU3O1 TQUQOtUOqpbWNKAXsNsw1Zzb1VENPNXFQe23WUQ2o/XpMZoICUp+2fFpZoOg4Ha/noDl plkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714442010; x=1715046810; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Hv+3TQWtz+l9v301xql/bYc7jYbklH0Do6Y20HlR1yg=; b=ZBJk3Crio5xJi5Rqt/EsxQZX28a40fsaRkOLVMxvmJB1fa4DN6RFkivbQjCpVEIs0+ dxdnEPeIGAY/QW3AltAIDq2jLJKvZZIqH9EDkBamVE8+zYYev4vuwxbErjm7x9NvWi0y cHMBpMLA1+ZlKK1ykNnr5m/GMRZK/jKZW5qa1C471Ij89tb4miZR4bgTkzH83XM8l3nX sCGp5VgX7oMWnqrHlzwA4QZZUj1G1LHD6pErlrSDLXIZBPWwlllQRAP0CIbAyT3W8AUi pFyVmhWOkw1DESbF/U21Nf4xDerDeMW2f6V6NZbDz97GD/7r6mLYC+VqankkMwv4Tjwr xlzQ== X-Gm-Message-State: AOJu0YzeGOFgnZpO+mCpmQ9xDXDu1hTlqHYNt/rXTTMWTJRo8XSJc6Xt i7nIvHU+L82mZanjsc8AkJK5bGQzlaHvKdtQF7vyM9Qs3S1ApgbH/HW+0a019UhwECvePYa7DnP G X-Received: by 2002:a05:6a20:2d07:b0:1a7:5780:1f4b with SMTP id g7-20020a056a202d0700b001a757801f4bmr18914216pzl.24.1714442010261; Mon, 29 Apr 2024 18:53:30 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:3d56:74b5:22f4:1590]) by smtp.gmail.com with ESMTPSA id gv2-20020a056a004e8200b006ea6f189976sm19955360pfb.163.2024.04.29.18.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 18:53:29 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Cc: Bernd Edlinger Subject: [PATCH] gdb/testsuite: Restore libc_has_debug_info's less strict behaviour Date: Mon, 29 Apr 2024 22:53:25 -0300 Message-ID: <20240430015325.89780-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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+patch=linaro.org@sourceware.org The code that was factored out from gdb.base/relativedebug.exp assumed that libc has debug info and only determined that it doesn't if it saw a specific message from GDB to that effect. In the process of factoring it into a require predicate, I made it stricter by trying to make a specific determination of whether or not debug info is available. Pedro noticed that "It'll disable the testcase on systems that link with their libc statically (even if has debug info), or systems that name their libc something else." Which is something I hadn't considered. This patch returns libc_has_debug_info to the original behaviour. Also, remove a verbose message that is redundant with the $message variable. --- gdb/testsuite/lib/gdb.exp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index d092258a9e50..c55ade065844 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3699,8 +3699,9 @@ proc support_displaced_stepping {} { return 0 } -# Return 1 if GDB can find the libc debug info, or 0 and a reason string if it -# can't. This procedure is meant to be called by the require procedure. +# Return 0 and a reason string if GDB can determine that libc doesn't have +# debug info, and 1 otherwise. This procedure is meant to be called by the +# require procedure. gdb_caching_proc libc_has_debug_info {} { global srcdir subdir gdb_prompt inferior_exited_re @@ -3726,22 +3727,20 @@ gdb_caching_proc libc_has_debug_info {} { gdb_reinitialize_dir $srcdir/$subdir gdb_load "$obj" runto_main - set test "info sharedlibrary libc.so" + set libc_has_debug_info 1 + set message "unable to get information on libc.so" + set test "info sharedlibrary" gdb_test_multiple $test $test { -re ".*\(\\*\)\[^\r\n\]*/libc\.so.*$gdb_prompt $" { # Matched the "(*)" in the "Syms Read" columns which means: # "(*): Shared library is missing debugging information." - verbose -log "$me: libc doesn't have debug info" set libc_has_debug_info 0 set message "libc doesn't have debug info" } - -re ".*Yes\[ \t\]+\[^\r\n\]*/libc\.so.*$gdb_prompt $" { - verbose -log "$me: libc has debug info" - set libc_has_debug_info 1 - } - default { - set libc_has_debug_info 0 - set message "libc not found in the inferior" + -re ".*$gdb_prompt $" { + # The default pattern for the GDB prompt in gdb_test_multiple + # causes a FAIL if it matches, but in our case we should just + # assume that there is libc debug info. } } gdb_exit