From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11808 invoked by alias); 2 Apr 2008 08:53:40 -0000 Received: (qmail 11799 invoked by uid 22791); 2 Apr 2008 08:53:38 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Apr 2008 08:53:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m328r9r3006739; Wed, 2 Apr 2008 04:53:09 -0400 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m328r9rv011166; Wed, 2 Apr 2008 04:53:09 -0400 Received: from localhost.localdomain (vpn-14-26.rdu.redhat.com [10.11.14.26]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m328r7hK008098; Wed, 2 Apr 2008 04:53:08 -0400 Message-ID: <47F34972.8080403@redhat.com> Date: Wed, 02 Apr 2008 08:53:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Mark Wielaard CC: frysk@sourceware.org Subject: Re: [SCM] master: Implement hasWatchpointTriggered in abstract, and sub-classes. References: <20080401204912.27374.qmail@sourceware.org> <47F2A1E1.1070404@redhat.com> <1207122509.4953.27.camel@cc1341701-a.deven1.ov.home.nl> In-Reply-To: <1207122509.4953.27.camel@cc1341701-a.deven1.ov.home.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00006.txt.bz2 Mark Wielaard wrote: > debugStatus & (1L << index)) != 0; > > where debug status is the debug status register, and index is the > watchpoint to check. > > > I think this is a little too architecture specific and a little error > prone in usage. Code using this now has to iterate over all the possible > watchpoint indexes for a particular architecture. Maybe this is small > and trivial on all architectures, but it would feel more natural imho if > there was just a method to query which watchpoint index was triggered if > any. Something like: > > public abstract int watchpointTriggered(Task task); > Originally I did have something like this, but it does not answer the scenario of what happens when a sigtrap is delivered that denotes multiple watchpoints being triggered? There's no real clean way to do this per architecture. Could return an array of .. perhaps booleans denoting each register as being triggered, or maybe a list of .. same again, what? As there already is a general function implemented: int getWatchpointCount() the user can iterate over the watchpoints themselves in a simple loop. If you can make watchpointTriggered work so it accounts for multiple watchpoints hit, I'll be happy ;) Regards Phil >> Should the bit be reset in hasWatchpointTriggered? >> Or in a separate function function called as a separate API? >> > > A separate method is cleaner. The problem I had with that (in the > stepping flag) is that it then becomes somewhat harder to know when to > clear the status flags. Since the state machine is guaranteed to check > the status before any state transitions it is somewhat easier to make it > a check-and-clear-status method: > http://sourceware.org/ml/frysk/2007-q1/msg00024.html > If you have a separate method you can either call it directly after > checking the status, or in the Running.sendContinue() method. I > introduced this to have one point in the ptrace state machine where a > Task is set running again: > http://sourceware.org/ml/frysk/2007-q2/msg00329.html > We also already discussed basing the stepping flag on this new > infrastructure: http://sourceware.org/ml/frysk/2007-q3/msg00324.html > (And I agreed it would be somewhat cleaner than what is done now.) > > Ok I'll look at what goes on here. The second half of the question is, how and by what mechanism do you allow the user to continue a task. By default the task is stopped and will stay stopped until such a time that the user is done inspecting the environment. How will the user restart the task? Thanks! Regards Phil > Cheers, > > Mark > >