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: Fwd: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Date: Thu, 01 Oct 2015 15:14:57 +0300 Message-ID: <83d1wyaipq.fsf@gnu.org> References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> <837fn7bxrb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1443715119 4818 80.91.229.3 (1 Oct 2015 15:58:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2015 15:58:39 +0000 (UTC) Cc: 21572@debbugs.gnu.org To: Augusto Fraga Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 01 17:58:28 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 1ZhgFK-0007bh-Mv for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 17:58:14 +0200 Original-Received: from localhost ([::1]:52386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhgFJ-0006Yp-Oh for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2015 11:58:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhcmN-0000kk-9P for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2015 08:16:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhcmI-0002xB-TY for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2015 08:16:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhcmI-0002wx-QA for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2015 08:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZhcmI-0004bX-4x for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2015 08:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Oct 2015 12:16:02 +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.144370174217672 (code B ref 21572); Thu, 01 Oct 2015 12:16:02 +0000 Original-Received: (at 21572) by debbugs.gnu.org; 1 Oct 2015 12:15:42 +0000 Original-Received: from localhost ([127.0.0.1]:49994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zhcly-0004ay-6f for submit@debbugs.gnu.org; Thu, 01 Oct 2015 08:15:42 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:64218) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zhclt-0004am-W0 for 21572@debbugs.gnu.org; Thu, 01 Oct 2015 08:15:39 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NVJ00800J8ZX900@a-mtaout22.012.net.il> for 21572@debbugs.gnu.org; Thu, 01 Oct 2015 15:15:07 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVJ00830JD6QU50@a-mtaout22.012.net.il>; Thu, 01 Oct 2015 15:15:07 +0300 (IDT) In-reply-to: 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:107143 Archived-At: > Date: Wed, 30 Sep 2015 21:37:33 -0300 > From: Augusto Fraga > > > From: Eli Zaretskii gnu.org> > > Date: Wed, 30 Sep 2015 20:52:24 +0300 > > > > 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). > > The only string that needs to be converted back to UTF-8 is the > sources file names string For your use case, yes. But if your program manipulates non-ASCII text in its strings (like non-ASCII file names it creates), you will see the same problem with them. Why should they be treated any different? > (couldn't it be done by hacking the gdb-get-source-file-list > function?). No, because the source file names arrive through other ways as well, notably when GDB reports a breakpoint being hit. I actually started with gdb-get-source-file-list, but this wasn't enough to automatically pop up the source when the program is started. > > 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 think that would be a nice option if gdb had a flag to disable these > octal sequences for the mi protocol. It would make everything easier. I agree. But if this will happen (and I hope it will; I'm talking to GDB developers about that), Emacs users will not be able to take advantage of that until their sysadmins upgrade to that newer version of GDB. So it makes sense to provide a solution now, with the existing GDB versions. > > 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. > > Nice! I'll try it out when you commit. You can do that now, see commits 439f483 and 9c86325. Note that this decoding is by default turned off, for the reasons I explained in the doc string of gdb-mi-decode-strings option and in the comments to the gdb-mi-decode function. Set it to t to see the feature at work.