32-bit Thumb-2 breakpoints

Daniel Jacobowitz dan at debian.org
Wed Feb 3 08:48:22 EST 2010


On Wed, Feb 03, 2010 at 01:28:24PM +0000, Russell King - ARM Linux wrote:
> Software breakpoints are a pain in the backside if you have threaded
> programs, because when you insert a breakpoint into one thread, it's
> active in all threads - you can't insert a breakpoint into only one
> thread.
> 
> If we have the ability to set hardware breakpoints, I'd like to see
> that used in preference to software breakpoints, and only resort to
> software breakpoints if there's no other alternative.

GDB has quite good support for this platform-independent problem,
not to mention that it's sometimes a feature.  I don't think it's a
problem.  The latest addition is displaced stepping support,
available for ARM, which is used to bypass software breakpoints
hit by an uninteresting thread without having to stop the rest
of the program.

There's a lot of reasons to avoid using hardware breakpoints; for
instance, software breakpoints are faster when installing the
breakpoint in every thread, and there's usually contention
with watchpoint resources where the hardware-ness makes a
bigger impact.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the linux-arm-kernel mailing list