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 Fri, Mar 03, 2006 at 11:09:39AM +0200, Eli Zaretskii wrote:
> Was the reason for this discussed at some point?  What I miss from
> Daniel's patch is some kind of explanation as to the reason(s) for it.
> I have my guesses, but I don't think I should do guesswork here.
> Perhaps I missed the explanation in the patch, but I did look at the
> comments and the gdbint.texinfo text, and didn't find anything that
> explains why we need this.

Sorry, I should have linked to the explanation.  It's here:
  http://sourceware.org/ml/gdb-patches/2006-02/msg00386.html

That patch allows us to guess whether completely unknown code is ARM or
Thumb.  If we are guessing based on target state and user settings,
rather than from the symbol table as we do now, it's possible for
the guess to change between when a breakpoint is inserted and when
it is removed.  If that happens, we can try to remove a four byte
breakpoint as if it were a two byte breakpoint, which will lead
to memory corruption.

I tried always caching and restoring four bytes, but that doesn't
work with e.g. remote targets - we send a Z0,4 packet, and then
a z0,2 packet to remove it, which will no doubt confuse some
remote stubs.

-- 
Daniel Jacobowitz
CodeSourcery


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