Update comments for the gdb/24331 fix.
Commit Message
On Mon, May 15, 2023 at 2:43 AM Andrew Burgess <aburgess@redhat.com> wrote:
>
> It's fine to reference the bug, but could you expand this comment to say
> what's actually being tested, e.g.
Sorry, I've already committed previous patch.
Ok to commit this one?
Thanks,
---
gdb/testsuite/gdb.base/printcmds.exp | 5 ++++-
gdb/testsuite/gdb.python/py-format-string.exp | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)
Comments
Paul Pluzhnikov <ppluzhnikov@google.com> writes:
> On Mon, May 15, 2023 at 2:43 AM Andrew Burgess <aburgess@redhat.com> wrote:
>>
>> It's fine to reference the bug, but could you expand this comment to say
>> what's actually being tested, e.g.
>
> Sorry, I've already committed previous patch.
> Ok to commit this one?
LGTM.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks,
Andrew
>
> Thanks,
>
> ---
> gdb/testsuite/gdb.base/printcmds.exp | 5 ++++-
> gdb/testsuite/gdb.python/py-format-string.exp | 2 --
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
> index f2be549f2a5..2506f745f20 100644
> --- a/gdb/testsuite/gdb.base/printcmds.exp
> +++ b/gdb/testsuite/gdb.base/printcmds.exp
> @@ -1077,7 +1077,10 @@ proc test_repeat_bytes {} {
> }
> }
>
> -# Test for BZ#24331
> +# Test that 'set elements' correctly limits the number of characters
> +# printed from a string when a string ends with repeated characters.
> +# This is gdb/24331
> +
> proc test_repeat_bytes_limit {} {
> gdb_test "print -elem 3 -- \"AAAAA\"" "= \"AAA\"..."
> gdb_test "print -char 3 -elem 10 -- \"AAAAA\"" "= \"AAA\"..."
> diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp
> index 2a011ebd45a..55a37766bff 100644
> --- a/gdb/testsuite/gdb.python/py-format-string.exp
> +++ b/gdb/testsuite/gdb.python/py-format-string.exp
> @@ -745,8 +745,6 @@ proc test_max_string_one { setting unlimited } {
> "${default_pointer_regexp} \"hel\"..."
> check_format_string "a_binary_string" $opts \
> "${default_pointer_regexp} \"hel\"..."
> - # This will print four characters instead of three, see
> - # <https://sourceware.org/bugzilla/show_bug.cgi?id=24331>.
> check_format_string "a_binary_string_array" $opts \
> "\"hel\"..."
> check_format_string "a_big_string" $opts \
> --
> 2.40.1.606.ga4b1b128d6-goog
@@ -1077,7 +1077,10 @@ proc test_repeat_bytes {} {
}
}
-# Test for BZ#24331
+# Test that 'set elements' correctly limits the number of characters
+# printed from a string when a string ends with repeated characters.
+# This is gdb/24331
+
proc test_repeat_bytes_limit {} {
gdb_test "print -elem 3 -- \"AAAAA\"" "= \"AAA\"..."
gdb_test "print -char 3 -elem 10 -- \"AAAAA\"" "= \"AAA\"..."
@@ -745,8 +745,6 @@ proc test_max_string_one { setting unlimited } {
"${default_pointer_regexp} \"hel\"..."
check_format_string "a_binary_string" $opts \
"${default_pointer_regexp} \"hel\"..."
- # This will print four characters instead of three, see
- # <https://sourceware.org/bugzilla/show_bug.cgi?id=24331>.
check_format_string "a_binary_string_array" $opts \
"\"hel\"..."
check_format_string "a_big_string" $opts \