Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Marc Khouzam <marc.khouzam@ericsson.com>
To: "'gdb@sourceware.org'" <gdb@sourceware.org>
Subject: UTF-8 not working for MI?
Date: Thu, 19 Aug 2010 17:25:00 -0000	[thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC5716E94E4D@EUSAACMS0703.eamcs.ericsson.se> (raw)

Hi,

I've noticed that in MI mode, gdb does not show UTF-8 characters properly.
Please see short session comparaison below.
Surprisingly, I get proper output when using an MI command from CLI mode.

Is there a setting I'm supposed to turn on when using MI mode? or is this
a bug?  If it is a bug, I can open a PR.

Thanks

Marc


Program
1       wchar_t a = 0xe4; // ä
2       int main()
3       {
4           return 0;
5       }

> gdb -nx a.out
GNU gdb (GDB) 7.2.50.20100816-cvs
(gdb) p a
$1 = 228 L'ä'
(gdb) interpreter-exec mi "-var-create - * a"
^done,name="var1",numchild="0",value="228 L'ä'",type="wchar_t",has_more="0"
(gdb) show charset 
The host character set is "auto; currently UTF-8".
The target character set is "auto; currently UTF-8".
The target wide character set is "auto; currently UTF-32".

=====

> gdb -i mi -nx a.out
=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.2.50.20100816-cvs\n"
(gdb) -gdb-show charset
^done,value="auto"
(gdb) p a
&"p a\n"
~"$1 = 228 L'\303\244'"
~"\n"
^done
(gdb) -var-create - * a
^done,name="var1",numchild="0",value="228 L'\303\244'",type="wchar_t",has_more="0"
(gdb) show charset 
&"show charset \n"
~"The host character set is \"auto; currently UTF-8\".\n"
~"The target character set is \"auto; currently UTF-8\".\n"
~"The target wide character set is \"auto; currently UTF-32\".\n"
^done


             reply	other threads:[~2010-08-19 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 17:25 Marc Khouzam [this message]
2010-08-19 18:20 ` Tom Tromey
2010-08-20  1:57   ` Marc Khouzam
2010-08-20 18:51     ` Tom Tromey
2010-08-27 15:21       ` Marc Khouzam
2010-08-27 16:45         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F7CE05678329534C957159168FA70DEC5716E94E4D@EUSAACMS0703.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox