[PATCH, ppc] Fix hw *points for embedded ppc in a threaded environment.

Luis Gustavo luis_gustavo@mentor.com
Mon Aug 6 14:33:00 GMT 2012


Hi,

GDB has always assumed that hardware watchpoints and breakpoints should 
be replicated for every new thread in ppc. This worked fine for the old 
DABR-based mechanism since both server and embedded ppc's supported only 
a single hw watchpoint or breakpoint.

With the somewhat recent booke kernel interface, more hw 
watchpoints/breakpoints are available to GDB.

The logic of replicating the existing process' debug state to the new 
thread is still there though, but the new booke interface in the kernel 
already replicates that state. More precisely, the kernel gives the new 
thread the debug state of its parent thread.

When GDB tries to replicate the debug state, it will actually cause the 
kernel to allocate a new hw *point entry, leading to inadequate 
consumption of hw debug resources.

It's still unclear if the kernel is supposed to do this and i'm chasing 
answers with the ppc linux kernel folks 
(https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-August/100083.html). 
Nonetheless, the kernel is out and it has such behavior.

This patch tries to address this problem by clearing any debug state 
prior to replicating *points to the new thread. If the kernel is doing 
something it's not supposed to, then this is a workaround for the broken 
kernels.

This would be nice to include before 7.5, as it's an annoying problem.

OK?

Regards,
Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix_ppc_hw_watch.diff
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120806/044c2ce8/attachment.bin>


More information about the Gdb-patches mailing list