From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25504 invoked by alias); 17 Oct 2012 18:28:37 -0000 Received: (qmail 25492 invoked by uid 22791); 17 Oct 2012 18:28:35 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Wed, 17 Oct 2012 18:28:32 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HISVnH021847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Oct 2012 14:28:31 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9HISTOR007660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 17 Oct 2012 14:28:30 -0400 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: printing 0xbeef wchar_t on x86-windows... References: <20121015190052.GH3034@adacore.com> <87wqyq6tcl.fsf@fleche.redhat.com> <20121016224342.GH3050@adacore.com> <87fw5d7uck.fsf@fleche.redhat.com> <20121017145806.GK3050@adacore.com> Date: Wed, 17 Oct 2012 18:28:00 -0000 In-Reply-To: <20121017145806.GK3050@adacore.com> (Joel Brobecker's message of "Wed, 17 Oct 2012 07:58:06 -0700") Message-ID: <878vb52bsi.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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/msg00297.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> Thanks! I gave it a whirl, JIC, and as you suspected, it does not Joel> fix the 0xdeadbeef issue on Windows. It looks like a nice improvement, Joel> however - with maybe one comment which I will send by replying Joel> to the email... Thanks. FWIW the appended builds and regtests ok; but really it needs testing in your environment. Tom diff --git a/gdb/valprint.c b/gdb/valprint.c index 6e651f6..583329d 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2037,7 +2037,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, convert_between_encodings (INTERMEDIATE_ENCODING, host_charset (), obstack_base (&wchar_buf), obstack_object_size (&wchar_buf), - 1, &output, translit_char); + sizeof (gdb_wchar_t), &output, translit_char); obstack_1grow (&output, '\0'); fputs_filtered (obstack_base (&output), stream); @@ -2278,7 +2278,7 @@ generic_printstr (struct ui_file *stream, struct type *type, convert_between_encodings (INTERMEDIATE_ENCODING, host_charset (), obstack_base (&wchar_buf), obstack_object_size (&wchar_buf), - 1, &output, translit_char); + sizeof (gdb_wchar_t), &output, translit_char); obstack_1grow (&output, '\0'); fputs_filtered (obstack_base (&output), stream);