emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB on Mac is (NOT) Broken


From: Stefan Monnier
Subject: Re: GDB on Mac is (NOT) Broken
Date: Sat, 20 Mar 2010 15:45:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> +   ;; 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))))
> + 

Actually, detecting the CRLF itself would be better.  But at least this
seems "safe for GNU".  So I think it's acceptable for 23.2.

> +       (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)))
  
Rather than string-match, you can
(eq ?\n (aref gdb-first-output-line (1- (length gdb-first-output-line))))


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]