This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Save the length of inserted breakpoints


> Date: Wed, 12 Apr 2006 08:57:13 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]