Message ID | 1394509106-27143-1-git-send-email-vapier@gentoo.org |
---|---|
State | Committed |
Headers | show |
Assuming that memory-region ram is initialized to zero (I think it is based on reading the common/ code), this is fine. Thanks!
On Mon 10 Mar 2014 23:44:31 DJ Delorie wrote: > Assuming that memory-region ram is initialized to zero (I think it is > based on reading the common/ code), this is fine. Thanks! the default fill value is 0. it can be changed by memory-fill, but no sim does that. a user could change this with command line flags, but i guess you'd get what you pay for at that point :). -mike
> a user could change this with command line flags, but i guess you'd > get what you pay for at that point :). +1 on that :-)
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c index c3fa4a9..2a648f5 100644 --- a/sim/msp430/msp430-sim.c +++ b/sim/msp430/msp430-sim.c @@ -249,9 +249,14 @@ sim_create_inferior (SIM_DESC sd, int c; int new_pc; + /* Set the PC to the default reset vector if available. */ c = sim_core_read_buffer (sd, MSP430_CPU (sd), read_map, resetv, 0xfffe, 2); - new_pc = resetv[0] + 256 * resetv[1]; + + /* If the reset vector isn't initialized, then use the ELF entry. */ + if (abfd != NULL && !new_pc) + new_pc = bfd_get_start_address (abfd); + sim_pc_set (MSP430_CPU (sd), new_pc); msp430_pc_store (MSP430_CPU (sd), new_pc);