]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use generic_printstr from ada_language::printstr
authorTom Tromey <tromey@adacore.com>
Mon, 2 Dec 2024 19:37:28 +0000 (12:37 -0700)
committerTom Tromey <tromey@adacore.com>
Thu, 12 Dec 2024 14:41:12 +0000 (07:41 -0700)
commitf6dcf290ce55686474bedb3feeadd82f215e170b
tree50bb542ba23e4af80284297691d565ca802310ac
parent267749aeb02ae0bcd040d45cf4157462e571d96b
Use generic_printstr from ada_language::printstr

Currently, if you create a lazy string while in Ada language mode, the
string will be rendered strangely, like:

    "["d0"]["9f"]["d1"]["80"]["d0"]["b8"]...

This happens because ada_printstr does not really handle UTF-8
decoding.

This patch changes ada_language::printstr to use generic_printstr when
UTF-8 is used.

Note that this code could probably be improved some more -- the
current patch only addresses the narrow case of the Python API.  I've
filed a follow-up bug (PR ada/32413) for the remaining changes.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/ada-lang.c
gdb/testsuite/gdb.ada/lazy-string.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/lazy-string/main.adb [new file with mode: 0644]