From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2871 invoked by alias); 29 Sep 2015 09:18:32 -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 2121 invoked by uid 89); 29 Sep 2015 09:18:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Sep 2015 09:18:25 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NVF00400LLTYF00@a-mtaout20.012.net.il> for gdb@sourceware.org; Tue, 29 Sep 2015 12:18:03 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVF004UZLTYPZ40@a-mtaout20.012.net.il> for gdb@sourceware.org; Tue, 29 Sep 2015 12:17:59 +0300 (IDT) Date: Tue, 29 Sep 2015 09:18:00 -0000 From: Eli Zaretskii Subject: GDB/MI reporting non-ASCII file names To: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a8s5d1nw.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00029.txt.bz2 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. TIA