From 3e873a96c3f6ee40cdbb6518816d9b263fd8cc30 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Sun, 8 May 1994 01:21:24 +0000 Subject: [PATCH] Fix typo in gdb-goto-first-gdb-instance. Re-write gdb-look-for-tagged-buffer to avoid recursion (I was getting errors because of too much nesting, obviously elisp lacks tail recursion optimization) Fix toggle-bp-this-line for new ways of communicating with gdb and rename to gdb-toggle-bp-this-line. --- gdb/gdba.el | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/gdb/gdba.el b/gdb/gdba.el index 07cb91e96e5..5f7d52a7cf7 100644 --- a/gdb/gdba.el +++ b/gdb/gdba.el @@ -293,7 +293,7 @@ handlers.") (or (and gdb-buffer-instance (eq gdb-buffer-type 'gud) (car blist)) - (gdb-find-first-gdb-instance (cdr blist)))))) + (gdb-goto-first-gdb-instance (cdr blist)))))) (defun buffer-gdb-instance (buf) (save-excursion @@ -803,12 +803,15 @@ The key should be one of the cars in `gdb-instance-buffer-rules-assoc'." (defun gdb-rules-name-maker (rules) (car (cdr rules))) (defun gdb-look-for-tagged-buffer (instance key bufs) - (and bufs - (set-buffer (car bufs)) - (or (and (eq gdb-buffer-instance instance) - (eq gdb-buffer-type key) - (car bufs)) - (gdb-look-for-tagged-buffer instance key (cdr bufs))))) + (let ((retval nil)) + (while (and (not retval) bufs) + (set-buffer (car bufs)) + (if (and (eq gdb-buffer-instance instance) + (eq gdb-buffer-type key)) + (setq retval (car bufs))) + (setq bufs (cdr bufs)) + ) + retval)) (defun gdb-instance-buffer-p (buf) (save-excursion @@ -1829,21 +1832,21 @@ Link exprs of the form: ;;; gud.el ends here -(defun toggle-bp-this-line () +(defun gdb-toggle-bp-this-line () (interactive) (save-excursion - (let (bp-num bp-state) - (beginning-of-line 1) - (if (not (looking-at "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)")) - (error "Not recognized as breakpoint line (demo foo).") - (process-send-string - gdb-buffer-process!!! - (concat - (if (eq ?y (char-after (match-beginning 2))) - "server disable " - "server enable ") - (buffer-substring (match-beginning 0) - (match-end 1)) - "\n")))))) - - + (beginning-of-line 1) + (if (not (looking-at "\\([0-9]*\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)")) + (error "Not recognized as breakpoint line (demo foo).") + (gdb-instance-enqueue-idle-input + gdb-buffer-instance + (list + (concat + (if (eq ?y (char-after (match-beginning 2))) + "server disable " + "server enable ") + (buffer-substring (match-beginning 0) + (match-end 1)) + "\n") + '(lambda () nil))) + ))) -- 2.30.2