gdbtui source window does't display Unicode text

Bug #1866604 reported by Лъчезар Георгиев
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In Ubuntu 20.04, I discovered that the gdb 9 TUI source code window doesn't display properly the UTF-8 characters (Chinese, Cyrillic, etc.) but displays correctly only the ASCII ones. For example, the following source code

printf("Здравей, свят!\n");

appears in the source code window as

printf("^^P^ ^P^ ^Q^┗↑@^^P^ ^P^ ^P^ ^P^ ^^Q^┗↑╝^^P^ ^Q^ ^Q^ \n");

The command windows is not affected (when I type non-ASCII characters into it, they appear OK).

Additionally, I found out the following:

(1) This bug was introduced in version 8.3;
(2) It affects only some CPU architectures.

In more detail, I tested version "Debian 8.3.1-1" on two 64-bit machines with the same version of Debian (bullseye/sid), one with PowerPC, and the other with SPARC. The bug shows up only on the SPARC machine, not the PowerPC one. I then built the generic version 8.3.1 on a 64-bit ARM machine. The bug didn't show up there. And then, I built it on a 64-bit MIPS (big endian) machine, where the bug did show up. Repeated this with version 8.3. The bug showed up again. When I built the generic version 8.2.1 on the same MIPS machine, the bug didn't show up. A "diff -u gdb-8.2.1/gdb/tui gdb-8.3/gdb/tui" shows a lot of changes made in the TUI code of version 8.3 to add some colourisation to the TUI, and the bug was probably introduced during this process. Sorry that I can't help more to isolate the bug. But it's quite strange that it manifests itself only on x86-64 (as I had found out previously using Ubuntu 20-04), SPARC and MIPS, but not on ARM and PowerPC. I suppose that because of this, it will be rather hard to pinpoint.

This bug is similar to the already fixed bug 1275210 where I also described it but then realised that it has a different origin and is therefore a different bug, so I report it as a new one now. Someone already reported this bug as bug 25296 in the gdb Bugzilla which I confirmed there.

Tags: gdb gdbtui utf-8
Revision history for this message
melo.dc (melo.dc) wrote :

yes,i have this problem too.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdb (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.