From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/5] Fix bogus gdb_test invocations
Date: Wed, 30 Mar 2022 20:29:27 +0100 [thread overview]
Message-ID: <20220330192929.3161015-4-pedro@palves.net> (raw)
In-Reply-To: <20220330192929.3161015-1-pedro@palves.net>
A following patch will make gdb_test error out if bogus arguments are
passed, which exposed bugs in a few testcases:
- gdb.python/py-parameter.exp, passing a spurious "1" as extra
parameter, resulting in:
ERROR: Unexpected arguments: {set test-file-param bar.txt} {The name of the file has been changed to bar.txt} {set new file parameter} 1
- gdb.python/py-xmethods.exp, a missing test message, resulting in
the next gdb_test being interpreted as message, question and
response! With the enforcing patch, this was caught with:
ERROR: Unexpected arguments: {p g.mul<char>('a')} {From Python G<>::mul.*} gdb_test {p g_ptr->mul<char>('a')} {From Python G<>::mul.*} {after: g_ptr->mul<char>('a')}
- gdb.base/pointers.exp, missing a quote.
Change-Id: I66f2db4412025a64121db7347dfb0b48240d46d4
---
gdb/testsuite/gdb.base/pointers.exp | 2 +-
gdb/testsuite/gdb.python/py-parameter.exp | 2 +-
gdb/testsuite/gdb.python/py-xmethods.exp | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index bca8377637b..db60b2bf540 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -209,7 +209,7 @@ gdb_test "print **ptr_to_ptr_to_float" " = 100" \
gdb_test "break marker1" ".*" ""
gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" \
- continue to marker1"
+ "continue to marker1"
gdb_test "up" "more_code.*" "up from marker1"
gdb_test "print *pUC" " = 21 \'.025\'.*" "print value of *pUC"
diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index 98d4b2d4684..199d3bc16ec 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -199,7 +199,7 @@ proc_with_prefix test_file_parameter { } {
"The name of the file is foo.txt.*" "show initial file value"
gdb_test "set test-file-param bar.txt" \
"The name of the file has been changed to bar.txt" \
- "set new file parameter" 1
+ "set new file parameter"
gdb_test "show test-file-param" \
"The name of the file is bar.txt.*" "show new file value"
gdb_test "python print (test_file_param.value)" \
diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp
index f879e9c15a2..18057782143 100644
--- a/gdb/testsuite/gdb.python/py-xmethods.exp
+++ b/gdb/testsuite/gdb.python/py-xmethods.exp
@@ -130,6 +130,7 @@ gdb_test "p g.size_mul< 5 >()" "From Python G<>::size_mul.*" \
gdb_test "p g.mul<double>(2.0)" "From Python G<>::mul.*" \
"after: g.mul<double>(2.0)"
gdb_test "p g.mul<char>('a')" "From Python G<>::mul.*" \
+ "after: g.mul<char>('a')"
gdb_test "p g_ptr->mul<char>('a')" "From Python G<>::mul.*" \
"after: g_ptr->mul<char>('a')"
--
2.26.2
next prev parent reply other threads:[~2022-03-30 19:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 19:29 [PATCH 0/5] Make gdb_test's question non-optional if specified Pedro Alves
2022-03-30 19:29 ` [PATCH 1/5] Remove gdb_test questions that GDB doesn't ask Pedro Alves
2022-03-30 19:29 ` [PATCH 2/5] gdb.base/scope.exp: Remove bogus gdb_test questions Pedro Alves
2022-03-30 19:29 ` Pedro Alves [this message]
2022-03-30 19:29 ` [PATCH 4/5] Avoid having to unload file in gdb.server/connect-with-no-symbol-file.exp Pedro Alves
2022-03-30 19:29 ` [PATCH 5/5] Make gdb_test's question non-optional if specified Pedro Alves
2022-04-07 20:31 ` Bruno Larsen
2022-04-08 12:18 ` Pedro Alves
2022-05-17 10:13 ` [PATCH 5/6] gdb.base/skip.exp: Don't abuse gdb_test's question support (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-16 16:01 ` [PATCH 5/5] Make gdb_test's question non-optional if specified Tom Tromey
2022-05-17 11:25 ` Pedro Alves
2022-05-17 22:48 ` Tom Tromey
2022-05-18 11:01 ` [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-18 12:15 ` Tom de Vries
2022-05-18 12:36 ` Pedro Alves
2022-05-18 14:13 ` Pedro Alves
2022-05-18 14:49 ` Tom de Vries
2022-05-18 20:34 ` Tom Tromey
2022-05-19 12:42 ` Pedro Alves
2022-05-23 10:48 ` Tom de Vries
2022-05-23 12:01 ` Tom de Vries
2022-05-23 12:50 ` [committed][gdb/testsuite] Fix -prompt handling in gdb_test Tom de Vries
2022-05-23 12:53 ` [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) Pedro Alves
2022-05-17 11:41 ` [PATCH 5/5] Make gdb_test's question non-optional if specified Simon Marchi
2022-05-17 12:04 ` Pedro Alves
2022-05-16 16:02 ` [PATCH 0/5] " Tom Tromey
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=20220330192929.3161015-4-pedro@palves.net \
--to=pedro@palves.net \
--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).