From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Emacs mode for GDB Date: Mon, 20 May 2002 23:36:57 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <15593.31369.271002.495717@nick.uklinux.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1021931278 975 127.0.0.1 (20 May 2002 21:47:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 May 2002 21:47:58 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 179v0Y-0000Fc-00 for ; Mon, 20 May 2002 23:47:58 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 179vEf-0001eC-00 for ; Tue, 21 May 2002 00:02:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 179v0r-0000GT-00; Mon, 20 May 2002 17:48:17 -0400 Original-Received: from dial-212-1-151-2.access.uk.tiscali.com ([212.1.151.2] helo=nick.uklinux.net) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 179uyv-0000Al-00 for ; Mon, 20 May 2002 17:46:17 -0400 Original-Received: by nick.uklinux.net (Postfix, from userid 501) id 9776076035; Mon, 20 May 2002 23:36:57 +0100 (BST) Original-To: emacs-devel@gnu.org X-Mailer: VM 6.97 under Emacs 21.1.1 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4215 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4215 I am writing a mode for Emacs that allows it to act as a GUI for gdb. It is based on an earlier file called gdba.el which may not be familiar to some members of this mailing list since, as far as I know, most GNU/Linux distributions only included it in the source package of gdb and not the binary one. gdba.el has a stack buffer, breakpoints buffer and separate input/output buffer for the program being debugged among other features. It uses a feature of gdb called annotations. Although Emacs uses the gdb option `-annotations=1' (or `-fullname') in gud.el, this option only generates one annotation (to tell gud where it has stopped). The option used here, `-annotations=2', has many more and this makes it more powerful. The mode I am writing extends gdba.el and uses features of Emacs 21 that weren't available to it such as the toolbar and breakpoint icons (or characters for a text-only terminal) in the display margin. Before I develop this mode further, I would be grateful for some feedback to help ensure it is a mode that people actually want to use. I have therefore placed a tar file with the lisp code and associated files at http://nick.uklinux.net/gdbel-0.1.tgz for anyone who is able to spend some time to look at it and give comment. There is also a screenshot of Emacs using this mode at http://nick.uklinux.net/screenshot.png. Thanks Nick Brief description of mode ------------------------- This mode works best in X using the full screen. You can see its features if you run gdb using a simple C program that calls another procedure and prints some output : After a short delay the following layout should appear (key-bindings given in relevant buffer) : --------------------------------------------------------------------- gdb toolbar --------------------------------------------------------------------- GUD buffer (I/O of gdb) | Locals buffer | | | --------------------------------------------------------------------- Source buffer | Input/Output (of debugee) buffer | (comint-mode) | | | | | | --------------------------------------------------------------------- Stack buffer | Breakpoints buffer [mouse-2] gud-frames-select | SPC gud-toggle-bp-this-line | g gud-goto-bp-this-line | d gud-delete-bp-this-line --------------------------------------------------------------------- All the buffers share the toolbar and source should always display in the same window e.g after typing g on a breakpoint in the breakpoints buffer. The GUI interacts with the GUD buffer eg breakpoint icons are displayed not only by setting a break with gud-break but also by typing break in the GUD buffer. There are also a couple of interactive lisp functions e.g gdb-restore-windows - to restore the layout if its lost. gdb-quit - to delete (most) of the buffers used by gdb.