[RFA]: Watchpoints per thread patch

Jeff Johnston jjohnstn@redhat.com
Thu Oct 28 20:13:00 GMT 2004

Daniel Jacobowitz wrote:
> On Thu, Oct 28, 2004 at 03:47:22PM -0400, Jeff Johnston wrote:
>>Daniel Jacobowitz wrote:
>>>On Wed, Oct 27, 2004 at 07:17:13PM -0400, Jeff Johnston wrote:
>>>>Were you thinking of add_thread()?  If so, we would have to move the 
>>>>calls to add_thread so they never occur before an attach because the 
>>>>low-level observers will need the thread already attached.
>>>Oh, that's a good point.  Do you think that's a reasonable change to
>>It is a can of worms.  I can move the add_thread call in attach_thread 
>>easily enough, but there are other calls to add_thread strewn about.  For 
>>example, corelow.c calls add_thread as does infrun.c when it finds a new 
>>process.  I certainly don't see it being valid for either of these 
>>scenarios to insert/remove all watchpoints.  My personal preference would 
>>be to leave it where it is for now.
> There are two separate questions here:
>   - When do we need to be adding and removing watchpoints from threads
>     on GNU/Linux?
>   - When should an observer named "new_thread" be called?
> If it's not valid to do the former action at all the latter points,
> then it's not the right observer to be using.

It could easily be called new_linux_thread or new_lwp_thread.

> The code in infrun is never reached for native GNU/Linux threads, btw;
> I'm not sure which targets if any do reach it.  I don't believe remote
> GNU/Linux threads do either.

If you feel that add_thread will be safe in other scenarios, I am more than 
happy to do the change, but I will only be testing linux.

-- Jeff J.

More information about the Gdb-patches mailing list