From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Date: Wed, 30 Sep 2015 20:52:24 +0300 Message-ID: <837fn7bxrb.fsf@gnu.org> References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1443686230 12467 80.91.229.3 (1 Oct 2015 07:57:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2015 07:57:10 +0000 (UTC) Cc: 21572@debbugs.gnu.org To: Augusto Fraga Giachero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 01 09:57:00 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZhYjb-0003vD-Nb for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 09:56:59 +0200 Original-Received: from localhost ([::1]:40366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYjb-0000sB-1q for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 03:56:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhLYw-0003IR-NO for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 13:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhLYs-00051c-Av for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 13:53:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhLYs-00051U-7Z for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 13:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZhLYr-0002at-Sh for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2015 13:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Sep 2015 17:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21572-submit@debbugs.gnu.org id=B21572.14436355559939 (code B ref 21572); Wed, 30 Sep 2015 17:53:01 +0000 Original-Received: (at 21572) by debbugs.gnu.org; 30 Sep 2015 17:52:35 +0000 Original-Received: from localhost ([127.0.0.1]:49506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhLYR-0002aF-EL for submit@debbugs.gnu.org; Wed, 30 Sep 2015 13:52:35 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:60713) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhLYO-0002a5-HS for 21572@debbugs.gnu.org; Wed, 30 Sep 2015 13:52:33 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NVI00J0047LEG00@mtaout29.012.net.il> for 21572@debbugs.gnu.org; Wed, 30 Sep 2015 20:53:19 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVI00NFU4CVOKC0@mtaout29.012.net.il>; Wed, 30 Sep 2015 20:53:19 +0300 (IDT) In-reply-to: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107111 Archived-At: > From: Augusto Fraga Giachero > Date: Sun, 27 Sep 2015 12:26:55 -0300 > > I'm having problems when trying to debug a program with gdb. The GUD > doesn't load the source files if they have any utf-8 character in their > names. I know that gdb replaces utf-8 characters with backslash and > their corresponding octal value, it seems that GUD isn't parsing these > octal sequences. They are just ASCII characters, so GUD had no reason to parse them. > Here is an part of my gdb-source-file-list: > > (... "/home/augusto/Projetos/Eletr\303\264nica/ARM/IoControl/src/main.c" > ...) > > The correct path should be: > /home/augusto/Projetos/EletrĂ´nica/ARM/IoControl/src/main.c > > I think it's not hard to fix it Actually, it's not very simple. GDB outputs octal escapes in every string, not just in file names, so decoding should be done on a very low level, where we don't yet know what is a file name and what is some other string (like a value of some string variable). We can decode that if we assume that all the strings output by GDB are encoded the same (in your case, probably UTF-8), and keeping fingers crossed that the communications channel between GBD and Emacs never breaks the 3-digit sequence due to buffering issues. I have a prototype fix along the above-mentioned lines which I will commit soon, unless someone has a better idea. You could then patch your gdb-mi.el and use it with those source files. Alternatively, you can invoke GDB via "M-x gud-gdb RET", which doesn't have this problem in the first place. Thanks.