Created
August 12, 2015 18:15
-
-
Save legumbre/65e3dbcbd0717f10107b to your computer and use it in GitHub Desktop.
Toggle breakpoint command from a gud source buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-gud-toggle-breakpoint () | |
"Enable/disable breakpoint at the current line of source buffer." | |
(interactive) | |
(save-excursion | |
(beginning-of-line) | |
(let* ((bol (point)) | |
(ovl (overlay-get (car (overlays-in bol bol)) 'before-string)) | |
(bptno (get-text-property 0 'gdb-bptno ovl)) | |
(bpten (get-text-property 0 'gdb-enabled ovl))) | |
(if bpten (gud-basic-call (format "-break-disable %s" bptno)) | |
(gud-basic-call (format "-break-enable %s" bptno)))))) | |
;; Use M-: (overlay-get (car (overlays-in (point) (point))) 'before-string) | |
;; to see the rest of the text properties addded by gud |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment