public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch v2] Fix cyrillic symbols show in tui
@ 2020-03-31  9:16 vaag
  2020-03-31 13:59 ` Simon Marchi
  2020-03-31 16:43 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: vaag @ 2020-03-31  9:16 UTC (permalink / raw)
  To: gdb-patches

From: Vahagn Vardanyan <vaag@ispras.ru>

Cyrillic symbols are truncated when assigned to signed char
and are shown as special symbols in tui.
The patch uses unsigned char to allow 256 bit encoding.

gdb/ChangeLog

        * tui/tui-winsource.c (tui_copy_source_line):
        Change type from char to unsigned char.
        * tui/tui-winsource.c (show_source_line):
        Use mvwaddstr instead of tui_puts.
---
 gdb/tui/tui-winsource.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index b5ba59e2f7..598b632e25 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -87,7 +87,7 @@ tui_copy_source_line (const char **ptr, int line_no, int first_col,
     }
 
   int column = 0;
-  char c;
+  unsigned char c;
   do
     {
       int skip_bytes;
@@ -260,8 +260,8 @@ tui_source_window_base::show_source_line (int lineno)
   if (line->is_exec_point)
     tui_set_reverse_mode (handle.get (), true);
 
-  wmove (handle.get (), lineno, TUI_EXECINFO_SIZE);
-  tui_puts (line->line.c_str (), handle.get ());
+  mvwaddstr (handle.get(), lineno, 4,
+               (char *) line->line.c_str ());
   if (line->is_exec_point)
     tui_set_reverse_mode (handle.get (), false);
 
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-05 20:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31  9:16 [patch v2] Fix cyrillic symbols show in tui vaag
2020-03-31 13:59 ` Simon Marchi
2020-03-31 16:43 ` Tom Tromey
2020-04-05 16:10   ` Tom Tromey
2020-04-05 20:41     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).