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


On Sat, Mar 04, 2006 at 12:01:00AM +0200, Eli Zaretskii wrote:
> > I find this a little bit strange, since every target will have to do
> > just about the same thing.
> 
> We could have a generic method that most of them could use.  Those
> that have peculiarities, such as those which started this thread, will
> have to provide their own methods.

For the record, it is not a target with peculiarities.  It's an
architecture with a feature (that on the order of four other
GDB-supported architectures have).

There's a division in GDB between the target, which is a method of
communication et cetera ("how"), and the architecture, which describes
"what" is being debugged.  It's a quirk of the architecture (all of the
architectures, although none of the others do this sort of heuristic
today) that there are multiple sizes of breakpoints and we can't
statically determine which one we need.  It's a requirement of most
targets that we know how big a breakpoint is when inserting or removing
it.

The architecture says "the breakpoint at 0x8000 should be 2 bytes
long".  The target sets the breakpoint.  The target goes to remove the
breakpoint, and needs to know how long it was when it was set.

If it were contained within either a target or an architecture, the
solution would obviously be much smaller.

-- 
Daniel Jacobowitz
CodeSourcery


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