       (setq gud-last-last-frame gud-last-frame))
     (rename-buffer (format "*rdebug-cmd-%s*" gud-target-name))
 
+    ;; Add the buffer-displaying commands to the Gud buffer,
+    (let ((prefix-map (make-sparse-keymap)))
+      (define-key (current-local-map) gud-key-prefix prefix-map)
+      (rdebug-populate-secondary-buffer-map-plain prefix-map))
+    
+    (rdebug-populate-common-keys (current-local-map))
+    (rdebug-populate-debugger-menu (current-local-map))
+      
+    (setq comint-prompt-regexp "^(rdb:-) ")
+    (setq paragraph-start comint-prompt-regexp)
+
     (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist)
             rdebug-debugger-support-minor-mode-map-when-active)
+    (gud-call "set annotate 3")
+    (gud-call "frame 0")
     (when rdebug-many-windows
-      (rdebug-setup-windows))))
+      (rdebug-setup-windows))
+    (run-hooks 'rdebug-mode-hook)))
 
 
 ;; -------------------------------------------------------------------

    (set (make-local-variable 'gud-last-frame) nil)
    (rdebug-track-mode 1)
    (rdebug-common-initialization)
    (when name
      (setq gud-target-name name)
      (setq gud-comint-buffer (current-buffer)))

    (set (make-local-variable 'gud-find-file) 'gud-rdebug-find-file)
    (setq gud-last-last-frame nil)
    (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter)
    (gud-set-buffer)
    ;;

