I managed to build from source code a gdb which correctly shows Cyrillic
characters (and probably all other UTF-8 encoded characters which the
console font supports) in the source code window. But in order to write
an acceptable gdb patch, I would need to study the configuration
scripts, which isn't easy. So, for now, may the following information be
useful to anyone who would like to build their own gdb which correctly
displays UTF-8 encoded characters in the source code window.

In order to do this, gdb needs to be:

1) patched so that instead of the "ncurses" headers and library, it uses
the wide-character "ncursesw", which decodes the UTF-8 encoded multi-
byte characters correctly.

2) configured with --enable-tui and --with-curses switches, among the
other eventually needed switches (the existing ones can be examined with
the "show config" gdb command, and then applied to "configure". Sure,
several needed additional packages will have to be installed, too).

To accomplish (1), I wrote the following "slow and dirty" script which
changes many more occurrences of "ncurses" than necessary, but surely
changes also those that really need to be changed, among them:

# Please be patient: this script is very slow!
find gdb -type f | xargs sed -si 's/ncurses/ncursesw/g'
find gdb -type f | xargs sed -si 's|ncursesw/ncursesw|ncursesw/curses|g'

It's written for the case when "sudo apt-get install gdb-source" is
executed to get the current gdb source archive, which is then extracted.
If extracting another archive with some other top level directory name,
the "gdb" in the above script must be changed to match that name.

Hope this helps, and once again, sorry that at least at the moment I
can't provide a good patch. By the way, the bug is fixed in FreeBSD-11,
albeit its gdb is an older version (6.1.1). If someone could find their
patch that accomplished this, that would be even more helpful. But, as I
wrote, it would be a patch against version 6.1.1, so it would probably
need to be edited for the newer one. Why this new release of FreeBSD
uses an old gdb version? I don't know, ask them.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1275210

Title:
  gdbtui does not give input and show cyrillic symbols

Status in gdb package in Ubuntu:
  New

Bug description:
  
┌──main.c────────────────────────────────────────────────────────────────────────────────┐
     │1       #include <stdio.h>                                                
                                                               │
     │2                                                                         
                                                               │
     │3       int main()                                                        
                                                               │
     │4       {                                                                 
                                                               │
     │5               printf("M-P~_M-Q~@M-PM-8M-PM-2M-PM-5M-Q~B 
M-P~\M-PM-8M-Q~@\n");                                                          │
     │6               return 0;                                                 
                                                               │
     │7       }                                                                 
                                                               │
     │8                                                                         
                                                                                
                                                                                
                                   │
     
└─────────────────────────────────────────────────────────────────────────────────────┘
  exec No process In:                                                           
                                              Line: ??   PC: ??
  GNU gdb (GDB) 7.6.1-ubuntu
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  For bug reporting instructions, please see:
  <http://www.gnu.org/software/gdb/bugs/>...
  Reading symbols from /home/eldar/hello...done.
  (gdb) M-Q~GM-Q~BM-PM-> M-Q~BM-PM-0M-PM-:M-PM->M-PM-5

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1275210/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to