public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [pushed/Ada] Relax expected output in gdb.ada/access_tagged_param.exp test
Date: Mon, 08 Jan 2018 09:41:00 -0000	[thread overview]
Message-ID: <1515404478-38666-1-git-send-email-brobecker@adacore.com> (raw)

Hello,

One of the tests in gdb.ada/access_tagged_param.exp verifies
the value of the parameters being printed by GDB when stopping
at a breakpoint inside procedure Pck.Inspect.

In particular, one of these parameters is actually generated
internally by the compiler, and does only indirectly depend
on the user-level code. A recent change in AdaCore's compiler
caused the code expansion to change a little bit, and as a result,
the value of that parameter has changed from 2 to 3. This can be
evindenced by looking at the code post expansion, using the -gnatDG
command-line switch to generate the .dg files:

    $ gnatmake -g -gnatDG foo.adb
    $ vi foo.adb.dg

We can see that the call to pck.inspect used to be:

    pck__inspect (P8b, objL => 2);

With a recent version of GNAT Pro, it is now:

    pck__inspect (P9b, objL => 3);

This change causes a spurious FAIL when running this testcase.
The objL parameter being, at heart, a simple counter of the nesting
level, this commit relaxes the expected output to accept any single-
digit number. We could accept any decimal, but given the example
program, I dout that number will reach double-digit level. If it
does, we'll double-check that this is normal, and relax the expected
output further.

gdb/testsuite/ChangeLog:

        * gdb.ada/access_tagged_param.exp: Relax expected output
        for value of "ObjL" in "continue" to pck.inspect breakpoint
        test.

Tested on x86_64-linux and pushed to master.

Thanks,
-- 
Joel

---
 gdb/testsuite/ChangeLog                       | 6 ++++++
 gdb/testsuite/gdb.ada/access_tagged_param.exp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index baa0104..7f4d80d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
 2018-01-08  Joel Brobecker  <brobecker@adacore.com>
 
+	* gdb.ada/access_tagged_param.exp: Relax expected output
+	for value of "ObjL" in "continue" to pck.inspect breakpoint
+	test.
+
+2018-01-08  Joel Brobecker  <brobecker@adacore.com>
+
 	* gdb.ada/arr_enum_idx_w_gap.exp
 	* gdb.ada/arr_enum_idx_w_gap/foo_q418_043.adb
 
diff --git a/gdb/testsuite/gdb.ada/access_tagged_param.exp b/gdb/testsuite/gdb.ada/access_tagged_param.exp
index 598cf89..47b180d 100644
--- a/gdb/testsuite/gdb.ada/access_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/access_tagged_param.exp
@@ -37,4 +37,4 @@ gdb_breakpoint "pck.inspect"
 # the value of all the parameters.
 
 gdb_test "continue" \
-         ".*Breakpoint $decimal, pck\\.inspect \\(obj=$hex, <objL>=2\\) at .*"
+         ".*Breakpoint $decimal, pck\\.inspect \\(obj=$hex, <objL>=\[1-9\]\\) at .*"
-- 
2.1.4

                 reply	other threads:[~2018-01-08  9:41 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=1515404478-38666-1-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.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).