unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
@ 2018-11-29 16:58 ksqsf
  0 siblings, 0 replies; 6+ messages in thread
From: ksqsf @ 2018-11-29 16:58 UTC (permalink / raw)
  To: 33548

Dear maintainers,

It seems that GDB MI doesn't decode file paths correctly, which can
result in some really weird unexpected behaviors.

For example, it attempts to find file
/home/ksqsf/我的坚果云/"/home/ksqsf/\346\210\221\347\232\204\345\235\232\346
\236\234\344\272\221/code.cpp"

I traced down to the source and found that gdb-get-source-file, gdb-
get-source-file-list, and gdb-get-location don't decode file paths
using a correct coding system. (In my case, UTF-8.) Instead, they
simply use 'read'.

Hope this can be fixed soon!

Regards,
_rika







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
       [not found] <1543510714.13628.2.camel@ksqsf.moe>
@ 2018-11-29 19:35 ` Eli Zaretskii
  2018-11-30  2:03   ` ksqsf
       [not found]   ` <1543543399.17576.1.camel@ksqsf.moe>
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2018-11-29 19:35 UTC (permalink / raw)
  To: ksqsf; +Cc: 33548

> From: ksqsf <i@ksqsf.moe>
> Date: Fri, 30 Nov 2018 00:58:34 +0800
> Feedback-ID: bizesmtp:ksqsf.moe:qybgforeign:qybgforeign2
> 
> It seems that GDB MI doesn't decode file paths correctly, which can
> result in some really weird unexpected behaviors.
> 
> For example, it attempts to find file
> /home/ksqsf/我的坚果云/"/home/ksqsf/\346\210\221\347\232\204\345\235\232\346
> \236\234\344\272\221/code.cpp"
> 
> I traced down to the source and found that gdb-get-source-file, gdb-
> get-source-file-list, and gdb-get-location don't decode file paths
> using a correct coding system. (In my case, UTF-8.) Instead, they
> simply use 'read'.

Does it help to set gdb-mi-decode-strings to utf-8?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
  2018-11-29 19:35 ` bug#33548: 25.1; GUD GDB doesn't decode file paths correctly Eli Zaretskii
@ 2018-11-30  2:03   ` ksqsf
       [not found]   ` <1543543399.17576.1.camel@ksqsf.moe>
  1 sibling, 0 replies; 6+ messages in thread
From: ksqsf @ 2018-11-30  2:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33548

在 2018-11-29四的 21:35 +0200,Eli Zaretskii写道:
> Does it help to set gdb-mi-decode-strings to utf-8?

Yes! This fixes this problem for me. Thanks. This report can be closed
now. I think this variable deserves a mention in the doc anyway.
Actually it should be made default.

I noticed the warning, but can we do better? I mean, simply stops gdb
from escaping strings (does gdb even support this?), as _inconsistent_
escaping does nothing but introducing problems. LLDB seems to do better
job in this regard.







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
       [not found]   ` <1543543399.17576.1.camel@ksqsf.moe>
@ 2018-11-30  7:39     ` Eli Zaretskii
  2018-11-30  8:03       ` ksqsf
       [not found]       ` <1543565036.30749.1.camel@ksqsf.moe>
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2018-11-30  7:39 UTC (permalink / raw)
  To: ksqsf; +Cc: 33548-done

> From: ksqsf <i@ksqsf.moe>
> Cc: 33548@debbugs.gnu.org
> Date: Fri, 30 Nov 2018 10:03:19 +0800
> Feedback-ID: bizesmtp:ksqsf.moe:qybgforeign:qybgforeign4
> 
> 在 2018-11-29四的 21:35 +0200,Eli Zaretskii写道:
> > Does it help to set gdb-mi-decode-strings to utf-8?
> 
> Yes! This fixes this problem for me. Thanks. This report can be closed
> now.

Done.

> I think this variable deserves a mention in the doc anyway.

What documentation did you have in mind?

> Actually it should be made default.

No, I don't think so.  It has some confusing side effects, and in most
cases is unnecessary.

> I noticed the warning, but can we do better? I mean, simply stops gdb
> from escaping strings (does gdb even support this?), as _inconsistent_
> escaping does nothing but introducing problems.

You can tell GDB to stop escaping in strings ("set print
sevenbit-strings", which is off by default), but GDB is under user
control, and the user is legitimately allowed to turn escaping on, we
cannot do anything about that.  Plus, there are GDB settings to
control the encoding of text strings that GDB emits based on values of
the variables of the program being debugged.

> LLDB seems to do better job in this regard.

??? LLDB doesn't have a respectable implementation of the MI protocol
to begin with.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
  2018-11-30  7:39     ` Eli Zaretskii
@ 2018-11-30  8:03       ` ksqsf
       [not found]       ` <1543565036.30749.1.camel@ksqsf.moe>
  1 sibling, 0 replies; 6+ messages in thread
From: ksqsf @ 2018-11-30  8:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 33548-done

在 2018-11-30五的 09:39 +0200,Eli Zaretskii写道:
> What documentation did you have in mind?

"(emacs) Debuggers" or better "(emacs) GDB Graphical Interface". I did
check these sections but neither mentions encoding. (At least in Emacs
25.1. Though I missed it in the source file...)







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#33548: 25.1; GUD GDB doesn't decode file paths correctly
       [not found]       ` <1543565036.30749.1.camel@ksqsf.moe>
@ 2018-11-30  8:47         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2018-11-30  8:47 UTC (permalink / raw)
  To: ksqsf; +Cc: 33548-done

> From: ksqsf <i@ksqsf.moe>
> Cc: 33548-done@debbugs.gnu.org
> Date: Fri, 30 Nov 2018 16:03:56 +0800
> 
> 在 2018-11-30五的 09:39 +0200,Eli Zaretskii写道:
> > What documentation did you have in mind?
> 
> "(emacs) Debuggers" or better "(emacs) GDB Graphical Interface".

I've put that in "Source Buffers" instead.

Thanks.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-30  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1543510714.13628.2.camel@ksqsf.moe>
2018-11-29 19:35 ` bug#33548: 25.1; GUD GDB doesn't decode file paths correctly Eli Zaretskii
2018-11-30  2:03   ` ksqsf
     [not found]   ` <1543543399.17576.1.camel@ksqsf.moe>
2018-11-30  7:39     ` Eli Zaretskii
2018-11-30  8:03       ` ksqsf
     [not found]       ` <1543565036.30749.1.camel@ksqsf.moe>
2018-11-30  8:47         ` Eli Zaretskii
2018-11-29 16:58 ksqsf

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).