public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.ada/convvar_comp.exp with broken debug info
Date: Fri, 29 Jul 2022 16:13:24 +0200	[thread overview]
Message-ID: <20220729141322.GA32385@delia.home> (raw)

Hi,

On aarch64-linux I run into this failure with gcc 7.5.0:
...
(gdb) print $item.started^M
$1 = (-5312, 65535, 4202476)^M
(gdb) FAIL: gdb.ada/convvar_comp.exp: print $item.started
...

The test-case expects (0, 0, 0), but we're getting another value due to
incorrect location information.

Work around this by:
- first printing the value, and then
- verifying that the convenience variable matches the printed value.

I've verified that the test-case still checks what it should by disabling
the fix from commit cc0e770c0d0 ("memory error printing component of record
from convenience variable") and observing the test-case fail.

Tested on x86_64-linux and aarch64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29420

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.ada/convvar_comp.exp with broken debug info

---
 gdb/testsuite/gdb.ada/convvar_comp.exp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.ada/convvar_comp.exp b/gdb/testsuite/gdb.ada/convvar_comp.exp
index ebc2659aeaa..1923bd785c7 100644
--- a/gdb/testsuite/gdb.ada/convvar_comp.exp
+++ b/gdb/testsuite/gdb.ada/convvar_comp.exp
@@ -30,7 +30,15 @@ if ![runto "break_me" ] then {
   return
 }
 
+set val ""
+gdb_test_multiple "print item.started" "" {
+    -re -wrap " = \\((.*)\\)" {
+	set val $expect_out(1,string)
+	pass $gdb_test_name
+    }
+}
+
 gdb_test_no_output "set variable \$item := item"
 
 gdb_test "print \$item.started" \
-         " = \\(0, 0, 0\\)"
+    " = \\($val\\)"

                 reply	other threads:[~2022-07-29 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220729141322.GA32385@delia.home \
    --to=tdevries@suse.de \
    --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).