From f6dcf290ce55686474bedb3feeadd82f215e170b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 2 Dec 2024 12:37:28 -0700 Subject: 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 --- gdb/testsuite/gdb.ada/lazy-string/main.adb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gdb/testsuite/gdb.ada/lazy-string/main.adb (limited to 'gdb/testsuite/gdb.ada/lazy-string/main.adb') diff --git a/gdb/testsuite/gdb.ada/lazy-string/main.adb b/gdb/testsuite/gdb.ada/lazy-string/main.adb new file mode 100644 index 0000000..b5ccd01 --- /dev/null +++ b/gdb/testsuite/gdb.ada/lazy-string/main.adb @@ -0,0 +1,25 @@ +-- Copyright 2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +procedure Main is + + procedure Blah (Arg : String) is + begin + null; -- STOP + end; + +begin + Blah ("funçao"); +end Main; -- cgit v1.1