[RFA]: Watchpoints per thread patch

Jeff Johnston jjohnstn@redhat.com
Wed Oct 27 23:17:00 GMT 2004


Daniel Jacobowitz wrote:
> On Wed, Oct 27, 2004 at 06:36:14PM -0400, Jeff Johnston wrote:
> 
>>+      /* For every active watchpoint, we need to insert the watchpoint on 
>>+         the new thread.  */
>>+      if ((b->loc_type == bp_loc_hardware_watchpoint
>>+	   || b->owner->type == bp_watchpoint))
> 
> 
> Do you need bp_watchpoint here?  That's going to be a software
> watchpoint.
>

No, it should only be hardware watchpoints.  I will remove this.

> 
>>@@ -757,11 +759,16 @@ attach_thread (ptid_t ptid, const td_thr
>>   if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
>>     return;			/* A zombie thread -- do not attach.  */
>> 
>>+  new_ptid = BUILD_LWP (ti_p->ti_lid, GET_PID (ptid));
>>+
>>   /* Under GNU/Linux, we have to attach to each and every thread.  */
>> #ifdef ATTACH_LWP
>>-  ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0);
>>+  ATTACH_LWP (new_ptid, 0);
>> #endif
>> 
>>+  /* Inform any observers of new attached thread.  */
>>+  observer_notify_new_thread (new_ptid);
>>+
>>   /* Enable thread event reporting for this thread.  */
>>   err = td_thr_event_enable_p (th_p, 1);
>>   if (err != TD_OK)
> 
> 
> Is there somewhere in the core threading code we could do this, rather
> than in a GNU/Linux target file?
> 

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.

-- Jeff J.



More information about the Gdb-patches mailing list