From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26983 invoked by alias); 14 Apr 2006 19:22:52 -0000 Received: (qmail 26969 invoked by uid 22791); 14 Apr 2006 19:22:51 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Apr 2006 19:22:49 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k3EJLnBM025895; Fri, 14 Apr 2006 21:21:50 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3EJLn7r015535; Fri, 14 Apr 2006 21:21:49 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3EJLn4e005595; Fri, 14 Apr 2006 21:21:49 +0200 (CEST) Date: Fri, 14 Apr 2006 19:53:00 -0000 Message-Id: <200604141921.k3EJLn4e005595@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: jimb@red-bean.com CC: eliz@gnu.org, ghost@cs.msu.su, gdb@sources.redhat.com In-reply-to: <8f2776cb0604141053v73e512e3o2d1c9086312316bd@mail.gmail.com> (jimb@red-bean.com) Subject: Re: printing wchar_t* References: <200604141257.41690.ghost@cs.msu.su> <200604141837.26618.ghost@cs.msu.su> <8f2776cb0604141053v73e512e3o2d1c9086312316bd@mail.gmail.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00207.txt.bz2 > Date: Fri, 14 Apr 2006 10:53:44 -0700 > From: "Jim Blandy" > > I think folks are seeing difficult problems where there aren't any. > Even if the host character set (that is, the character set GDB is > using to communicate with its user, or in its MI communications) is > plain, old ASCII, GDB can, without any loss of information, convey the > contents of a wide string using an arbitrary target character set via > MI to a GUI, using code the GUI must already have. > > Suppose we have a wide string where wchar_t values are Unicode code > points. Suppose our host character set is plain ASCII. Suppose the > user's program has a string containing the digits '123', followed by > some funky Tibetan characters U+0F04 U+0FCC, followed by the letters > 'xyz'. When asked to print that string, GDB should print the > following twenty-one ASCII characters: > > L"123\x0f04\x0fccxyz" > > Since this is a valid way to write that string in a source program, a > user at the GDB command line should understand it. Since consumers of > MI information must contain parsers for C values already, they can > reliably find the contents of the string. I think this makes an awful lot of sense. Mark