From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29433 invoked by alias); 14 Dec 2011 15:00:16 -0000 Received: (qmail 29410 invoked by uid 22791); 14 Dec 2011 15:00:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Dec 2011 14:59:57 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RaqJH-0000wy-BQ from pedro_alves@mentor.com ; Wed, 14 Dec 2011 06:59:55 -0800 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Dec 2011 14:59:53 +0000 From: Pedro Alves To: Andreas Schwab Subject: Re: [RFC/WIP PATCH 02/14] Mask software breakpoints from memory writes too Date: Wed, 14 Dec 2011 15:06:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-13-generic; KDE/4.7.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <20111128153742.17761.21459.stgit@localhost6.localdomain6> <201112141152.33791.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201112141459.49456.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00453.txt.bz2 On Wednesday 14 December 2011 12:53:04, Andreas Schwab wrote: > Pedro Alves writes: > > > Does this fix it? > > > > --- a/gdb/ppc-linux-tdep.c > > +++ b/gdb/ppc-linux-tdep.c > > @@ -218,7 +218,7 @@ ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, > > program modified the code on us, so it is wrong to put back the > > old value. */ > > if (val == 0 && memcmp (bp, old_contents, bplen) == 0) > > - val = target_write_memory (addr, bp_tgt->shadow_contents, bplen); > > + val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen); > > > > do_cleanups (cleanup); > > return val; > > Looks good, thanks. Thanks. I've applied the patch below to do the same adjustment to all memory_remove_breakpoint callbacks. Applied to both mainline and the 7.4 branch. -- Pedro Alves 2011-12-14 Pedro Alves * ia64-tdep.c (ia64_memory_remove_breakpoint): Use target_write_raw_memory. * m32r-tdep.c (m32r_memory_remove_breakpoint): Use target_write_raw_memory. * microblaze-linux-tdep.c (microblaze_linux_memory_remove_breakpoint): Use target_write_raw_memory. * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Use target_write_raw_memory. --- gdb/ia64-tdep.c | 2 +- gdb/m32r-tdep.c | 2 +- gdb/microblaze-linux-tdep.c | 2 +- gdb/ppc-linux-tdep.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 68e5021..d1940e6 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -811,7 +811,7 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch, /* In BUNDLE_MEM, be careful to modify only the bits belonging to SLOTNUM and not any of the other ones that are stored in SHADOW_CONTENTS. */ replace_slotN_contents (bundle_mem, instr_saved, slotnum); - val = target_write_memory (addr, bundle_mem, BUNDLE_LEN); + val = target_write_raw_memory (addr, bundle_mem, BUNDLE_LEN); do_cleanups (cleanup); return val; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 136fd7b..b417db0 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -163,7 +163,7 @@ m32r_memory_remove_breakpoint (struct gdbarch *gdbarch, } /* Write contents. */ - val = target_write_memory (addr & 0xfffffffc, buf, 4); + val = target_write_raw_memory (addr & 0xfffffffc, buf, 4); return val; } diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c index c14e01b..7b2662d 100644 --- a/gdb/microblaze-linux-tdep.c +++ b/gdb/microblaze-linux-tdep.c @@ -58,7 +58,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, program modified the code on us, so it is wrong to put back the old value. */ if (val == 0 && memcmp (bp, old_contents, bplen) == 0) - val = target_write_memory (addr, bp_tgt->shadow_contents, bplen); + val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen); return val; } diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index e623742..9968621 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -218,7 +218,7 @@ ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, program modified the code on us, so it is wrong to put back the old value. */ if (val == 0 && memcmp (bp, old_contents, bplen) == 0) - val = target_write_memory (addr, bp_tgt->shadow_contents, bplen); + val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen); do_cleanups (cleanup); return val;