MonitorUI: Difference between revisions

From vice-emu
Jump to navigation Jump to search
Line 43: Line 43:
** ports that do not handle this (yet) may create a window that can not be closed by the user
** ports that do not handle this (yet) may create a window that can not be closed by the user
* entering and exiting the monitor only transfers focus to/from the emulation window respectively
* entering and exiting the monitor only transfers focus to/from the emulation window respectively
=Status=
* <tt>KeepMonitorOpen</tt> resource is implemented, defaults to 1 and allows reverting to the "old" behaviour by setting it to 0

Revision as of 19:59, 7 June 2012

Reason for this page: defining the intended behaviour of the monitor (g)ui to maintain consistency across ports and to prevent needless work :)

General Behaviour

Entering the monitor

  • exit fullscreen mode if needed
  • if monitor window is not visible, enable it
  • transfer focus to the monitor window

Leaving the monitor

  • restore fullscreen mode, make emulation window visible
  • transfer focus to the emulator window

Single stepping should not close the monitor. There's no need to set the focus back to the emulator window for a single assembly instruction. (This needs some special handling in the monitor code)

Reasons for keeping the monitor open or for closing it

Keeping the monitor open

The console driver is capable of outputting text even when the monitor is not active (ie when the emulation is running). This can be useful because eg trace/watch output shows up immediately.

Additionally developers may want to look at the last monitor output (e.g. a piece of disassembly) while the emulation runs.

Close on exit

Exiting the monitor closes the monitor window, closing the monitor window exits the monitor respectively. The emulation continues and no monitor window clobbers the screen anymore. This is the default behavior, which is also (exclusively) used by most ports.

Proposed Solution

The existing command exit (x) shall close the monitor window and continue the emulation. A close button of the monitor window (if any) shall act in the same way as the command exit.

To be able to keep the monitor window open even when the emulation is re-started, the command go (or g or goto) is to be modified. If go is issued without address, the emulation should continue from the current state. The existing semantic of go <addr> doesn't change.

These two commands (exit, go) allow the user to to do what he wants in any situation.

To be clarified: Should exit close the link to a remote monitor?

  • when issued from remote? i would say so Gpz 09:38, 14 March 2012 (UTC)

Implementation

keep open on exit

This is optional behavior which is only available on ports that support it (currently: gtk, xaw). It should be enabled if both console_log->console_can_stay_open and KeepMonitorOpen are 1 and the above mentioned "go" command is issued in the monitor. (in all other cases this command should act like exit)

  • the monitor window stays open all the time, except for when the user closes the window.
    • TODO: this creates the problem that the monitor window might be closed, although console_log->console_can_stay_open and KeepMonitorOpen are 1. This must be handled somehow by switching between buffered and non buffered mode at runtime.
    • ports that do not handle this (yet) may create a window that can not be closed by the user
  • entering and exiting the monitor only transfers focus to/from the emulation window respectively

Status

  • KeepMonitorOpen resource is implemented, defaults to 1 and allows reverting to the "old" behaviour by setting it to 0