From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8927 invoked by alias); 3 Mar 2006 17:54:11 -0000 Received: (qmail 8910 invoked by uid 22791); 3 Mar 2006 17:54:10 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 03 Mar 2006 17:54:09 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FFETf-0003ly-9r; Fri, 03 Mar 2006 12:54:07 -0500 Date: Fri, 03 Mar 2006 18:04:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: Save the length of inserted breakpoints Message-ID: <20060303175407.GA14450@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org References: <20060302221711.GB18830@nevyn.them.org> <200603022301.k22N1qEt008208@elgar.sibelius.xs4all.nl> <20060303141123.GA8069@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00080.txt.bz2 On Fri, Mar 03, 2006 at 07:41:37PM +0200, Eli Zaretskii wrote: > > Date: Fri, 3 Mar 2006 09:11:24 -0500 > > From: Daniel Jacobowitz > > Cc: Mark Kettenis , gdb-patches@sourceware.org > > > > That patch allows us to guess whether completely unknown code is ARM or > > Thumb. If we are guessing based on target state and user settings, > > rather than from the symbol table as we do now, it's possible for > > the guess to change between when a breakpoint is inserted and when > > it is removed. If that happens, we can try to remove a four byte > > breakpoint as if it were a two byte breakpoint, which will lead > > to memory corruption. > > Can't this be done ion the target-dependent code? Why do we need to > know, on the GDB application level, how many bytes did the breakpoint > instruction take? Because the target vector is told to remove breakpoints given only an address and an opaque shadow-contents buffer big enough to hold what may have been overwritten in memory. The change of breakpoint size happens in architecture-specific code, but the insertion and removal happens in target-specific code. If every target cached the size of inserted breakpoints and made sure to remove them at the same size, that would work too, but right now most targets don't need to remember anything about the breakpoints they've inserted; the common layer of GDB handles it. -- Daniel Jacobowitz CodeSourcery