# HG changeset patch # User Nick Roberts # Date 1117282533 0 # Node ID 28ffa958559dd280856839d63cf493b3dd78ab11 # Parent e0779e3435556da907f8bd9ceb82bf452eb4485f (gdb-assembler-custom): Be more careful about preserving point. diff -r e0779e343555 -r 28ffa958559d lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Sat May 28 12:12:06 2005 +0000 +++ b/lisp/progmodes/gdb-ui.el Sat May 28 12:15:33 2005 +0000 @@ -2439,20 +2439,21 @@ (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 @@ (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))))