summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-09-08 17:52:26 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-09-08 17:52:26 +0000
commit09149728d05373e9dbeca071e99afc486d90d462 (patch)
tree42ecc5582ad6c54e0f3162cc7e0e12ab3cadbe76
parent86e503f0830a331b9b2e18fe295e51341503f73d (diff)
downloadgdb-09149728d05373e9dbeca071e99afc486d90d462.tar.gz
gdb/
* ia64-tdep.c (ia64_memory_insert_breakpoint) (ia64_memory_remove_breakpoint): Return immediately if any of memory reads fail. Do not combine the VAL values.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ia64-tdep.c25
2 files changed, 25 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d84702d5e74..d4cdc95ad54 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2009-09-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * ia64-tdep.c (ia64_memory_insert_breakpoint)
+ (ia64_memory_remove_breakpoint): Return immediately if any of memory
+ reads fail. Do not combine the VAL values.
+
+2009-09-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
Fix ia64 shadowing of breakpoints in multiple slots of a single bundle.
* ia64-tdep.c (ia64_memory_insert_breakpoint): New call
of make_show_memory_breakpoints_cleanup with parameter 0. Move the
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 29601bde2d5..d68c04483c8 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -629,6 +629,11 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
breakpoint instruction bits region. */
cleanup = make_show_memory_breakpoints_cleanup (0);
val = target_read_memory (addr, bundle, BUNDLE_LEN);
+ if (val != 0)
+ {
+ do_cleanups (cleanup);
+ return val;
+ }
/* Slot number 2 may skip at most 2 bytes at the beginning. */
bp_tgt->shadow_len = BUNDLE_LEN - 2;
@@ -645,7 +650,12 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
adjacent placed breakpoints. It is due to our SHADOW_CONTENTS overlapping
the real breakpoint instruction bits region. */
make_show_memory_breakpoints_cleanup (1);
- val |= target_read_memory (addr, bundle, BUNDLE_LEN);
+ val = target_read_memory (addr, bundle, BUNDLE_LEN);
+ if (val != 0)
+ {
+ do_cleanups (cleanup);
+ return val;
+ }
/* Check for L type instruction in slot 1, if present then bump up the slot
number to the slot 2. */
@@ -666,9 +676,8 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
bp_tgt->placed_size = bp_tgt->shadow_len;
- if (val == 0)
- val = target_write_memory (addr + slotnum, bundle + slotnum,
- bp_tgt->shadow_len);
+ val = target_write_memory (addr + slotnum, bundle + slotnum,
+ bp_tgt->shadow_len);
do_cleanups (cleanup);
return val;
@@ -695,6 +704,11 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
breakpoint instruction bits region. */
cleanup = make_show_memory_breakpoints_cleanup (1);
val = target_read_memory (addr, bundle_mem, BUNDLE_LEN);
+ if (val != 0)
+ {
+ do_cleanups (cleanup);
+ return val;
+ }
/* Check for L type instruction in slot 1, if present then bump up the slot
number to the slot 2. */
@@ -723,8 +737,7 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch,
/* In BUNDLE_MEM be careful to modify only the bits belonging to SLOTNUM and
never any other possibly also stored in SHADOW_CONTENTS. */
replace_slotN_contents (bundle_mem, instr_saved, slotnum);
- if (val == 0)
- val = target_write_memory (addr, bundle_mem, BUNDLE_LEN);
+ val = target_write_memory (addr, bundle_mem, BUNDLE_LEN);
do_cleanups (cleanup);
return val;