[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using gdb in emacs 21 on Mac OS X 10.1.5
From: |
peter . ilberg |
Subject: |
Re: Using gdb in emacs 21 on Mac OS X 10.1.5 |
Date: |
Tue, 7 Sep 2004 07:41:01 -0500 |
Nick Roberts <address@hidden> wrote on 09/05/2004 07:07:59 PM:
> > > > I'm using gdb 5.0 (20001113 Apple version 203 built on
11-07-2001).
> > >
> > So this is a bug in Apple's gdb. Maybe it is time to upgrade...
>
> The previous bug report suggests that 5.3 works (without watch
expressions)
> on a newer version of Mac OS X. There's a snapshot on
> http://nick.uklinux.net
> that shows what the mode can look like. If you get time to experiment
with
> GDB 6.0 or later on Mac OS X please keep us informed.
After playing some more with gdb-ui.el over the weekend I've got it
working
with gdb 5.0. Well, I haven't done any extensive testing but breakpoints,
local variables and stack frames seem to work. Very nice! I'm glad I spent
some more time looking into this.
The solution was to manually insert the missing annotations around gdb's
prompt. Yes, it's a kludge but it works. Obviously, you should only do
this
if gdb doesn't send them already.
I've noticed that there is/can be whitespace between the file name and the
line number in the breakpoint table. I don't know if this is another
peculiarity of my version of gdb, though. Here's how I ran into it:
1 - compile main.c (just a main () function)
2 - M-x gdba
3 - break 35 (or whatever line you want to break on inside main ())
The call to looking-at fails (see below), file and line are nil,
subsequent
functions raise exceptions. (turn on debug on error)
You might have to M-x gdb-many-windows before setting the breakpoint.
Anyway, I'm appending a small patch fixing the two issues, in case
somebody
else tries this with a configuration similar to mine.
Thanks again for your help and for gdba!
Peter
--- ./emacs/lisp/progmodes/gdb-ui.el Sat Jul 3 09:21:12 2004
+++ ./emacs/lisp/progmodes/gdb-ui.el Sat Sep 4 14:00:51 2004
@@ -838,6 +838,15 @@
;; Start accumulating output for the GUD buffer
(let ((output ""))
;;
+ ;; Insert pre-prompt and prompt messages around the gdb prompt
+ (if (string-match "(gdb) " gud-marker-acc)
+ (setq gud-marker-acc
+ (concat (substring gud-marker-acc 0 (match-beginning 0))
+ "\n\032\032pre-prompt\n"
+ "(gdb) "
+ "\n\032\032prompt\n"
+ (substring gud-marker-acc (match-end 0)))))
+ ;;
;; Process all the complete markers in this chunk.
(while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
(let ((annotation (match-string 1 gud-marker-acc)))
@@ -1109,7 +1118,7 @@
(beginning-of-line)
(if (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t)
(progn
- (looking-at "\\(\\S-*\\):\\([0-9]+\\)")
+ (looking-at "\\(\\S-*\\)\\s-*:\\([0-9]+\\)")
(let ((line (match-string 2)) (buffer-read-only nil)
(file (match-string 1)))
(add-text-properties (point-at-bol) (point-at-eol)