]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/valprint.c
Fix bad interaction between element limit and repeated values (BZ#24331).
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 8 May 2023 01:03:42 +0000 (01:03 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Sat, 13 May 2023 18:10:05 +0000 (18:10 +0000)
commitd2b585f3cfc253678bf33b552a219e25eb29e686
treed2dee89582caa642cbc98422ed25483e3acf64dd
parent249d1bad51b568c74ea37e8b3e76c179eb53a733
Fix bad interaction between element limit and repeated values (BZ#24331).

Currently

  print -elements=3 -- "AAAAAA"

prints complete string, which is not what the user asked for.

Fix two buggy tests exposed by the fix, and add a new test.

Reviewed-by: Keith Seitz <keiths@redhat.com>
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.python/py-format-string.exp
gdb/valprint.c