From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25759 invoked by alias); 22 Oct 2013 18:24:39 -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 25732 invoked by uid 89); 22 Oct 2013 18:24:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2013 18:24:37 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9MIOGAT030955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Oct 2013 14:24:17 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9MIOFMw022202 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 22 Oct 2013 14:24:16 -0400 Message-ID: <5266C2CF.6090309@redhat.com> Date: Tue, 22 Oct 2013 18:24:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pierre Muller CC: "'gdb-patches'" Subject: Re: [RFC 1/6 -V2] Fix display of tabulation character for mingw hosts. References: <002901cebaf2$35ec65a0$a1c530e0$@muller@ics-cnrs.unistra.fr> <002c01cebaf2$89798ea0$9c6cabe0$@muller@ics-cnrs.unistra.fr> <524A230B.5020304@redhat.com> <001501cebe7c$990fba50$cb2f2ef0$@muller@ics-cnrs.unistra.fr> In-Reply-To: <001501cebe7c$990fba50$cb2f2ef0$@muller@ics-cnrs.unistra.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00699.txt.bz2 On 10/01/2013 01:02 AM, Pierre Muller wrote: >> -----Message d'origine----- >> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches- >> owner@sourceware.org] De la part de Keith Seitz >> Envoyé : mardi 1 octobre 2013 03:19 >> À : Pierre Muller >> Cc : 'gdb-patches' >> Objet : Re: [RFC 1/6] Fix display of tabulation character for mingw hosts. >> > Yes, I must confess that I broke more coding style rules > than I usually do here, sorry about that... It happens to all of us; don't worry about it. >> Does this fix the output of many tests in the test suite already? If >> not, it would be really, really nice to have a test to check (and >> demonstrate) this quirk. > > It does fix 2 failures inside printcmds.exp > > 288-p ctable1[9] > 289:$50 = 9 '\t' > 290-(gdb) PASS: gdb.base/printcmds.exp: p ctable1[9] > 291-p ctable1[10] > 292-$51 = 10 '\n' > -- > 1869-$560 = (unsigned char *) "\001\002\003\004\005\006\a\b"... > 1870-(gdb) PASS: gdb.base/printcmds.exp: p &ctable1[1] > 1871-p &ctable1[1*8] > 1872:$561 = (unsigned char *) "\b\t\n\v\f\r\016\017"... > 1873-(gdb) PASS: gdb.base/printcmds.exp: p &ctable1[1*8] > 1874-p &ctable1[2*8] > 1875-$562 = (unsigned char *) > "\020\021\022\023\024\025\026\027"... > > Is this enough? Yes, I just wanted to make sure that if this regressed, it would be caught by some test. I am still having difficulties running tests on MinGW. > Here is a new patch version. > To avoid the very complicated preprocessor checks that decides if we > use wide chars inside gdb_wchar.h, I added a new macro > HAVE_MINGW_GDB_ISWPRINT. > While the idea seems good to me, I am unsure about the choice > of this macro name, are there similar examples already inside the code? To be honest, I'm not a really big fan of putting platform-specific knowledge into the source code without abstraction, but in this case, the alternative of creating, e.g., a nm.h file for this and replicating all the #if ... logic in gdb_wchar.h is even less appealing to me. [There is some precedent for this approach, too.] I would just drop the "MINGW" part of the name. There's always the possibility that some other platform might require a similar workaround. Perhaps a maintainer will chime in here with a more elegant/attractive/appropriate approach. > ChangeLog entry: > > 2013-10-01 Pierre Muller > > Fix display of tabulation character for MinGW hosts. > * gdb_wchar.h (gdb_iswprint): Declare as external function > if __MINGW32__ macro is set. I think you can simply use: "Declare as external function on MinGW." > (HAVE_MINGW_GDB_ISWPRINT): New macro, declared only for > MinGW hosts using wide characters. > * mingw-hdep.c (gdb_iswprint): New function. > Implemented only if HAVE_MINGW_GDB_ISWPRINT macro is defined. The custom IIRC is to use: * mingw-hdep.c (gdb_iswprint) [HVAE_MINGW_ISWPRINT]: New function. I think it is time for a maintainer to review this. Keith