aboutsummaryrefslogtreecommitdiff
path: root/sim/avr
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-11-12 15:17:42 +0000
committerTristan Gingold <gingold@adacore.com>2009-11-12 15:17:42 +0000
commit33bcfade88c909dad35b582bd8b0e6f9f5d1e395 (patch)
tree8c8efad74dc2abb07da9345f270d34d9605a3013 /sim/avr
parentf24fce77816b17011fdd159f529d1b2dceb4fdac (diff)
downloadgdb-33bcfade88c909dad35b582bd8b0e6f9f5d1e395.zip
gdb-33bcfade88c909dad35b582bd8b0e6f9f5d1e395.tar.gz
gdb-33bcfade88c909dad35b582bd8b0e6f9f5d1e395.tar.bz2
2009-11-12 Tristan Gingold <gingold@adacore.com>
* avr/interp.c (sim_load): Clear memory before loading.
Diffstat (limited to 'sim/avr')
-rw-r--r--sim/avr/interp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sim/avr/interp.c b/sim/avr/interp.c
index 903370f..8d267dd 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);