diff options
author | Kim F. Storm <storm@cua.dk> | 2003-11-23 00:27:38 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2003-11-23 00:27:38 +0000 |
commit | f48e9893db77297f778dc2e39deb856bc3424c54 (patch) | |
tree | eee18624023affd13b8688146da72a98f134daa7 /lisp/gdb-ui.el | |
parent | 76693d123220d60c4465e92c4a80143c25bd85f4 (diff) | |
download | emacs-f48e9893db77297f778dc2e39deb856bc3424c54.tar.gz |
(gdb-mouse-toggle-breakpoint): New defun.
(gdba): Bind it to [left-margin mouse-1] and [left-fringe mouse-1].
Diffstat (limited to 'lisp/gdb-ui.el')
-rw-r--r-- | lisp/gdb-ui.el | 17 |
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 : (gud-call "until *%a" arg))) "\C-u" "Continue to current line or address.") + (define-key gud-minor-mode-map [left-margin mouse-1] 'gdb-mouse-toggle-breakpoint) + (define-key gud-minor-mode-map [left-fringe mouse-1] 'gdb-mouse-toggle-breakpoint) + (setq comint-input-sender 'gdb-send) ;; ;; (re-)initialise @@ -1055,6 +1058,20 @@ static char *magick[] = { (end-of-line))))) (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) +(defun gdb-mouse-toggle-breakpoint (event) + "Toggle breakpoint with mouse click in left margin." + (interactive "e") + (mouse-minibuffer-check event) + (let ((posn (event-end event))) + (message "pt=%S posn=%S" (posn-point posn) posn) + (if (numberp (posn-point posn)) + (with-selected-window (posn-window posn) + (save-excursion + (goto-char (posn-point posn)) + (if (posn-object posn) + (gud-remove nil) + (gud-break nil))))))) + (defun gdb-breakpoints-buffer-name () (with-current-buffer gud-comint-buffer (concat "*breakpoints of " (gdb-get-target-string) "*"))) |