From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9913 invoked by alias); 30 Sep 2015 15:52:06 -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 9835 invoked by uid 89); 30 Sep 2015 15:52:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout22.012.net.il Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Sep 2015 15:52:03 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NVH00000Y87BN00@a-mtaout22.012.net.il> for gdb@sourceware.org; Wed, 30 Sep 2015 18:52:00 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVH00MT8YQOZ190@a-mtaout22.012.net.il>; Wed, 30 Sep 2015 18:52:00 +0300 (IDT) Date: Wed, 30 Sep 2015 15:52:00 -0000 From: Eli Zaretskii Subject: Re: GDB/MI reporting non-ASCII file names In-reply-to: <560BF686.1030400@redhat.com> To: Pedro Alves Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a8s3c3c3.fsf@gnu.org> References: <83a8s5d1nw.fsf@gnu.org> <560BCCF9.2040202@redhat.com> <83bnckasck.fsf@gnu.org> <560BF686.1030400@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00035.txt.bz2 > Date: Wed, 30 Sep 2015 15:49:42 +0100 > From: Pedro Alves > CC: gdb@sourceware.org > > >> https://sourceware.org/ml/gdb/2010-08/msg00129.html > > > > Thanks. So it's hard-wired in MI, and the grammar requires that. Too > > bad. > > We can always extend it. Maybe we just need to document that ascii is > the default, and that frontends should > issue -gdb-set print sevenbit-strings off if they want non-ascii? > Seems like Eclipse ended up doing that. But "-gdb-set print sevenbit-strings off" doesn't seem to work: I get spurious "\200" strings which disrupt the whole sequence. I thought that was because 7-bit strings were a requirement in MI, for some reason. But now I think the culprit is this part of printchar: if (c < 0x20 || (c >= 0x7F && c < 0xA0) || <<<<<<<<<<<<<<<<<<<<<<<<<<<<< (sevenbit_strings && c >= 0x80)) This produces octal escapes for characters in 0x7F..0x8F regardless of the value of sevenbit_strings, which does the wrong thing with non-leading bytes of UTF-8 sequences. If you compile a program from a source file whose name includes non-ASCII characters, then debug that program with -i=mi, do you see the file names correctly, after turning 7 bits off? Btw, I see valid non-ASCII file names when I use CLI and the annotations instead. So does this mean we don't use printchar for emitting file names in that case?