From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes Date: Fri, 23 Oct 2020 13:50:24 +0200 Message-ID: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26329"; mail-complaints-to="usenet@ciao.gmane.io" To: 44173@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 23 13:51:26 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVvbS-0006jb-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 13:51:26 +0200 Original-Received: from localhost ([::1]:53924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVvbR-0000d8-DA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 07:51:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVvb4-0000ZC-Ig for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVvb4-0004zk-93 for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVvb4-0005ot-8A for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Oct 2020 11:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44173 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160345383722333 (code B ref -1); Fri, 23 Oct 2020 11:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Oct 2020 11:50:37 +0000 Original-Received: from localhost ([127.0.0.1]:56184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVvaf-0005o9-Ay for submit@debbugs.gnu.org; Fri, 23 Oct 2020 07:50:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVvab-0005nr-LB for submit@debbugs.gnu.org; Fri, 23 Oct 2020 07:50:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVvab-0008UC-Cd for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:50:33 -0400 Original-Received: from mail211c50.megamailservers.eu ([91.136.10.221]:51184 helo=mail194c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVvaY-0004qd-QX for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:50:33 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603453827; bh=u4kklsMFqxnn5eNchr/n6B+tTExPT7xx+qn9Bh1EvJY=; h=From:Subject:Date:To:From; b=c874sEA6S7yCAhO3byrztOZ/c7ARMgGrlUlNyqAT7E07N7+l95fgoxhe1WLJETTtE mUbX8V1egxTj/XU7kHjdX5uzOWdgMX4LwBdIDOIA/u5/h8am0wAje9KAQ9SQSMS0jH HqHocOP6VYD2hWGDpBEsQN3R5rYwkgM27e4JsEJk= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09NBoPZH030481 for ; Fri, 23 Oct 2020 11:50:27 +0000 X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F20.5F92C383.004F:SCFSTAT76743386, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsozJleN c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=_cU9G5k4Y-PE8ZC3SQsA:9 a=CjuIK1q_8ugA:10 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.10.221; envelope-from=mattiase@acm.org; helo=mail194c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/23 07:50:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191363 Archived-At: 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.