From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 07:50:37 2020 Received: (at submit) by debbugs.gnu.org; 23 Oct 2020 11:50:37 +0000 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 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 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 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 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 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: 28.0.50; gdb-mi mangles strings with octal escapes Message-Id: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> Date: Fri, 23 Oct 2020 13:50:24 +0200 To: bug-gnu-emacs@gnu.org 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-Rules: 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 08:02:15 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 12:02:15 +0000 Received: from localhost ([127.0.0.1]:56228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVvlv-00080D-AP for submit@debbugs.gnu.org; Fri, 23 Oct 2020 08:02:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVvlt-0007uc-40 for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 08:02:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46486) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVvln-0006xV-RW; Fri, 23 Oct 2020 08:02:07 -0400 Received: from [176.228.60.248] (port=3103 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVvlm-0002mF-Ur; Fri, 23 Oct 2020 08:02:07 -0400 Date: Fri, 23 Oct 2020 15:01:52 +0300 Message-Id: <837drhjglr.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 23 Oct 2020 13:50:24 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 23 Oct 2020 13:50:24 +0200 > > 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. I'm okay with writing a GDB/MI parser, but I'm not sure I understand how would that help to solve this particular conundrum. AFAIR, there's a genuine ambiguity there regarding non-ASCII characters reported from GDB. Could you tell how will this be solved by a different parser? P.S. Btw: gdb-mi.el already has a BNF parser for GDB/MI. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 08:41:19 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 12:41:19 +0000 Received: from localhost ([127.0.0.1]:56273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwNi-0000n4-OA for submit@debbugs.gnu.org; Fri, 23 Oct 2020 08:41:19 -0400 Received: from mail1461c50.megamailservers.eu ([91.136.14.61]:54208 helo=mail267c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwNc-0000mJ-2T for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 08:41:14 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603456865; bh=og3WgEwuZE0n4XfeZzkztMdOCq6XpCwC6MTNTV4r7/A=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=cZUPIE+1DVFHi/Ao/ttkw0qhWlG0gMJzBEfcNZWCccUJFMcbbMm1Uogv9EoILBegB 9doIkOEfgI1XugUgYWBVKSpiEgBWwGonjb4i+7sjuINjKVpMuTby3dDrd+MB59Kk1s 4MPg6liSutVfhDZmSuOR3BKpBvEMWwbHX3XYDgvo= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09NCf2K7002977; Fri, 23 Oct 2020 12:41:04 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <837drhjglr.fsf@gnu.org> Date: Fri, 23 Oct 2020 14:41:02 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F25.5F92CF61.003E: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Cf92G4jl c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=HARwweAvmzVtI4QVdmQA:9 a=QEXdDO2ut3YA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 23 okt. 2020 kl. 14.01 skrev Eli Zaretskii : > I'm okay with writing a GDB/MI parser, but I'm not sure I understand > how would that help to solve this particular conundrum. AFAIR, > there's a genuine ambiguity there regarding non-ASCII characte [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 okt. 2020 kl. 14.01 skrev Eli Zaretskii : > I'm okay with writing a GDB/MI parser, but I'm not sure I understand > how would that help to solve this particular conundrum. AFAIR, > there's a genuine ambiguity there regarding non-ASCII characters > reported from GDB. Would you mind explaining the ambiguity? Do you mean what coding system = should be used for "\303\266" -- whether it should be interpreted as a = string of those two bytes, the string "=C3=83=C2=B6", the string "=C3=B6",= or something else? This bug is not about the encoding; it's about not interpreting the = string as "303266". > Could you tell how will this be solved by a > different parser? Again, I'm not sure what you mean. The bug arises because we feed = incorrectly translated data into a JSON parser. If we parse the string = ourselves instead of going via JSON, that particular problem goes away. > P.S. Btw: gdb-mi.el already has a BNF parser for GDB/MI. It doesn't parse the lower parts of the grammar -- 'result', 'value' and = so on. JSON is used for that. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 09:20:05 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 13:20:05 +0000 Received: from localhost ([127.0.0.1]:56349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwzE-0003wY-UK for submit@debbugs.gnu.org; Fri, 23 Oct 2020 09:20:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVwzE-0003vr-8k for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 09:20:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49341) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVwz8-0000lu-O4; Fri, 23 Oct 2020 09:19:58 -0400 Received: from [176.228.60.248] (port=3872 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVwz8-0005fp-0B; Fri, 23 Oct 2020 09:19:58 -0400 Date: Fri, 23 Oct 2020 16:19:42 +0300 Message-Id: <834kmljd01.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 23 Oct 2020 14:41:02 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 23 Oct 2020 14:41:02 +0200 > Cc: 44173@debbugs.gnu.org > > 23 okt. 2020 kl. 14.01 skrev Eli Zaretskii : > > > I'm okay with writing a GDB/MI parser, but I'm not sure I understand > > how would that help to solve this particular conundrum. AFAIR, > > there's a genuine ambiguity there regarding non-ASCII characters > > reported from GDB. > > Would you mind explaining the ambiguity? Do you mean what coding system should be used for "\303\266" -- whether it should be interpreted as a string of those two bytes, the string "ö", the string "ö", or something else? My memory is imperfect, but luckily I was wise enough to summarize the problems in a comment to gdb-mi-decode, which you mentioned. Let me now quote it: ;; FIXME: This is fragile: it relies on the assumption that all the ;; non-ASCII strings output by GDB, including names of the source ;; files, values of string variables in the inferior, etc., are all ;; encoded in the same encoding. It also assumes that the \nnn ;; sequences are not split between chunks of output of the GDB process ;; due to buffering, and arrive together. Finally, if some string ;; included literal \nnn strings (as opposed to non-ASCII characters ;; converted by GDB/MI to octal escapes), this decoding will mangle ;; those strings. When/if GDB acquires the ability to not ;; escape-protect non-ASCII characters in its MI output, this kludge ;; should be removed. The basic ambiguity, AFAIR, is what is described last here: a string reported bu GDB could include literal \nnn sequences, which are not non-ASCII characters that GDB/MI converts to octal escapes. The information which was which is lost once we receive the GDB/MI output. > This bug is not about the encoding; it's about not interpreting the string as "303266". AFAIU, this bug's root cause is the way we solved the ambiguity, which basically assumes one of the possible interpretations should be preferred to another, because it is more popular/useful. Let me turn the table and ask you how did you get that string you show in the original report? What kind of application were you debugging, and what did that string mean in that application? > > Could you tell how will this be solved by a > > different parser? > > Again, I'm not sure what you mean. The bug arises because we feed incorrectly translated data into a JSON parser. If we parse the string ourselves instead of going via JSON, that particular problem goes away. And what will then happen to non-ASCII strings and file names reported by GDB? How will our parser solve that? > > P.S. Btw: gdb-mi.el already has a BNF parser for GDB/MI. > > It doesn't parse the lower parts of the grammar -- 'result', 'value' and so on. JSON is used for that. Do you intend to extend the existing parser or write a new one from scratch? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 10:22:13 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 14:22:13 +0000 Received: from localhost ([127.0.0.1]:57940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVxxM-00081v-SN for submit@debbugs.gnu.org; Fri, 23 Oct 2020 10:22:13 -0400 Received: from mail1458c50.megamailservers.eu ([91.136.14.58]:50178 helo=mail267c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVxxJ-00081g-MH for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 10:22:11 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603462922; bh=lqdCEJ0YYvbA936LoWOb70Mqko3UmIVY6lR8wcUscRc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Qpu3ppvWMu44XT1hGIXKl3RKyiuTpRQvqAl0S0Qp9/zlV7iR9AVle90UcSOL9wyKm Mc8EZU+HwbE8kE0QWFseL8MkySaygBFuKFtctFmZmBo1ag9H4CAs/TH4nxw28/GV8A eFAvaWfrefYlyaCoL40gce4/IofM9T6K3OhOB8j4= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09NELuEW031073; Fri, 23 Oct 2020 14:21:59 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <834kmljd01.fsf@gnu.org> Date: Fri, 23 Oct 2020 16:21:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1F.5F92E70A.0072: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Cf92G4jl c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=aD-8tkJ-s0J0S0xM4JUA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 23 okt. 2020 kl. 15.19 skrev Eli Zaretskii : > The basic ambiguity, AFAIR, is what is described last here: a string > reported bu GDB could include literal \nnn sequences, which are not > non-ASCII characters that GDB/MI converts to octal escape [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 okt. 2020 kl. 15.19 skrev Eli Zaretskii : > The basic ambiguity, AFAIR, is what is described last here: a string > reported bu GDB could include literal \nnn sequences, which are not > non-ASCII characters that GDB/MI converts to octal escapes. The > information which was which is lost once we receive the GDB/MI output. So you mean that GDB would produce the value "\303" that does not stand = for a string containing the single byte octal 303? When does this occur? > AFAIU, this bug's root cause is the way we solved the ambiguity, which > basically assumes one of the possible interpretations should be > preferred to another, because it is more popular/useful. Then we disagree. The code doesn't do the right thing if = gdb-mi-decode-string is nil, unless you by 'ambiguity' mean that GDB = sometimes inserts a spurious backslash that should be ignored. When = gdb-mi-decode-string is non-nil, it is sometimes wrong as well. > Let me turn the table and ask you how did you get that string you show > in the original report? A program in the C language containing the local declaration char *s =3D "\303\266"; produces nonsense in the 'Locals' window when debugged. It doesn't = matter what the string means; I would have been happy with gdb/emacs = interpreting it as utf-8, latin-1 or just raw bytes presented in octal = or hex. > And what will then happen to non-ASCII strings and file names reported > by GDB? How will our parser solve that? The parser can either leave the strings as undecoded unibyte strings -- = that is, "\303\266" would be a 2-char string -- or decode them according = to gdb-mi-decode-strings, in which case it might become a 1-char = multibyte string. In the former case, the code receiving the parse tree = could decide what to do with the strings and how to display them, = perhaps on a case-by-case basis. > Do you intend to extend the existing parser or write a new one from > scratch? Extending the existing one appears sensible, just replacing the JSON = tour. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 10:45:03 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 14:45:03 +0000 Received: from localhost ([127.0.0.1]:57959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVyJS-0000CR-PG for submit@debbugs.gnu.org; Fri, 23 Oct 2020 10:45:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVyJQ-0000Bg-B7 for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 10:45:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50909) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVyJL-0003YR-17; Fri, 23 Oct 2020 10:44:55 -0400 Received: from [176.228.60.248] (port=1116 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVyJK-0004i6-A3; Fri, 23 Oct 2020 10:44:54 -0400 Date: Fri, 23 Oct 2020 17:44:39 +0300 Message-Id: <83zh4dhui0.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 23 Oct 2020 16:21:55 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 23 Oct 2020 16:21:55 +0200 > Cc: 44173@debbugs.gnu.org > > 23 okt. 2020 kl. 15.19 skrev Eli Zaretskii : > > > The basic ambiguity, AFAIR, is what is described last here: a string > > reported bu GDB could include literal \nnn sequences, which are not > > non-ASCII characters that GDB/MI converts to octal escapes. The > > information which was which is lost once we receive the GDB/MI output. > > So you mean that GDB would produce the value "\303" that does not > stand for a string containing the single byte octal 303? Yes. > When does this occur? There's nothing special in the text "\303" that says it must be an octal escape. They are just 4 ASCII characters. Moreover, even if it is an escape, it is not clear how to interpret it: as a raw byte or as a character encoded in some 8-bit encoding. As you probably know, GDB has settings that control how strings it reports are encoded, so the same string can be reported in different forms. > > AFAIU, this bug's root cause is the way we solved the ambiguity, which > > basically assumes one of the possible interpretations should be > > preferred to another, because it is more popular/useful. > > Then we disagree. The code doesn't do the right thing if gdb-mi-decode-string is nil, unless you by 'ambiguity' mean that GDB sometimes inserts a spurious backslash that should be ignored. When gdb-mi-decode-string is non-nil, it is sometimes wrong as well. The ambiguity is whether gdb-mi-decode-strings should be nil or non-nil. We have it nil by default because non-ASCII strings and file names are rare, but when you are debugging a program that uses such strings, you had better set it non-nil. And when some of your program's source file use non-ASCII characters, you _must_ set it non-nil, otherwise "M-x gdb" will not find the source files it needs to visit as you step through the program. > > Let me turn the table and ask you how did you get that string you show > > in the original report? > > A program in the C language containing the local declaration > > char *s = "\303\266"; > > produces nonsense in the 'Locals' window when debugged. It doesn't matter what the string means; I would have been happy with gdb/emacs interpreting it as utf-8, latin-1 or just raw bytes presented in octal or hex. That doesn't really answer my question, though, about the use case that causes such a string to be in the program. Without a use case, I could tell you to set gdb-mi-decode-strings non-nil and be done with it. > > And what will then happen to non-ASCII strings and file names reported > > by GDB? How will our parser solve that? > > The parser can either leave the strings as undecoded unibyte strings -- that is, "\303\266" would be a 2-char string -- or decode them according to gdb-mi-decode-strings, in which case it might become a 1-char multibyte string. In the former case, the code receiving the parse tree could decide what to do with the strings and how to display them, perhaps on a case-by-case basis. Well, I know that several possible ways exist, but each one of them loses in some situations. You say "the code receiving the parse tree could decide", but will that code have information to make that decision correctly? And if you must decide in the parser, how would you suggest to make the decision to avoid making incorrect decisions? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 13:31:58 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 17:31:58 +0000 Received: from localhost ([127.0.0.1]:58313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW0uz-0000Ps-Jp for submit@debbugs.gnu.org; Fri, 23 Oct 2020 13:31:57 -0400 Received: from mail204c50.megamailservers.eu ([91.136.10.214]:49768 helo=mail193c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW0uw-0000Pd-Bw for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 13:31:55 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603474310; bh=JSg4elOzANM47jlpmp3ph6lcyex22CExIRArjHKF5hU=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=HkS2yJyvymPm67/LJNrBFi203xRcD/pNcD3c83ieLkDrK6d7X2oFWUeZRvXYPLRmM LcQUDL32GAAT7CNGCRoCdMxHMDMqJ2PGIW4JCr4H64NYEQP0fi4JkAtDWebbQioGdV v4tehkesA9drsnQ4rs+Oc0RKe6cKF8UQdY/9ryzI= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09NHVlTs014193; Fri, 23 Oct 2020 17:31:49 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83zh4dhui0.fsf@gnu.org> Date: Fri, 23 Oct 2020 19:31:47 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F26.5F931386.0042: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=cM2eTWWN c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=JmvihpTtNtbsZxv4WTAA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 okt. 2020 kl. 16.44 skrev Eli Zaretskii : > There's nothing special in the text "\303" that says it must be an > octal escape. They are just 4 ASCII characters. The grammar uses the name 'c-string', so it is reasonable to assume that = most of the lexical conventions of C strings are obeyed. Perhaps you mean that \ooo can occur outside c-string productions? If = so, please say where you have seen it, or have evidence of it being = produced. The possibilities are limited. For example, stream records may use an = unquoted (newline-terminated) string in place of a c-string, but I = haven't seen any evidence of this in practice and it appears that = gdb-mi.el does not handle that case either. The only other possibility in the grammar would be inside 'variable' = productions (field keys) which are unquoted, but those only come from a = small set of fixed names. To be clear: the exact encoding of non-ASCII bytes (whether present = literally or as octal escapes in c-string tokens) is unclear, and I do = not attempt to solve that problem here and now. This is about more = fundamental parsing and lexing problems. Namely: handling octal escapes in gdb-gdbmi-marker-filter is doing it at = the wrong level. Moreover, this substitution, when performed, is not = correct since it ignores the context; the 4-byte (excluding quotes) = string "\\377" then appears to the user as the 2-byte string "\\377", = where the '\377' sequence is painted in a distinct colour and really is = the raw byte 0xff, and thus not a valid C character escape sequence. Finally, the JSON mess is evidently the wrong way to go since it does = not take care of strings properly -- and heavens know what else, since = gdb-jsonify-buffer works at the wrong level (a pattern here) by doing = regexp replacement on the whole text prior to parsing. > That doesn't really answer my question, though, about the use case > that causes such a string to be in the program. Without a use case, I > could tell you to set gdb-mi-decode-strings non-nil and be done with > it. Why a string is in a program is irrelevant; the user does not = necessarily know that. If Emacs says that a string contains six decimal = digits when it really just contains two (nonzero) bytes, then that is a = lie no matter what. > Well, I know that several possible ways exist, but each one of them > loses in some situations. You say "the code receiving the parse tree > could decide", but will that code have information to make that > decision correctly? And if you must decide in the parser, how would > you suggest to make the decision to avoid making incorrect decisions? Again that problem is outside the scope of this bug but I think we can = agree that it is easier, or at least no more difficult, to make a = correct decision knowing the context of the string than not. Let's see what a value/result parser can do and work from there. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 14:20:32 2020 Received: (at 44173) by debbugs.gnu.org; 23 Oct 2020 18:20:32 +0000 Received: from localhost ([127.0.0.1]:58351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW1g0-0001ey-5m for submit@debbugs.gnu.org; Fri, 23 Oct 2020 14:20:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW1fw-0001el-MO for 44173@debbugs.gnu.org; Fri, 23 Oct 2020 14:20:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55902) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kW1fr-0007hU-CF; Fri, 23 Oct 2020 14:20:23 -0400 Received: from [176.228.60.248] (port=2339 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kW1fq-0001GB-Nv; Fri, 23 Oct 2020 14:20:23 -0400 Date: Fri, 23 Oct 2020 21:20:09 +0300 Message-Id: <83mu0ciz3a.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 23 Oct 2020 19:31:47 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 23 Oct 2020 19:31:47 +0200 > Cc: 44173@debbugs.gnu.org > > Let's see what a value/result parser can do and work from there. Whatever. I don't understand your answers and don't see how they resolve the issues I raised. I guess we will have to see who is right when the code is in place. Too bad. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 12:22:05 2020 Received: (at 44173) by debbugs.gnu.org; 24 Oct 2020 16:22:05 +0000 Received: from localhost ([127.0.0.1]:34947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWMIv-0003gJ-Fc for submit@debbugs.gnu.org; Sat, 24 Oct 2020 12:22:05 -0400 Received: from mail1435c50.megamailservers.eu ([91.136.14.35]:41706 helo=mail263c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWMIs-0003fg-Ly for 44173@debbugs.gnu.org; Sat, 24 Oct 2020 12:22:03 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603556516; bh=Y9YIJlylEH0+yO5foN7RnnB5DGLoAqll+IBfitlu0ys=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=a6yGv+4nYydyLrpttrmvyioXbPJ9CW6R44fMlP7O1tvC2gSqToCnBjvbN8atpGmTg Oma4PiFlwUPAoUz+grBzcTWyx79ZmoAa4HW89+vDSqWe8/Yqw+5ybihvSJSvnZcX5o LMVpMwvZFO6s2FCZq7zSeL2zFY85Q/LxexEd/FhA= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09OGLrwo013832; Sat, 24 Oct 2020 16:21:55 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Message-Id: <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> Content-Type: multipart/mixed; boundary="Apple-Mail=_CF4DD323-DE40-4752-9858-14D1A017C92D" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes Date: Sat, 24 Oct 2020 18:21:53 +0200 In-Reply-To: <83mu0ciz3a.fsf@gnu.org> To: Eli Zaretskii References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1A.5F9454A4.000C: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=e6d4tph/ c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=0vIXtaScyy5i44ZiIu0A:9 a=CjuIK1q_8ugA:10 a=47JzH84rEA7rK7q0I68A:9 a=De_Ol2h6w80A:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 23 okt. 2020 kl. 20.20 skrev Eli Zaretskii : > I don't understand your answers and don't see how they > resolve the issues I raised. Sorry if I've been communicating badly (but it takes two to do it). I honestly thought I did address your concerns but must have misunderstood you. Please tell me what you believe I have not explained [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_CF4DD323-DE40-4752-9858-14D1A017C92D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 23 okt. 2020 kl. 20.20 skrev Eli Zaretskii : > I don't understand your answers and don't see how they > resolve the issues I raised. Sorry if I've been communicating badly (but it takes two to do it). I honestly thought I did address your concerns but must have = misunderstood you. Please tell me what you believe I have not explained properly, and I = promise I'll do my best to answer it without referring to any previous = message. Meanwhile, here is a proof of concept which may clarify what I failed to = put in words. It actually runs both the old and new value parsers on = data sent by GDB, and logs an error message if discrepancies are found. = They seem to work identically unless there are strings with octal = escapes, which are handled correctly by the new parser. (Of course, a = proper patch would not retain the old parser.) If gdb-mi-decode-strings is non-nil, then file names, string contents = etc are properly decoded as UTF-8 as expected, without any of the = bugginess of the current code. Otherwise raw bytes are shown as octal = escapes, which also fixes the original bug. --Apple-Mail=_CF4DD323-DE40-4752-9858-14D1A017C92D Content-Disposition: attachment; filename=gdb-mi.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="gdb-mi.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 9e8af84a60..867e13b38a 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2516,8 +2516,9 @@ gud-gdbmi-marker-filter "Filter GDB/MI output." ;; If required, decode non-ASCII text encoded with octal escapes. - (or (null gdb-mi-decode-strings) - (setq string (gdb-mi-decode string))) +;; FIXME: Now done in gdb-mi--parse-c-string; this can go away +;; (or (null gdb-mi-decode-strings) +;; (setq string (gdb-mi-decode string))) ;; Record transactions if logging is enabled. (when gdb-enable-debug @@ -2833,7 +2834,7 @@ gdb-jsonify-buffer (goto-char (point-max)) (insert "}"))) -(defun gdb-json-read-buffer (&optional fix-key fix-list) +(defun gdb-json-read-buffer-old (&optional fix-key fix-list) "Prepare and parse GDB/MI output in current buffer with `json-read'. FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'." @@ -2843,6 +2844,140 @@ gdb-json-read-buffer (let ((json-array-type 'list)) (json-read)))) +;; Parse result records: this process converts key=value to the cons pair +;; (variable . value) where variable is a symbol. Lists and tuples become +;; Lisp lists. + +(defun gdb-mi--parse-tuple-or-list (end-char) + "Parse a GDB/MI tuple or list, both returned as a Lisp list. +END-CHAR is the ending delimiter; will stop at end-of-buffer otherwise." + (let ((items nil)) + (while (not (or (eobp) + (eq (following-char) end-char))) + (let ((item (gdb-mi--parse-result-or-value))) + (push item items) + (when (eq (following-char) ?,) + (forward-char)))) + (when (eq (following-char) end-char) + (forward-char)) + (nreverse items))) + +(defun gdb-mi--parse-c-string () + (let ((start (point)) + (pieces nil) + (octals-used nil)) + (while (and (re-search-forward (rx (or ?\\ ?\"))) + (not (eq (preceding-char) ?\"))) + (push (buffer-substring start (1- (point))) pieces) + (cond + ((looking-at (rx (** 1 3 (any "0-7")))) ;FIXME: optimise + (push (unibyte-string (string-to-number (match-string 0) 8)) pieces) + (setq octals-used t) + (goto-char (match-end 0))) + ((looking-at (rx (any "ntrvfab\"\\"))) + (push (cdr (assq (following-char) + '((?n . "\n") + (?t . "\t") + (?r . "\r") + (?v . "\v") + (?f . "\f") + (?a . "\a") + (?b . "\b") + (?\" . "\"") + (?\\ . "\\")))) + pieces) + (forward-char)) + (t + (error "Unrecognised escape char: %c" (following-char)))) + (setq start (point))) + (push (buffer-substring start (1- (point))) pieces) + (let ((s (apply #'concat (nreverse pieces)))) + (if (and octals-used gdb-mi-decode-strings) + (let ((coding + (if (coding-system-p gdb-mi-decode-strings) + gdb-mi-decode-strings + ;; FIXME: try making this cheaper + (buffer-local-value + 'buffer-file-coding-system + (gdb-get-buffer-create 'gdb-partial-output-buffer))))) + (decode-coding-string s coding)) + s)))) + +(defun gdb-mi--parse-value () + "Parse a value." + (cond + ((eq (following-char) ?\{) + (forward-char) + (gdb-mi--parse-tuple-or-list ?\})) + ((eq (following-char) ?\[) + (forward-char) + (gdb-mi--parse-tuple-or-list ?\])) + ((eq (following-char) ?\") + (forward-char) + (gdb-mi--parse-c-string)) + (t (error "Bad start of result or value: %c" (following-char))))) + +(defun gdb-mi--parse-result-or-value () + "Parse a result (key=value) or value." + (if (looking-at (rx (group (+ (any "a-zA-Z" ?_ ?-))) "=")) + (progn + (goto-char (match-end 0)) + (let* ((variable (intern (match-string 1))) + (value (gdb-mi--parse-value))) + (cons variable value))) + (gdb-mi--parse-value))) + +(defun gdb-mi--parse-results () + "Parse zero or more result productions as a list." + (gdb-mi--parse-tuple-or-list nil)) + +(defun gdb-mi--fix-key (key value) + "Convert any result (key-value pair) in VALUE whose key is KEY to its value." + (cond + ((atom value) value) + ((symbolp (car value)) + (if (eq (car value) key) + (cdr value) + (cons (car value) (gdb-mi--fix-key key (cdr value))))) + (t (mapcar (lambda (x) (gdb-mi--fix-key key x)) value)))) + +(defun gdb-mi--extend-fullname (remote value) + "Prepend REMOTE to any result string with `fullname' as the key." + (cond + ((atom value) value) + ((symbolp (car value)) + (if (and (eq (car value) 'fullname) + (stringp (cdr value))) + (cons 'fullname (concat remote (cdr value))) + (cons (car value) (gdb-mi--extend-fullname remote (cdr value))))) + (t (mapcar (lambda (x) (gdb-mi--extend-fullname remote x)) value)))) + +(defun gdb-json-read-buffer-new (&optional fix-key _fix-list) + (goto-char (point-min)) + (let ((results (gdb-mi--parse-results))) + (let ((remote (file-remote-p default-directory))) + (when remote + (setq results (gdb-mi--extend-fullname remote results)))) + (when fix-key + ;; FIXME: fix-key should be a symbol. + (setq results (gdb-mi--fix-key (intern fix-key) results))) + ;; FIXME: fix-list is irrelevant since tuples and lists in the + ;; input both yield Lisp lists. + results)) + +(defun gdb-json-read-buffer (&optional fix-key fix-list) + (save-excursion + (let* ((input (buffer-string)) + (new (gdb-json-read-buffer-new fix-key fix-list)) + (_ (cl-assert (equal (buffer-string) input))) + (old (gdb-json-read-buffer-old fix-key fix-list))) + (unless (equal old new) + (message "ERROR: input=%S" input) + (message "OLD: %S" old) + (message "NEW: %S" new)) + new))) + + (defun gdb-json-string (string &optional fix-key fix-list) "Prepare and parse STRING containing GDB/MI output with `json-read'. --Apple-Mail=_CF4DD323-DE40-4752-9858-14D1A017C92D-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 13:23:27 2020 Received: (at 44173) by debbugs.gnu.org; 24 Oct 2020 17:23:27 +0000 Received: from localhost ([127.0.0.1]:35065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWNGJ-0005DY-3N for submit@debbugs.gnu.org; Sat, 24 Oct 2020 13:23:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWNGG-0005DI-LS for 44173@debbugs.gnu.org; Sat, 24 Oct 2020 13:23:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50112) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWNGB-00085E-AP; Sat, 24 Oct 2020 13:23:19 -0400 Received: from [176.228.60.248] (port=4419 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kWNGA-0004gJ-J1; Sat, 24 Oct 2020 13:23:19 -0400 Date: Sat, 24 Oct 2020 20:23:06 +0300 Message-Id: <837drfh72d.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sat, 24 Oct 2020 18:21:53 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Sat, 24 Oct 2020 18:21:53 +0200 > Cc: 44173@debbugs.gnu.org > > If gdb-mi-decode-strings is non-nil, then file names, string contents etc are properly decoded as UTF-8 as expected Not UTF-8, but the value of gdb-mi-decode-strings, if it's a coding-system, right? > without any of the bugginess of the current code. Otherwise raw bytes are shown as octal escapes, which also fixes the original bug. I hoped/thought you intended to solve this issue as well, but if the situation is no worse than it was before, it's fine to leave it at that. However, please retain at least part of the comment regarding gdb-mi-decode-strings and the ambiguity related to its use, I think it's important that people know that. And I hope you've verified that this does still fix the problem in bug#21572, which this variable and the related code tries to fix? > + (t > + (error "Unrecognised escape char: %c" (following-char)))) How about leaving the text unchanged instead of signaling an error (and thus preventing the entire data from getting to the higher levels)? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 14:27:27 2020 Received: (at 44173) by debbugs.gnu.org; 24 Oct 2020 18:27:27 +0000 Received: from localhost ([127.0.0.1]:35108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWOGE-0006nU-Pr for submit@debbugs.gnu.org; Sat, 24 Oct 2020 14:27:27 -0400 Received: from mail1458c50.megamailservers.eu ([91.136.14.58]:41558 helo=mail267c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWOGB-0006nC-M4 for 44173@debbugs.gnu.org; Sat, 24 Oct 2020 14:27:25 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603564036; bh=3hM3LXIir97xZr6FqnUXrxnk4r4YHaatpC2PNSfnBwc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=XqjOtV9I4Y5CqnWZjEtuxw9EV63fdggCiAxHt9Jw3Q2veZ0UNMAct4cfP5QjPYN1E 5ElZ5UTI7rjpo+rBo01YBlsdTp86elBoYaRhOAWNPrJViuCwBjetMNd1DgKcYq+9sO /0PAWozBC7XYC8jvIvZFhzDM3AyQRDENPkOZMlVY= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09OIRDJ0027189; Sat, 24 Oct 2020 18:27:15 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <837drfh72d.fsf@gnu.org> Date: Sat, 24 Oct 2020 20:27:13 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1D.5F947204.0057: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Cf92G4jl c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=7rUh4Dt9qm2lQ08n2l4A:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 24 okt. 2020 kl. 19.23 skrev Eli Zaretskii : >> If gdb-mi-decode-strings is non-nil, then file names, string contents etc are properly decoded as UTF-8 as expected > > Not UTF-8, but the value of gdb-mi-decode-strings, if it's a > coding-system, [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 24 okt. 2020 kl. 19.23 skrev Eli Zaretskii : >> If gdb-mi-decode-strings is non-nil, then file names, string contents = etc are properly decoded as UTF-8 as expected >=20 > Not UTF-8, but the value of gdb-mi-decode-strings, if it's a > coding-system, right? Right. > I hoped/thought you intended to solve this issue as well, but if the > situation is no worse than it was before, it's fine to leave it at > that. However, please retain at least part of the comment regarding > gdb-mi-decode-strings and the ambiguity related to its use, I think > it's important that people know that. Yes, the valid parts of the comment will be kept. I'm not sure what a solution to the remaining problems would look like, = but it would probably involve splitting gdb-mi-decode-strings in = separate variables for file names and program values. On the other hand, = given that the world is converging to UTF-8, it may be a disappearing = problem? In any case, should we want to decode strings differently depending on = their structural position in the answer, I believe that it would be = better done in the field accessors instead of the parser. For example, (bindat-get-field breakpoint 'fullname) might become something like (gdb-mi--get-string-field breakpoint 'fullname 'filename) which would tell the accessor how to decode the field. In the short term I suggest changing the default value of = gdb-mi-decode-strings to 't' as this gives the behaviour most commonly = expected by the user. However, it is not critical, and in any case = orthogonal to the issue at hand. What do you think? > And I hope you've verified that this does still fix the problem in > bug#21572, which this variable and the related code tries to fix? Yes -- I tried debugging programs whose source file names contain = Unicode chars and they were shown correctly (with gdb-mi-decode-strings = =3D t). >> + (t >> + (error "Unrecognised escape char: %c" (following-char)))) >=20 > How about leaving the text unchanged instead of signaling an error > (and thus preventing the entire data from getting to the higher > levels)? Maybe, but I really dislike hiding bugs by being overly tolerant. It is = precisely this tolerant nature of 'json-read' that caused this bug in = the first place. (I'm not sure whether this is compliant with RFC 8259, = by the way.) I think it's fine to signal errors if the syntax isn't what we expect; = after all, that is what the JSON parser does in other cases. Thanks for the helpful comments. I'll prepare a proper patch. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 14:45:20 2020 Received: (at 44173) by debbugs.gnu.org; 24 Oct 2020 18:45:20 +0000 Received: from localhost ([127.0.0.1]:35113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWOXY-0007Ea-El for submit@debbugs.gnu.org; Sat, 24 Oct 2020 14:45:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWOXX-0007EM-9K for 44173@debbugs.gnu.org; Sat, 24 Oct 2020 14:45:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51237) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWOXR-0000KA-Pf; Sat, 24 Oct 2020 14:45:13 -0400 Received: from [176.228.60.248] (port=1473 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kWOXN-0002PL-I8; Sat, 24 Oct 2020 14:45:13 -0400 Date: Sat, 24 Oct 2020 21:44:57 +0300 Message-Id: <833623h39y.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sat, 24 Oct 2020 20:27:13 +0200) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Sat, 24 Oct 2020 20:27:13 +0200 > Cc: 44173@debbugs.gnu.org > > > I hoped/thought you intended to solve this issue as well, but if the > > situation is no worse than it was before, it's fine to leave it at > > that. However, please retain at least part of the comment regarding > > gdb-mi-decode-strings and the ambiguity related to its use, I think > > it's important that people know that. > > Yes, the valid parts of the comment will be kept. > I'm not sure what a solution to the remaining problems would look like, but it would probably involve splitting gdb-mi-decode-strings in separate variables for file names and program values. How do we know, at that level, whether a string is a file name or not? And even if we succeed in knowing that about source file names of the debuggee, we have no hope of knowing whether some string in the debuggee is a file name or just a string. > On the other hand, given that the world is converging to UTF-8, it may be a disappearing problem? The rate of the convergence is severely exaggerated. And GDB can be used to debug all kinds of targets, which is why it has settings for the host and the target charsets. As long as GDB doesn't convert everything to UTF-8, I don't see how gdb-mi.el could do that. > In any case, should we want to decode strings differently depending on their structural position in the answer, I believe that it would be better done in the field accessors instead of the parser. For example, > > (bindat-get-field breakpoint 'fullname) > > might become something like > > (gdb-mi--get-string-field breakpoint 'fullname 'filename) > > which would tell the accessor how to decode the field. See above: this still doesn't solve the problem of knowing the correct encoding, even in specific fields of specific responses. > In the short term I suggest changing the default value of gdb-mi-decode-strings to 't' as this gives the behaviour most commonly expected by the user. However, it is not critical, and in any case orthogonal to the issue at hand. What do you think? I'm not at all sure this is what users want, since non-ASCII file names in debugging are quite rare. But I don't mind changing the default value. > >> + (t > >> + (error "Unrecognised escape char: %c" (following-char)))) > > > > How about leaving the text unchanged instead of signaling an error > > (and thus preventing the entire data from getting to the higher > > levels)? > > Maybe, but I really dislike hiding bugs by being overly tolerant. We could display a warning. But interrupting (and possibly ruining) a debugging session because of our bug is very harsh: the user is certainly not guilty. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 24 15:41:58 2020 Received: (at 44173) by debbugs.gnu.org; 24 Oct 2020 19:41:58 +0000 Received: from localhost ([127.0.0.1]:35154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWPQM-0000B8-3P for submit@debbugs.gnu.org; Sat, 24 Oct 2020 15:41:58 -0400 Received: from mail1452c50.megamailservers.eu ([91.136.14.52]:46474 helo=mail266c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWPQI-0000As-Va for 44173@debbugs.gnu.org; Sat, 24 Oct 2020 15:41:57 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603568508; bh=6HQp65DI8H8WgXXcE5sYVt+DaGRLYrxhPSDHv9LSJ+Y=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=K/t929oZKqS55M5ekOxqJpN3t72aHuvYYis1TnED2N9EkXIDqrYZgcXTZYjc7s9OL qHOD5rqLCM4oEMgxXqUs81Fhh0AJGWAM5/JrR8kxKaHGUwpQZ74PEqKOTL4Dg/BwJb hxl3I9bs14cdgXQKDaeH9ZWjNko+3M5PjCvULThE= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09OJfkDQ007877; Sat, 24 Oct 2020 19:41:47 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <833623h39y.fsf@gnu.org> Date: Sat, 24 Oct 2020 21:41:45 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1C.5F94837C.0048: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=A5MSwJeG c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=7rUh4Dt9qm2lQ08n2l4A:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 24 okt. 2020 kl. 20.44 skrev Eli Zaretskii : > How do we know, at that level, whether a string is a file name or not? > And even if we succeed in knowing that about source file names of the > debuggee, we have no hope of knowing whether some str [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 24 okt. 2020 kl. 20.44 skrev Eli Zaretskii : > How do we know, at that level, whether a string is a file name or not? > And even if we succeed in knowing that about source file names of the > debuggee, we have no hope of knowing whether some string in the > debuggee is a file name or just a string. I think we can distinguish source file names by what field they occur in = (which is why I thought that doing it in the accessor might do), but you = are certainly right about strings in the program being debugged. > The rate of the convergence is severely exaggerated. And GDB can be > used to debug all kinds of targets, which is why it has settings for > the host and the target charsets. As long as GDB doesn't convert > everything to UTF-8, I don't see how gdb-mi.el could do that. I don't disagree. What we can do is to have defaults that cover the most = likely case and let users with less common setups change those. > See above: this still doesn't solve the problem of knowing the correct > encoding, even in specific fields of specific responses. That's true, and I don't have a good answer. Perhaps we somehow can get = GDB (or the OS, if it is the file system) to inform us. But as you = noted, even GDB doesn't know what encoding the debugged program uses. It = could very well be multiple encodings at once. A serious debugger interface would probably push this decision to the = data presentation layer and allow the user to specify how he wants to = view the contents of a particular string, in the same way that users = select radix for viewing integers. Not sure how this would be done in = gdb-mi. >> In the short term I suggest changing the default value of = gdb-mi-decode-strings to 't' as this gives the behaviour most commonly = expected by the user. However, it is not critical, and in any case = orthogonal to the issue at hand. What do you think? >=20 > I'm not at all sure this is what users want, since non-ASCII file > names in debugging are quite rare. But I don't mind changing the > default value. Let's do this separately then. It seems unlikely to cause trouble. >> Maybe, but I really dislike hiding bugs by being overly tolerant. >=20 > We could display a warning. But interrupting (and possibly ruining) a > debugging session because of our bug is very harsh: the user is > certainly not guilty. I definitely have some sympathy for that point of view, but then again, = warnings that don't impede the user's progress tend to go unfixed, so = being 'nice' to the user isn't necessarily in his or her best interest. But we could try (warn ...), which I suppose you were thinking about? = It's fairly visible. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 25 08:48:02 2020 Received: (at 44173) by debbugs.gnu.org; 25 Oct 2020 12:48:02 +0000 Received: from localhost ([127.0.0.1]:35934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWfRJ-0000YV-0A for submit@debbugs.gnu.org; Sun, 25 Oct 2020 08:48:02 -0400 Received: from mail1442c50.megamailservers.eu ([91.136.14.42]:38804 helo=mail264c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWfRG-0000YD-85 for 44173@debbugs.gnu.org; Sun, 25 Oct 2020 08:48:00 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603630071; bh=s2Eeama6XcCOIZ14rWoIQySu/d9TYTvx2MWFrwz7dc4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=piirOxT7e6nmy+5G0AnDHKzOs1ELozcPG+FFzSrTa71eKzsNwYNwkUWNa11gCwIff BupVhYHDzk82IeE7bm/IKbVQuVNIoD+6lCmnlNF2pvW/Q2BpQ+GeQXjG90tN3lFPVg WKa5/xeB3CNmjgWYZk+ccQRzf9OB2Jq+KUm+gjKM= Feedback-ID: mattiase@acm.or Received: from localhost.localdomain (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail264c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09PClnD6008089; Sun, 25 Oct 2020 12:47:51 +0000 Message-ID: <055a3d6769e3922525082f95468519b5c5491090.camel@acm.org> Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: Mattias =?ISO-8859-1?Q?Engdeg=E5rd?= To: Eli Zaretskii Date: Sun, 25 Oct 2020 13:47:49 +0100 In-Reply-To: <833623h39y.fsf@gnu.org> References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> Content-Type: multipart/mixed; boundary="=-b7/EYwVuHu019ppgoMKp" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 X-CTCH-RefID: str=0001.0A782F21.5F9573F7.0034: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=PPNxBsiC c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=LLPZWm0_0O8A:10 a=J25bvR6Ei5JXhURPxpsA:9 a=QEXdDO2ut3YA:10 a=N54-gffFAAAA:8 a=mDV3o1hIAAAA:8 a=3TquBLveltQazBSQ4NoA:9 a=ErXYxWBFPQg7SNkx:21 a=eKKq3G446wv2sHf0:21 a=B2y7HmGcmWMA:10 a=6l0D2HzqY3Epnrm8mE3f:22 a=_FVE-zBwftR9WsbkzFJk:22 a=pHzHmUro8NiASowvMSCR:22 a=nt3jZW36AmriUCFCBwmW:22 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Here is the complete patch. It does not change the default value of gdb-mi-decode-strings. From 413b5e1ade51d9d4f1013649e03330d880004f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sun, 25 Oct 2020 12:40:36 +0100 Subject: [PATCH] Parse GDB/MI [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-b7/EYwVuHu019ppgoMKp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Here is the complete patch. It does not change the default value of gdb-mi-decode-strings. --=-b7/EYwVuHu019ppgoMKp Content-Disposition: attachment; filename*0=0001-Parse-GDB-MI-results-directly-instead-of-going-via-J.pat; filename*1=ch Content-Type: text/x-patch; name="0001-Parse-GDB-MI-results-directly-instead-of-going-via-J.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSA0MTNiNWUxYWRlNTFkOWQ0ZjEwMTM2NDllMDMzMzBkODgwMDA0ZjIzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/TWF0dGlhcz0yMEVuZ2RlZz1DMz1BNXJkPz0g PG1hdHRpYXNlQGFjbS5vcmc+CkRhdGU6IFN1biwgMjUgT2N0IDIwMjAgMTI6NDA6MzYgKzAxMDAK U3ViamVjdDogW1BBVENIXSBQYXJzZSBHREIvTUkgcmVzdWx0cyBkaXJlY3RseSBpbnN0ZWFkIG9m IGdvaW5nIHZpYSBKU09OCiAoYnVnIzQ0MTczKQoKVHJhbnNsYXRpbmcgR0RCL01JIGludG8gSlNP TiBpcyBhbiB1bm5lY2Vzc2FyeSBhbmQgZnJhZ2lsZSBkZXRvdXIKdGhhdCBtYWRlIGl0IGhhcmQg dG8gZGVhbCB3aXRoIG9jdGFsIGVzY2FwZXMgaW4gc3RyaW5ncyBjb3JyZWN0bHkuClBhcnNlIEdE Qi9NSSBkaXJlY3RseSBpbnN0ZWFkLgoKKiBsaXNwL3Byb2dtb2Rlcy9nZGItbWkuZWwgKGdkYi1t aS1kZWNvZGUtc3RyaW5ncyk6IEFkanVzdCBkb2Mgc3RyaW5nLgooZ2RiLW1pLWRlY29kZSwgZ3Vk LWdkYm1pLW1hcmtlci1maWx0ZXIpOiBSZW1vdmUgZ2RiLW1pLWRlY29kZS4KKGdkYi1qc29uaWZ5 LWJ1ZmZlcik6IFJlbW92ZS4KKGdkYi1taS0tcGFyc2UtdHVwbGUtb3ItbGlzdCwgZ2RiLW1pLS1w YXJzZS1jLXN0cmluZykKKGdkYi1taS0tcGFyc2UtdmFsdWUsIGdkYi1taS0tc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3aXNlLiIKKyAgKGxldCAoKGl0ZW1zIG5pbCkpCisg ICAgKHdoaWxlIChub3QgKG9yIChlb2JwKQorICAgICAgICAgICAgICAgICAgICAoZXEgKGZvbGxv d2luZy1jaGFyKSBlbmQtY2hhcikpKQorICAgICAgKGxldCAoKGl0ZW0gKGdkYi1taS0tcGFyc2Ut cmVzdWx0LW9yLXZhbHVlKSkpCisgICAgICAgIChwdXNoIGl0ZW0gaXRlbXMpCisgICAgICAgICh3 aGVuIChlcSAoZm9sbG93aW5nLWNoYXIpID8sKQorICAgICAgICAgIChmb3J3YXJkLWNoYXIpKSkp CisgICAgKHdoZW4gKGVxIChmb2xsb3dpbmctY2hhcikgZW5kLWNoYXIpCisgICAgICAoZm9yd2Fy ZC1jaGFyKSkKKyAgICAobnJldmVyc2UgaXRlbXMpKSkKKworKGRlZnVuIGdkYi1taS0tcGFyc2Ut Yy1zdHJpbmcgKCkKKyAgIlBhcnNlIGEgYy1zdHJpbmcuIgorICAobGV0ICgoc3RhcnQgKHBvaW50 KSkKKyAgICAgICAgKHBpZWNlcyBuaWwpCisgICAgICAgIChvY3RhbHMtdXNlZCBuaWwpKQorICAg ICh3aGlsZSAoYW5kIChyZS1zZWFyY2gtZm9yd2FyZCAocnggKG9yID9cXCA/XCIpKSkKKyAgICAg ICAgICAgICAgICAobm90IChlcSAocHJlY2VkaW5nLWNoYXIpID9cIikpKQorICAgICAgKHB1c2gg KGJ1ZmZlci1zdWJzdHJpbmcgc3RhcnQgKDEtIChwb2ludCkpKSBwaWVjZXMpCisgICAgICAoY29u ZAorICAgICAgICgobG9va2luZy1hdCAocnggKGFueSAiMC03IikgKD8gKGFueSAiMC03IikgKD8g KGFueSAiMC03IikpKSkpCisgICAgICAgIChwdXNoICh1bmlieXRlLXN0cmluZyAoc3RyaW5nLXRv LW51bWJlciAobWF0Y2gtc3RyaW5nIDApIDgpKSBwaWVjZXMpCisgICAgICAgIChzZXRxIG9jdGFs cy11c2VkIHQpCisgICAgICAgIChnb3RvLWNoYXIgKG1hdGNoLWVuZCAwKSkpCisgICAgICAgKChs b29raW5nLWF0IChyeCAoYW55ICJudHJ2ZmFiXCJcXCIpKSkKKyAgICAgICAgKHB1c2ggKGNkciAo YXNzcSAoZm9sbG93aW5nLWNoYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgJygoP24gLiAi XG4iKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKD90IC4gIlx0IikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICg/ciAuICJcciIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAo P3YgLiAiXHYiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKD9mIC4gIlxmIikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICg/YSAuICJcYSIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAoP2IgLiAiXGIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKD9cIiAuICJcIiIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAoP1xcIC4gIlxcIikpKSkKKyAgICAgICAgICAg ICAgcGllY2VzKQorICAgICAgICAoZm9yd2FyZC1jaGFyKSkKKyAgICAgICAodAorICAgICAgICAo d2FybiAiVW5yZWNvZ25pc2VkIGVzY2FwZSBjaGFyOiAlYyIgKGZvbGxvd2luZy1jaGFyKSkpKQor ICAgICAgKHNldHEgc3RhcnQgKHBvaW50KSkpCisgICAgKHB1c2ggKGJ1ZmZlci1zdWJzdHJpbmcg c3RhcnQgKDEtIChwb2ludCkpKSBwaWVjZXMpCisgICAgKGxldCAoKHMgKGFwcGx5ICMnY29uY2F0 IChucmV2ZXJzZSBwaWVjZXMpKSkpCisgICAgICAoaWYgKGFuZCBvY3RhbHMtdXNlZCBnZGItbWkt ZGVjb2RlLXN0cmluZ3MpCisgICAgICAgICAgKGxldCAoKGNvZGluZworICAgICAgICAgICAgICAg ICAoaWYgKGNvZGluZy1zeXN0ZW0tcCBnZGItbWktZGVjb2RlLXN0cmluZ3MpCisg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tcmVzdWx0 cykpKQogICAgIChsZXQgKChyZW1vdGUgKGZpbGUtcmVtb3RlLXAgZGVmYXVsdC1kaXJlY3Rvcnkp KSkKICAgICAgICh3aGVuIHJlbW90ZQotICAgICAgICAoZ290by1jaGFyIChwb2ludC1taW4pKQot ICAgICAgICAod2hpbGUgKHJlLXNlYXJjaC1mb3J3YXJkICJbXFxbLF1mdWxsbmFtZT1cIlxcKC4r XFwpXCIiIG5pbCB0KQotICAgICAgICAgIChyZXBsYWNlLW1hdGNoIChjb25jYXQgcmVtb3RlICJc XDEiKSBuaWwgbmlsIG5pbCAxKSkpKQotICAgIChnb3RvLWNoYXIgKHBvaW50LW1pbikpCisgICAg ICAgIChzZXRxIHJlc3VsdHMgKGdkYi1taS0tZXh0ZW5kLWZ1bGxuYW1lIHJlbW90ZSByZXN1bHRz KSkpKQogICAgICh3aGVuIGZpeC1rZXkKLSAgICAgIChzYXZlLWV4Y3Vyc2lvbgotICAgICAgICAo d2hpbGUgKHJlLXNlYXJjaC1mb3J3YXJkIChjb25jYXQgIltcXFssXVxcKCIgZml4LWtleSAiPVxc KSIpIG5pbCB0KQotICAgICAgICAgIChyZXBsYWNlLW1hdGNoICIiIG5pbCBuaWwgbmlsIDEpKSkp Ci0gICAgKHdoZW4gZml4LWxpc3QKLSAgICAgIChzYXZlLWV4Y3Vyc2lvbgotICAgICAgICA7OyBG aW5kIHBvc2l0aW9ucyBvZiBicmFjZXMgd2hpY2ggZW5jbG9zZSBicm9rZW4gbGlzdAotICAgICAg ICAod2hpbGUgKHJlLXNlYXJjaC1mb3J3YXJkIChjb25jYXQgZml4LWxpc3QgIj17XCIiKSBuaWwg dCkKLSAgICAgICAgICAobGV0ICgocDEgKGdvdG8tY2hhciAoLSAocG9pbnQpIDIpKSkKLSAgICAg ICAgICAgICAgICAocDIgKHByb2duIChmb3J3YXJkLXNleHApCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAoMS0gKHBvaW50KSkpKSkKLSAgICAgICAgICAgIDs7IFJlcGxhY2UgYnJhY2VzIHdp dGggYnJhY2tldHMKLSAgICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbgotICAgICAgICAgICAgICAo Z290by1jaGFyIHAxKQotICAgICAgICAgICAgICAoZGVsZXRlLWNoYXIgMSkKLSAgICAgICAgICAg ICAgKGluc2VydCAiWyIpCi0gICAgICAgICAgICAgIChnb3RvLWNoYXIgcDIpCi0gICAgICAgICAg ICAgIChkZWxldGUtY2hhciAxKQotICAgICAgICAgICAgICAoaW5zZXJ0ICJdIikpKSkpKQotICAg IChnb3RvLWNoYXIgKHBvaW50LW1pbikpCi0gICAgKGluc2VydCAieyIpCi0gICAgKGxldCAoKHJl IChjb25jYXQgIlxcKFtbOmFsbnVtOl1fLV0rXFwpPSIpKSkKLSAgICAgICh3aGlsZSAocmUtc2Vh cmNoLWZvcndhcmQgcmUgbmlsIHQpCi0gICAgICAgIChyZXBsYWNlLW1hdGNoICJcIlxcMVwiOiIg bmlsIG5pbCkKLSAgICAgICAgKGlmIChlcSAoY2hhci1hZnRlcikgP1wiKSAoZm9yd2FyZC1zZXhw KSAoZm9yd2FyZC1jaGFyKSkpKQotICAgIChnb3RvLWNoYXIgKHBvaW50LW1heCkpCi0gICAgKGlu c2VydCAifSIpKSkKLQotKGRlZnVuIGdkYi1qc29uLXJlYWQtYnVmZmVyICgmb3B0aW9uYWwgZml4 LWtleSBmaXgtbGlzdCkKLSAgIlByZXBhcmUgYW5kIHBhcnNlIEdEQi9NSSBvdXRwdXQgaW4gY3Vy cmVudCBidWZmZXIgd2l0aCBganNvbi1yZWFkJy4KLQotRklYLUtFWSBhbmQgRklYLUxJU1Qgd29y ayBhcyBpbiBgZ2RiLWpzb25pZnktYnVmZmVyJy4iCi0gIChnZGItanNvbmlmeS1idWZmZXIgZml4 LWtleSBmaXgtbGlzdCkKLSAgKHNhdmUtZXhjdXJzaW9uCi0gICAgKGdvdG8tY2hhciAocG9pbnQt bWluKSkKLSAgICAobGV0ICgoanNvbi1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KChnYW1tYSAuICJ5IikgKGRlbHRh IC4gKCkpKSkpKSkpCisgIChzaG91bGQgKGVxdWFsCisgICAgICAgICAgIChnZGItbWktLWZyb20t c3RyaW5nCisgICAgICAgICAgICAiYWxwaGE9XCJhYlxcbmNkXCIsYmV0YT1bXCJ4XCIse2dhbW1h PVwieVwiLGRlbHRhPVtdfV0iCisgICAgICAgICAgICAnZ2FtbWEpCisgICAgICAgICAgICcoKGFs cGhhIC4gImFiXG5jZCIpCisgICAgICAgICAgICAgKGJldGEgLiAoIngiICgieSIgKGRlbHRhIC4g KCkpKSkpKSkpCisKKyAgKHNob3VsZCAoZXF1YWwgKGdkYi1taS0tZnJvbS1zdHJpbmcgImFscGhh PVwiYVxcMzAzXFwyNDViXCIiKQorICAgICAgICAgICAgICAgICBgKChhbHBoYSAuICwoc3RyaW5n LXRvLW11bHRpYnl0ZSAiYVwzMDNcMjQ1YiIpKSkpKQorICAobGV0ICgoZ2RiLW1pLWRlY29kZS1z dHJpbmdzICd1dGYtOCkpCisgICAgKHNob3VsZCAoZXF1YWwgKGdkYi1taS0tZnJvbS1zdHJpbmcg ImFscGhhPVwiYVxcMzAzXFwyNDViXCIiKQorICAgICAgICAgICAgICAgICAgICcoKGFscGhhIC4g ImHDpWIiKSkpKSkKKyAgKQorCisocHJvdmlkZSAnZ2RiLW1pLXRlc3RzKQotLSAKMi4yNi4yCgo= --=-b7/EYwVuHu019ppgoMKp-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 27 14:17:06 2020 Received: (at 44173) by debbugs.gnu.org; 27 Oct 2020 18:17:06 +0000 Received: from localhost ([127.0.0.1]:45781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTWr-0005N2-S6 for submit@debbugs.gnu.org; Tue, 27 Oct 2020 14:17:06 -0400 Received: from mail224c50.megamailservers.eu ([91.136.10.234]:56660 helo=mail33c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTWo-0005Io-GJ for 44173@debbugs.gnu.org; Tue, 27 Oct 2020 14:17:03 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1603822620; bh=pkHy0mqlZwQbP/4NgIm1nxrt9BHM8qtVAlo0pYL52jM=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=O2Z8hoVxMFC+/ctdkdFDaL6bUO3Bpq2Dauvr38oOECfvXDKtiHUDVQu5l9rer9MCN NWz9XPmzwIETaSI+xmKH28XKlUmeOeY72PEDjCT4rDtwVyL2R9OmaB9ybIt5XqG8nY +rHJYMjVB+w3BOq1V/qud5Tx6R4ncEQK2f0VRgQs= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se [85.230.78.48]) (authenticated bits=0) by mail33c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09RIGuAC021984; Tue, 27 Oct 2020 18:16:59 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_D07DED0A-E442-4A51-9C99-5FE2F3035DDE" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes Date: Tue, 27 Oct 2020 19:16:55 +0100 In-Reply-To: To: Eli Zaretskii References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1B.5F98641C.0034: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=eaJDgIMH c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=M51BFTxLslgA:10 a=719au2fyJ3IcWybkmOwA:9 a=CjuIK1q_8ugA:10 a=3ykR9pfZF-Th5EYBN40A:9 a=B2y7HmGcmWMA:10 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Here is an updated patch, rebased after some basic code cleaning in gdb-mi.el. OK for master? Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_D07DED0A-E442-4A51-9C99-5FE2F3035DDE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is an updated patch, rebased after some basic code cleaning in = gdb-mi.el. OK for master? --Apple-Mail=_D07DED0A-E442-4A51-9C99-5FE2F3035DDE Content-Disposition: attachment; filename=0001-Parse-GDB-MI-results-directly-instead-of-going-via-J.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Parse-GDB-MI-results-directly-instead-of-going-via-J.patch" Content-Transfer-Encoding: quoted-printable =46rom=2092b6c84f6554d3b266d239bc9da3ee9a07053e95=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2025=20Oct=202020=2012:40:36=20+0100=0A= Subject:=20[PATCH]=20Parse=20GDB/MI=20results=20directly=20instead=20of=20= going=20via=20JSON=0A=20(bug#44173)=0A=0ATranslating=20GDB/MI=20into=20= JSON=20is=20an=20unnecessary=20and=20fragile=20detour=0Athat=20made=20it=20= hard=20to=20deal=20with=20octal=20escapes=20in=20strings=20correctly.=0A= Parse=20GDB/MI=20directly=20instead.=0A=0A*=20lisp/progmodes/gdb-mi.el=20= (gdb-mi-decode-strings):=20Adjust=20doc=20string.=0A(gdb-mi-decode,=20= gud-gdbmi-marker-filter):=20Remove=20gdb-mi-decode.=0A= (gdb-jsonify-buffer):=20Remove.=0A(gdb-mi--parse-tuple-or-list,=20= gdb-mi--parse-c-string)=0A(gdb-mi--parse-value,=20= gdb-mi--parse-result-or-value)=0A(gdb-mi--parse-results,=20= gdb-mi--fix-key,=20gdb-mi--extend-fullname)=0A= (gdb-mi--c-string-from-string):=20New=20functions.=0A= (gdb-json-read-buffer,=20gdb-json-string,=20gdb-json-partial-output):=0A= Rename=20to=20gdb-mi--read-buffer,=20gdb-mi--from-string=20and=0A= gdb-mi--partial-output=20respectively.=20=20Remove=20useless=20FIX-LIST=0A= argument.=20=20FIX-KEY=20is=20now=20a=20symbol,=20not=20a=20string.=20= All=20callers=20updated.=0A(gdb-tooltip-print,=20= gdbmi-bnf-log-stream-output,=20gdb-internals)=0A(gdb-console,=20= gdb-done-or-error,=20gdb-get-source-file-list)=0A(gdb-get-prompt,=20= gdb-get-source-file):=0AUse=20gdb-mi--c-string-from-string=20instead=20= of=20'read'.=0A*=20test/lisp/progmodes/gdb-mi-tests.el:=20New=20file.=0A= ---=0A=20lisp/progmodes/gdb-mi.el=20=20=20=20=20=20=20=20=20=20=20=20|=20= 318=20+++++++++++++++-------------=0A=20= test/lisp/progmodes/gdb-mi-tests.el=20|=20=2044=20++++=0A=202=20files=20= changed,=20220=20insertions(+),=20142=20deletions(-)=0A=20create=20mode=20= 100644=20test/lisp/progmodes/gdb-mi-tests.el=0A=0Adiff=20--git=20= a/lisp/progmodes/gdb-mi.el=20b/lisp/progmodes/gdb-mi.el=0Aindex=20= f0262c2315..77dc392cb8=20100644=0A---=20a/lisp/progmodes/gdb-mi.el=0A+++=20= b/lisp/progmodes/gdb-mi.el=0A@@=20-89,7=20+89,6=20@@=0A=20;;;=20Code:=0A=20= =0A=20(require=20'gud)=0A-(require=20'json)=0A=20(require=20'cl-lib)=0A=20= (require=20'cl-seq)=0A=20(eval-when-compile=20(require=20'pcase))=0A@@=20= -166,7=20+165,7=20@@=20gdb-threads-list=0A=20=20=20"Associative=20list=20= of=20threads=20provided=20by=20\"-thread-info\"=20MI=20command.=0A=20=0A=20= Keys=20are=20thread=20numbers=20(in=20strings)=20and=20values=20are=20= structures=20as=0A-returned=20from=20-thread-info=20by=20= `gdb-json-partial-output'.=20=20Updated=20in=0A+returned=20from=20= -thread-info=20by=20`gdb-mi--partial-output'.=20=20Updated=20in=0A=20= `gdb-thread-list-handler-custom'.")=0A=20=0A=20(defvar=20= gdb-running-threads-count=20nil=0A@@=20-185,7=20+184,7=20@@=20= gdb-breakpoints-list=0A=20=20=20"Associative=20list=20of=20breakpoints=20= provided=20by=20\"-break-list\"=20MI=20command.=0A=20=0A=20Keys=20are=20= breakpoint=20numbers=20(in=20string)=20and=20values=20are=20structures=0A= -as=20returned=20from=20\"-break-list\"=20by=20`gdb-json-partial-output'=0A= +as=20returned=20from=20\"-break-list\"=20by=20`gdb-mi--partial-output'=0A= =20\(\"body\"=20field=20is=20used).=20Updated=20in=0A=20= `gdb-breakpoints-list-handler-custom'.")=0A=20=0A@@=20-1122,11=20= +1121,11=20@@=20gdb-tooltip-print=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"\\)")=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= nil=20t)=0A=20=20=20=20=20=20=20(tooltip-show=0A-=20=20=20=20=20=20=20= (concat=20expr=20"=20=3D=20"=20(read=20(match-string=201)))=0A+=20=20=20=20= =20=20=20(concat=20expr=20"=20=3D=20"=20(gdb-mi--c-string-from-string=20= (match-string=201)))=0A=20=20=20=20=20=20=20=20(or=20= gud-tooltip-echo-area=0A=20=09=20=20=20(not=20(display-graphic-p)))))=0A=20= =20=20=20=20=20((re-search-forward=20=20"msg=3D\\(\".+\"\\)$"=20nil=20t)=0A= -=20=20=20=20=20=20(tooltip-show=20(read=20(match-string=201))=0A+=20=20=20= =20=20=20(tooltip-show=20(gdb-mi--c-string-from-string=20(match-string=20= 1))=0A=20=20=20=20=20=20=20=20(or=20gud-tooltip-echo-area=0A=20=09=20=20=20= (not=20(display-graphic-p))))))))=0A=20=0A@@=20-1266,7=20+1265,7=20@@=20= gdb-mi--field=0A=20=20=20(cdr=20(assq=20field=20value)))=0A=20=0A=20= (defun=20gdb-var-create-handler=20(expr)=0A-=20=20(let*=20((result=20= (gdb-json-partial-output)))=0A+=20=20(let*=20((result=20= (gdb-mi--partial-output)))=0A=20=20=20=20=20(if=20(not=20(gdb-mi--field=20= result=20'msg))=0A=20=20=20=20=20=20=20=20=20(let=20((var=0A=20=09=20=20=20= =20=20=20=20(list=20(gdb-mi--field=20result=20'name)=0A@@=20-1307,7=20= +1306,7=20@@=20gdb-var-list-children=0A=20=0A=20(defun=20= gdb-var-list-children-handler=20(varnum)=0A=20=20=20(let*=20((var-list=20= nil)=0A-=09=20(output=20(gdb-json-partial-output=20'child))=0A+=09=20= (output=20(gdb-mi--partial-output=20'child))=0A=20=09=20(children=20= (gdb-mi--field=20output=20'children)))=0A=20=20=20=20=20(catch=20= 'child-already-watched=0A=20=20=20=20=20=20=20(dolist=20(var=20= gdb-var-list)=0A@@=20-1382,7=20+1381,7=20@@=20gdb-var-update=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20'gdb-var-update))=0A=20=0A=20(defun=20= gdb-var-update-handler=20()=0A-=20=20(let=20((changelist=20= (gdb-mi--field=20(gdb-json-partial-output)=20'changelist)))=0A+=20=20= (let=20((changelist=20(gdb-mi--field=20(gdb-mi--partial-output)=20= 'changelist)))=0A=20=20=20=20=20(dolist=20(var=20gdb-var-list)=0A=20=20=20= =20=20=20=20(setcar=20(nthcdr=205=20var)=20nil))=0A=20=20=20=20=20(let=20= ((temp-var-list=20gdb-var-list))=0A@@=20-2304,7=20+2303,8=20@@=20= gdbmi-bnf-log-stream-output=0A=20=20=20;;=20Suppress=20"No=20registers."=20= =20GDB=206.8=20and=20earlier=0A=20=20=20;;=20duplicates=20MI=20error=20= message=20on=20internal=20stream.=0A=20=20=20;;=20Don't=20print=20to=20= GUD=20buffer.=0A-=20=20(if=20(not=20(string-equal=20(read=20c-string)=20= "No=20registers.\n"))=0A+=20=20(if=20(not=20(string-equal=20= (gdb-mi--c-string-from-string=20c-string)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"No=20registers.\n"))=0A=20=20= =20=20=20=20=20(gdb-internals=20c-string)))=0A=20=0A=20=0A@@=20-2426,7=20= +2426,7=20@@=20gdbmi-bnf-incomplete-record-result=0A=20=20=20=20=20=20=20= is-complete)))=0A=20=0A=20=0A-;=20The=20following=20grammar=20rules=20= are=20not=20yet=20implemented=20by=20this=20GDBMI-BNF=20parser.=0A+;=20= The=20following=20grammar=20rules=20are=20not=20parsed=20directly=20by=20= this=20GDBMI-BNF=20parser.=0A=20;=20The=20handling=20of=20those=20rules=20= is=20currently=20done=20by=20the=20handlers=20registered=0A=20;=20in=20= gdbmi-bnf-result-state-configs=0A=20;=0A@@=20-2448,19=20+2448,17=20@@=20= gdbmi-bnf-incomplete-record-result=0A=20;=20list=20=3D=3D>=0A=20;=20=20=20= =20=20=20"[]"=20|=20"["=20value=20(=20","=20value=20)*=20"]"=20|=20"["=20= result=20(=20","=20result=20)*=20"]"=0A=20=0A+;;=20FIXME:=20This=20is=20= fragile:=20it=20relies=20on=20the=20assumption=20that=20all=20the=0A+;;=20= non-ASCII=20strings=20output=20by=20GDB,=20including=20names=20of=20the=20= source=0A+;;=20files,=20values=20of=20string=20variables=20in=20the=20= inferior,=20etc.,=20are=20all=0A+;;=20encoded=20in=20the=20same=20= encoding.=0A+=0A=20(defcustom=20gdb-mi-decode-strings=20nil=0A=20=20=20= "When=20non-nil,=20decode=20octal=20escapes=20in=20GDB=20output=20into=20= non-ASCII=20text.=0A=20=0A=20If=20the=20value=20is=20a=20coding-system,=20= use=20that=20coding-system=20to=20decode=0A=20the=20bytes=20= reconstructed=20from=20octal=20escapes.=20=20Any=20other=20non-nil=20= value=0A-means=20to=20decode=20using=20the=20coding-system=20set=20for=20= the=20GDB=20process.=0A-=0A-Warning:=20setting=20this=20non-nil=20might=20= mangle=20strings=20reported=20by=20GDB=0A-that=20have=20literal=20= substrings=20which=20match=20the=20\\nnn=20octal=20escape=0A-patterns,=20= where=20nnn=20is=20an=20octal=20number=20between=20200=20and=20377.=20=20= So=0A-we=20only=20recommend=20to=20set=20this=20variable=20non-nil=20if=20= the=20program=20you=0A-are=20debugging=20really=20reports=20non-ASCII=20= text,=20or=20some=20of=20its=20source=0A-file=20names=20include=20= non-ASCII=20characters."=0A+means=20to=20decode=20using=20the=20= coding-system=20set=20for=20the=20GDB=20process."=0A=20=20=20:type=20= '(choice=0A=20=20=20=20=20=20=20=20=20=20=20(const=20:tag=20"Don't=20= decode"=20nil)=0A=20=20=20=20=20=20=20=20=20=20=20(const=20:tag=20= "Decode=20using=20default=20coding-system"=20t)=0A@@=20-2468,47=20= +2466,9=20@@=20gdb-mi-decode-strings=0A=20=20=20:group=20'gdb=0A=20=20=20= :version=20"25.1")=0A=20=0A-;;=20The=20idea=20of=20the=20following=20= function=20was=20suggested=0A-;;=20by=20Kenichi=20Handa=20= .=0A-;;=0A-;;=20FIXME:=20This=20is=20fragile:=20it=20= relies=20on=20the=20assumption=20that=20all=20the=0A-;;=20non-ASCII=20= strings=20output=20by=20GDB,=20including=20names=20of=20the=20source=0A= -;;=20files,=20values=20of=20string=20variables=20in=20the=20inferior,=20= etc.,=20are=20all=0A-;;=20encoded=20in=20the=20same=20encoding.=20=20It=20= also=20assumes=20that=20the=20\nnn=0A-;;=20sequences=20are=20not=20split=20= between=20chunks=20of=20output=20of=20the=20GDB=20process=0A-;;=20due=20= to=20buffering,=20and=20arrive=20together.=20=20Finally,=20if=20some=20= string=0A-;;=20included=20literal=20\nnn=20strings=20(as=20opposed=20to=20= non-ASCII=20characters=0A-;;=20converted=20by=20GDB/MI=20to=20octal=20= escapes),=20this=20decoding=20will=20mangle=0A-;;=20those=20strings.=20=20= When/if=20GDB=20acquires=20the=20ability=20to=20not=0A-;;=20= escape-protect=20non-ASCII=20characters=20in=20its=20MI=20output,=20this=20= kludge=0A-;;=20should=20be=20removed.=0A-(defun=20gdb-mi-decode=20= (string)=0A-=20=20"Decode=20octal=20escapes=20in=20MI=20output=20STRING=20= into=20multibyte=20text."=0A-=20=20(let=20((coding=0A-=20=20=20=20=20=20=20= =20=20(if=20(coding-system-p=20gdb-mi-decode-strings)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20gdb-mi-decode-strings=0A-=20=20=20=20=20=20=20=20=20= =20=20(with-current-buffer=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (gdb-get-buffer-create=20'gdb-partial-output-buffer)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20buffer-file-coding-system))))=0A-=20=20=20=20= (with-temp-buffer=0A-=20=20=20=20=20=20(set-buffer-multibyte=20nil)=0A-=20= =20=20=20=20=20(prin1=20string=20(current-buffer))=0A-=20=20=20=20=20=20= (goto-char=20(point-min))=0A-=20=20=20=20=20=20;;=20prin1=20quotes=20the=20= octal=20escapes=20as=20well,=20which=20interferes=20with=0A-=20=20=20=20=20= =20;;=20their=20interpretation=20by=20'read'=20below.=20=20Remove=20the=20= extra=0A-=20=20=20=20=20=20;;=20backslashes=20to=20countermand=20that.=0A= -=20=20=20=20=20=20(while=20(re-search-forward=20= "\\\\\\(\\\\[2-3][0-7][0-7]\\)"=20nil=20t)=0A-=20=20=20=20=20=20=20=20= (replace-match=20"\\1"=20nil=20nil))=0A-=20=20=20=20=20=20(goto-char=20= (point-min))=0A-=20=20=20=20=20=20(decode-coding-string=20(read=20= (current-buffer))=20coding))))=0A-=0A=20(defun=20gud-gdbmi-marker-filter=20= (string)=0A=20=20=20"Filter=20GDB/MI=20output."=0A=20=0A-=20=20;;=20If=20= required,=20decode=20non-ASCII=20text=20encoded=20with=20octal=20= escapes.=0A-=20=20(or=20(null=20gdb-mi-decode-strings)=0A-=20=20=20=20=20= =20(setq=20string=20(gdb-mi-decode=20string)))=0A-=0A=20=20=20;;=20= Record=20transactions=20if=20logging=20is=20enabled.=0A=20=20=20(when=20= gdb-enable-debug=0A=20=20=20=20=20(push=20(cons=20'recv=20string)=20= gdb-debug-log)=0A@@=20-2555,7=20+2515,7=20@@=20gdb-thread-created=0A=20= (defun=20gdb-thread-exited=20(_token=20output-field)=0A=20=20=20"Handle=20= =3Dthread-exited=20async=20record.=0A=20Unset=20`gdb-thread-number'=20if=20= current=20thread=20exited=20and=20update=20threads=20list."=0A-=20=20= (let*=20((thread-id=20(gdb-mi--field=20(gdb-json-string=20output-field)=20= 'id)))=0A+=20=20(let*=20((thread-id=20(gdb-mi--field=20= (gdb-mi--from-string=20output-field)=20'id)))=0A=20=20=20=20=20(if=20= (string=3D=20gdb-thread-number=20thread-id)=0A=20=20=20=20=20=20=20=20=20= (gdb-setq-thread-number=20nil))=0A=20=20=20=20=20;;=20When=20we=20= continue=20current=20thread=20and=20it=20quickly=20exits,=0A@@=20-2569,7=20= +2529,7=20@@=20gdb-thread-selected=0A=20=20=20"Handler=20for=20= =3Dthread-selected=20MI=20output=20record.=0A=20=0A=20Sets=20= `gdb-thread-number'=20to=20new=20id."=0A-=20=20(let*=20((result=20= (gdb-json-string=20output-field))=0A+=20=20(let*=20((result=20= (gdb-mi--from-string=20output-field))=0A=20=20=20=20=20=20=20=20=20=20= (thread-id=20(gdb-mi--field=20result=20'id)))=0A=20=20=20=20=20= (gdb-setq-thread-number=20thread-id)=0A=20=20=20=20=20;;=20Typing=20= `thread=20N'=20in=20GUD=20buffer=20makes=20GDB=20emit=20`^done'=20= followed=0A@@=20-2585,7=20+2545,7=20@@=20gdb-thread-selected=0A=20=0A=20= (defun=20gdb-running=20(_token=20output-field)=0A=20=20=20(let*=20= ((thread-id=0A-=20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20= (gdb-json-string=20output-field)=20'thread-id)))=0A+=20=20=20=20=20=20=20= =20=20=20(gdb-mi--field=20(gdb-mi--from-string=20output-field)=20= 'thread-id)))=0A=20=20=20=20=20;;=20We=20reset=20gdb-frame-number=20to=20= nil=20if=20current=20thread=20has=20gone=0A=20=20=20=20=20;;=20running.=20= This=20can't=20be=20done=20in=20gdb-thread-list-handler-custom=0A=20=20=20= =20=20;;=20because=20we=20need=20correct=20gdb-frame-number=20by=20the=20= time=0A@@=20-2614,7=20+2574,7=20@@=20gdb-stopped=0A=20=20=20"Given=20the=20= contents=20of=20*stopped=20MI=20async=20record,=20select=20new=0A=20= current=20thread=20and=20update=20GDB=20buffers."=0A=20=20=20;;=20Reason=20= is=20available=20with=20target-async=20only=0A-=20=20(let*=20((result=20= (gdb-json-string=20output-field))=0A+=20=20(let*=20((result=20= (gdb-mi--from-string=20output-field))=0A=20=20=20=20=20=20=20=20=20=20= (reason=20(gdb-mi--field=20result=20'reason))=0A=20=20=20=20=20=20=20=20=20= =20(thread-id=20(gdb-mi--field=20result=20'thread-id))=0A=20=20=20=20=20=20= =20=20=20=20(retval=20(gdb-mi--field=20result=20'return-value))=0A@@=20= -2694,7=20+2654,7=20@@=20gdb-internals=0A=20=09=20(if=20(string=3D=20= output-field=20"\"\\n\"")=0A=20=09=20=20=20=20=20""=0A=20=09=20=20=20= (let=20((error-message=0A-=09=09=20=20(read=20output-field)))=0A+=09=09=20= =20(gdb-mi--c-string-from-string=20output-field)))=0A=20=09=20=20=20=20=20= (put-text-property=0A=20=09=20=20=20=20=20=200=20(length=20= error-message)=0A=20=09=20=20=20=20=20=20'face=20font-lock-warning-face=0A= @@=20-2705,7=20+2665,8=20@@=20gdb-internals=0A=20;;=20(frontend=20MI=20= commands=20should=20not=20print=20to=20this=20stream)=0A=20(defun=20= gdb-console=20(output-field)=0A=20=20=20(setq=20gdb-filter-output=0A-=09= (gdb-concat-output=20gdb-filter-output=20(read=20output-field))))=0A+=09= (gdb-concat-output=20gdb-filter-output=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (gdb-mi--c-string-from-string=20output-field))))=0A=20=0A=20(defun=20= gdb-done=20(token-number=20output-field=20is-complete)=0A=20=20=20= (gdb-done-or-error=20token-number=20'done=20output-field=20is-complete))=0A= @@=20-2722,7=20+2683,8=20@@=20gdb-done-or-error=0A=20=09;;=20MI=20error=20= -=20send=20to=20minibuffer=0A=20=09(when=20(eq=20type=20'error)=0A=20=20=20= =20=20=20=20=20=20=20=20;;=20Skip=20"msg=3D"=20from=20`output-field'=0A-=20= =20=20=20=20=20=20=20=20=20(message=20"%s"=20(read=20(substring=20= output-field=204)))=0A+=20=20=20=20=20=20=20=20=20=20(message=20"%s"=20= (gdb-mi--c-string-from-string=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(substring=20output-field=204)))=0A=20=20= =20=20=20=20=20=20=20=20=20;;=20Don't=20send=20to=20the=20console=20= twice.=20=20(If=20it=20is=20a=20console=20error=0A=20=20=20=20=20=20=20=20= =20=20=20;;=20it=20is=20also=20in=20the=20console=20stream.)=0A=20=20=20=20= =20=20=20=20=20=20=20(setq=20output-field=20nil)))=0A@@=20-2770,83=20= +2732,154=20@@=20gdb-clear-partial-output=0A=20=20=20= (with-current-buffer=20(gdb-get-buffer-create=20= 'gdb-partial-output-buffer)=0A=20=20=20=20=20(erase-buffer)))=0A=20=0A= -(defun=20gdb-jsonify-buffer=20(&optional=20fix-key=20fix-list)=0A-=20=20= "Prepare=20GDB/MI=20output=20in=20current=20buffer=20for=20parsing=20= with=20`json-read'.=0A-=0A-Field=20names=20are=20wrapped=20in=20double=20= quotes=20and=20equal=20signs=20are=0A-replaced=20with=20semicolons.=0A-=0A= -If=20FIX-KEY=20is=20non-nil,=20strip=20all=20\"FIX-KEY=3D\"=20= occurrences=20from=0A-partial=20output.=20=20This=20is=20used=20to=20get=20= rid=20of=20useless=20keys=20in=20lists=0A-in=20MI=20messages,=20e.g.:=20= [key=3D..,=20key=3D..].=20=20-stack-list-frames=20and=0A--break-info=20= are=20examples=20of=20MI=20commands=20which=20issue=20such=0A-responses.=0A= -=0A-If=20FIX-LIST=20is=20non-nil,=20\"FIX-LIST=3D{..}\"=20is=20replaced=20= with=0A-\"FIX-LIST=3D[..]\"=20prior=20to=20parsing.=20=20This=20is=20= used=20to=20fix=20broken=0A--break-info=20output=20when=20it=20contains=20= breakpoint=20script=20field=0A-incompatible=20with=20GDB/MI=20output=20= syntax.=0A+;;=20Parse=20GDB/MI=20result=20records:=20this=20process=20= converts=0A+;;=20=20list=20=20=20=20=20=20[...]=20=20=20=20=20=20->=20=20= list=0A+;;=20=20tuple=20=20=20=20=20{...}=20=20=20=20=20=20->=20=20list=0A= +;;=20=20result=20=20=20=20KEY=3DVALUE=20=20->=20=20(KEY=20.=20VALUE)=20= where=20KEY=20is=20a=20symbol=0A+;;=20=20c-string=20=20"..."=20=20=20=20=20= =20->=20=20string=0A+=0A+(defun=20gdb-mi--parse-tuple-or-list=20= (end-char)=0A+=20=20"Parse=20a=20tuple=20or=20list,=20either=20returned=20= as=20a=20Lisp=20list.=0A+END-CHAR=20is=20the=20ending=20delimiter;=20= will=20stop=20at=20end-of-buffer=20otherwise."=0A+=20=20(let=20((items=20= nil))=0A+=20=20=20=20(while=20(not=20(or=20(eobp)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(eq=20(following-char)=20= end-char)))=0A+=20=20=20=20=20=20(let=20((item=20= (gdb-mi--parse-result-or-value)))=0A+=20=20=20=20=20=20=20=20(push=20= item=20items)=0A+=20=20=20=20=20=20=20=20(when=20(eq=20(following-char)=20= ?,)=0A+=20=20=20=20=20=20=20=20=20=20(forward-char))))=0A+=20=20=20=20= (when=20(eq=20(following-char)=20end-char)=0A+=20=20=20=20=20=20= (forward-char))=0A+=20=20=20=20(nreverse=20items)))=0A+=0A+(defun=20= gdb-mi--parse-c-string=20()=0A+=20=20"Parse=20a=20c-string."=0A+=20=20= (let=20((start=20(point))=0A+=20=20=20=20=20=20=20=20(pieces=20nil)=0A+=20= =20=20=20=20=20=20=20(octals-used=20nil))=0A+=20=20=20=20(while=20(and=20= (re-search-forward=20(rx=20(or=20?\\=20?\")))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(not=20(eq=20(preceding-char)=20?\")))=0A+=20=20=20= =20=20=20(push=20(buffer-substring=20start=20(1-=20(point)))=20pieces)=0A= +=20=20=20=20=20=20(cond=0A+=20=20=20=20=20=20=20((looking-at=20(rx=20= (any=20"0-7")=20(?=20(any=20"0-7")=20(?=20(any=20"0-7")))))=0A+=20=20=20=20= =20=20=20=20(push=20(unibyte-string=20(string-to-number=20(match-string=20= 0)=208))=20pieces)=0A+=20=20=20=20=20=20=20=20(setq=20octals-used=20t)=0A= +=20=20=20=20=20=20=20=20(goto-char=20(match-end=200)))=0A+=20=20=20=20=20= =20=20((looking-at=20(rx=20(any=20"ntrvfab\"\\")))=0A+=20=20=20=20=20=20=20= =20(push=20(cdr=20(assq=20(following-char)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'((?n=20.=20"\n")=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (?t=20.=20"\t")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(?r=20.=20"\r")=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(?v=20.=20"\v")=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(?f=20.=20"\f")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(?a=20.=20"\a")=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(?b=20.=20= "\b")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(?\"=20.=20"\"")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(?\\=20.=20"\\"))))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20pieces)=0A+=20=20=20=20=20=20=20=20= (forward-char))=0A+=20=20=20=20=20=20=20(t=0A+=20=20=20=20=20=20=20=20= (warn=20"Unrecognised=20escape=20char:=20%c"=20(following-char))))=0A+=20= =20=20=20=20=20(setq=20start=20(point)))=0A+=20=20=20=20(push=20= (buffer-substring=20start=20(1-=20(point)))=20pieces)=0A+=20=20=20=20= (let=20((s=20(apply=20#'concat=20(nreverse=20pieces))))=0A+=20=20=20=20=20= =20(if=20(and=20octals-used=20gdb-mi-decode-strings)=0A+=20=20=20=20=20=20= =20=20=20=20(let=20((coding=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(if=20(coding-system-p=20gdb-mi-decode-strings)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20gdb-mi-decode-strings=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (buffer-local-value=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20'buffer-file-coding-system=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20FIXME:=20This=20is=20somewhat=20expensive.=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (gdb-get-buffer-create=20'gdb-partial-output-buffer)))))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(decode-coding-string=20s=20coding))=0A+=20=20=20=20= =20=20=20=20s))))=0A+=0A+;;=20FIXME:=20Ideally=20this=20function=20= should=20not=20be=20needed.=0A+(defun=20gdb-mi--c-string-from-string=20= (string)=0A+=20=20"Parse=20a=20c-string=20from=20(the=20beginning=20of)=20= STRING."=0A+=20=20(with-temp-buffer=0A+=20=20=20=20(insert=20string)=0A+=20= =20=20=20(goto-char=20(1+=20(point-min)))=20=20=20=20=20=20=20=20;=20= Skip=20leading=20double=20quote.=0A+=20=20=20=20= (gdb-mi--parse-c-string)))=0A=20=0A-If=20`default-directory'=20is=20= remote,=20full=20file=20names=20are=20adapted=20accordingly."=0A-=20=20= (save-excursion=0A+(defun=20gdb-mi--parse-value=20()=0A+=20=20"Parse=20a=20= value."=0A+=20=20(cond=0A+=20=20=20((eq=20(following-char)=20?\{)=0A+=20=20= =20=20(forward-char)=0A+=20=20=20=20(gdb-mi--parse-tuple-or-list=20?\}))=0A= +=20=20=20((eq=20(following-char)=20?\[)=0A+=20=20=20=20(forward-char)=0A= +=20=20=20=20(gdb-mi--parse-tuple-or-list=20?\]))=0A+=20=20=20((eq=20= (following-char)=20?\")=0A+=20=20=20=20(forward-char)=0A+=20=20=20=20= (gdb-mi--parse-c-string))=0A+=20=20=20(t=20(error=20"Bad=20start=20of=20= result=20or=20value:=20%c"=20(following-char)))))=0A+=0A+(defun=20= gdb-mi--parse-result-or-value=20()=0A+=20=20"Parse=20a=20result=20= (key=3Dvalue)=20or=20value."=0A+=20=20(if=20(looking-at=20(rx=20(group=20= (+=20(any=20"a-zA-Z"=20?_=20?-)))=20"=3D"))=0A+=20=20=20=20=20=20(progn=0A= +=20=20=20=20=20=20=20=20(goto-char=20(match-end=200))=0A+=20=20=20=20=20= =20=20=20(let*=20((variable=20(intern=20(match-string=201)))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(value=20(gdb-mi--parse-value)))=0A+=20= =20=20=20=20=20=20=20=20=20(cons=20variable=20value)))=0A+=20=20=20=20= (gdb-mi--parse-value)))=0A+=0A+(defun=20gdb-mi--parse-results=20()=0A+=20= =20"Parse=20zero=20or=20more=20result=20productions=20as=20a=20list."=0A= +=20=20(gdb-mi--parse-tuple-or-list=20nil))=0A+=0A+(defun=20= gdb-mi--fix-key=20(key=20value)=0A+=20=20"Convert=20any=20result=20= (key-value=20pair)=20in=20VALUE=20whose=20key=20is=20KEY=20to=20its=20= value."=0A+=20=20(cond=0A+=20=20=20((atom=20value)=20value)=0A+=20=20=20= ((symbolp=20(car=20value))=0A+=20=20=20=20(if=20(eq=20(car=20value)=20= key)=0A+=20=20=20=20=20=20=20=20(cdr=20value)=0A+=20=20=20=20=20=20(cons=20= (car=20value)=20(gdb-mi--fix-key=20key=20(cdr=20value)))))=0A+=20=20=20= (t=20(mapcar=20(lambda=20(x)=20(gdb-mi--fix-key=20key=20x))=20value))))=0A= +=0A+(defun=20gdb-mi--extend-fullname=20(remote=20value)=0A+=20=20= "Prepend=20REMOTE=20to=20any=20result=20string=20with=20`fullname'=20as=20= the=20key=20in=20VALUE."=0A+=20=20(cond=0A+=20=20=20((atom=20value)=20= value)=0A+=20=20=20((symbolp=20(car=20value))=0A+=20=20=20=20(if=20(and=20= (eq=20(car=20value)=20'fullname)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (stringp=20(cdr=20value)))=0A+=20=20=20=20=20=20=20=20(cons=20'fullname=20= (concat=20remote=20(cdr=20value)))=0A+=20=20=20=20=20=20(cons=20(car=20= value)=20(gdb-mi--extend-fullname=20remote=20(cdr=20value)))))=0A+=20=20=20= (t=20(mapcar=20(lambda=20(x)=20(gdb-mi--extend-fullname=20remote=20x))=20= value))))=0A+=0A+(defun=20gdb-mi--read-buffer=20(fix-key)=0A+=20=20= "Parse=20the=20current=20buffer=20as=20a=20list=20of=20result=20= productions.=0A+If=20FIX-KEY=20is=20a=20non-nil=20symbol,=20convert=20= all=20FIX-KEY=3DVALUE=20results=20into=20VALUE.=0A+This=20is=20used=20to=20= get=20rid=20of=20useless=20keys=20in=20lists=20in=20MI=20messages;=0A= +eg,=20[key=3D..,=20key=3D..].=20=20-stack-list-frames=20and=20= -break-info=20are=0A+examples=20of=20MI=20commands=20which=20issue=20= such=20responses."=0A+=20=20(goto-char=20(point-min))=0A+=20=20(let=20= ((results=20(gdb-mi--parse-results)))=0A=20=20=20=20=20(let=20((remote=20= (file-remote-p=20default-directory)))=0A=20=20=20=20=20=20=20(when=20= remote=0A-=20=20=20=20=20=20=20=20(goto-char=20(point-min))=0A-=20=20=20=20= =20=20=20=20(while=20(re-search-forward=20"[\\[,]fullname=3D\"\\(.+\\)\""=20= nil=20t)=0A-=20=20=20=20=20=20=20=20=20=20(replace-match=20(concat=20= remote=20"\\1")=20nil=20nil=20nil=201))))=0A-=20=20=20=20(goto-char=20= (point-min))=0A+=20=20=20=20=20=20=20=20(setq=20results=20= (gdb-mi--extend-fullname=20remote=20results))))=0A=20=20=20=20=20(when=20= fix-key=0A-=20=20=20=20=20=20(save-excursion=0A-=20=20=20=20=20=20=20=20= (while=20(re-search-forward=20(concat=20"[\\[,]\\("=20fix-key=20"=3D\\)")=20= nil=20t)=0A-=20=20=20=20=20=20=20=20=20=20(replace-match=20""=20nil=20= nil=20nil=201))))=0A-=20=20=20=20(when=20fix-list=0A-=20=20=20=20=20=20= (save-excursion=0A-=20=20=20=20=20=20=20=20;;=20Find=20positions=20of=20= braces=20which=20enclose=20broken=20list=0A-=20=20=20=20=20=20=20=20= (while=20(re-search-forward=20(concat=20fix-list=20"=3D{\"")=20nil=20t)=0A= -=20=20=20=20=20=20=20=20=20=20(let=20((p1=20(goto-char=20(-=20(point)=20= 2)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(p2=20(progn=20= (forward-sexp)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(1-=20(point)))))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Replace=20braces=20with=20brackets=0A-=20=20=20=20=20=20=20=20= =20=20=20=20(save-excursion=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (goto-char=20p1)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (delete-char=201)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20(insert=20= "[")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20(goto-char=20p2)=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(delete-char=201)=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(insert=20"]"))))))=0A-=20=20=20=20(goto-char=20= (point-min))=0A-=20=20=20=20(insert=20"{")=0A-=20=20=20=20(let=20((re=20= (concat=20"\\([[:alnum:]_-]+\\)=3D")))=0A-=20=20=20=20=20=20(while=20= (re-search-forward=20re=20nil=20t)=0A-=20=20=20=20=20=20=20=20= (replace-match=20"\"\\1\":"=20nil=20nil)=0A-=20=20=20=20=20=20=20=20(if=20= (eq=20(char-after)=20?\")=20(forward-sexp)=20(forward-char))))=0A-=20=20=20= =20(goto-char=20(point-max))=0A-=20=20=20=20(insert=20"}")))=0A-=0A= -(defun=20gdb-json-read-buffer=20(&optional=20fix-key=20fix-list)=0A-=20=20= "Prepare=20and=20parse=20GDB/MI=20output=20in=20current=20buffer=20with=20= `json-read'.=0A-=0A-FIX-KEY=20and=20FIX-LIST=20work=20as=20in=20= `gdb-jsonify-buffer'."=0A-=20=20(gdb-jsonify-buffer=20fix-key=20= fix-list)=0A-=20=20(save-excursion=0A-=20=20=20=20(goto-char=20= (point-min))=0A-=20=20=20=20(let=20((json-array-type=20'list))=0A-=20=20=20= =20=20=20(json-read))))=0A+=20=20=20=20=20=20(setq=20results=20= (gdb-mi--fix-key=20fix-key=20results)))=0A+=20=20=20=20results))=0A=20=0A= -(defun=20gdb-json-string=20(string=20&optional=20fix-key=20fix-list)=0A= -=20=20"Prepare=20and=20parse=20STRING=20containing=20GDB/MI=20output=20= with=20`json-read'.=0A+(defun=20gdb-mi--from-string=20(string=20= &optional=20fix-key)=0A+=20=20"Prepare=20and=20parse=20STRING=20= containing=20GDB/MI=20output.=0A=20=0A-FIX-KEY=20and=20FIX-LIST=20work=20= as=20in=20`gdb-jsonify-buffer'."=0A+FIX-KEY=20works=20as=20in=20= `gdb-mi--read-buffer'."=0A=20=20=20(with-temp-buffer=0A=20=20=20=20=20= (insert=20string)=0A-=20=20=20=20(gdb-json-read-buffer=20fix-key=20= fix-list)))=0A+=20=20=20=20(gdb-mi--read-buffer=20fix-key)))=0A=20=0A= -(defun=20gdb-json-partial-output=20(&optional=20fix-key=20fix-list)=0A-=20= =20"Prepare=20and=20parse=20gdb-partial-output-buffer=20with=20= `json-read'.=0A+(defun=20gdb-mi--partial-output=20(&optional=20fix-key)=0A= +=20=20"Prepare=20and=20parse=20gdb-partial-output-buffer.=0A=20=0A= -FIX-KEY=20and=20FIX-KEY=20work=20as=20in=20`gdb-jsonify-buffer'."=0A= +FIX-KEY=20works=20as=20in=20`gdb-mi--read-buffer'."=0A=20=20=20= (with-current-buffer=20(gdb-get-buffer-create=20= 'gdb-partial-output-buffer)=0A-=20=20=20=20(gdb-json-read-buffer=20= fix-key=20fix-list)))=0A+=20=20=20=20(gdb-mi--read-buffer=20fix-key)))=0A= =20=0A=20(defun=20gdb-line-posns=20(line)=0A=20=20=20"Return=20a=20pair=20= of=20LINE=20beginning=20and=20end=20positions."=0A@@=20-3015,7=20+3048,7=20= @@=20def-gdb-trigger-and-handler=0A=20=0A=20(defun=20= gdb-breakpoints-list-handler-custom=20()=0A=20=20=20(let=20= ((breakpoints-list=20(gdb-mi--field=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20= (gdb-json-partial-output=20'bkpt)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20= (gdb-mi--partial-output=20'bkpt)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'BreakpointTable)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'body))=0A=20=20=20=20=20=20= =20=20=20(table=20(make-gdb-table)))=0A@@=20-3338,7=20+3371,7=20@@=20= gdb-threads-mode=0A=20=20=20'gdb-invalidate-threads)=0A=20=0A=20(defun=20= gdb-thread-list-handler-custom=20()=0A-=20=20(let=20((threads-list=20= (gdb-mi--field=20(gdb-json-partial-output)=20'threads))=0A+=20=20(let=20= ((threads-list=20(gdb-mi--field=20(gdb-mi--partial-output)=20'threads))=0A= =20=20=20=20=20=20=20=20=20(table=20(make-gdb-table))=0A=20=20=20=20=20=20= =20=20=20(marked-line=20nil))=0A=20=20=20=20=20(setq=20gdb-threads-list=20= nil)=0A@@=20-3579,7=20+3612,7=20@@=20gdb-memory-column-width=0A=20=20=20=20= =20=20=20(error=20"Unknown=20format"))))=0A=20=0A=20(defun=20= gdb-read-memory-custom=20()=0A-=20=20(let*=20((res=20= (gdb-json-partial-output))=0A+=20=20(let*=20((res=20= (gdb-mi--partial-output))=0A=20=20=20=20=20=20=20=20=20=20(err-msg=20= (gdb-mi--field=20res=20'msg)))=0A=20=20=20=20=20(if=20(not=20err-msg)=0A=20= =20=20=20=20=20=20=20=20(let=20((memory=20(gdb-mi--field=20res=20= 'memory)))=0A@@=20-3988,7=20+4021,7=20@@=20gdb-disassembly-mode=0A=20=20=20= 'gdb-invalidate-disassembly)=0A=20=0A=20(defun=20= gdb-disassembly-handler-custom=20()=0A-=20=20(let*=20((instructions=20= (gdb-mi--field=20(gdb-json-partial-output)=20'asm_insns))=0A+=20=20(let*=20= ((instructions=20(gdb-mi--field=20(gdb-mi--partial-output)=20= 'asm_insns))=0A=20=20=20=20=20=20=20=20=20=20(address=20(gdb-mi--field=20= (gdb-current-buffer-frame)=20'addr))=0A=20=20=20=20=20=20=20=20=20=20= (table=20(make-gdb-table))=0A=20=20=20=20=20=20=20=20=20=20(marked-line=20= nil))=0A@@=20-4129,7=20+4162,7=20@@=20gdb-frame-location=0A=20=20=20=20=20= =20=20(if=20res=20(concat=20"=20of=20"=20res)=20""))))=0A=20=0A=20(defun=20= gdb-stack-list-frames-custom=20()=0A-=20=20(let=20((stack=20= (gdb-mi--field=20(gdb-json-partial-output=20'frame)=20'stack))=0A+=20=20= (let=20((stack=20(gdb-mi--field=20(gdb-mi--partial-output=20'frame)=20= 'stack))=0A=20=20=20=20=20=20=20=20=20(table=20(make-gdb-table)))=0A=20=20= =20=20=20(set-marker=20gdb-stack-position=20nil)=0A=20=20=20=20=20= (dolist=20(frame=20stack)=0A@@=20-4257,7=20+4290,7=20@@=20= gdb-edit-locals-value=0A=20;;=20Don't=20display=20values=20of=20arrays=20= or=20structures.=0A=20;;=20These=20can=20be=20expanded=20using=20= gud-watch.=0A=20(defun=20gdb-locals-handler-custom=20()=0A-=20=20(let=20= ((locals-list=20(gdb-mi--field=20(gdb-json-partial-output)=20'locals))=0A= +=20=20(let=20((locals-list=20(gdb-mi--field=20(gdb-mi--partial-output)=20= 'locals))=0A=20=20=20=20=20=20=20=20=20(table=20(make-gdb-table)))=0A=20=20= =20=20=20(dolist=20(local=20locals-list)=0A=20=20=20=20=20=20=20(let=20= ((name=20(gdb-mi--field=20local=20'name))=0A@@=20-4354,7=20+4387,7=20@@=20= gdb-frame-locals-buffer=0A=20(defun=20gdb-registers-handler-custom=20()=0A= =20=20=20(when=20gdb-register-names=0A=20=20=20=20=20(let=20= ((register-values=0A-=20=20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20= (gdb-json-partial-output)=20'register-values))=0A+=20=20=20=20=20=20=20=20= =20=20=20(gdb-mi--field=20(gdb-mi--partial-output)=20'register-values))=0A= =20=20=20=20=20=20=20=20=20=20=20(table=20(make-gdb-table)))=0A=20=20=20=20= =20=20=20(dolist=20(register=20register-values)=0A=20=20=20=20=20=20=20=20= =20(let*=20((register-number=20(gdb-mi--field=20register=20'number))=0A= @@=20-4444,7=20+4477,7=20@@=20gdb-get-changed-registers=0A=20(defun=20= gdb-changed-registers-handler=20()=0A=20=20=20(setq=20= gdb-changed-registers=20nil)=0A=20=20=20(dolist=20(register-number=0A-=20= =20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20(gdb-json-partial-output)=20= 'changed-registers))=0A+=20=20=20=20=20=20=20=20=20=20=20(gdb-mi--field=20= (gdb-mi--partial-output)=20'changed-registers))=0A=20=20=20=20=20(push=20= register-number=20gdb-changed-registers)))=0A=20=0A=20(defun=20= gdb-register-names-handler=20()=0A@@=20-4452,7=20+4485,7=20@@=20= gdb-register-names-handler=0A=20=20=20;;=20only=20once=20(in=20= gdb-init-1)=0A=20=20=20(setq=20gdb-register-names=20nil)=0A=20=20=20= (dolist=20(register-name=0A-=20=20=20=20=20=20=20=20=20=20=20= (gdb-mi--field=20(gdb-json-partial-output)=20'register-names))=0A+=20=20=20= =20=20=20=20=20=20=20=20(gdb-mi--field=20(gdb-mi--partial-output)=20= 'register-names))=0A=20=20=20=20=20(push=20register-name=20= gdb-register-names))=0A=20=20=20(setq=20gdb-register-names=20(reverse=20= gdb-register-names)))=0A=20=0C=0A@@=20-4463,7=20+4496,8=20@@=20= gdb-get-source-file-list=0A=20is=20set=20in=20them."=0A=20=20=20= (goto-char=20(point-min))=0A=20=20=20(while=20(re-search-forward=20= gdb-source-file-regexp=20nil=20t)=0A-=20=20=20=20(push=20(read=20= (match-string=201))=20gdb-source-file-list))=0A+=20=20=20=20(push=20= (gdb-mi--c-string-from-string=20(match-string=201))=0A+=20=20=20=20=20=20= =20=20=20=20gdb-source-file-list))=0A=20=20=20(dolist=20(buffer=20= (buffer-list))=0A=20=20=20=20=20(with-current-buffer=20buffer=0A=20=20=20= =20=20=20=20(when=20(member=20buffer-file-name=20gdb-source-file-list)=0A= @@=20-4479,7=20+4513,7=20@@=20gdb-get-main-selected-frame=0A=20(defun=20= gdb-frame-handler=20()=0A=20=20=20"Set=20`gdb-selected-frame'=20and=20= `gdb-selected-file'=20to=20show=0A=20overlay=20arrow=20in=20source=20= buffer."=0A-=20=20(let=20((frame=20(gdb-mi--field=20= (gdb-json-partial-output)=20'frame)))=0A+=20=20(let=20((frame=20= (gdb-mi--field=20(gdb-mi--partial-output)=20'frame)))=0A=20=20=20=20=20= (when=20frame=0A=20=20=20=20=20=20=20(setq=20gdb-selected-frame=20= (gdb-mi--field=20frame=20'func))=0A=20=20=20=20=20=20=20(setq=20= gdb-selected-file=20(gdb-mi--field=20frame=20'fullname))=0A@@=20-4510,7=20= +4544,7=20@@=20gdb-get-prompt=0A=20=20=20(goto-char=20(point-min))=0A=20=20= =20(setq=20gdb-prompt-name=20nil)=0A=20=20=20(re-search-forward=20= gdb-prompt-name-regexp=20nil=20t)=0A-=20=20(setq=20gdb-prompt-name=20= (read=20(match-string=201)))=0A+=20=20(setq=20gdb-prompt-name=20= (gdb-mi--c-string-from-string=20(match-string=201)))=0A=20=20=20;;=20= Insert=20first=20prompt.=0A=20=20=20(setq=20gdb-filter-output=20(concat=20= gdb-filter-output=20gdb-prompt-name)))=0A=20=0A@@=20-4959,7=20+4993,7=20= @@=20gdb-get-source-file=0A=20=20=20;;=20This=20function=20is=20called=20= only=20once=20on=20startup.=0A=20=20=20(goto-char=20(point-min))=0A=20=20= =20(if=20(re-search-forward=20gdb-source-file-regexp=20nil=20t)=0A-=20=20= =20=20=20=20(setq=20gdb-main-file=20(read=20(match-string=201))))=0A+=20=20= =20=20=20=20(setq=20gdb-main-file=20(gdb-mi--c-string-from-string=20= (match-string=201))))=0A=20=20=20(if=20gdb-many-windows=0A=20=20=20=20=20= =20=20(gdb-setup-windows)=0A=20=20=20=20=20(gdb-get-buffer-create=20= 'gdb-breakpoints-buffer)=0Adiff=20--git=20= a/test/lisp/progmodes/gdb-mi-tests.el=20= b/test/lisp/progmodes/gdb-mi-tests.el=0Anew=20file=20mode=20100644=0A= index=200000000000..79493a571b=0A---=20/dev/null=0A+++=20= b/test/lisp/progmodes/gdb-mi-tests.el=0A@@=20-0,0=20+1,44=20@@=0A+;;;=20= gdb-mi-tests.el=20---=20tests=20for=20gdb-mi.el=20=20=20=20-*-=20= lexical-binding:=20t=20-*-=0A+=0A+;;=20Copyright=20(C)=202020=20Free=20= Software=20Foundation,=20Inc.=0A+=0A+;;=20This=20file=20is=20part=20of=20= GNU=20Emacs.=0A+=0A+;;=20GNU=20Emacs=20is=20free=20software:=20you=20can=20= redistribute=20it=20and/or=20modify=0A+;;=20it=20under=20the=20terms=20= of=20the=20GNU=20General=20Public=20License=20as=20published=20by=0A+;;=20= the=20Free=20Software=20Foundation,=20either=20version=203=20of=20the=20= License,=20or=0A+;;=20(at=20your=20option)=20any=20later=20version.=0A+=0A= +;;=20GNU=20Emacs=20is=20distributed=20in=20the=20hope=20that=20it=20= will=20be=20useful,=0A+;;=20but=20WITHOUT=20ANY=20WARRANTY;=20without=20= even=20the=20implied=20warranty=20of=0A+;;=20MERCHANTABILITY=20or=20= FITNESS=20FOR=20A=20PARTICULAR=20PURPOSE.=20=20See=20the=0A+;;=20GNU=20= General=20Public=20License=20for=20more=20details.=0A+=0A+;;=20You=20= should=20have=20received=20a=20copy=20of=20the=20GNU=20General=20Public=20= License=0A+;;=20along=20with=20GNU=20Emacs.=20=20If=20not,=20see=20= .=0A+=0A+(require=20'ert)=0A+(require=20= 'gdb-mi)=0A+=0A+(ert-deftest=20gdb-mi-parse-value=20()=0A+=20=20;;=20= Test=20the=20GDB/MI=20result/value=20parser.=0A+=20=20(should=20(equal=0A= +=20=20=20=20=20=20=20=20=20=20=20(gdb-mi--from-string=0A+=20=20=20=20=20= =20=20=20=20=20=20=20= "alpha=3D\"ab\\ncd\",beta=3D[\"x\",{gamma=3D\"y\",delta=3D[]}]")=0A+=20=20= =20=20=20=20=20=20=20=20=20'((alpha=20.=20"ab\ncd")=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20(beta=20.=20("x"=20((gamma=20.=20"y")=20(delta=20.=20= ())))))))=0A+=20=20(should=20(equal=0A+=20=20=20=20=20=20=20=20=20=20=20= (gdb-mi--from-string=0A+=20=20=20=20=20=20=20=20=20=20=20=20= "alpha=3D\"ab\\ncd\",beta=3D[\"x\",{gamma=3D\"y\",delta=3D[]}]"=0A+=20=20= =20=20=20=20=20=20=20=20=20=20'gamma)=0A+=20=20=20=20=20=20=20=20=20=20=20= '((alpha=20.=20"ab\ncd")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(beta=20= .=20("x"=20("y"=20(delta=20.=20())))))))=0A+=0A+=20=20(should=20(equal=20= (gdb-mi--from-string=20"alpha=3D\"a\\303\\245b\"")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`((alpha=20.=20,(string-to-multibyte=20= "a\303\245b")))))=0A+=20=20(let=20((gdb-mi-decode-strings=20'utf-8))=0A+=20= =20=20=20(should=20(equal=20(gdb-mi--from-string=20= "alpha=3D\"a\\303\\245b\"")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'((alpha=20.=20"a=C3=A5b")))))=0A+=20=20)=0A+=0A+(provide=20= 'gdb-mi-tests)=0A--=20=0A2.26.2=0A=0A= --Apple-Mail=_D07DED0A-E442-4A51-9C99-5FE2F3035DDE-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 31 04:23:21 2020 Received: (at 44173) by debbugs.gnu.org; 31 Oct 2020 08:23:21 +0000 Received: from localhost ([127.0.0.1]:60498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYmAT-0003co-4q for submit@debbugs.gnu.org; Sat, 31 Oct 2020 04:23:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYmAR-0003cd-QR for 44173@debbugs.gnu.org; Sat, 31 Oct 2020 04:23:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35486) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYmAM-0003oA-C9; Sat, 31 Oct 2020 04:23:14 -0400 Received: from [176.228.60.248] (port=1659 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kYmAL-00036a-Ot; Sat, 31 Oct 2020 04:23:14 -0400 Date: Sat, 31 Oct 2020 10:22:56 +0200 Message-Id: <83wnz6hkin.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Tue, 27 Oct 2020 19:16:55 +0100) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Tue, 27 Oct 2020 19:16:55 +0100 > Cc: 44173@debbugs.gnu.org > > Here is an updated patch, rebased after some basic code cleaning in gdb-mi.el. > OK for master? Yes, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 31 09:57:15 2020 Received: (at 44173) by debbugs.gnu.org; 31 Oct 2020 13:57:15 +0000 Received: from localhost ([127.0.0.1]:34136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYrNb-0006DB-B2 for submit@debbugs.gnu.org; Sat, 31 Oct 2020 09:57:15 -0400 Received: from mail1475c50.megamailservers.eu ([91.136.14.75]:52648 helo=mail118c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYrNX-0006Cq-LU for 44173@debbugs.gnu.org; Sat, 31 Oct 2020 09:57:13 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1604152624; bh=b8pDMy7ZLfr3WJvCqQ+lXSDV7AbCbmEuwZUfoYXbAhM=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=o3U3W9KDvo1fRDgVvmNOWeFMcYRhrNGD86FUvUokm9YmGMpcZ2jsFl65wvVTzM+Bj 06d02KFK7h2FzmJyzIyK0j5Q2CHGv/hXrukl68/4jBpKTTfEr7Ht6OzLUoALH9JCow QF8jXmdBfaUrspqfgRXOaPIzZdoQsawtBdcD2mtI= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 09VDv1bJ015133; Sat, 31 Oct 2020 13:57:03 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_C8A9F264-77C8-492B-BE37-7B8ED41131DD" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes Date: Sat, 31 Oct 2020 14:57:01 +0100 In-Reply-To: <83wnz6hkin.fsf@gnu.org> To: Eli Zaretskii References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> <83wnz6hkin.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F23.5F9D6D30.0003, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KaGsTjQD c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=fva0glHxQcdzfTCdkJYA:9 a=CjuIK1q_8ugA:10 a=_sxVm95o-PjTATNXiI0A:9 a=B2y7HmGcmWMA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 44173 Cc: 44173@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_C8A9F264-77C8-492B-BE37-7B8ED41131DD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 31 okt. 2020 kl. 09.22 skrev Eli Zaretskii : > Yes, thanks. Thank you, pushed. The attached patch changes the default value of gdb-mi-decode-strings = from nil to t. I think we agree that it's probably a good idea, but leave the patch = here in case there are comments on the documentation. --Apple-Mail=_C8A9F264-77C8-492B-BE37-7B8ED41131DD Content-Disposition: attachment; filename=0001-Change-the-default-value-of-gdb-mi-decode-strings-to.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Change-the-default-value-of-gdb-mi-decode-strings-to.patch" Content-Transfer-Encoding: quoted-printable =46rom=200b94246450d524a748dba28aefc2611c53ddf30c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sat,=2031=20Oct=202020=2014:44:58=20+0100=0A= Subject:=20[PATCH]=20Change=20the=20default=20value=20of=20= gdb-mi-decode-strings=20to=20t=0A=20(bug#44173)=0A=0AThis=20is=20likely=20= to=20be=20a=20more=20commonly=20wanted=20default=20value=20today.=0A=0A*=20= lisp/progmodes/gdb-mi.el=20(gdb-mi-decode-strings):=20Change=20default.=0A= *=20doc/emacs/building.texi=20(Source=20Buffers):=20Update=20manual.=0A*=20= etc/NEWS:=20Announce.=0A---=0A=20doc/emacs/building.texi=20=20|=2013=20= ++++++-------=0A=20etc/NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=205=20+++++=0A=20lisp/progmodes/gdb-mi.el=20|=20=202=20+-=0A=203=20= files=20changed,=2012=20insertions(+),=208=20deletions(-)=0A=0Adiff=20= --git=20a/doc/emacs/building.texi=20b/doc/emacs/building.texi=0Aindex=20= 3e09f24322..23e22f46fb=20100644=0A---=20a/doc/emacs/building.texi=0A+++=20= b/doc/emacs/building.texi=0A@@=20-1092,13=20+1092,12=20@@=20Source=20= Buffers=0A=20more=20detail.=0A=20=0A=20@vindex=20gdb-mi-decode-strings=0A= -=20=20If=20the=20file=20names=20of=20the=20source=20files=20are=20shown=20= with=20octal=20escapes,=0A-set=20the=20variable=20= @code{gdb-mi-decode-strings}=20to=20the=20appropriate=0A-coding-system,=20= most=20probably=20@code{utf-8}.=20=20(This=20is=20@code{nil}=20by=0A= -default=20because=20GDB=20may=20emit=20octal=20escapes=20in=20= situations=20where=0A-decoding=20is=20undesirable,=20and=20also=20= because=20the=20program=20being=20debugged=0A-might=20use=20an=20= encoding=20different=20from=20the=20one=20used=20to=20encode=20non-ASCII=0A= -file=20names=20on=20your=20system.)=0A+=20=20By=20default,=20source=20= file=20names=20and=20non-ASCII=20strings=20in=20the=20program=0A+being=20= debugged=20are=20decoded=20using=20the=20default=20coding-system.=20=20= If=20you=0A+prefer=20a=20different=20decoding,=20perhaps=20because=20the=20= program=20being=0A+debugged=20uses=20a=20different=20encoding,=20set=20= the=20variable=0A+@code{gdb-mi-decode-strings}=20to=20the=20appropriate=20= coding-system,=20or=20to=0A+@code{nil}=20to=20leave=20such=20characters=20= as=20undecoded=20octal=20escapes.=0A=20=0A=20@node=20Breakpoints=20= Buffer=0A=20@subsubsection=20Breakpoints=20Buffer=0Adiff=20--git=20= a/etc/NEWS=20b/etc/NEWS=0Aindex=20a52122bcea..23b4deddf8=20100644=0A---=20= a/etc/NEWS=0A+++=20b/etc/NEWS=0A@@=20-806,6=20+806,11=20@@=20Now=20GDB=20= only=20uses=20one=20source=20window=20to=20display=20source=20file=20by=20= default.=0A=20Customize=20'gdb-max-source-window-count'=20to=20use=20= more=20than=20one=20window.=0A=20Control=20source=20file=20display=20by=20= 'gdb-display-source-buffer-action'.=0A=20=0A++++=0A+***=20The=20default=20= value=20of=20gdb-mi-decode-strings=20is=20now=20t.=0A+This=20means=20= that=20the=20default=20coding-system=20is=20now=20used=20to=20decode=20= strings=0A+and=20source=20file=20names=20from=20GDB.=0A+=0A=20**=20= Gravatar=0A=20=0A=20---=0Adiff=20--git=20a/lisp/progmodes/gdb-mi.el=20= b/lisp/progmodes/gdb-mi.el=0Aindex=204bebf88d35..6e9b6830a0=20100644=0A= ---=20a/lisp/progmodes/gdb-mi.el=0A+++=20b/lisp/progmodes/gdb-mi.el=0A@@=20= -2455,7=20+2455,7=20@@=20gdbmi-bnf-incomplete-record-result=0A=20;;=20= files,=20values=20of=20string=20variables=20in=20the=20inferior,=20etc.,=20= are=20all=0A=20;;=20encoded=20in=20the=20same=20encoding.=0A=20=0A= -(defcustom=20gdb-mi-decode-strings=20nil=0A+(defcustom=20= gdb-mi-decode-strings=20t=0A=20=20=20"When=20non-nil,=20decode=20octal=20= escapes=20in=20GDB=20output=20into=20non-ASCII=20text.=0A=20=0A=20If=20= the=20value=20is=20a=20coding-system,=20use=20that=20coding-system=20to=20= decode=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_C8A9F264-77C8-492B-BE37-7B8ED41131DD-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 06 08:03:14 2020 Received: (at 44173-done) by debbugs.gnu.org; 6 Nov 2020 13:03:14 +0000 Received: from localhost ([127.0.0.1]:55358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb1Oc-0005Ah-CP for submit@debbugs.gnu.org; Fri, 06 Nov 2020 08:03:14 -0500 Received: from mail1480c50.megamailservers.eu ([91.136.14.80]:33398 helo=mail118c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb1OY-0005AE-Th for 44173-done@debbugs.gnu.org; Fri, 06 Nov 2020 08:03:11 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1604667783; bh=e0jINJZPTkF/J0SNJZ5dRNL4QgrX5vYLAGCQlhiQcrY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=GpcIqsIHXSzCTPo+WOKAg4rGTlmL34Yz7JHUgf8ZYLKK4bEDbRZzcEcEmDLDg5bS8 5irjEptd7qCZoLYCdZ+5tx86QOl2l/1NTSggXBT4xXGtNDgFzp12WeJQShaWgylFNw YpQtsUSedfeCJpRUo49C5IIVCN8ef7I+0JYH6VaE= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0A6D2xDr004776; Fri, 6 Nov 2020 13:03:02 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44173: 28.0.50; gdb-mi mangles strings with octal escapes From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Fri, 6 Nov 2020 14:01:06 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <5C6EC06A-F571-421B-AEF6-08E5A8B89973@acm.org> References: <2A87D378-9FB9-4FC7-951E-5BA9832051CF@acm.org> <837drhjglr.fsf@gnu.org> <834kmljd01.fsf@gnu.org> <2C183F78-8E7D-48AE-BCC2-1E32EC0A4E29@acm.org> <83zh4dhui0.fsf@gnu.org> <865DFE77-16F6-4F20-8238-76E6A09801C8@acm.org> <83mu0ciz3a.fsf@gnu.org> <9D6D4CDF-DCEE-4EED-B0E5-44A999CD4DFA@acm.org> <837drfh72d.fsf@gnu.org> <3191F82D-0C4C-4E56-B96D-798C22234E63@acm.org> <833623h39y.fsf@gnu.org> <83wnz6hkin.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F23.5FA54987.000C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=U/Ps8tju c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=N54-gffFAAAA:8 a=EKSj-k5INJhKplonu18A:9 a=QEXdDO2ut3YA:10 a=v7zKWsmy5NQA:10 a=6l0D2HzqY3Epnrm8mE3f:22 X-Origin-Country: SE X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 31 okt. 2020 kl. 14.57 skrev Mattias Engdegård : > The attached patch changes the default value of gdb-mi-decode-strings from nil to t. This patch has now been pushed since it did not appear controversial. Changes are of course still possible. With that, the bug is closed. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 44173-done Cc: 44173-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 31 okt. 2020 kl. 14.57 skrev Mattias Engdeg=C3=A5rd : > The attached patch changes the default value of gdb-mi-decode-strings = from nil to t. This patch has now been pushed since it did not appear controversial. = Changes are of course still possible. With that, the bug is closed. From unknown Sun Jun 15 08:47:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 05 Dec 2020 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator