From unknown Tue Jun 17 22:29:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Resent-From: Augusto Fraga Giachero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Sep 2015 16:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 21572@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14433705087512 (code B ref -1); Sun, 27 Sep 2015 16:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Sep 2015 16:15:08 +0000 Received: from localhost ([127.0.0.1]:45798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgEbS-0001x3-9N for submit@debbugs.gnu.org; Sun, 27 Sep 2015 12:15:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59352) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgDtz-0000si-0V for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgDtx-0003wn-Kj for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtx-0003wj-Ii for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtw-0000Om-AN for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgDtr-0003iL-Ak for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:08 -0400 Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:33578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtr-0003gD-6z for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:03 -0400 Received: by qgev79 with SMTP id v79so103452778qge.0 for ; Sun, 27 Sep 2015 08:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Nx7FMVdqAHIpuu1RbMRd1XqoWQW7T4YZk4itL0I4opc=; b=i2p5XmcQ7zV58xfyqjE9vSW068uNl3BgUGbOtDTIPjQjpWrWWhixJVMgF5ripZXvi3 dWTo1lu2s5z6/UR79Mq434ushuWrcvVLD1RLQbvSJ5tGkiNFRSvNRfB2mqe0p7lCKPL2 9gRnQETloUOLJYS0oyVYTsjUUsAM4Ee7tKf3nB1of9n+iXD5NMFz4ejFJyjYnX9niq7j 7BV5/BjYS5aDr7bmpj7qmIfJdZH9rl/nwkyHWjckFdXKn0nA1M1sVkkU1laP0qVYj1P7 /xqD5FPjc1gxgDy1KQMX/Hrh4oSjwUopqRgILoxKIC2Xsg4EvG6cogGKBq7sKsGJjAI4 jEUg== X-Received: by 10.140.151.197 with SMTP id 188mr8041317qhx.26.1443367802281; Sun, 27 Sep 2015 08:30:02 -0700 (PDT) Received: from deskarch0 ([177.195.8.68]) by smtp.gmail.com with ESMTPSA id z196sm5328865qhd.22.2015.09.27.08.30.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Sep 2015 08:30:01 -0700 (PDT) From: Augusto Fraga Giachero Date: Sun, 27 Sep 2015 12:26:55 -0300 Message-ID: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Mailman-Approved-At: Sun, 27 Sep 2015 12:15:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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. 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=C3=B4nica/ARM/IoControl/src/main.c I think it's not hard to fix it, but my knowledge of lisp isn't that great. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis Windowing system distributor `The X.Org Foundation', version 11.0.11702000 Configured using: `configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fstack-protector-str= ong --param=3Dssp-buffer-size=3D4' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LANG: pt_BR.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: global-company-mode: t company-mode: t yas-global-mode: t yas-minor-mode: t display-time-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: [yas] Loading for `emacs-lisp-mode', just-in-time: (lambda nil (yas--load-d= irectory-1 (quote /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snipp= ets/emacs-lisp-mode) (quote emacs-lisp-mode)))! [yas] Loading compiled snippets from /home/augusto/.emacs.d/elpa/yasnippet-= 20150811.1222/snippets/emacs-lisp-mode [yas] Loading for `prog-mode', just-in-time: (lambda nil (yas--load-directo= ry-1 (quote /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snippets/pr= og-mode) (quote prog-mode)))! [yas] Loading compiled snippets from /home/augusto/.emacs.d/elpa/yasnippet-= 20150811.1222/snippets/prog-mode Loading /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snippets/prog-m= ode/.yas-setup...done For information about GNU Emacs and the GNU system, type C-h C-a. *message*-20150927-113643 has auto save data; consider M-x recover-this-file Beginning of buffer Mark set [2 times] Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message idna cl-macs format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils company-files company-oddmuse company-keywords company-etags etags ring company-gtags company-dabbrev-code company-dabbrev company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb company-irony irony-completion irony-snippet irony find-func company waher-theme ido cl-extra yasnippet help-mode cl gv linum-relative advice help-fns linum picasm picasm-loops picasm-external edmacro kmacro cl-loaddefs cl-lib info easymenu tex-site package epg-config time time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 154849 3972) (symbols 48 24539 0) (miscs 40 103 151) (strings 32 37552 10436) (string-bytes 1 932429) (vectors 16 17551) (vector-slots 8 519725 3706) (floats 8 406 239) (intervals 56 257 0) (buffers 960 15) (heap 1024 34440 1713)) From unknown Tue Jun 17 22:29:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name 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: To: Augusto Fraga Giachero Cc: 21572@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21572-submit@debbugs.gnu.org id=B21572.14436355559939 (code B ref 21572); Wed, 30 Sep 2015 17:53:01 +0000 Received: (at 21572) by debbugs.gnu.org; 30 Sep 2015 17:52:35 +0000 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 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 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) 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) Date: Wed, 30 Sep 2015 20:52:24 +0300 From: Eli Zaretskii In-reply-to: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> X-012-Sender: halo1@inter.net.il Message-id: <837fn7bxrb.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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. From unknown Tue Jun 17 22:29:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21572: Fwd: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Resent-From: Augusto Fraga Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Oct 2015 00:38: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: To: 21572@debbugs.gnu.org Received: via spool by 21572-submit@debbugs.gnu.org id=B21572.144365985713820 (code B ref 21572); Thu, 01 Oct 2015 00:38:01 +0000 Received: (at 21572) by debbugs.gnu.org; 1 Oct 2015 00:37:37 +0000 Received: from localhost ([127.0.0.1]:49692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhRsP-0003ap-CS for submit@debbugs.gnu.org; Wed, 30 Sep 2015 20:37:37 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:32796) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhRsM-0003ah-Jk for 21572@debbugs.gnu.org; Wed, 30 Sep 2015 20:37:35 -0400 Received: by wiclk2 with SMTP id lk2so10069341wic.0 for <21572@debbugs.gnu.org>; Wed, 30 Sep 2015 17:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oxs9SqI2hSwi2fmOPsrCH6hCQI58Hqg8i64KsthpfcA=; b=lw4dqB7ZkYbOlNN5jX6UbmS+L6FINLQ7YApIdBWV6VtTfGTrWsQUvhCZ57rgYfKBUf wN9ga3gluIyM7KOOkfrfUk14tgH/ITKqqZSSmCoYCA6Rr/iHdYtP9k0II3mI23Elk+gT HsOwVcukKv6JlC8WNoxiNkbHo6DCyPS3hXz85aGELqmv3Xe2mB+wrqE2fcHHLr3ouvsJ XHTgd5DQHksn0wCrXr0T4gMHHDt3a+IRarBBVF28iHtIn+G+KP4e+5xOU82lVIaDT2ir 3JtWOBCyaIXufXOhubG4q4ujLxB6tfv4/Dm5WB3+snUANuflPMAcUbhoRfoV3hNPcLJQ WdtA== MIME-Version: 1.0 X-Received: by 10.180.208.49 with SMTP id mb17mr226553wic.52.1443659853905; Wed, 30 Sep 2015 17:37:33 -0700 (PDT) Received: by 10.28.215.136 with HTTP; Wed, 30 Sep 2015 17:37:33 -0700 (PDT) In-Reply-To: References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> <837fn7bxrb.fsf@gnu.org> Date: Wed, 30 Sep 2015 21:37:33 -0300 Message-ID: From: Augusto Fraga Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) > 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 (couldn't it be done by hacking the gdb-get-source-file-list function?). > 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 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. > Alternatively, you can invoke GDB via "M-x gud-gdb RET", which doesn't > have this problem in the first place. Well, but I wouldn't have a good source debugging interface. In fact the "M-x gdb RET" doesn't fails, it only doesn't load the buffer for the source code (it behaves like standard gdb without tui). Thank you! From unknown Tue Jun 17 22:29:00 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Augusto Fraga Giachero Subject: bug#21572: closed (Re: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name) Message-ID: References: <83fv1uajov.fsf@gnu.org> <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> X-Gnu-PR-Message: they-closed 21572 X-Gnu-PR-Package: emacs Reply-To: 21572@debbugs.gnu.org Date: Thu, 01 Oct 2015 11:55:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1443700503-15785-1" This is a multi-part message in MIME format... ------------=_1443700503-15785-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the fil= e name which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21572@debbugs.gnu.org. --=20 21572: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21572 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1443700503-15785-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21572-done) by debbugs.gnu.org; 1 Oct 2015 11:54:14 +0000 Received: from localhost ([127.0.0.1]:49968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhcRC-00045W-3U for submit@debbugs.gnu.org; Thu, 01 Oct 2015 07:54:14 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:48166) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhcR9-00045M-Eo for 21572-done@debbugs.gnu.org; Thu, 01 Oct 2015 07:54:12 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NVJ00I00I6BEC00@a-mtaout23.012.net.il> for 21572-done@debbugs.gnu.org; Thu, 01 Oct 2015 14:54:02 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVJ00I9UIE17Y70@a-mtaout23.012.net.il>; Thu, 01 Oct 2015 14:54:02 +0300 (IDT) Date: Thu, 01 Oct 2015 14:53:52 +0300 From: Eli Zaretskii Subject: Re: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name In-reply-to: <837fn7bxrb.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: augustofg96@gmail.com Message-id: <83fv1uajov.fsf@gnu.org> References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> <837fn7bxrb.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21572-done Cc: 21572-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 30 Sep 2015 20:52:24 +0300 > From: Eli Zaretskii > Cc: 21572@debbugs.gnu.org > > 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. I've pushed those changes now, and I'm marking this bug done. Thanks. ------------=_1443700503-15785-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Sep 2015 16:15:08 +0000 Received: from localhost ([127.0.0.1]:45798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgEbS-0001x3-9N for submit@debbugs.gnu.org; Sun, 27 Sep 2015 12:15:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59352) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgDtz-0000si-0V for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgDtx-0003wn-Kj for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtx-0003wj-Ii for submit@debbugs.gnu.org; Sun, 27 Sep 2015 11:30:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtw-0000Om-AN for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgDtr-0003iL-Ak for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:08 -0400 Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:33578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgDtr-0003gD-6z for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 11:30:03 -0400 Received: by qgev79 with SMTP id v79so103452778qge.0 for ; Sun, 27 Sep 2015 08:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Nx7FMVdqAHIpuu1RbMRd1XqoWQW7T4YZk4itL0I4opc=; b=i2p5XmcQ7zV58xfyqjE9vSW068uNl3BgUGbOtDTIPjQjpWrWWhixJVMgF5ripZXvi3 dWTo1lu2s5z6/UR79Mq434ushuWrcvVLD1RLQbvSJ5tGkiNFRSvNRfB2mqe0p7lCKPL2 9gRnQETloUOLJYS0oyVYTsjUUsAM4Ee7tKf3nB1of9n+iXD5NMFz4ejFJyjYnX9niq7j 7BV5/BjYS5aDr7bmpj7qmIfJdZH9rl/nwkyHWjckFdXKn0nA1M1sVkkU1laP0qVYj1P7 /xqD5FPjc1gxgDy1KQMX/Hrh4oSjwUopqRgILoxKIC2Xsg4EvG6cogGKBq7sKsGJjAI4 jEUg== X-Received: by 10.140.151.197 with SMTP id 188mr8041317qhx.26.1443367802281; Sun, 27 Sep 2015 08:30:02 -0700 (PDT) Received: from deskarch0 ([177.195.8.68]) by smtp.gmail.com with ESMTPSA id z196sm5328865qhd.22.2015.09.27.08.30.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Sep 2015 08:30:01 -0700 (PDT) From: Augusto Fraga Giachero To: bug-gnu-emacs@gnu.org Subject: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Date: Sun, 27 Sep 2015 12:26:55 -0300 Message-ID: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 27 Sep 2015 12:15:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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. 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=C3=B4nica/ARM/IoControl/src/main.c I think it's not hard to fix it, but my knowledge of lisp isn't that great. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis Windowing system distributor `The X.Org Foundation', version 11.0.11702000 Configured using: `configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fstack-protector-str= ong --param=3Dssp-buffer-size=3D4' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LANG: pt_BR.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: global-company-mode: t company-mode: t yas-global-mode: t yas-minor-mode: t display-time-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: [yas] Loading for `emacs-lisp-mode', just-in-time: (lambda nil (yas--load-d= irectory-1 (quote /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snipp= ets/emacs-lisp-mode) (quote emacs-lisp-mode)))! [yas] Loading compiled snippets from /home/augusto/.emacs.d/elpa/yasnippet-= 20150811.1222/snippets/emacs-lisp-mode [yas] Loading for `prog-mode', just-in-time: (lambda nil (yas--load-directo= ry-1 (quote /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snippets/pr= og-mode) (quote prog-mode)))! [yas] Loading compiled snippets from /home/augusto/.emacs.d/elpa/yasnippet-= 20150811.1222/snippets/prog-mode Loading /home/augusto/.emacs.d/elpa/yasnippet-20150811.1222/snippets/prog-m= ode/.yas-setup...done For information about GNU Emacs and the GNU system, type C-h C-a. *message*-20150927-113643 has auto save data; consider M-x recover-this-file Beginning of buffer Mark set [2 times] Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message idna cl-macs format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils company-files company-oddmuse company-keywords company-etags etags ring company-gtags company-dabbrev-code company-dabbrev company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb company-irony irony-completion irony-snippet irony find-func company waher-theme ido cl-extra yasnippet help-mode cl gv linum-relative advice help-fns linum picasm picasm-loops picasm-external edmacro kmacro cl-loaddefs cl-lib info easymenu tex-site package epg-config time time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 154849 3972) (symbols 48 24539 0) (miscs 40 103 151) (strings 32 37552 10436) (string-bytes 1 932429) (vectors 16 17551) (vector-slots 8 519725 3706) (floats 8 406 239) (intervals 56 257 0) (buffers 960 15) (heap 1024 34440 1713)) ------------=_1443700503-15785-1-- From unknown Tue Jun 17 22:29:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21572: Fwd: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name 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: To: Augusto Fraga Cc: 21572@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21572-submit@debbugs.gnu.org id=B21572.144370174217672 (code B ref 21572); Thu, 01 Oct 2015 12:16:02 +0000 Received: (at 21572) by debbugs.gnu.org; 1 Oct 2015 12:15:42 +0000 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 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 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) 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) Date: Thu, 01 Oct 2015 15:14:57 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83d1wyaipq.fsf@gnu.org> References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> <837fn7bxrb.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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. From unknown Tue Jun 17 22:29:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21572: Fwd: bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Resent-From: Augusto Fraga Giachero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Oct 2015 13:01: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: To: 21572@debbugs.gnu.org Received: via spool by 21572-submit@debbugs.gnu.org id=B21572.144370445221647 (code B ref 21572); Thu, 01 Oct 2015 13:01:02 +0000 Received: (at 21572) by debbugs.gnu.org; 1 Oct 2015 13:00:52 +0000 Received: from localhost ([127.0.0.1]:50019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhdTg-0005d5-1D for submit@debbugs.gnu.org; Thu, 01 Oct 2015 09:00:52 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:35223) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhdTd-0005cx-Fb for 21572@debbugs.gnu.org; Thu, 01 Oct 2015 09:00:50 -0400 Received: by wicge5 with SMTP id ge5so28818313wic.0 for <21572@debbugs.gnu.org>; Thu, 01 Oct 2015 06:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KTWnGXWgr7ZDNrEwdodQ69N2F5uTDbJssGnSUp4FCVg=; b=iNMOh8LgBs9x342ZHTBMuLosi4Ozbe1Vsv3ufKvYOa66Ff6sQYVKfKjFGAKIwJKwAr olXaHrV0h9QL+1wawvEtW30jTuBHLSCGmNdUeYccFq+hBGY3gipYWcSQZR3kzm7+q9xf ZVmCS4f7x0iEd4eDFhE2Zb9uVZ0hRW2NmATgy94xEpazxGD5pyyhxHYAlzTb8Obz3nSq cZ+2Swfk6Qe6KDW7+m/J4AtNFl831AFvtGd7iN1ztPDGxOy4AIir39CndH4aazMuLfwR cnQf0oMh8VBYgzcOD/AyfOqc5xsWdnkFFWbGMNVMZfTJMtD5r86UEEN/krtryJx3X8j+ gGIg== MIME-Version: 1.0 X-Received: by 10.180.39.242 with SMTP id s18mr3019269wik.79.1443704448771; Thu, 01 Oct 2015 06:00:48 -0700 (PDT) Received: by 10.28.215.136 with HTTP; Thu, 1 Oct 2015 06:00:48 -0700 (PDT) In-Reply-To: <83d1wyaipq.fsf@gnu.org> References: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me> <837fn7bxrb.fsf@gnu.org> <83d1wyaipq.fsf@gnu.org> Date: Thu, 1 Oct 2015 10:00:48 -0300 Message-ID: From: Augusto Fraga Giachero Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) > From: Eli Zaretskii gnu.org> > Date: Thu, 01 Oct 2015 15:14:57 +0300 > > 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. Thank you! I've tried and it worked well! It is a nice short-time fix until gdb support turning off octal conversion for non-ASCII strings. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 21:01:21 2015 Received: (at control) by debbugs.gnu.org; 18 Nov 2015 02:01:21 +0000 Received: from localhost ([127.0.0.1]:42192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zys3l-0000Br-7k for submit@debbugs.gnu.org; Tue, 17 Nov 2015 21:01:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38225) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zys3j-0000Bk-Tv for control@debbugs.gnu.org; Tue, 17 Nov 2015 21:01:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zys3j-0006b8-7F for control@debbugs.gnu.org; Tue, 17 Nov 2015 21:01:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zys3j-0006b4-4l for control@debbugs.gnu.org; Tue, 17 Nov 2015 21:01:19 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1Zys3i-0004z0-S3 for control@debbugs.gnu.org; Tue, 17 Nov 2015 21:01:18 -0500 Subject: control message for bug 21940 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Tue, 17 Nov 2015 21:01:18 -0500 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) unarchive 21572 fixed 21940 25.1 forcemerge 21572 21940