From 536d05fc48ca9be2b7001797f6c320d657370a25 Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Fri, 28 Sep 2001 06:02:12 +0000 Subject: [PATCH] - 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. --- bochs/gui/siminterface.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index 4edb02bcd..12f9f7b15 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -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