diff options
author | Pedro Alves <palves@redhat.com> | 2011-10-31 12:55:26 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-10-31 12:55:26 +0000 |
commit | b9fd179153353a88a34dd97a03ee698376212d29 (patch) | |
tree | 8bc287b65968fbb6ab935b498ed00a0db9363cec /gdb/gdbserver/mem-break.c | |
parent | bb593acb76bc52b23ddbad3f9b5199be26879da5 (diff) | |
download | gdb-b9fd179153353a88a34dd97a03ee698376212d29.zip gdb-b9fd179153353a88a34dd97a03ee698376212d29.tar.gz gdb-b9fd179153353a88a34dd97a03ee698376212d29.tar.bz2 |
2011-10-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
* mem-break.c (check_mem_write): Add `myaddr' parameter. Don't
clobber the breakpoints' shadows with fast tracepoint jumps.
* mem-break.h (check_mem_write): Add `myaddr' parameter.
* target.c (write_inferior_memory): Also pass MYADDR down to
check_mem_write.
gdb/testsuite/
* gdb.trace/trace-break.c: New.
* gdb.trace/trace-break.exp: New.
Diffstat (limited to 'gdb/gdbserver/mem-break.c')
-rw-r--r-- | gdb/gdbserver/mem-break.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c index eea8c71..348f59d 100644 --- a/gdb/gdbserver/mem-break.c +++ b/gdb/gdbserver/mem-break.c @@ -1029,7 +1029,8 @@ check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) } void -check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) +check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, + const unsigned char *myaddr, int mem_len) { struct process_info *proc = current_process (); struct raw_breakpoint *bp = proc->raw_breakpoints; @@ -1063,7 +1064,7 @@ check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) buf_offset = start - mem_addr; memcpy (fast_tracepoint_jump_shadow (jp) + copy_offset, - buf + buf_offset, copy_len); + myaddr + buf_offset, copy_len); if (jp->inserted) memcpy (buf + buf_offset, fast_tracepoint_jump_insn (jp) + copy_offset, copy_len); @@ -1092,7 +1093,7 @@ check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) copy_offset = start - bp->pc; buf_offset = start - mem_addr; - memcpy (bp->old_data + copy_offset, buf + buf_offset, copy_len); + memcpy (bp->old_data + copy_offset, myaddr + buf_offset, copy_len); if (bp->inserted) { if (validate_inserted_breakpoint (bp)) |