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

Sergio Durigan Junior
2013-04-17T17:05:03Z

Hey!

Thank for the patch. One thing I noticed:

On Wednesday, April 17 2013, Luis Machado wrote:

> Index: gdb-head/gdb/ppc-linux-nat.c
> ===================================================================
> --- gdb-head.orig/gdb/ppc-linux-nat.c 2013-04-17 10:24:52.919499117 +0200
> +++ gdb-head/gdb/ppc-linux-nat.c 2013-04-17 11:12:20.731448515 +0200
> @@ -2179,6 +2179,21 @@ ppc_linux_new_thread (struct lwp_info *l
> for (i = 0; i < max_slots_number; i++)
> if (hw_breaks[i].hw_break)
> booke_insert_point (hw_breaks[i].hw_break, tid);

Didn't you forget to delete the previous line? :-)

> + {
> + /* The ppc Linux kernel causes a thread to inherit its parent
> + thread's debug state, and that includes any hardware
> + watchpoints or breakpoints that the parent thread may have set.
> +
> + For this reason, the debug state of the new thread is cleared
> + before trying to replicate any hardware watchpoints or
> + breakpoints contained in other threads. */
> +
> + /* The ppc debug resource accounting is done through "slots".
> + Ask the kernel the deallocate this specific *point's slot. */
> + ptrace (PPC_PTRACE_DELHWDEBUG, tid, 0, hw_breaks[i].slot);
> +
> + booke_insert_point (hw_breaks[i].hw_break, tid);
> + }

--
Sergio