[slime-cvs] CVS slime

CVS User trittweiler trittweiler at common-lisp.net
Thu Mar 18 15:59:57 UTC 2010


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv19810

Modified Files:
	ChangeLog slime.el 
Log Message:
	Add M-x slime-attach-gdb as an interactive function.

	The ATTACH-GDB restart is nice because it's convenient and the
	backends can specify customized gdb configuration.

	Sometimes, if the Lisp is too screwed up, going over a restart
	involving the SWANK middle layer may not be possible. For that, a
	manual M-x slime-attach-gdb may come in handy.

	* slime.el (slime-read-connection): New helper.
	(slime-attach-gdb): Use it. Make it an interactive function.


--- /project/slime/cvsroot/slime/ChangeLog	2010/03/18 12:37:34	1.2040
+++ /project/slime/cvsroot/slime/ChangeLog	2010/03/18 15:59:57	1.2041
@@ -1,5 +1,19 @@
 2010-03-18  Tobias C. Rittweiler <tcr at freebits.de>
 
+	Add M-x slime-attach-gdb as an interactive function.
+
+	The ATTACH-GDB restart is nice because it's convenient and the
+	backends can specify customized gdb configuration.
+
+	Sometimes, if the Lisp is too screwed up, going over a restart
+	involving the SWANK middle layer may not be possible. For that, a
+	manual M-x slime-attach-gdb may come in handy.
+
+	* slime.el (slime-read-connection): New helper.
+	(slime-attach-gdb): Use it. Make it an interactive function.
+
+2010-03-18  Tobias C. Rittweiler <tcr at freebits.de>
+
 	* swank.lisp (call-with-gdb-restart): Forgot to remove trailing T.
 
 2010-03-18  Tobias C. Rittweiler <tcr at freebits.de>
--- /project/slime/cvsroot/slime/slime.el	2010/03/18 12:29:07	1.1286
+++ /project/slime/cvsroot/slime/slime.el	2010/03/18 15:59:57	1.1287
@@ -764,6 +764,19 @@
                               `(swank:list-all-package-names t)))
 		     nil t initial-value)))
 
+(defun slime-read-connection (prompt &optional initial-value)
+  "Read a connection from the minibuffer. Returns the net
+process, or nil."
+  (assert (memq initial-value slime-net-processes))
+  (flet ((connection-identifier (p)
+           (format "%s (pid %d)" (slime-connection-name p) (slime-pid p))))
+    (let ((candidates (mapcar #'(lambda (p)
+                                  (cons (connection-identifier p) p))
+                              slime-net-processes)))
+      (cdr (assoc (completing-read prompt candidates 
+                                   nil t (connection-identifier initial-value))
+                  candidates)))))
+
 ;; Interface
 (defun slime-read-symbol-name (prompt &optional query)
   "Either read a symbol name or choose the one at point.
@@ -2293,7 +2306,11 @@
                  (remove* id (slime-rex-continuations) :key #'car))
            (error "Invalid rpc: %s" message))))))
 
-(defun slime-attach-gdb (pid commands)
+(defun slime-attach-gdb (pid &optional commands)
+  "Run `gud-gdb'on the connection with PID `pid'."
+  (interactive 
+   (list (slime-pid (slime-read-connection "Attach gdb to: "
+                                           (slime-connection)))))
   (gud-gdb (format "gdb -p %d" pid))
   (with-current-buffer gud-comint-buffer
     (dolist (cmd commands)





More information about the slime-cvs mailing list