 
 	 ;; Set the accumulator to the remaining text.
 	 gud-marker-acc (substring gud-marker-acc (match-end 0))))
+
+      ;; Display the source file where we want it, gud will only pick
+      ;; an arbitrary window.
+      (if gud-last-frame
+          (rdebug-pick-source-window))
 
       ;; Does the remaining text look like it might end with the
       ;; beginning of another marker?  If it does, then keep it in

               (switch-to-buffer buf))
              (t
               ;; Pick another window, preferably a secondary window.
               (let* ((windows (window-list (selected-frame)))
                      (candidate (selected-window)))
                 (dolist (win windows)
                   (if (buffer-local-value 'rdebug-secondary-buffer
                                           (window-buffer win))
                       (setq candidate win)))
                 (select-window candidate)
                 (switch-to-buffer buf))))))))


;; -- breakpoints

Program-location lines look like this:
   /tmp/gcd.rb:29:  gcd
   /tmp/gcd.rb:29
   C:/tmp/gcd.rb:29
   \\sources\\capfilterscanner\\capanalyzer.rb:3:  <module>
")

