       (setq buffer-read-only t)
       (let ((inhibit-read-only t)
             (setup-func (gethash name rdebug--annotation-setup-map)))
-        (erase-buffer)
+        (if (string= name "output")
+            (goto-char (point-max))
+          (erase-buffer))
         (insert contents)
         (when setup-func (funcall setup-func buf comint-buffer)))))))
+
+
+;;
+;; Window layout
+;;
+
+(defun rdebug-many-windows-layout-standard (src-buf name)
+  "The default rdebug window layout, see `rdebug' for more information."
+  (delete-other-windows)
+  (split-window nil ( / ( * (window-height) 3) 4))
+  (split-window nil ( / (window-height) 3))
+  (split-window-horizontally)
+  (other-window 1)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "variables" name))
+  (other-window 1)
+  (switch-to-buffer src-buf)
+  (other-window 1)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "stack" name))
+  (split-window-horizontally)
+  (other-window 1)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "breakpoints" name))
+  (other-window 1)
+  (goto-char (point-max)))
+
+(defun rdebug-many-windows-layout-conservative (src-buf name)
+  "A conservative rdebug window layout with three windows.
+
+This window layout mimics the traditional debugger shell and
+source window layout, it only add one secondary window.
+Initially, the secondary window displays output of the debugged
+process, but any secondary buffer can be displayed, press `?' in
+the window for more details."
+  (delete-other-windows)
+  (split-window-horizontally)
+  (other-window 1)
+  (switch-to-buffer src-buf)
+  (other-window 1)
+  (split-window nil 20)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "output" name))
+  (other-window 1))
+
+(defun rdebug-many-windows-layout-stack-of-secondary-windows (src-buf name)
+  "A rdebug window layout with several secondary windows to the right.
+The debugger shell and the source code window is to the left."
+  (delete-other-windows)
+  (split-window-horizontally)
+  (split-window nil 20)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "cmd" name))
+  (other-window 1)
+  (switch-to-buffer src-buf)
+  (other-window 1)
+  (split-window)
+  (split-window)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "variables" name))
+  (other-window 1)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "stack" name))
+  (other-window 1)
+  (split-window)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "output" name))
+  (other-window 1)
+  (set-window-buffer
+   (selected-window) (rdebug-get-buffer "breakpoints" name))
+  (other-window 1))
+
 
 (defun rdebug-setup-windows ()
   "Layout the window pattern for `rdebug-many-windows'. This was mostly copied
 from `gdb-setup-windows', but simplified."
   (rdebug-debug-enter "rdebug-setup-windows"
   (pop-to-buffer gud-comint-buffer)
-  (let ((script-name gud-target-name))
-    (rdebug-process-annotation "help" "")
-    (delete-other-windows)
-    (split-window nil ( / ( * (window-height) 3) 4))
-    (split-window nil ( / (window-height) 3))
-    (split-window-horizontally)
-    (other-window 1)
-    (set-window-buffer 
-     (selected-window) 
-     (get-buffer-create (format "*rdebug-variables-%s*" script-name)))
-    (other-window 1)
-    (switch-to-buffer
-     (cond (gud-last-last-frame
-            (gud-find-file (car gud-last-last-frame)))
-           (gud-target-name
-            (gud-find-file gud-target-name))
-           (t
-            ;; Put buffer list in window if we
-            ;; can't find a source file.
-            (list-buffers-noselect))))
-    (other-window 1)
-    (set-window-buffer 
-     (selected-window) 
-     (get-buffer-create (format "*rdebug-stack-%s*" script-name)))
-    (split-window-horizontally)
-    (other-window 1)
-    (set-window-buffer 
-     (selected-window) 
-     (get-buffer-create (format "*rdebug-breakpoints-%s*" script-name)))
-    (other-window 1)
-    (goto-char (point-max))
-    (rdebug-set-window-configuration-state 'debugger))))
-  
+  (rdebug-process-annotation "help" "")
+  (let ((buf
+         (cond (gud-last-last-frame
+                (gud-find-file (car gud-last-last-frame)))
+               (gud-target-name
+                (gud-find-file gud-target-name))
+               (t
+                ;; Put buffer list in window if we
+                ;; can't find a source file.
+                (list-buffers-noselect)))))
+    (funcall rdebug-many-windows-layout-function buf gud-target-name))
+  (rdebug-set-window-configuration-state 'debugger)))
+
+
+(defun rdebug-setup-windows-initially ()
+  "Like `rdebug-setup-windows', but erase the content of accumulative windows.
+This is called when the debugger starts."
+  (let ((buf (get-buffer (format "*rdebug-output-%s*" gud-target-name))))
+    (if buf
+        (with-current-buffer buf
+          (let ((inhibit-read-only t))
+            (erase-buffer)))))
+  (rdebug-setup-windows))
+
+(defun rdebug-get-buffer (name script-name)
+  (get-buffer-create (format "*rdebug-%s-%s*" name script-name)))
+
+
 (defun rdebug-restore-windows ()
   "Equivalent of `gdb-restore-windows' for rdebug."
   (interactive)

      (puthash "stack"       'rdebug--setup-stack-buffer                 map)
      (puthash "variables"   'rdebug--setup-variables-buffer             map)
      (puthash "display"     'rdebug--setup-display-buffer               map)
      (puthash "help"        'rdebug--setup-secondary-window-help-buffer map)
      map)))

(defun rdebug-process-annotation (name contents)
  (rdebug-debug-enter "rdebug-process-annotation"
  (let ((buf (get-buffer-create (format "*rdebug-%s-%s*" name gud-target-name)))
        ;; Buffer local, doesn't survive the buffer change.
        (comint-buffer gud-comint-buffer))

  (define-key map "B" 'rdebug-display-breakpoints-buffer)
  (define-key map "C" 'rdebug-display-cmd-buffer)
  (define-key map "D" 'rdebug-display-display-buffer)
  (define-key map "O" 'rdebug-display-output-buffer)
  (define-key map "V" 'rdebug-display-variables-buffer)
  (define-key map "S" 'rdebug-display-stack-buffer)
  (define-key map "?" 'rdebug-display-secondary-window-help-buffer))
