From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15976 invoked by alias); 14 Dec 2011 11:52:58 -0000 Received: (qmail 15966 invoked by uid 22791); 14 Dec 2011 11:52:57 -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 11:52:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RanO3-0006IG-Uc from pedro_alves@mentor.com ; Wed, 14 Dec 2011 03:52:40 -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 11:52:38 +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 12:53: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> <201112132132.41317.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201112141152.33791.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/msg00445.txt.bz2 On Wednesday 14 December 2011 00:18:01, Andreas Schwab wrote: > Pedro Alves writes: > > > On Tuesday 13 December 2011 21:24:24, Andreas Schwab wrote: > >> Pedro Alves writes: > >> > >> > 2011-12-06 Pedro Alves > >> > > >> > gdb/ > >> > * breakpoint.c (breakpoint_restore_shadows): Rename to ... > >> > (breakpoint_xfer_memory): ... this. Change prototype. Handle > >> > memory writes too. > >> > * breakpoint.h (breakpoint_restore_shadows): Delete. > >> > (breakpoint_xfer_memory): Declare. > >> > * mem-break.c (default_memory_insert_breakpoint) > >> > (default_memory_remove_breakpoint): Use target_write_raw_memory. > >> > (memory_xfer_partial): Rename to ... > >> > (memory_xfer_partial_1): ... this. Don't mask out breakpoints > >> > here. > >> > (memory_xfer_partial): New. > >> > (target_write_raw_memory): New. > >> > * target.h (target_write_raw_memory): New. > >> > >> That completely breaks gdb on powerpc. Breakpoints cause gdb to infloop. > > > > Got a backtrace showing the loop? It'd be really helpful. > > This is repeated endlessly with stop_pc never advancing: So ppc doesn't use mem-break.c:default_memory_remove_breakpoint. 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; -- Pedro Alves