From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: nickrob@snap.net.nz (Nick Roberts)
Cc: emacs-devel@gnu.org
Subject: Re: GDB on Mac is (NOT) Broken
Date: Tue, 16 Mar 2010 09:18:34 +0900 [thread overview]
Message-ID: <wlk4tdktk5.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <19357.53872.672127.600861@totara.tehura.co.nz>
>>>>> On Mon, 15 Mar 2010 19:23:44 +1300, nickrob@snap.net.nz (Nick Roberts) said:
> That it [Emacs] doesn't work with Apple GDB I don't see as a bug.
> Of course, if you or someone else posts a fix, I will be happy to
> apply it.
The simplest workaround would be something like (push '("\\`gdb\\'"
. (utf-8-dos . utf-8-unix)) process-coding-system-alist). But
detecting Apple versions of GDB would be better. Could you check the
patch below?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
=== modified file 'lisp/progmodes/gdb-ui.el'
*** lisp/progmodes/gdb-ui.el 2010-02-19 04:55:31 +0000
--- lisp/progmodes/gdb-ui.el 2010-03-15 23:47:49 +0000
***************
*** 162,167 ****
--- 162,168 ----
(defvar gdb-ready nil)
(defvar gdb-stack-update nil)
(defvar gdb-early-user-input nil)
+ (defvar gdb-first-output-line "")
(defvar gdb-buffer-type nil
"One of the symbols bound in `gdb-buffer-rules'.")
***************
*** 335,340 ****
--- 336,342 ----
(setq gdb-stack-update nil)
(setq gdb-flush-pending-output nil)
(setq gdb-early-user-input nil)
+ (setq gdb-first-output-line "")
(setq gud-filter-pending-text nil)
(gdb-thread-identification)
(run-hooks 'gdb-mode-hook))
***************
*** 705,710 ****
--- 707,722 ----
(if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
+ ;; Workaround for some Apple versions of GDB that add ^M at EOL
+ ;; after the command "server interpreter mi -stack-info-frame".
+ (if (string-match "(Apple version " gdb-first-output-line)
+ (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))))
+
;; 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)))
***************
*** 1769,1774 ****
--- 1781,1792 ----
(progn
(setq output (gdb-concat-output output gud-marker-acc))
(setq gud-marker-acc "")))
+ (if (not (string-match "\n" gdb-first-output-line))
+ (setq gdb-first-output-line
+ (concat gdb-first-output-line
+ (if (string-match "\n" output)
+ (substring output 0 (match-end 0))
+ output))))
output)))
(defun gdb-concat-output (so-far new)
next prev parent reply other threads:[~2010-03-16 0:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 6:23 GDB on Mac is (NOT) Broken Nick Roberts
2010-03-15 16:39 ` Chad Brown
2010-03-15 20:17 ` Nick Roberts
2010-03-16 0:18 ` YAMAMOTO Mitsuharu [this message]
2010-03-16 2:59 ` Steve Revilak
2010-03-16 5:27 ` Nick Roberts
2010-03-16 8:55 ` Chad Brown
2010-03-16 21:00 ` Nick Roberts
2010-03-20 4:10 ` YAMAMOTO Mitsuharu
2010-03-21 6:50 ` Nick Roberts
2010-03-22 1:29 ` YAMAMOTO Mitsuharu
2010-03-22 2:32 ` Nick Roberts
2010-03-22 2:46 ` Stefan Monnier
2010-03-22 3:04 ` Nick Roberts
2010-03-22 13:43 ` Stefan Monnier
2010-03-22 20:55 ` Nick Roberts
2010-03-23 1:13 ` Stefan Monnier
2010-03-23 1:55 ` YAMAMOTO Mitsuharu
2010-03-23 2:38 ` Nick Roberts
2010-03-23 3:12 ` Stefan Monnier
2010-03-26 9:02 ` Nick Roberts
2010-03-26 20:20 ` Stefan Monnier
2010-03-27 1:00 ` YAMAMOTO Mitsuharu
2010-03-17 13:30 ` Leo
2010-03-20 19:45 ` Stefan Monnier
2010-03-21 4:43 ` YAMAMOTO Mitsuharu
[not found] <20100314185409.00EDD9B718@mxperim5.sea5.speakeasy.net>
2010-03-15 2:43 ` Steve Revilak
-- strict thread matches above, loose matches on Subject: below --
2010-03-14 0:32 Nick Roberts
2010-03-14 19:45 ` Harald Hanche-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlk4tdktk5.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=emacs-devel@gnu.org \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.