From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62697: gdb-mi.el: Change target-async to mi-async Date: Fri, 07 Apr 2023 13:29:46 +0300 Message-ID: <83bkk0ouhx.fsf@gnu.org> References: <835ya9qgox.fsf@gnu.org> <79ec3700-02ab-7574-1411-dfef0ec5eb7f@gmail.com> <83h6tsp5s1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20532"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62697@debbugs.gnu.org, gustaf.waldemarson@gmail.com To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 07 12:30:35 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkjMW-00051B-RS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Apr 2023 12:30:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkjM5-0001mK-Bl; Fri, 07 Apr 2023 06:30:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkjM4-0001lw-Dx for bug-gnu-emacs@gnu.org; Fri, 07 Apr 2023 06:30:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkjM3-0006Fi-O7 for bug-gnu-emacs@gnu.org; Fri, 07 Apr 2023 06:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkjM3-0007xO-6n for bug-gnu-emacs@gnu.org; Fri, 07 Apr 2023 06:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Apr 2023 10:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62697 X-GNU-PR-Package: emacs Original-Received: via spool by 62697-submit@debbugs.gnu.org id=B62697.168086336430250 (code B ref 62697); Fri, 07 Apr 2023 10:30:03 +0000 Original-Received: (at 62697) by debbugs.gnu.org; 7 Apr 2023 10:29:24 +0000 Original-Received: from localhost ([127.0.0.1]:55716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkjLP-0007rp-Uo for submit@debbugs.gnu.org; Fri, 07 Apr 2023 06:29:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkjLN-0007rX-4y for 62697@debbugs.gnu.org; Fri, 07 Apr 2023 06:29:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkjLH-0005ju-Fb; Fri, 07 Apr 2023 06:29:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PvflA2tM8yFOqt+qvSLaY1LPIkDbstrfbH0tUdNXGdQ=; b=lubYlPIOUGR8 1OF1/WGhOfpvPDuQXlHODha5/pPUUe1LvztuXKm7VrY06duwvAiqZDLV4eXjWXD64xEQzYU1yL5Dy r+Xsv2kzrp5uCA1eY5rWOGG7XyymlLit99W3ym/0480r7XIcKYUDYKejunAognFG622GRekZ5ExZ3 EiFPWJntBxcq6AvlU6jWa1lOY8dKkEXrn0KZ7arsGv5Zu9xM62yG2R3RFLCR8XzqMCI8X1lriAa20 GbiZ2nxarF0KZo29c4eCVvR2DFIyxP6Zb8pvISfKDS3dMmSzsJ1c34p4/CanWdoOk/nj4frA9bwbg rRn0Ma0qrTMzenk9mxEqFQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkjLG-0001Bg-Ob; Fri, 07 Apr 2023 06:29:15 -0400 In-Reply-To: (message from Jim Porter on Fri, 7 Apr 2023 00:25:03 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259373 Archived-At: > Date: Fri, 7 Apr 2023 00:25:03 -0700 > Cc: 62697@debbugs.gnu.org, gustaf.waldemarson@gmail.com > From: Jim Porter > > On 4/6/2023 11:26 PM, Eli Zaretskii wrote: > > > > The frontend may specify a preference for asynchronous execution > > using the '-gdb-set mi-async 1' command, which should be emitted > > before either running the executable or attaching to the target. > > > > If GDB is invoked with, e.g., "gdb -p PID", then we need to send this > > command up front, before GDB attaches. > > Maybe I'm just misunderstanding something, but it looks like "-gdb-set > target-async 1" is already sent from a callback: specifically, the one > for "-gdb-set non-stop 1". Is this code already violating GDB's rules? I don't know. > Would adding another layer of callback make it any worse? I don't know. > Maybe so, but if we're worried about the latter, then couldn't we do > something like: I don't know! It will take someone who knows a lot more than I do about both GDB/MI and gdb-mi.el to tell, and the changes need to be tested with many different versions of GDB. Feel free to do that and see if those changes are benign, and then we can install them. Failing that, given that we don't have an active enough maintainer of gdb-mi.el on board, I feel that suppressing the annoying message is a much more easy way out. > Assuming handlers are called in the same order as their inputs are sent, They are called in the order in which responses for inputs are received, not in the order these inputs are sent. I don't think these are the same orders, at least they aren't guaranteed to be. You can see this by yourself if you enable the gdb-mi debug mode (each response is tagged with the number of the corresponding input command, and those numbers are given to commands by gdb-mi.el in the order it sends the commands). > My main worry with just suppressing the warning is that presumably at > some point in the future, GDB will remove the old form entirely, and > then gdb-mi.el breaks. I'm not even sure this will be removed at all. It certainly won't be removed soon, as they just recently started issuing a warning. For example, the annotations feature of GDB, use by "M-x gud-gdb", is still being supported, although it became deprecated as soon as GDB/MI was added to GDB. > If we could get this code to use the new form when available, then > there's no need to worry about having to publish a hotfix for > gdb-mi.el on short notice. I agree. But if adding that means dealing with tricky timing-dependent and version-dependent bugs, I prefer to use a less radical solution, even if it's less clean and less future-proof. Btw, as an easy alternative, we could add a defcustom whose value would be the minimum supported value of GDB. Then users could set it to, say, 7.8.0, to force gdb-mi.el to use mi-async, and by that avoid the annoyance. This could even go into Emacs 29.