]> git.eshelyaron.com Git - emacs.git/commitdiff
(gdb-apple-test): New function.
authorNick Roberts <nickrob@snap.net.nz>
Fri, 26 Mar 2010 08:58:41 +0000 (21:58 +1300)
committerNick Roberts <nickrob@snap.net.nz>
Fri, 26 Mar 2010 08:58:41 +0000 (21:58 +1300)
(gdb-init-1): Use it.

lisp/ChangeLog
lisp/progmodes/gdb-ui.el

index 37605ea3bdb0e656920ccbc0522482c02f2ffe21..1d31f31a20ba3e433e160039945446e55a2b12be 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-26  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+            Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gdb-ui.el (gdb-apple-test): New function.
+       (gdb-init-1): Use it.
+
 2010-02-10  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * vc.el (vc-root-diff): Doc fix.
index 9c4f8b4dd5817c00fc861c697f67811317ba125a..aa4cfab1badbd26cc818e3f651cae51e2015412e 100644 (file)
@@ -705,6 +705,9 @@ otherwise do not."
 
   (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
 
+  (if (eq system-type 'darwin)
+      (gdb-enqueue-input (list "server show version\n" 'gdb-apple-test)))
+
   ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
   (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
                           'gdb-get-version)))
@@ -736,6 +739,18 @@ otherwise do not."
   (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))
   (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)))
 
+;; Workaround for some Apple versions of GDB that add ^M at EOL
+;; after the command "server interpreter mi -stack-info-frame".
+(defun gdb-apple-test ()
+  (goto-char (point-min))
+  (if (re-search-forward "(Apple version " nil t)
+      (let* ((process (get-buffer-process gud-comint-buffer))
+            (coding-systems (process-coding-system process)))
+       (set-process-coding-system process
+                                  (coding-system-change-eol-conversion
+                                   (car coding-systems) 'dos)
+                                  (cdr coding-systems)))))
+
 (defun gdb-get-version ()
   (goto-char (point-min))
   (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)