From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25285 invoked by alias); 17 Sep 2009 08:50:51 -0000 Received: (qmail 25276 invoked by uid 22791); 17 Sep 2009 08:50:51 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_PASS X-Spam-Check-By: sourceware.org Received: from sam.opera.com (HELO smtp.opera.com) (213.236.208.81) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Sep 2009 08:50:44 +0000 Received: from xman.oslo.opera.com (pat-tdc.opera.com [213.236.208.22]) (authenticated bits=0) by smtp.opera.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id n8H8oeSl010169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 17 Sep 2009 08:50:41 GMT Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: gdb-patches@sourceware.org Subject: Re: Default target wide character set References: Date: Thu, 17 Sep 2009 08:50:00 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Alexey Feldgendler" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-IsSubscribed: yes 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: 2009-09/txt/msg00559.txt.bz2 On Wed, 16 Sep 2009 20:55:52 +0200, Tom Tromey wrote: > I don't know your copyright assignment situation, but if you are > planning to submit patches, it doesn't hurt to get started on that > early. Send me email off-list if you want to do this. Sure, I'll make any small fix that makes sense on its own as a separate patch. Alexey>> Side question: how does gdb figure out sizeof(wchar_t)? Does it Alexey>> come from the symbol table or from elsewhere? > Yeah, look in c-lang.c for a call to lookup_typename with an argument of > "wchar_t". The resulting type can be queried for its attributes. What happens then no symbol table is available? > What I would propose doing is adding a new charset named "UCS". If this > is selected as the target wide charset, then we would automatically pick > UCS-2 or UCS-4 depending on sizeof(target wchar_t). This would probably > mean having a few special cases in the code (like we do for the -BE and > -LE variants). We would then make this the default target wide charset. > > What do you think of that? I think it's a very good idea. Indeed, it's much more user-friendly to have an auto-sensing option with clearly defined semantics. On Wed, 16 Sep 2009 22:40:01 +0200, Eli Zaretskii wrote: > AFAIK, Windows (whose wchar_t is 16-bit) uses UTF-16, not UCS-2. > > What other platforms have a 16-bit wchar_t, and are you sure any > significant portion of them use UCS-2 (which is an obsolete encoding, > AFAIK)? Because UCS-2 is a subset of UTF-16, it won't hurt to just change all uses of UCS-2 in gdb to UTF-16. On Wed, 16 Sep 2009 22:46:30 +0200, Tom Tromey wrote: > We could name it "auto" then. I agree, and make it default. Seems we agree here, I'll submit a patch soon. -- Alexey Feldgendler Software Developer, Desktop Team, Opera Software ASA [ICQ: 115226275] http://my.opera.com/feldgendler/