From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: GDB on Mac is (NOT) Broken Date: Sat, 20 Mar 2010 15:45:59 -0400 Message-ID: References: <19357.53872.672127.600861@totara.tehura.co.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269114378 30489 80.91.229.12 (20 Mar 2010 19:46:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Mar 2010 19:46:18 +0000 (UTC) Cc: Nick Roberts , emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 20 20:46:13 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nt4cf-0004lf-D1 for ged-emacs-devel@m.gmane.org; Sat, 20 Mar 2010 20:46:13 +0100 Original-Received: from localhost ([127.0.0.1]:51035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nt4cZ-0006vs-T6 for ged-emacs-devel@m.gmane.org; Sat, 20 Mar 2010 15:46:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nt4cV-0006vY-9Y for emacs-devel@gnu.org; Sat, 20 Mar 2010 15:46:03 -0400 Original-Received: from [140.186.70.92] (port=33404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nt4cU-0006uv-27 for emacs-devel@gnu.org; Sat, 20 Mar 2010 15:46:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nt4cS-00088t-IL for emacs-devel@gnu.org; Sat, 20 Mar 2010 15:46:01 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:34440 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nt4cS-00088p-GB for emacs-devel@gnu.org; Sat, 20 Mar 2010 15:46:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAF7CpEtFpZMX/2dsb2JhbACbPHS8EoR9BIsdgzY X-IronPort-AV: E=Sophos;i="4.51,279,1267419600"; d="scan'208";a="58672503" Original-Received: from 69-165-147-23.dsl.teksavvy.com (HELO pastel.home) ([69.165.147.23]) by ironport2-out.pppoe.ca with ESMTP; 20 Mar 2010 15:45:59 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 85E8A7FBC; Sat, 20 Mar 2010 15:45:59 -0400 (EDT) In-Reply-To: (YAMAMOTO Mitsuharu's message of "Tue, 16 Mar 2010 09:18:34 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122382 Archived-At: > + ;; 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