Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [RFAv2 4/4] Fix gdb.ada/fun_renaming.exp by using more unique names.
Date: Wed, 26 Dec 2018 14:03:00 -0000	[thread overview]
Message-ID: <20181226140304.19594-5-philippe.waroquiers@skynet.be> (raw)
In-Reply-To: <20181226140304.19594-1-philippe.waroquiers@skynet.be>

The test fails due to conflict between var 'next' and s-pooloc.adb next:
(gdb) print next(1)
Multiple matches for next
[0] cancel
[1] pack.next (integer) return integer at /bd/home/philippe/gdb/git/binutils-gdb/gdb/testsuite/gdb.ada/fun_renaming/pack.adb:19
[2] system.pool_local.next (system.address) return system.pool_local.acc_address at s-pooloc.adb:151
> FAIL: gdb.ada/fun_renaming.exp: print next(1) (timeout)

Fix by making the names and renamings more unique.

gdb/testsuite/ChangeLog
2018-12-26  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.ada/fun_renaming/pack.ads (Next): Rename to Fun_Rename_Test_Next.
	(Renamed_Next): Rename to Renamed_Fun_Rename_Test_Next.
	gdb.ada/fun_renaming/pack.adb (Next): Rename to Fun_Rename_Test_Next.
	gdb.ada/fun_renaming/fun_renaming.adb (N): Rename to Fun_Rename_Test_N.
	gdb.ada/fun_renaming.exp: Update accordingly.
---
 gdb/testsuite/gdb.ada/fun_renaming.exp             | 14 +++++++-------
 .../gdb.ada/fun_renaming/fun_renaming.adb          |  7 ++++---
 gdb/testsuite/gdb.ada/fun_renaming/pack.adb        |  4 ++--
 gdb/testsuite/gdb.ada/fun_renaming/pack.ads        |  5 +++--
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/fun_renaming.exp b/gdb/testsuite/gdb.ada/fun_renaming.exp
index 4d4116cc13..cbdd0032ea 100644
--- a/gdb/testsuite/gdb.ada/fun_renaming.exp
+++ b/gdb/testsuite/gdb.ada/fun_renaming.exp
@@ -27,18 +27,18 @@ set bp_location [gdb_get_line_number "BREAK" ${testdir}/fun_renaming.adb]
 runto "fun_renaming.adb:$bp_location"
 
 # Sanity check: make sure we can call a regular global function.
-gdb_test "print next(1)" " = 2"
+gdb_test "print fun_rename_test_next(1)" " = 2"
 
 # Starting with GCC 6, renamed subprograms are materialized in the debugging
 # information: make sure we can call the regular global function using its
 # multiple names.
 
-set test "print n(1)"
+set test "print fun_rename_test_n(1)"
 gdb_test_multiple $test $test {
     -re " = 2\..*$gdb_prompt $"  {
         pass $test
     }
-    -re "No definition of \"n\" in current context\..*$gdb_prompt $" {
+    -re "No definition of \"fun_rename_test_n\" in current context\..*$gdb_prompt $" {
         if {[test_compiler_info {gcc-6*}]} {
             fail $test
         } else {
@@ -47,12 +47,12 @@ gdb_test_multiple $test $test {
     }
 
 }
-set test "print renamed_next(1)"
+set test "print renamed_fun_rename_test_next(1)"
 gdb_test_multiple $test $test {
     -re " = 2\..*$gdb_prompt $" {
         pass $test
     }
-    -re "No definition of \"renamed_next\" in current context\..*$gdb_prompt $" {
+    -re "No definition of \"renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
         if {[test_compiler_info {gcc-6*}]} {
             fail $test
         } else {
@@ -61,12 +61,12 @@ gdb_test_multiple $test $test {
     }
 }
 
-set test "print pack.renamed_next(1)"
+set test "print pack.renamed_fun_rename_test_next(1)"
 gdb_test_multiple $test $test {
     -re " = 2\..*$gdb_prompt $" {
         pass $test
     }
-    -re "No definition of \"pack\.renamed_next\" in current context\..*$gdb_prompt $" {
+    -re "No definition of \"pack\.renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
         if {[test_compiler_info {gcc-6*}]} {
             fail $test
         } else {
diff --git a/gdb/testsuite/gdb.ada/fun_renaming/fun_renaming.adb b/gdb/testsuite/gdb.ada/fun_renaming/fun_renaming.adb
index eae6eeaf73..12cec24a56 100644
--- a/gdb/testsuite/gdb.ada/fun_renaming/fun_renaming.adb
+++ b/gdb/testsuite/gdb.ada/fun_renaming/fun_renaming.adb
@@ -16,8 +16,9 @@
 with Pack;
 
 procedure Fun_Renaming is
-   function N (I : Integer) return Integer renames Pack.Next;
+   function Fun_Rename_Test_N (I : Integer) return Integer
+     renames Pack.Fun_Rename_Test_Next;
 begin
-   Pack.Discard (N (1)); --  BREAK
-   Pack.Discard (Pack.Renamed_Next (1)); --  BREAK
+   Pack.Discard (Fun_Rename_Test_N (1)); --  BREAK
+   Pack.Discard (Pack.Renamed_Fun_Rename_Test_Next (1)); --  BREAK
 end Fun_Renaming;
diff --git a/gdb/testsuite/gdb.ada/fun_renaming/pack.adb b/gdb/testsuite/gdb.ada/fun_renaming/pack.adb
index abbec2a284..5349cdee5a 100644
--- a/gdb/testsuite/gdb.ada/fun_renaming/pack.adb
+++ b/gdb/testsuite/gdb.ada/fun_renaming/pack.adb
@@ -14,10 +14,10 @@
 --  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 package body Pack is
-   function Next (I : Integer) return Integer is
+   function Fun_Rename_Test_Next (I : Integer) return Integer is
    begin
       return I + 1;
-   end Next;
+   end Fun_Rename_Test_Next;
 
    procedure Discard (I : Integer) is
    begin
diff --git a/gdb/testsuite/gdb.ada/fun_renaming/pack.ads b/gdb/testsuite/gdb.ada/fun_renaming/pack.ads
index be46315440..ba3a999f42 100644
--- a/gdb/testsuite/gdb.ada/fun_renaming/pack.ads
+++ b/gdb/testsuite/gdb.ada/fun_renaming/pack.ads
@@ -15,8 +15,9 @@
 
 package Pack is
 
-   function Next (I : Integer) return Integer;
-   function Renamed_Next (I : Integer) return Integer renames Next;
+   function Fun_Rename_Test_Next (I : Integer) return Integer;
+   function Renamed_Fun_Rename_Test_Next (I : Integer) return Integer
+     renames Fun_Rename_Test_Next;
    procedure Discard (I : Integer);
 
 end Pack;
-- 
2.19.2


  parent reply	other threads:[~2018-12-26 14:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 14:03 [RFAv2 0/4] Fix some gdb.ada tests failure " Philippe Waroquiers
2018-12-26 14:03 ` [RFAv2 3/4] Fix gdb.ada/assign_arr.exp " Philippe Waroquiers
2018-12-26 15:29   ` Joel Brobecker
2018-12-26 14:03 ` [RFAv2 1/4] Fix gdb.ada/packed_array_assign.exp " Philippe Waroquiers
2018-12-26 15:20   ` Joel Brobecker
2018-12-26 14:03 ` Philippe Waroquiers [this message]
2018-12-27  2:39   ` [RFAv2 4/4] Fix gdb.ada/fun_renaming.exp " Joel Brobecker
2018-12-27 10:07     ` Philippe Waroquiers
2018-12-26 14:03 ` [RFAv2 2/4] Fix gdb.ada/rename_subscript_param.exp " Philippe Waroquiers
2018-12-26 15:27   ` Joel Brobecker
2018-12-26 15:50     ` Philippe Waroquiers
2018-12-27  2:36       ` Joel Brobecker

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=20181226140304.19594-5-philippe.waroquiers@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --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