From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17419 invoked by alias); 3 Mar 2006 14:11:32 -0000 Received: (qmail 17411 invoked by uid 22791); 3 Mar 2006 14:11:32 -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 14:11:29 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FFB08-00028O-JY; Fri, 03 Mar 2006 09:11:24 -0500 Date: Fri, 03 Mar 2006 15:03:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: Save the length of inserted breakpoints Message-ID: <20060303141123.GA8069@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , Mark Kettenis , gdb-patches@sourceware.org References: <20060302221711.GB18830@nevyn.them.org> <200603022301.k22N1qEt008208@elgar.sibelius.xs4all.nl> 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/msg00074.txt.bz2 On Fri, Mar 03, 2006 at 11:09:39AM +0200, Eli Zaretskii wrote: > Was the reason for this discussed at some point? What I miss from > Daniel's patch is some kind of explanation as to the reason(s) for it. > I have my guesses, but I don't think I should do guesswork here. > Perhaps I missed the explanation in the patch, but I did look at the > comments and the gdbint.texinfo text, and didn't find anything that > explains why we need this. Sorry, I should have linked to the explanation. It's here: http://sourceware.org/ml/gdb-patches/2006-02/msg00386.html 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. I tried always caching and restoring four bytes, but that doesn't work with e.g. remote targets - we send a Z0,4 packet, and then a z0,2 packet to remove it, which will no doubt confuse some remote stubs. -- Daniel Jacobowitz CodeSourcery