[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GDB on Mac is (NOT) Broken
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: GDB on Mac is (NOT) Broken |
Date: |
Mon, 22 Mar 2010 10:29:15 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Sun, 21 Mar 2010 19:50:41 +1300, address@hidden (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
address@hidden
- Re: GDB on Mac is (NOT) Broken, (continued)
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/15
- Re: GDB on Mac is (NOT) Broken, Chad Brown, 2010/03/15
- Re: GDB on Mac is (NOT) Broken, YAMAMOTO Mitsuharu, 2010/03/15
- Re: GDB on Mac is (NOT) Broken, YAMAMOTO Mitsuharu, 2010/03/20
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/21
- Re: GDB on Mac is (NOT) Broken,
YAMAMOTO Mitsuharu <=
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Stefan Monnier, 2010/03/21
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Stefan Monnier, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/23
- Re: GDB on Mac is (NOT) Broken, Stefan Monnier, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, YAMAMOTO Mitsuharu, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Stefan Monnier, 2010/03/22
- Re: GDB on Mac is (NOT) Broken, Nick Roberts, 2010/03/26