From: Eli Zaretskii <eliz@gnu.org>
To: Augusto Fraga Giachero <augustofg96@gmail.com>
Cc: 21572@debbugs.gnu.org
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 [thread overview]
Message-ID: <837fn7bxrb.fsf@gnu.org> (raw)
In-Reply-To: <87612vopc0.fsf@deskarch0.i-did-not-set--mail-host-address--so-tickle-me>
> From: Augusto Fraga Giachero <augustofg96@gmail.com>
> 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.
next prev parent reply other threads:[~2015-09-30 17:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 15:26 bug#21572: 24.5; Gud gdb doesn't load source files with utf-8 chars in the file name Augusto Fraga Giachero
2015-09-30 17:52 ` Eli Zaretskii [this message]
[not found] ` <CAD1u=nOrGAjZ8Qpr2bt09h5PR-B_Wht_P7EUJdEdvDuXmtrR+Q@mail.gmail.com>
2015-10-01 0:37 ` bug#21572: Fwd: " Augusto Fraga
2015-10-01 12:14 ` Eli Zaretskii
2015-10-01 13:00 ` Augusto Fraga Giachero
2015-10-01 11:53 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=837fn7bxrb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=21572@debbugs.gnu.org \
--cc=augustofg96@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).