From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23256 invoked by alias); 27 Oct 2004 23:17:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23236 invoked from network); 27 Oct 2004 23:17:19 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 27 Oct 2004 23:17:19 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id i9RNHJW0020510 for ; Wed, 27 Oct 2004 19:17:19 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9RNHDr29388; Wed, 27 Oct 2004 19:17:14 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i9RNHDbU020644; Wed, 27 Oct 2004 19:17:13 -0400 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 5F1E880002E; Wed, 27 Oct 2004 19:17:13 -0400 (EDT) Message-ID: <41802C79.7040103@redhat.com> Date: Wed, 27 Oct 2004 23:17:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [RFA]: Watchpoints per thread patch References: <4175A9C9.8040300@redhat.com> <41769FF3.7010801@gnu.org> <20041020173035.GA26622@nevyn.them.org> <418022DE.204@redhat.com> <20041027224155.GA3485@nevyn.them.org> In-Reply-To: <20041027224155.GA3485@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00462.txt.bz2 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.