From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23009 invoked by alias); 2 Mar 2006 23:02:32 -0000 Received: (qmail 23001 invoked by uid 22791); 2 Mar 2006 23:02:31 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Mar 2006 23:02:27 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k22N1qKi032049; Fri, 3 Mar 2006 00:01:52 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id k22N1qTl021973; Fri, 3 Mar 2006 00:01:52 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id k22N1qEt008208; Fri, 3 Mar 2006 00:01:52 +0100 (CET) Date: Thu, 02 Mar 2006 23:13:00 -0000 Message-Id: <200603022301.k22N1qEt008208@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20060302221711.GB18830@nevyn.them.org> (message from Daniel Jacobowitz on Thu, 2 Mar 2006 17:17:11 -0500) Subject: Re: Save the length of inserted breakpoints References: <20060302221711.GB18830@nevyn.them.org> 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/msg00062.txt.bz2 > Date: Thu, 2 Mar 2006 17:17:11 -0500 > From: Daniel Jacobowitz > > This nasty, mechanical patch adds "len" arguments to > target_remove_breakpoint and target_remove_hw_breakpoint. The goal is > to allow BREAKPOINT_FROM_PC to include heuristics, which may possibly > change between when a breakpoint is inserted and when it is removed; > in order to stay in sync, we need to always remove breakpoints in the > same way that we inserted them. > > There's not much more to say about this patch. It's big, obvious, and > pretty ugly. Any comments on this? Does it look OK? Yuck! It really is ugly. For one thing, I think it is a bit pointless, to add a the BREAKPOINT_FROM_PC() to targets where we know the length of a breakpoint instruction is fixed. Another thing is that I think the order of the arguments of target_remove_breakpoint() is wrong. I think it makes sense to see your "len" argument as the length of the saved memory. Then it is more logical to make "len" the last argument of target_remove_breakpoint(). However, doesn't it make more sense to have target_insert_breakpoint() save the length instead of using BREAKPOINT_FROM_PC() to ask for it? Mark