From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9911 invoked by alias); 12 Apr 2006 09:44:13 -0000 Received: (qmail 9900 invoked by uid 22791); 12 Apr 2006 09:44:12 -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; Wed, 12 Apr 2006 09:44:10 +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 k3C9hZTm005979; Wed, 12 Apr 2006 11:43:35 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3C9hYij005715; Wed, 12 Apr 2006 11:43:34 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3C9hYJ8012016; Wed, 12 Apr 2006 11:43:34 +0200 (CEST) Date: Wed, 12 Apr 2006 09:44:00 -0000 Message-Id: <200604120943.k3C9hYJ8012016@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20060411214613.GA702@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 11 Apr 2006 17:46:13 -0400) Subject: Re: Save the length of inserted breakpoints References: <20060302221711.GB18830@nevyn.them.org> <200603022301.k22N1qEt008208@elgar.sibelius.xs4all.nl> <20060411214613.GA702@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-04/txt/msg00147.txt.bz2 > Date: Tue, 11 Apr 2006 17:46:13 -0400 > From: Daniel Jacobowitz > > On Fri, Mar 03, 2006 at 12:01:52AM +0100, Mark Kettenis wrote: > > 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? > > All true. Do you like this version better? I think it's much > more elegant. target_insert_breakpoint et al. now take the > struct bp_location, instead of just the shadow contents cache. > They can fill in whatever they choose. I'm very sorry Daniel, but I think this is a bad idea. Passing down struct bp_location makes the interface between the low-level tdep code and the high-level breakpoint code much less clear. The low-level code really should not know about the details of the breakpoint implementation because people will be tempted to abuse it. And changing the breakpoint interface will become a pain because suddenly we will need to change all targets as well. Mark