diff options
author | Gavin Romig-Koch <gavin@redhat.com> | 1997-05-22 13:16:03 +0000 |
---|---|---|
committer | Gavin Romig-Koch <gavin@redhat.com> | 1997-05-22 13:16:03 +0000 |
commit | 6e61ecfc92456bd557cd2276a92e34a13fd1ca4e (patch) | |
tree | 3d94cfc562be34fd30d884455d68e00beb695e40 /sim/common/sim-resume.c | |
parent | fb07c6969379c9f7ee889296e368c60918bd3898 (diff) | |
download | gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.zip gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.tar.gz gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.tar.bz2 |
Change longjmp param/setjmp return value used for simulator restart from 0 to 2.
Diffstat (limited to 'sim/common/sim-resume.c')
-rw-r--r-- | sim/common/sim-resume.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sim/common/sim-resume.c b/sim/common/sim-resume.c index e1004b7..ebc9ce6 100644 --- a/sim/common/sim-resume.c +++ b/sim/common/sim-resume.c @@ -18,16 +18,18 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sim-main.h" - #include <signal.h> +#include "sim-main.h" +#include "sim-assert.h" + /* Halt the simulator after just one instruction */ static void has_stepped (SIM_DESC sd, void *data) { + ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); sim_engine_halt (sd, NULL, NULL, NULL_CIA, sim_stopped, SIGTRAP); } @@ -41,6 +43,9 @@ sim_resume (SIM_DESC sd, { sim_engine *engine = STATE_ENGINE (sd); jmp_buf buf; + int jmpval; + + ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); /* we only want to be single stepping the simulator once */ if (engine->stepper != NULL) @@ -52,8 +57,14 @@ sim_resume (SIM_DESC sd, engine->stepper = sim_events_schedule (sd, 1, has_stepped, sd); /* run/resume the simulator */ + /* jmpval: 0 (initial use) start simulator + 1 halt simulator + 2 restart simulator + */ + engine->jmpbuf = &buf; - if (! setjmp (buf)) + jmpval = setjmp (buf); + if (jmpval == 0 || jmpval == 2) { int last_cpu_nr = sim_engine_last_cpu_nr (sd); int next_cpu_nr = sim_engine_next_cpu_nr (sd); |