Bochs/bochs/cpu
Bryce Denney 80a3900b8b - apply a patch I've been working on
- modified files: config.h.in cpu/init.cc debug/dbg_main.cc gui/control.cc
  gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h
  gui/wxmain.cc gui/wxmain.h iodev/keyboard.cc

----------------------------------------------------------------------
Patch name: patch.wx-show-cpu2
Author: Bryce Denney
Date: Fri Sep  6 12:13:28 EDT 2002

Description:

Second try at implementing the "Debug:Show Cpu" and "Debug:Show
Keyboard" dialog with values that change as the simulation proceeds.
(Nobody gets to see the first try.)  This is the first step toward
making something resembling a wxWindows debugger.

First, variables which are going to be visible in the CI must be
registered as parameters.  For some variables, it might be acceptable
to change them from Bit32u into bx_param_num_c and access them only
with set/get methods, but for most variables it would be a horrible
pain and wreck performance.

To deal with this, I introduced the concept of a shadow parameter.  A
normal parameter has its value stored inside the struct, but a shadow
parameter has only a pointer to the value.  Shadow params allow you to
treat any variable as if it was a parameter, without having to change
its type and access it using get/set methods.  Of course, a shadow
param's value is controlled by someone else, so it can change at any
time.

To demonstrate and test the registration of shadow parameters, I
added code in cpu/init.cc to register a few CPU registers and
code in iodev/keyboard.cc to register a few keyboard state values.
Now these parameters are visible in the Debug:Show CPU and
Debug:Show Keyboard dialog boxes.

The Debug:Show* dialog boxes are created by the ParamDialog class,
which already understands how to display each type of parameter,
including the new shadow parameters (because they are just a subclass
of a normal parameter class).  I have added a ParamDialog::Refresh()
method, which rereads the value from every parameter that it is
displaying and changes the displayed value.  At the moment, in the
Debug:Show CPU dialog, changing the values has no effect.  However
this is trivial to add when it's time (just call CommitChanges!).  It
wouldn't really make sense to change the values unless you have paused
the simulation, for example when single stepping with the debugger.

The Refresh() method must be called periodically or else the dialog
will show the initial values forever.  At the moment, Refresh() is
called when the simulator sends an async event called
BX_ASYNC_EVT_REFRESH, created by a call to SIM->refresh_ci ().

Details:
- implement shadow parameter class for Bit32s, called bx_shadow_num_c.
  implement shadow parameter class for Boolean, called bx_shadow_bool_c.
  more to follow (I need one for every type!)
- now the simulator thread can request that the config interface refresh
  its display.  For now, the refresh event causes the CI to check every
  parameter it is watching and change the display value.  Later, it may
  be worth the trouble to keep track of which parameters have actually
  changed.  Code in the simulator thread calls SIM->refresh_ci(), which
  creates an async event called BX_ASYNC_EVT_REFRESH and sends it to
  the config interface.  When it arrives in the wxWindows gui thread,
  it calls RefreshDialogs(), which calls the Refresh() method on any
  dialogs that might need it.
- in the debugger, SIM->refresh_ci() is called before every prompt
  is printed.  Otherwise, the refresh would wait until the next
  SIM->periodic(), which might be thousands of cycles.  This way,
  when you're single stepping, the dialogs update with every step.
- To improve performance, the CI has a flag (MyFrame::WantRefresh())
  which tells whether it has any need for refresh events.  If no
  dialogs are showing that need refresh events, then no event is sent
  between threads.
- add a few defaults to the param classes that affect the settings of
  newly created parameters.  When declaring a lot of params with
  similar settings it's more compact to set the default for new params
  rather than to change each one separately.  default_text_format is
  the printf format string for displaying numbers.  default_base is
  the default base for displaying numbers (0, 16, 2, etc.)
- I added to ParamDialog to make it able to display modeless dialog
  boxes such as "Debug:Show CPU".  The new Refresh() method queries
  all the parameters for their current value and changes the value in
  the wxWindows control.  The ParamDialog class still needs a little
  work; for example, if it's modal it should have Cancel/Ok buttons,
  but if it's going to be modeless it should maybe have Apply (commit
  any changes) and Close.
2002-09-06 16:43:26 +00:00
..
access.cc Oops, had to fix a bunch of parentheses. 2002-09-06 16:29:49 +00:00
apic.cc - if misaligned or wrong size write, print the address and length! 2002-07-23 15:32:14 +00:00
arith8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
arith16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
arith32.cc - checked in cmpxchg8b patch from Michael Hohmuth <hohmuth@innocent.com> 2001-11-17 22:22:03 +00:00
bcd.cc - AAM can generate an exception (divide by 0) 2002-07-06 11:02:35 +00:00
bit.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
cpu.cc Added guest2host TLB tricks to read-modify-write variants of 2002-09-03 04:54:28 +00:00
cpu.h Speed-up for TLB invalidates as proposed by Peter Tattam. 2002-09-06 14:58:56 +00:00
ctrl_xfer8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
ctrl_xfer16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
ctrl_xfer32.cc Added a comment on iret flag writing. 2002-02-22 05:33:36 +00:00
ctrl_xfer_pro.cc - Applied patch from Santiago Bazerque. See this bug report: 2001-11-10 23:00:55 +00:00
data_xfer8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
data_xfer16.cc Made some very minor mods, to make CPUID aware of CMOV instructions 2002-09-01 04:01:14 +00:00
data_xfer32.cc Made some very minor mods, to make CPUID aware of CMOV instructions 2002-09-01 04:01:14 +00:00
debugstuff.cc - committed patches/patch.no-busy-in-tr-cache. I'm leaving the patch 2001-10-09 21:15:14 +00:00
decode16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
decode32.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
exception.cc - add #if BX_DEBUGGER around a few more things. :) 2002-03-12 19:00:44 +00:00
fetchdecode.cc Added guest2host TLB tricks to read-modify-write variants of 2002-09-03 04:54:28 +00:00
flag_ctrl_pro.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
flag_ctrl.cc - POPFD implemented for vm86 (tested with MS-DOS 6.2 and EMM386) 2002-08-05 19:45:32 +00:00
init.cc - apply a patch I've been working on 2002-09-06 16:43:26 +00:00
io_pro.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
io.cc Fixed repeated IO/string instruction acceleration bug. Not all the 2002-09-03 19:38:27 +00:00
lazy_flags.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
lazy_flags.h - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
logical8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
logical16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
logical32.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
Makefile.in - update Makefile dependencies on nearly everything 2002-08-27 22:43:57 +00:00
mult8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
mult16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
mult32.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
paging.cc Oops, had to fix a bunch of parentheses. 2002-09-06 16:29:49 +00:00
proc_ctrl.cc Now, when you compile with --enable-guest2host-tlb, non-paged 2002-09-05 02:31:24 +00:00
protect_ctrl_pro.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
protect_ctrl.cc - committed patches/patch.no-busy-in-tr-cache. I'm leaving the patch 2001-10-09 21:15:14 +00:00
resolve16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
resolve32.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
segment_ctrl_pro.cc - patch from Mike Rieker <mrieker@o3one.org> associated with this bug rpt: 2001-11-13 05:11:41 +00:00
segment_ctrl.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
shift8.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
shift16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
shift32.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
soft_int.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
stack16.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
stack32.cc - Somebody was convinced that the enter instruction with level>0 was broken, 2002-03-05 15:50:17 +00:00
stack_pro.cc - add RCS Id to header of every file. This makes it easier to know what's 2001-10-03 13:10:38 +00:00
string.cc Fixed repeated IO/string instruction acceleration bug. Not all the 2002-09-03 19:38:27 +00:00
tasking.cc - in task_switch when it tried to ensure that the old TSS was paged in, 2001-11-11 04:57:05 +00:00
vm8086.cc - included instinc's patch.stack-return-from-v86 2002-06-27 13:31:54 +00:00