From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20925 invoked by alias); 12 Apr 2006 18:38:00 -0000 Received: (qmail 20916 invoked by uid 22791); 12 Apr 2006 18:37:59 -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 18:37:57 +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 k3CIbNEI025946; Wed, 12 Apr 2006 20:37:23 +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 k3CIbM2d011398; Wed, 12 Apr 2006 20:37:22 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3CIbMwu004466; Wed, 12 Apr 2006 20:37:22 +0200 (CEST) Date: Wed, 12 Apr 2006 18:38:00 -0000 Message-Id: <200604121837.k3CIbMwu004466@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20060412125712.GA22145@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 12 Apr 2006 08:57: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> <200604120943.k3C9hYJ8012016@elgar.sibelius.xs4all.nl> <20060412125712.GA22145@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/msg00151.txt.bz2 > Date: Wed, 12 Apr 2006 08:57:13 -0400 > From: Daniel Jacobowitz > > On Wed, Apr 12, 2006 at 11:43:34AM +0200, Mark Kettenis wrote: > > 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. > > Do you have a suggestion, then? I need some guidance; I've tried > several versions of this patch and you haven't liked them. I'm sorry about that. > Would a new "struct bp_target_info", defined and allocated centrally > for convenience, allay this concern? [Conveniently I can do the bulk > of the changes for that with sed :-)] Why hide things away if all you're going to need is a buffer and a length? I've tried really hard to see why one would need more than that, but failed completely. So I think we should have: int target_insert_breakpoint(CORE_ADDR addr, gdb_byte *buf, int *size); int target_remove_breakpoint(CORE_ADDR addr, gdb_byte *buf, int size); > I'd prefer to define and allocate it centrally, rather than completely > per-target, since the requirements of targets seem to be so similar. Indeed. Mark