From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94409 invoked by alias); 30 Sep 2015 11:52:30 -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 94398 invoked by uid 89); 30 Sep 2015 11:52:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 30 Sep 2015 11:52:28 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0F093461EA; Wed, 30 Sep 2015 11:52:26 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8UBqPe3028357; Wed, 30 Sep 2015 07:52:26 -0400 Message-ID: <560BCCF9.2040202@redhat.com> Date: Wed, 30 Sep 2015 11:52: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 , gdb@sourceware.org Subject: Re: GDB/MI reporting non-ASCII file names References: <83a8s5d1nw.fsf@gnu.org> In-Reply-To: <83a8s5d1nw.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-09/txt/msg00031.txt.bz2 On 09/29/2015 10:18 AM, Eli Zaretskii wrote: > It seems that "gdb -i=mi" reports non-ASCII characters in filenames as > octal escapes. Here's an example from a GNU/Linux system whose > locale's codeset is UTF-8: > > (gdb) > -file-list-exec-source-file > ^done,line="1",file="/home/e/eliz/\320\277\321\200\320\276\320\262\320\265\321\200\320\272\320\260.c",fullname="/srv/data/home/e/eliz/\320\277\321\200\320\276\320\262\320\265\321\200\320\272\320\260.c",macro-info="1" > > Each of these \nnn is a string of literal ASCII characters, not a > single byte whose octal value is nnn. Why does MI do this? Where in > GDB do we convert bytes into this representation, and is there any way > of asking MI not to make these conversions? > > The reason for these questions is that Emacs's GDB interface fails to > recognize the original file name that hides behind these escapes, and > the result is that debugging a program whose source file names include > non-ASCII characters fails to display the source files through which > GDB steps. > > It is, of course, possible to decode these escapes on Emacs's side. > But since many MI output records include file-name fields, doing so > everywhere is quite a PITA. So if there's a way to avoid the need for > decoding in the first place, it's preferable. I happened to stumble on this discussion yesterday: https://www.sourceware.org/ml/gdb/2012-03/msg00001.html Which points at: https://sourceware.org/ml/gdb/2010-08/msg00129.html Thanks, Pedro Alves