GNU bug report logs - #21572
24.5; Gud gdb doesn't load source files with utf-8 chars in the file name

Previous Next

Package: emacs;

Reported by: Augusto Fraga Giachero <augustofg96 <at> gmail.com>

Date: Sun, 27 Sep 2015 16:16:01 UTC

Severity: normal

Merged with 21940

Found in version 24.5

Fixed in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21572 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Fraga Giachero <augustofg96 <at> gmail.com>
Cc: 21572 <at> debbugs.gnu.org
Subject: Re: 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
> From: Augusto Fraga Giachero <augustofg96 <at> 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.




This bug report was last modified 9 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.