[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Sun Aug 29 00:00:09 UTC 2010


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

Modified Files:
	ChangeLog swank-cmucl.lisp 
Log Message:
* swank-cmucl.lisp (*gdb-program-name*): Determine gdb location
from PATH.
(gdb-exec): Use *gdb-program-name* instead of "gdb".
(gdb-command): Mac OS X compatibility.
Patch by Raymond Toy.


--- /project/slime/cvsroot/slime/ChangeLog	2010/08/25 08:20:09	1.2131
+++ /project/slime/cvsroot/slime/ChangeLog	2010/08/29 00:00:09	1.2132
@@ -1,3 +1,11 @@
+2010-08-28  Stas Boukarev  <stassats at gmail.com>
+
+	* swank-cmucl.lisp (*gdb-program-name*): Determine gdb location
+	from PATH.
+	(gdb-exec): Use *gdb-program-name* instead of "gdb".
+	(gdb-command): Mac OS X compatibility.
+	Patch by Raymond Toy.
+
 2010-08-25  Stas Boukarev  <stassats at gmail.com>
 
 	* swank-sbcl.lisp (exec-image): Use (car sb-ext:*posix-argv*) if
--- /project/slime/cvsroot/slime/swank-cmucl.lisp	2010/08/13 07:31:01	1.227
+++ /project/slime/cvsroot/slime/swank-cmucl.lisp	2010/08/29 00:00:09	1.228
@@ -1892,7 +1892,10 @@
 ~8X  Saved Instruction Pointer~%" (mapcar #'fixnum 
                       (multiple-value-list (frame-registers frame)))))))
 
-(defvar *gdb-program-name* "/usr/bin/gdb")
+(defvar *gdb-program-name*
+  (ext:enumerate-search-list (p "path:gdb")
+    (when (probe-file p)
+      (return p))))
 
 (defimplementation disassemble-frame (frame-number)
   (print-frame-registers frame-number)
@@ -1924,20 +1927,24 @@
       (delete-file name))))
 
 (defun gdb-command (format-string &rest args)
-  (let ((str (gdb-exec (format nil 
+  (let ((str (gdb-exec (format nil
                                "interpreter-exec mi2 \"attach ~d\"~%~
                                 interpreter-exec console ~s~%detach"
                                (getpid)
                                (apply #'format nil format-string args))))
-        (prompt (format nil "~%^done~%(gdb) ~%")))
-    (subseq str (+ (search prompt str) (length prompt)))))
+        (prompt (format nil
+                        #-(and darwin x86) "~%^done~%(gdb) ~%"
+                        #+(and darwin x86)
+"~%^done,thread-id=\"1\"~%(gdb) ~%")))
+    (subseq str (+ (or (search prompt str) 0) (length prompt)))))
 
 (defun gdb-exec (cmd)
   (with-temporary-file (file filename)
     (write-string cmd file)
     (force-output file)
     (let* ((output (make-string-output-stream))
-           (proc (ext:run-program "gdb" `("-batch" "-x" ,filename) 
+           (proc (ext:run-program *gdb-program-name*
+                                  `("-batch" "-x" ,filename) 
                                   :wait t
                                   :output output)))
       (assert (eq (ext:process-status proc) :exited))





More information about the slime-cvs mailing list