From 33bcfade88c909dad35b582bd8b0e6f9f5d1e395 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 12 Nov 2009 15:17:42 +0000 Subject: [PATCH] 2009-11-12 Tristan Gingold * avr/interp.c (sim_load): Clear memory before loading. --- sim/ChangeLog | 4 ++++ sim/avr/interp.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sim/ChangeLog b/sim/ChangeLog index 6a5e74e5bb2..18f555cca2f 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,7 @@ +2009-11-12 Tristan Gingold + + * avr/interp.c (sim_load): Clear memory before loading. + 2009-11-09 Tristan Gingold * avr/interp.c (sim_resume): Fix typo for OP_ret. diff --git a/sim/avr/interp.c b/sim/avr/interp.c index 903370f8c28..8d267dd853d 100644 --- a/sim/avr/interp.c +++ b/sim/avr/interp.c @@ -1793,6 +1793,10 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty) { bfd *prog_bfd; + /* Clear all the memory. */ + memset (sram, 0, sizeof (sram)); + memset (flash, 0, sizeof (flash)); + prog_bfd = sim_load_file (sd, myname, callback, prog, abfd, sim_kind == SIM_OPEN_DEBUG, 0, sim_write); -- 2.30.2