From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [ia64] Fixup breakpoints errors handling
Date: Tue, 08 Sep 2009 18:03:00 -0000 [thread overview]
Message-ID: <20090908180231.GC3223@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20090907183259.GH30677@adacore.com>
On Mon, 07 Sep 2009 20:32:59 +0200, Joel Brobecker wrote:
> > gdb/
> > 2009-09-05 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.
>
> The patch is OK.
Checked-in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2009-09/msg00033.html
--- src/gdb/ChangeLog 2009/09/08 17:39:19 1.10849
+++ src/gdb/ChangeLog 2009/09/08 17:52:26 1.10850
@@ -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
--- src/gdb/ia64-tdep.c 2009/09/08 17:39:21 1.197
+++ src/gdb/ia64-tdep.c 2009/09/08 17:52:27 1.198
@@ -629,6 +629,11 @@
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 @@
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 @@
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 @@
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 @@
/* 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;
prev parent reply other threads:[~2009-09-08 18:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 19:01 Jan Kratochvil
2009-09-07 18:33 ` Joel Brobecker
2009-09-08 17:10 ` Jan Kratochvil
2009-09-08 18:03 ` Jan Kratochvil [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090908180231.GC3223@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox