public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Cc: Bruno Larsen <blarsen@redhat.com>
Subject: [PATCH 2/2] gdb/testsuite: fix running gdb.linespec/cp-completion-aliases.exp with clang
Date: Tue, 17 Jan 2023 14:00:08 +0100	[thread overview]
Message-ID: <20230117130007.1686917-3-blarsen@redhat.com> (raw)
In-Reply-To: <20230117130007.1686917-1-blarsen@redhat.com>

Currently, all important tests in gdb.linespec/cp-completion-aliases.exp
are failing when using clang because the wrong type is being suggested
for the completion.  For example, running with gcc and clang we get the
following output respectively:

(gdb) break get_value(object_p) <- gcc version
(gdb) break get_value(object*)  <- clang version

Since both suggestions are acceptable on their own, and the original bug
was if GDB suggested both at the same time, this commit updates the test
to accept both, gcc's and clang's outputs.
---
 .../gdb.linespec/cp-completion-aliases.exp         | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
index 33ad72e6f05..01ec61f4591 100644
--- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
+++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
@@ -27,15 +27,15 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
 # Disable the completion limit for the whole testcase.
 gdb_test_no_output "set max-completions unlimited"
 
-test_gdb_complete_unique \
+test_gdb_complete_unique_re \
     "break get_v" \
-    "break get_value(object_p)"
+    "break get_value\\(object(_p|\\\*)\\)"
 
-test_gdb_complete_unique \
+test_gdb_complete_unique_re \
     "break gr" \
-    "break grab_it(int_magic_t*)"
+    "break grab_it\\((int_magic_t|magic<int>)\\\*\\)"
 
-test_gdb_complete_multiple "break " "get_som" "ething(" {
-    "get_something(my_string_t)"
-    "get_something(object_p)"
+test_gdb_complete_multiple_re "break " "get_som" "ething\\\(" {
+    "get_something\\((my_string_t|char\ const\\*)\\)"
+    "get_something\\(object(_p|\\*)\\)"
 }
-- 
2.39.0


  parent reply	other threads:[~2023-01-17 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 13:00 [PATCH 0/2] Fix testing gdb.linespec/cp-completion-aliases with Bruno Larsen
2023-01-17 13:00 ` [PATCH 1/2] gdb/testsuite: add test with regex for multiple completion patterns Bruno Larsen
2023-01-17 13:00 ` Bruno Larsen [this message]
2023-02-03 13:44   ` [PATCH 2/2] gdb/testsuite: fix running gdb.linespec/cp-completion-aliases.exp with clang Andrew Burgess
2023-02-03 15:49     ` Andrew Burgess
2023-02-06 14:10     ` Bruno Larsen
2023-02-06 15:48       ` Andrew Burgess
2023-02-03  8:04 ` [PING][PATCH 0/2] Fix testing gdb.linespec/cp-completion-aliases with Bruno 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=20230117130007.1686917-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).