   "Layout the window pattern for `rdebug-many-windows'. This was mostly copied
 from `gdb-setup-windows', but simplified."
   (rdebug-debug-enter "rdebug-setup-windows"
+  (rdebug-set-window-configuration-state 'debugger t)
   (pop-to-buffer gud-comint-buffer)
   (rdebug-process-annotation "help" "")
   (let ((buf

    (define-key map [menu-bar debugger view output]
      '(menu-item "Output" rdebug-display-output-buffer))

    (define-key map [menu-bar debugger view display]
      '(menu-item "Watch" rdebug-display-display-buffer))

    (define-key map [menu-bar debugger view stack]
      '(menu-item "Stack trace" rdebug-display-stack-buffer))

   (list (gud-query-cmdline 'rdebug)))

  (rdebug-debug-enter "rdebug"
  (rdebug-set-window-configuration-state 'debugger t)
  ; Parse the command line and pick out the script name and whether --annotate
  ; has been set.
  (let* ((words (split-string-and-unquote command-line))
