GNU Emacs Lisp Reference Manual
When Edebug needs to display something (e.g., in trace mode), it saves the current window configuration from ``outside'' Edebug (see Window Configurations). When you exit Edebug (by continuing the program), it restores the previous window configuration.
Emacs redisplays only when it pauses. Usually, when you continue execution, the program comes back into Edebug at a breakpoint or after stepping without pausing or reading input in between. In such cases, Emacs never gets a chance to redisplay the ``outside'' configuration. What you see is the same window configuration as the last time Edebug was active, with no interruption.
Entry to Edebug for displaying something also saves and restores the following data, but some of these are deliberately not restored if an error or quit signal occurs.
edebug-save-windows is non-nil (see Edebug Display Update). The window configuration is not restored on error or quit, but the outside selected window is reselected even on error or quit in case a save-excursion is active. If the value of edebug-save-windows is a list, only the listed windows are saved and restored.
The window start and horizontal scrolling of the source code buffer are not restored, however, so that the display remains coherent within Edebug.
edebug-save-displayed-buffer-points is non-nil.overlay-arrow-position and overlay-arrow-string are saved and restored. So you can safely invoke Edebug from the recursive edit elsewhere in the same buffer.cursor-in-echo-area is locally bound to nil so that the cursor shows up in the window.