From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7356 invoked by alias); 16 Oct 2012 23:31:42 -0000 Received: (qmail 7348 invoked by uid 22791); 16 Oct 2012 23:31:42 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Oct 2012 23:31:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6A7C21C7EB3; Tue, 16 Oct 2012 19:31:37 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9oxeMmsN5D7D; Tue, 16 Oct 2012 19:31:37 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DCE481C7D5A; Tue, 16 Oct 2012 19:31:36 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 769EEC4B79; Tue, 16 Oct 2012 16:31:30 -0700 (PDT) Date: Tue, 16 Oct 2012 23:31:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: printing 0xbeef wchar_t on x86-windows... Message-ID: <20121016233130.GJ3050@adacore.com> References: <20121015190052.GH3034@adacore.com> <87wqyq6tcl.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wqyq6tcl.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-10/txt/msg00266.txt.bz2 > Joel> * valprint.c:generic_emit_char calls wchar_iterate, and finds > Joel> one valid character according to the intermediate encoding > Joel> ("wchar_t"), even though the character isn't valid in the > Joel> original/target charset ("CP1252"). > generic_emit_char should be assuming that the character is in the target > wide charset, not in the target charset. That is, "show > target-wide-charset". > > If the 'encoding' argument to generic_emit_char is "CP1252" then I think > something went wrong earlier. OK, small correction: generic_emit_char was called with 'encoding' set to "UTF-16LE", which makes sense, given that it is what the windows (actually cygwin) -tdep file explicitly sets it to. I probably got confused in my notes with what was happening with GDB 7.5, or maybe just got confused period. Other than that, I think that the rest remains accurate, so it seem that... > And, this call to convert_between_encodings is converting from the > intermediate charset to the host charset. So, I think this should be > sizeof (gdb_wchar_t). ... would be the way to go, assuming that we're not waiting for Keith's patches. A small request: If Keith's patch is still some ways off, I'd love to have a fix put in while we wait. This bug, and a few other charset-related ones, have been nagging at me for a while, and with more important tasks, traveling and, hum, holidays, I haven't had the time to follow up as quickly as I'd like... Cheers! -- Joel