unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
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: Mon, 22 Mar 2010 10:29:15 +0900	[thread overview]
Message-ID: <wliq8pp2j8.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <19365.49601.379093.424303@totara.tehura.co.nz>

>>>>> On Sun, 21 Mar 2010 19:50:41 +1300, nickrob@snap.net.nz (Nick Roberts) said:

> To be safer you need to add something like:

>   (gdb-enqueue-input (list "server show version\n" 'gdb-apple-test)))

> maybe at the start of gdb-init-2 and where gdb-apple-test inspects the
> output of "show version" (the prefix server ensures that the user
> doesn't see this command in the gdb history):

>   ;; 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)
>       (setq gdb-version "pre-6.4")
>       (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))))))

> To see how this works instrument gdb-apple-test with Edebug and look in
> the " *partial-output-yourprog" buffer (note leading space means hidden
> buffer).

>> If we want to
>> avoid string-match for most cases, then we can save the original value
>> at the beginning of the while-loop to some variable (say,
>> orig-gdb-first-prompt) and use it like this:

> The above patch would avoid continually matching in gud-gdba-marker-filter
> too.

> WDYT?

I think it's much cleaner.

I tried your code with removing the line (setq gdb-version "pre-6.4")
in gdb-apple-test, because set-process-coding-system should go to the
then-clause.

(I'm not familiar with this at all, but should Apple versions be
regarded as pre-6.4?  On Mac OS X 10.6, the first line looks like `GNU
gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC
2009)', and `server interpreter mi -stack-info-frame' results in
`^error,msg="No registers."'.)

It avoided the hang in completion, but in the
" *partial-output-yourprog*" buffer, ^M was already added because
"server show version\n" was executed after "server interpreter mi
-stack-info-frame\n" which triggered the addition of ^M.  How about
checking the result of "server show version\n" before "server
interpreter mi -stack-info-frame\n"?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp




  reply	other threads:[~2010-03-22  1:29 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wliq8pp2j8.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).