     map)
   "Keymap to navigate/set/enable rdebug breakpoints.")
 
+(defun rdebug-delete-frame-or-window ()
+  "Delete frame if there is only one window.  Otherwise delete the window."
+  (interactive)
+  (if (one-window-p) (delete-frame)
+    (delete-window)))
+
+(defun rdebug-breakpoints-mode ()
+  "Major mode for rdebug breakpoints.
+
+\\{rdebug-breakpoints-mode-map}"
+  (kill-all-local-variables)
+  (setq major-mode 'rdebug-breakpoints-mode)
+  (setq mode-name "RDEBUG Breakpoints")
+  (use-local-map rdebug-breakpoints-mode-map)
+  (setq buffer-read-only t)
+  (run-mode-hooks 'rdebug-breakpoints-mode-hook)
+  ;(if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
+  ;    'gdb-invalidate-breakpoints
+  ;  'gdbmi-invalidate-breakpoints)
+)
+
 (defconst rdebug--breakpoint-regexp
   "^\\ +\\([0-9]+\\) +at +\\(.+\\):\\([0-9]+\\)$"
   "Regexp to recognize breakpoint lines in rdebug breakpoint buffers.")


;; -- breakpoints

(defvar rdebug--breakpoints-map
  (let ((map (make-sparse-keymap)))
    (define-key map [mouse-2] 'rdebug-goto-breakpoint-mouse)
    ; (define-key map [? ] 'rdebug-toggle-breakpoint)
    (define-key map [(control m)] 'rdebug-goto-breakpoint)

                              (buffer-substring b e))
            (add-text-properties b e
                                 (list 'mouse-face 'highlight
                                       'keymap rdebug-breakpoints-mode-map))
            (add-text-properties
             (+ b (match-beginning 1)) (+ b (match-end 1))
             (list 'face font-lock-constant-face
