From: Nick Roberts Date: Sat, 28 May 2005 12:15:33 +0000 (+0000) Subject: (gdb-assembler-custom): Be more careful about preserving point. X-Git-Tag: emacs-pretest-22.0.90~9458 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8164904190cf82406b0dbd9b5a4437635caeb0dc;p=emacs.git (gdb-assembler-custom): Be more careful about preserving point. --- diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index ecb8f63f8ea..df9d455f7df 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -2439,20 +2439,21 @@ BUFFER nil or omitted means use the current buffer." (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer)) (pos 1) (address) (flag) (bptno)) (with-current-buffer buffer - (if (not (equal gdb-frame-address "main")) - (progn - (goto-char (point-min)) - (if (and gdb-frame-address - (re-search-forward gdb-frame-address nil t)) - (progn - (setq pos (point)) - (beginning-of-line) - (or gdb-overlay-arrow-position - (setq gdb-overlay-arrow-position (make-marker))) - (set-marker gdb-overlay-arrow-position - (point) (current-buffer)))))) - ;; remove all breakpoint-icons in assembler buffer before updating. - (gdb-remove-breakpoint-icons (point-min) (point-max))) + (save-excursion + (if (not (equal gdb-frame-address "main")) + (progn + (goto-char (point-min)) + (if (and gdb-frame-address + (re-search-forward gdb-frame-address nil t)) + (progn + (setq pos (point)) + (beginning-of-line) + (or gdb-overlay-arrow-position + (setq gdb-overlay-arrow-position (make-marker))) + (set-marker gdb-overlay-arrow-position + (point) (current-buffer)))))) + ;; remove all breakpoint-icons in assembler buffer before updating. + (gdb-remove-breakpoint-icons (point-min) (point-max)))) (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) (goto-char (point-min)) (while (< (point) (- (point-max) 1)) @@ -2465,9 +2466,10 @@ BUFFER nil or omitted means use the current buffer." (setq flag (char-after (match-beginning 2))) (setq address (match-string 3)) (with-current-buffer buffer + (save-excursion (goto-char (point-min)) (if (re-search-forward address nil t) - (gdb-put-breakpoint-icon (eq flag ?y) bptno))))))) + (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))) (if (not (equal gdb-frame-address "main")) (set-window-point (get-buffer-window buffer 0) pos))))