 	 (gud-find-file (car gud-last-last-frame))
        ;; Put buffer list in window if we
        ;; can't find a source file.
-       (list-buffers-noselect)))
+       ;;
+       ;; Note: The frame-specific buffer list (used when
+       ;; `Buffer-menu-use-frame-buffer-list' is non-nil), can contain
+       ;; killed buffers, which `list-buffers-noselect' crashes on.
+       (let ((Buffer-menu-use-frame-buffer-list nil))
+         (list-buffers-noselect))))
     (other-window 1)
     (set-window-buffer 
      (selected-window) 



(defmacro rdebug-debug-enter (str &rest body)
  `(progn
     (rdebug-debug-message "--> %s\n" ,str)
     (setq rdebug-debug-depth (+ rdebug-debug-depth 1))

    (setq gud-target-name target-name)
    (when rdebug-buffer (kill-buffer rdebug-buffer))
    (rename-buffer rdebug-buffer-name)

    ;; Setup exit callback so that the original frame configuration
    ;; can be restored.
    (let ((process (get-buffer-process gud-comint-buffer)))
      (if process
          (set-process-sentinel process
                                'rdebug-process-sentinel)))

    (set (make-local-variable 'gud-minor-mode) 'rdebug)

