From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24784 invoked by alias); 30 Mar 2010 20:33:25 -0000 Received: (qmail 24776 invoked by uid 22791); 30 Mar 2010 20:33:24 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 20:33:18 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2UKX5md009766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Mar 2010 16:33:06 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2UKX4CB029764; Tue, 30 Mar 2010 16:33:05 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2UKX3b2002500; Tue, 30 Mar 2010 16:33:04 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 4D437378185; Tue, 30 Mar 2010 14:33:03 -0600 (MDT) From: Tom Tromey To: "Pierre Muller" Cc: "'Eli Zaretskii'" , Subject: Re: [RFC] Allow explicit 16 or 32 char in 'x /s' References: <11484.4708740295$1268865815@news.gmane.org> <83r5ngix6d.fsf@gnu.org> <15103.6087111153$1269298497@news.gmane.org> Reply-To: tromey@redhat.com Date: Tue, 30 Mar 2010 20:33:00 -0000 In-Reply-To: <15103.6087111153$1269298497@news.gmane.org> (Pierre Muller's message of "Mon, 22 Mar 2010 23:54:34 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01083.txt.bz2 >>>>> "Pierre" == Pierre Muller writes: Pierre> But I don't know exactly for other languages and I would like Pierre> to be sure about what you want me to add to the docs... I think no other language has been updated to deal with wide characters. Pierre> Furthermore if you look into charset_for_string_type Pierre> function in c-lang.c source, you will see that there are two FIXME Pierre> just right at the position of these charset name settings. Yeah ... those are actually pedantic FIXMEs, in that (IIRC) nothing guarantees that char16_t==UTF-16, even though that is the common meaning. Pierre> To answer Tom's concern about the change in classify_type function, Pierre> I modified my patch to change the elttype in do_examine to match exactly Pierre> what is expected by charset_for_string_type function. Pierre> Thus this new version has no modification in c-lang.c file. Suppose the inferior does not define char16_t. Won't this new code allocate a new type each time the user uses x/hs? That seems bad. What about passing the desired encoding to LA_PRINT_STRING, via a new argument to val_print_string? That makes the patch a lot bigger, though it is mostly mechanical. Pierre> I also added a very basic check for string display using 'x Pierre> /hs' and 'x /ws'. Thanks. Pierre> + case 's': Pierre> + /* Display strings with byte size chars unless explicitly specified. Pierre> */ Pierre> + val.size = 'b'; Pierre> + break; I think x/hs followed by x should probably print another wide string. I couldn't tell offhand if it does this or not. Tom