]> git.eshelyaron.com Git - emacs.git/commitdiff
(gdb-mouse-until, gdb-mouse-jump): Make them
authorNick Roberts <nickrob@snap.net.nz>
Wed, 7 Feb 2007 21:12:52 +0000 (21:12 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Wed, 7 Feb 2007 21:12:52 +0000 (21:12 +0000)
work when there is just an assembler buffer (no source buffer).

lisp/progmodes/gdb-ui.el

index f4f855f62a5459d7c321c230bf9483203acf7393..21a00448166940b1af0676af40c65a0f8f263392 100644 (file)
@@ -611,29 +611,30 @@ With arg, use separate IO iff arg is positive."
 The destination source line can be selected either by clicking with mouse-2
 on the fringe/margin or dragging the arrow with mouse-1 (default bindings)."
   (interactive "e")
-  (if gud-overlay-arrow-position
-      (let ((start (event-start event))
-           (end  (event-end event))
-           (buffer (marker-buffer gud-overlay-arrow-position)) (line))
-       (if (not (string-match "Machine" mode-name))
-           (if (equal buffer (window-buffer (posn-window end)))
-               (with-current-buffer buffer
-                 (when (or (equal start end)
-                           (equal (posn-point start)
-                                  (marker-position
-                                   gud-overlay-arrow-position)))
-                   (setq line (line-number-at-pos (posn-point end)))
-                   (gud-call (concat "until " (number-to-string line))))))
-         (if (equal (marker-buffer gdb-overlay-arrow-position)
-                    (window-buffer (posn-window end)))
-             (when (or (equal start end)
-                       (equal (posn-point start)
-                              (marker-position
-                               gdb-overlay-arrow-position)))
-               (save-excursion
-                 (goto-line (line-number-at-pos (posn-point end)))
-                 (forward-char 2)
-                 (gud-call (concat "until *%a")))))))))
+  (let ((start (event-start event))
+       (end (event-end event)))
+    (if gud-overlay-arrow-position
+       (let ((buffer (marker-buffer gud-overlay-arrow-position)) (line))
+         (if (equal buffer (window-buffer (posn-window end)))
+             (with-current-buffer buffer
+               (when (or (equal start end)
+                         (equal (posn-point start)
+                                (marker-position
+                                 gud-overlay-arrow-position)))
+                 (setq line (line-number-at-pos (posn-point end)))
+                 (gud-call (concat "until " (number-to-string line))))))))
+    (if gdb-overlay-arrow-position
+    (let ((buffer (marker-buffer gdb-overlay-arrow-position)))
+      (if (equal buffer (window-buffer (posn-window end)))
+         (with-current-buffer buffer
+           (when (or (equal start end)
+                     (equal (posn-point start)
+                            (marker-position
+                             gdb-overlay-arrow-position)))
+             (save-excursion
+               (goto-line (line-number-at-pos (posn-point end)))
+               (forward-char 2)
+               (gud-call (concat "until *%a"))))))))))
 
 (defun gdb-mouse-jump (event)
   "Set execution address/line.
@@ -642,32 +643,34 @@ on the fringe/margin or dragging the arrow with mouse-1 (default bindings).
 Unlike gdb-mouse-until the destination address can be before the current
 line, and no execution takes place."
   (interactive "e")
-  (if gud-overlay-arrow-position
-      (let ((start (event-start event))
-           (end  (event-end event))
-           (buffer (marker-buffer gud-overlay-arrow-position)) (line))
-       (if (not (string-match "Machine" mode-name))
-           (if (equal buffer (window-buffer (posn-window end)))
-               (with-current-buffer buffer
-                 (when (or (equal start end)
-                           (equal (posn-point start)
-                                  (marker-position
-                                   gud-overlay-arrow-position)))
-                   (setq line (line-number-at-pos (posn-point end)))
-          (progn (gud-call (concat "tbreak " (number-to-string line)))
-                 (gud-call (concat "jump " (number-to-string line)))))))
-         (if (equal (marker-buffer gdb-overlay-arrow-position)
-                    (window-buffer (posn-window end)))
-             (when (or (equal start end)
-                       (equal (posn-point start)
-                              (marker-position
-                               gdb-overlay-arrow-position)))
-               (save-excursion
-                 (goto-line (line-number-at-pos (posn-point end)))
-                 (forward-char 2)
+  (let ((start (event-start event))
+       (end (event-end event)))
+    (if gud-overlay-arrow-position
+       (let ((buffer (marker-buffer gud-overlay-arrow-position)) (line))
+         (if (equal buffer (window-buffer (posn-window end)))
+             (with-current-buffer buffer
+               (when (or (equal start end)
+                         (equal (posn-point start)
+                                (marker-position
+                                 gud-overlay-arrow-position)))
+                 (setq line (line-number-at-pos (posn-point end)))
                  (progn
-                   (gud-call (concat "tbreak *%a"))
-                   (gud-call (concat "jump *%a"))))))))))
+                   (gud-call (concat "tbreak " (number-to-string line)))
+                   (gud-call (concat "jump " (number-to-string line)))))))))
+    (if gdb-overlay-arrow-position
+       (let ((buffer (marker-buffer gdb-overlay-arrow-position)))
+         (if (equal buffer (window-buffer (posn-window end)))
+             (with-current-buffer buffer
+               (when (or (equal start end)
+                         (equal (posn-point start)
+                                (marker-position
+                                 gdb-overlay-arrow-position)))
+                 (save-excursion
+                   (goto-line (line-number-at-pos (posn-point end)))
+                   (forward-char 2)
+                   (progn
+                     (gud-call (concat "tbreak *%a"))
+                     (gud-call (concat "jump *%a")))))))))))
 
 (defcustom gdb-speedbar-auto-raise nil
   "If non-nil raise speedbar every time display of watch expressions is\