From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30151: Debugger API Date: Thu, 18 Jan 2018 16:41:16 +0200 Message-ID: <83shb3ut4j.fsf@gnu.org> References: <1516251398.1364994.1239356432.7334F1AF@webmail.messagingengine.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1516286425 4113 195.159.176.226 (18 Jan 2018 14:40:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 14:40:25 +0000 (UTC) Cc: 30151@debbugs.gnu.org To: James Nguyen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 15:40:20 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecBMO-0008Vb-Ks for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 15:40:08 +0100 Original-Received: from localhost ([::1]:34834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecBOO-00033v-Jp for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 09:42:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecBOI-00033D-F9 for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 09:42:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecBOE-0005zs-9Z for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 09:42:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecBOE-0005ze-5M for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 09:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ecBOD-00053X-U0 for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 09:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jan 2018 14:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30151 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30151-submit@debbugs.gnu.org id=B30151.151628649319390 (code B ref 30151); Thu, 18 Jan 2018 14:42:01 +0000 Original-Received: (at 30151) by debbugs.gnu.org; 18 Jan 2018 14:41:33 +0000 Original-Received: from localhost ([127.0.0.1]:32899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecBNl-00052f-Gi for submit@debbugs.gnu.org; Thu, 18 Jan 2018 09:41:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecBNi-00052O-AX for 30151@debbugs.gnu.org; Thu, 18 Jan 2018 09:41:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecBNZ-0005Xa-U2 for 30151@debbugs.gnu.org; Thu, 18 Jan 2018 09:41:24 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecBNZ-0005XW-PU; Thu, 18 Jan 2018 09:41:21 -0500 Original-Received: from [176.228.60.248] (port=4175 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ecBNZ-00087b-7g; Thu, 18 Jan 2018 09:41:21 -0500 In-reply-to: <1516251398.1364994.1239356432.7334F1AF@webmail.messagingengine.com> (message from James Nguyen on Wed, 17 Jan 2018 20:56:38 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142252 Archived-At: > From: James Nguyen > Date: Wed, 17 Jan 2018 20:56:38 -0800 > > I've been meaning to look at how to implement a debugger for Emacs for various languages. > > There seems to be various options to go with (realgud, gud/gud-mi?, NIH roll my own) and it seems the community chooses different paths (including not writing one at all). > > Some debuggers that come to mind are: edebug, gud-gdb, realgud, cider, indium, jdibug with a varied feature set. > > I'm curious if it makes sense (or is doable) to have something similar to flycheck/flymake but for debugging (or like VSCode's https://code.visualstudio.com/docs/extensionAPI/api-debugging) so that there's a common interface to writing a debugger. Emacs provides an interface to _debuggers_, not to languages. For example, you can debug any language supported by GDB using gdb-mi.el, but will have to use "M-x pdb" (defined in gud.el) for Perl debugging. IOW, unlike VS, which is a single debugging engine, Emacs supports several debugging engines. The closest thing to VSCode's Debugging API we have is therefore gdb-mi.el -- if you are willing to limit yourself to those languages currently supported by GDB. So I'm not sure I understand your idea well enough to answer your questions in a useful way, at least not if I want to be sure I gave a complete answer that you can use to decide how to go about this project. Can you elaborate on your idea given the above considerations? > gud-def looks to be the closest thing but it seems somewhat low level given it doesn't draw breakpoints on screen (random example) or provide something like a 'locals' view. > > If gud-def is the recommended approach, I wonder why the other debuggers (list mentioned above) don't leverage it. gud-def (and gud.el in general) is supposed to be the extensible debugging interface, yes. However, the capabilities it can provide depend critically on what the is supported by the underlying debugger. E.g., displaying breakpoints requires that the debugger could be queried about the location(s) of each breakpoint, and that it returns the results of the query in a way that Emacs can unequivocally parse. I cannot tell why packages you mentioned that support debugging roll their own; perhaps the respective package developers could chime in and explain. Thanks.