public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Guinevere Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Cc: Guinevere Larsen <blarsen@redhat.com>
Subject: [PATCH 2/3] gdb/testsuite: ask for DWARF5 in gdb.cp/pass-by-ref.exp
Date: Thu,  2 May 2024 15:25:48 -0300	[thread overview]
Message-ID: <20240502182549.1607075-3-blarsen@redhat.com> (raw)
In-Reply-To: <20240502182549.1607075-1-blarsen@redhat.com>

The test gdb.cp/pass-by-ref.exp relies on some DWARF attributes that
were only added in version 5. Some compilers (notably clang on fedoras
older than 40) default to using DWARF4, which is why there are many
XFAILs in the output.

However, clang is able to emit dwarf5, and will start doing so as the
default in fedora 40 (which is what the buildbot is using) causing 80
XPASSes to be emitted.

This patch identifies which debug version is being produced by the
compiler, and only sets up the XFAIL if DWARF5 is not used.
---
 gdb/testsuite/gdb.cp/pass-by-ref.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.cp/pass-by-ref.exp b/gdb/testsuite/gdb.cp/pass-by-ref.exp
index 7b2a6196c50..69437e9799c 100644
--- a/gdb/testsuite/gdb.cp/pass-by-ref.exp
+++ b/gdb/testsuite/gdb.cp/pass-by-ref.exp
@@ -343,6 +343,9 @@ if {![runto_main]} {
     return -1
 }
 
+get_debug_format
+set using_dwarf5 [test_debug_format "DWARF 5"]
+
 set bp_location [gdb_get_line_number "stop here"]
 gdb_breakpoint $bp_location
 gdb_continue_to_breakpoint "end of main" ".*return .*;"
@@ -412,7 +415,8 @@ proc test_for_class { prefix states cbvfun data_field length} {
 		    "destructor should be called"
 	    }
 	} else {
-	    if {$cctor == "deleted" && ($is_gcc_6_or_older || $is_clang)} {
+	    if {$cctor == "deleted"
+		&& ($is_gcc_6_or_older || !$::using_dwarf5)} {
 		setup_xfail "*-*-*"
 	    }
 	    gdb_test "print ${cbvfun}<$name> (${name}_var)" \
-- 
2.44.0


  parent reply	other threads:[~2024-05-02 18:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 18:25 [PATCH 0/3] clang inspired testsuite fixups Guinevere Larsen
2024-05-02 18:25 ` [PATCH 1/3] gdb/testsuite: fix XPASSes when testing with clang Guinevere Larsen
2024-05-02 18:25 ` Guinevere Larsen [this message]
2024-05-02 18:25 ` [PATCH 3/3] gdb/testsuite: introduce dwarf5 option to gdb_compile Guinevere Larsen
2024-05-16 20:10 ` [PING][PATCH 0/3] clang inspired testsuite fixups Guinevere Larsen
2024-05-23 20:27   ` [PING^2][PATCH " Guinevere Larsen
2024-06-12 14:02     ` [PING^3][PATCH " Guinevere Larsen
2024-06-19 14:51       ` [PING^4][PATCH " Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240502182549.1607075-3-blarsen@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).