diff options
author | Kevin Buettner <kevinb@redhat.com> | 2013-08-08 00:10:01 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2013-08-08 00:10:01 +0000 |
commit | 317cc67d7529f24f8e384036d2269ff5f3d331fd (patch) | |
tree | 23dee0e8b67ba0ab62fcbb817c521ef3a2b0f9a5 | |
parent | b04006e69c4597b5e337be42668c8f351abf600b (diff) | |
download | gdb-317cc67d7529f24f8e384036d2269ff5f3d331fd.zip gdb-317cc67d7529f24f8e384036d2269ff5f3d331fd.tar.gz gdb-317cc67d7529f24f8e384036d2269ff5f3d331fd.tar.bz2 |
* gdb-if.c (hw_breakpoints): Remove.
(sim_store_register): Add an assert() to make sure PC is in range.
Delete code which referenced hw_breakpoints[].
-rw-r--r-- | sim/rl78/ChangeLog | 6 | ||||
-rw-r--r-- | sim/rl78/gdb-if.c | 19 |
2 files changed, 15 insertions, 10 deletions
diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog index 598b8a7..65eec15 100644 --- a/sim/rl78/ChangeLog +++ b/sim/rl78/ChangeLog @@ -1,3 +1,9 @@ +2013-08-07 Kevin Buettner <kevinb@redhat.com> + + * gdb-if.c (hw_breakpoints): Remove. + (sim_store_register): Add an assert() to make sure PC is in range. + Delete code which referenced hw_breakpoints[]. + 2013-06-03 Mike Frysinger <vapier@gentoo.org> * aclocal.m4, configure: Regenerate. diff --git a/sim/rl78/gdb-if.c b/sim/rl78/gdb-if.c index 04d4f0e..6b46600 100644 --- a/sim/rl78/gdb-if.c +++ b/sim/rl78/gdb-if.c @@ -55,8 +55,6 @@ static struct sim_state the_minisim = { static int open; -static unsigned char hw_breakpoints[MEM_SIZE/8]; - static struct host_callback_struct *host_callbacks; /* Open an instance of the sim. For this sim, only one instance @@ -341,7 +339,15 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length) val = get_le (buf, length); if (regno == sim_rl78_pc_regnum) - pc = val; + { + pc = val; + + /* The rl78 program counter is 20 bits wide. Ensure that GDB + hasn't picked up any stray bits. This has occurred when performing + a GDB "return" command in which the return address is obtained + from a 32-bit container on the stack. */ + assert ((pc & ~0x0fffff) == 0); + } else memory[reg_addr (regno)] = val; return size; @@ -456,13 +462,6 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver) break; } - if (hw_breakpoints[pc >> 3] - && (hw_breakpoints[pc >> 3] & (1 << (pc & 0x7)))) - { - reason = sim_stopped; - siggnal = GDB_SIGNAL_TRAP; - break; - } rc = setjmp (decode_jmp_buf); if (rc == 0) rc = decode_opcode (); |