aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-11-23 00:27:38 +0000
committerKim F. Storm2003-11-23 00:27:38 +0000
commitf48e9893db77297f778dc2e39deb856bc3424c54 (patch)
treeeee18624023affd13b8688146da72a98f134daa7
parent76693d123220d60c4465e92c4a80143c25bd85f4 (diff)
downloademacs-f48e9893db77297f778dc2e39deb856bc3424c54.tar.gz
emacs-f48e9893db77297f778dc2e39deb856bc3424c54.zip
(gdb-mouse-toggle-breakpoint): New defun.
(gdba): Bind it to [left-margin mouse-1] and [left-fringe mouse-1].
-rw-r--r--lisp/gdb-ui.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el
index be61bf8059a..b1bb026aef7 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/gdb-ui.el
@@ -145,6 +145,9 @@ The following interactive lisp functions help control operation :
145 (gud-call "until *%a" arg))) 145 (gud-call "until *%a" arg)))
146 "\C-u" "Continue to current line or address.") 146 "\C-u" "Continue to current line or address.")
147 147
148 (define-key gud-minor-mode-map [left-margin mouse-1] 'gdb-mouse-toggle-breakpoint)
149 (define-key gud-minor-mode-map [left-fringe mouse-1] 'gdb-mouse-toggle-breakpoint)
150
148 (setq comint-input-sender 'gdb-send) 151 (setq comint-input-sender 'gdb-send)
149 ;; 152 ;;
150 ;; (re-)initialise 153 ;; (re-)initialise
@@ -1055,6 +1058,20 @@ static char *magick[] = {
1055 (end-of-line))))) 1058 (end-of-line)))))
1056 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) 1059 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1057 1060
1061(defun gdb-mouse-toggle-breakpoint (event)
1062 "Toggle breakpoint with mouse click in left margin."
1063 (interactive "e")
1064 (mouse-minibuffer-check event)
1065 (let ((posn (event-end event)))
1066 (message "pt=%S posn=%S" (posn-point posn) posn)
1067 (if (numberp (posn-point posn))
1068 (with-selected-window (posn-window posn)
1069 (save-excursion
1070 (goto-char (posn-point posn))
1071 (if (posn-object posn)
1072 (gud-remove nil)
1073 (gud-break nil)))))))
1074
1058(defun gdb-breakpoints-buffer-name () 1075(defun gdb-breakpoints-buffer-name ()
1059 (with-current-buffer gud-comint-buffer 1076 (with-current-buffer gud-comint-buffer
1060 (concat "*breakpoints of " (gdb-get-target-string) "*"))) 1077 (concat "*breakpoints of " (gdb-get-target-string) "*")))