From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10731 invoked by alias); 9 Oct 2015 16:48:26 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10722 invoked by uid 89); 9 Oct 2015 16:48:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.5 required=5.0 tests=AWL,BAYES_50,BODY_8BITS,GARBLED_BODY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 09 Oct 2015 16:48:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 191F82FE830; Fri, 9 Oct 2015 16:48:24 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t99GmMvi027028; Fri, 9 Oct 2015 12:48:23 -0400 Message-ID: <5617EFD6.9020000@redhat.com> Date: Fri, 09 Oct 2015 16:48:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb@sourceware.org Subject: Re: GDB/MI reporting non-ASCII file names References: <83a8s5d1nw.fsf@gnu.org> <560BCCF9.2040202@redhat.com> <83bnckasck.fsf@gnu.org> <560BF686.1030400@redhat.com> <83a8s3c3c3.fsf@gnu.org> <5617A0FD.3020208@redhat.com> <83si5ktbgf.fsf@gnu.org> In-Reply-To: <83si5ktbgf.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2015-10/txt/msg00037.txt.bz2 On 10/09/2015 02:31 PM, Eli Zaretskii wrote: >> >> But with a file named "γλώσσα.c" + "set print sevenbit-strings off": >> >> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x00000000004004fb",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffd808"}],file="γλ�\216�\203�\203α.c",fullname="/home/pedro/gdb/tests/γλ�\216�\203�\203α.c",line="5"},thread-id="1",stopped-threads="all",core="3" >> =breakpoint-deleted,id="1" >> (gdb) > > I think the 0x7F..0xA0 range is a left-over from the Latin-N era, and > is a bad idea with the current UTF-8 default. > > Would something like the following be acceptable (if accompanied with > the suitable changes to NEWS and the manual)? > I wonder whether we should we use isprint instead of removing the condition entirely? If this could be covered by a test it'd be great. Thanks, Pedro Alves > diff --git a/gdb/utils.c b/gdb/utils.c > index afeff12..56eb9d5 100644 > --- a/gdb/utils.c > +++ b/gdb/utils.c > @@ -1509,12 +1509,11 @@ printchar (int c, void (*do_fputs) (const char *, struct ui_file *), > void (*do_fprintf) (struct ui_file *, const char *, ...) > ATTRIBUTE_FPTR_PRINTF_2, struct ui_file *stream, int quoter) > { > - c &= 0xFF; /* Avoid sign bit follies */ > + c &= 0xFF; /* Avoid sign bit follies */ > > - if (c < 0x20 || /* Low control chars */ > - (c >= 0x7F && c < 0xA0) || /* DEL, High controls */ > - (sevenbit_strings && c >= 0x80)) > - { /* high order bit set */ > + if (c < 0x20 || /* Low control chars */ > + (sevenbit_strings && c >= 0x80)) /* High order bit set */ > + { > switch (c) > { > case '\n': >