From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGHT+IHoWGzqo2/t0+raZLB6c9Q6/HwWlXEtBAhnKcewpC33ays3TLMeALC/W8DXN6XpoBeo4kkFug== 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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