       (define-key menu [view] (cons "View" submenu)))
 
     (define-key map [menu-bar debugger view output]
-      '(menu-item "Output" rdebug-display-output-buffer))
+      (rdebug-menu-item common-map "Output" 'rdebug-display-output-buffer))
 
     (define-key map [menu-bar debugger view watch]
-      '(menu-item "Watch" rdebug-display-watch-buffer))
+      (rdebug-menu-item common-map "Watch" 'rdebug-display-watch-buffer))
 
     (define-key map [menu-bar debugger view stack]
-      '(menu-item "Stack trace" rdebug-display-stack-buffer))
+      (rdebug-menu-item common-map "Stack trace" 'rdebug-display-stack-buffer))
 
     (define-key map [menu-bar debugger view shell]
-      '(menu-item "Debugger Shell" rdebug-display-cmd-buffer))
+      (rdebug-menu-item common-map "Debugger Shell" 'rdebug-display-cmd-buffer))
 
     (define-key map [menu-bar debugger view variables]
-      '(menu-item "Variables" rdebug-display-variables-buffer))
+      (rdebug-menu-item common-map "Variables" 'rdebug-display-variables-buffer))
 
     (define-key map [menu-bar debugger view breakpoints]
-      '(menu-item "Breakpoints" rdebug-display-breakpoints-buffer))
+      (rdebug-menu-item common-map
+                        "Breakpoints" 'rdebug-display-breakpoints-buffer))
     menu))
 
 

  "History of argument lists passed to rdebug.")

(defconst gud-rdebug-marker-regexp
  "^\\([^:\n]*\\):\\([0-9]*\\).*\n"
  "Regular expression used to find a file location given by rdebug.

Program-location lines look like this:


(defun rdebug-populate-debugger-menu (map)
  "Populate the Rdebug 'Debugger' menu."
  (let ((menu (make-sparse-keymap))
        (common-map (make-sparse-keymap)))
    ;; Use a simple common map to find the best key sequence to display in menu.
    (rdebug-populate-common-keys common-map)

    (define-key map [menu-bar debugger] (cons "Debugger" menu))

    (define-key menu [break-delete]
      (rdebug-menu-item common-map "Delete breakpoint" 'gud-remove))

    (define-key menu [break]
      (rdebug-menu-item common-map "Set breakpoint" 'gud-break))

    (define-key menu [finish] (rdebug-menu-item common-map "Step out" 'gud-finish))
    (define-key menu [step]   (rdebug-menu-item common-map "Step into" 'gud-step))
    (define-key menu [next]   (rdebug-menu-item common-map "Step over" 'gud-next))
    (define-key menu [cont]   (rdebug-menu-item common-map "Continue" 'gud-cont))
    (define-key menu [start]
      (rdebug-menu-item common-map "Start the debugger" 'rdebug))

    (define-key menu [placeholder] nil)

