Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] gdb/testsuite: fix max-completions regex in test_gdb_complete_cmd_multiple
@ 2026-10-26 14:45 Simon Marchi
  2026-10-26 14:45 ` [PATCH 2/2] gdb/macrotab: catch exception and rethrow around splay_tree_foreach Simon Marchi
  2026-10-28 17:21 ` [PATCH 1/2] gdb/testsuite: fix max-completions regex in test_gdb_complete_cmd_multiple Andrew Burgess
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Marchi @ 2026-10-26 14:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

When called with MAX_COMPLETIONS true and a non-empty COMPLETION_WORD,
test_gdb_complete_cmd_multiple fails to match the "List may be
truncated" line.  It expects that line to start with CMD_PREFIX only
("macro expand " in the example below), but GDB prints CMD_PREFIX
("macro expand ") followed by COMPLETION_WORD ("BEFORE_"):

    (gdb) complete macro expand BEFORE_
    macro expand BEFORE_MACSCP1_1
    macro expand BEFORE_MACSCP1_2
    macro expand BEFORE_ *** List may be truncated, max-completions reached. ***

Fix it by including COMPLETION_WORD in the expected line.  The next
patch adds a test that depends on this.  I suppose that no other test
uses this proc in this exact way currently, I don't see any regression
following this change.

Change-Id: I645197f625212dd6c654081742b3bd42fac36229
---
 gdb/testsuite/lib/completion-support.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index 112c48df6cf0..0c4b72b1c073 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -246,9 +246,9 @@ proc test_gdb_complete_cmd_multiple { cmd_prefix completion_word completion_list
     set expected_re [make_cmd_completion_list_re $cmd_prefix $completion_list $start_quote_char $end_quote_char]
 
     if {$max_completions} {
-	set cmd_prefix_re [string_to_regexp $cmd_prefix]
+	set input_re [string_to_regexp $cmd_prefix$completion_word]
 	append expected_re \
-	    "$cmd_prefix_re \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n"
+	    "$input_re \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n"
     }
 
     set cmd_re [string_to_regexp "complete $cmd_prefix$completion_word"]

base-commit: 50b7267f00c094614ab4efb43f7aac0507a436e7
-- 
2.56.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-28 19:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 14:45 [PATCH 1/2] gdb/testsuite: fix max-completions regex in test_gdb_complete_cmd_multiple Simon Marchi
2026-10-26 14:45 ` [PATCH 2/2] gdb/macrotab: catch exception and rethrow around splay_tree_foreach Simon Marchi
2026-10-28 17:37   ` Andrew Burgess
2026-10-28 19:24     ` Simon Marchi
2026-10-28 17:21 ` [PATCH 1/2] gdb/testsuite: fix max-completions regex in test_gdb_complete_cmd_multiple Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox