all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: 44173@debbugs.gnu.org
Subject: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes
Date: Fri, 23 Oct 2020 13:50:24 +0200	[thread overview]
Message-ID: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> (raw)

When GDB sends a string containing octally-escaped characters, it will be something like

 "abc\377def"

which is first massaged into JSON and then parsed as such, but since JSON doesn't recognise octal escapes, the result is

 "abc377def"

which is wrong. This assumes gdb-mi-decode-strings is nil, which it is by default; otherwise the octal escapes are decoded by a fragile preprocessing stage (gdb-mi-decode) which itself has known problems as noted in a comment.

Frankly, this business with going via JSON after several ad-hoc text-based transforms isn't very principled.

While the bug could be 'solved' by adding yet another regexp hack to gdb-mi-decode or gdb-mi-jsonify-buffer, I suggest we write a GDB/MI parser in Lisp directly, ditching the gdb-mi-decode preprocessing and JSON form entirely, solving this and related bugs once and for all. Many transforms can then be done on the S-expression result after parsing, which should be more efficient and less error-prone.






             reply	other threads:[~2020-10-23 11:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 11:50 Mattias Engdegård [this message]
2020-10-23 12:01 ` bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes Eli Zaretskii
2020-10-23 12:41   ` Mattias Engdegård
2020-10-23 13:19     ` Eli Zaretskii
2020-10-23 14:21       ` Mattias Engdegård
2020-10-23 14:44         ` Eli Zaretskii
2020-10-23 17:31           ` Mattias Engdegård
2020-10-23 18:20             ` Eli Zaretskii
2020-10-24 16:21               ` Mattias Engdegård
2020-10-24 17:23                 ` Eli Zaretskii
2020-10-24 18:27                   ` Mattias Engdegård
2020-10-24 18:44                     ` Eli Zaretskii
2020-10-24 19:41                       ` Mattias Engdegård
2020-10-27 18:16                         ` Mattias Engdegård
2020-10-31  8:22                           ` Eli Zaretskii
2020-10-31 13:57                             ` Mattias Engdegård
2020-11-06 13:01                               ` Mattias Engdegård
2020-10-25 12:47                       ` Mattias Engdegård

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org \
    --to=mattiase@acm.org \
    --cc=44173@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.