From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15075 invoked by alias); 12 Jun 2014 14:39:35 -0000 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 Received: (qmail 15057 invoked by uid 89); 12 Jun 2014 14:39:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jun 2014 14:39:32 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Wv6A3-0004MG-Al from Yao_Qi@mentor.com ; Thu, 12 Jun 2014 07:39:27 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 12 Jun 2014 07:39:27 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Thu, 12 Jun 2014 07:39:26 -0700 Message-ID: <5399BB32.5050409@codesourcery.com> Date: Thu, 12 Jun 2014 14:39:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pedro Alves CC: Tom Tromey , Joel Brobecker , Subject: Re: [ping] [PATCH] Different outputs affected by locale References: <1401192650-29688-1-git-send-email-yao@codesourcery.com> <538EAEE5.2080708@codesourcery.com> <20140604124708.GR4289@adacore.com> <538F1CC3.9090605@codesourcery.com> <87oay8a0t6.fsf@fleche.redhat.com> <538F803A.9020007@redhat.com> <538FE412.1050806@codesourcery.com> <53903119.6000204@redhat.com> <53903EE5.8090107@codesourcery.com> <539042A2.4050409@redhat.com> <539571C6.40605@codesourcery.com> <53958862.5020106@redhat.com> <5397BCEC.8080300@codesourcery.com> <539990BD.9020504@redhat.com> In-Reply-To: <539990BD.9020504@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00504.txt.bz2 On 06/12/2014 07:36 PM, Pedro Alves wrote: > What does "show host-charset" show on Windows, before and after > you make GDB pick LC_CTYPE=C from the environment (with the > setlocale gnulib module)? GDB on Windows gets host charset from GetACP(), in charset.c:_initialize_charset (). #elif defined (USE_WIN32API) { /* "CP" + x<=5 digits + paranoia. */ static char w32_host_default_charset[16]; snprintf (w32_host_default_charset, sizeof w32_host_default_charset, "CP%d", GetACP()); auto_host_charset_name = w32_host_default_charset; auto_target_charset_name = auto_host_charset_name; } #endif GetACP doesn't depend on locale, so I don't think LC_CTYPE=C affects the host-charset in GDB. However, I do this: printf ("%d\n", GetACP()); setlocale (LC_CTYPE, ""); printf ("%d\n", GetACP()); setlocale (LC_CTYPE, "C"); printf ("%d\n", GetACP()); On my Windows machine, 1252 is printed three times. > > (Ideally, the wchar tests would actually iterate testing GDB > behaves as expected with different values of LC_CTYPE, etc. set > in the environment. With all other tests assuming ASCII as set > by default by the testsuite framework.) On the condition that we know or enumerate the expected output for wchars under each LC_CTYPE on different host (or OS). Test like this is out of the scope of GDB (or debugger) testing, IMO. -- Yao (齐尧)