- change "set" behavior for parameters with handlers. Now it changes their

value and then calls the handler, so that the handler and functions that
  it calls can see the new value.
This commit is contained in:
Bryce Denney 2001-09-28 06:02:12 +00:00
parent f59e68968c
commit 536d05fc48

View File

@ -1,6 +1,6 @@
/*
* gui/siminterface.cc
* $Id: siminterface.cc,v 1.32 2001-06-27 19:16:01 fries Exp $
* $Id: siminterface.cc,v 1.33 2001-09-28 06:02:12 bdenney Exp $
*
* Defines the actual link between bx_simulator_interface_c methods
* and the simulator. This file includes bochs.h because it needs
@ -382,7 +382,8 @@ bx_param_num_c::set (Bit32s newval)
{
if (handler) {
// the handler can override the new value and/or perform some side effect
val = (*handler)(this, 1, newval);
val = newval;
(*handler)(this, 1, newval);
} else {
// just set the value. This code does not check max/min.
val = newval;
@ -473,14 +474,14 @@ bx_param_string_c::get (char *buf, int len)
void
bx_param_string_c::set (char *buf)
{
if (handler) {
// the handler can return a different char* to be copied into the value
buf = (*handler)(this, 1, buf, -1);
}
if (options->get () & BX_RAW_BYTES)
memcpy (val, buf, maxsize);
else
strncpy (val, buf, maxsize);
if (handler) {
// the handler can return a different char* to be copied into the value
buf = (*handler)(this, 1, buf, -1);
}
}
#if 0