From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23243 invoked by alias); 23 Aug 2002 12:44:10 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23236 invoked from network); 23 Aug 2002 12:44:09 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 23 Aug 2002 12:44:09 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17iDnQ-0001Kq-00; Fri, 23 Aug 2002 07:44:12 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17iDo5-0003Fn-00; Fri, 23 Aug 2002 08:44:53 -0400 Date: Fri, 23 Aug 2002 05:44:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: RFC: Two small remote protocol extensions Message-ID: <20020823124453.GA12257@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb@sources.redhat.com References: <20020502022543.GA22594@nevyn.them.org> <20020816143040.GA22041@nevyn.them.org> <3D5D0F62.4010207@ges.redhat.com> <20020816145306.GA24002@nevyn.them.org> <3D65B53D.8050603@ges.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D65B53D.8050603@ges.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg00283.txt.bz2 On Fri, Aug 23, 2002 at 12:08:29AM -0400, Andrew Cagney wrote: > > >This one, however, needs feedback. A user just reported a bogus > >>>SIGTRAP bug to me which is fixed by the above. > >>> > >>>To elaborate on the problem: right now we have two ways of specifying a > >>>thread to the remote agent. Hg specifies the "general" thread, and Hc > >>>specifies the "continue" thread. These correspond to inferior_ptid and > >>>resume_ptid, roughly. > >>> > >>>When we single-step, if we are not using some form of > >>>scheduler-locking, resume_ptid is 0. We don't tell the agent at that > >>>point what inferior_ptid is; it has to step _some_ thread, and it picks > >>>one, and if it doesn't pick the one GDB expected we get problems. > > I think it is passed down when schedule locking and when doing a thread hop. ? I don't believe so, but I'm not sure what you mean exactly. > I'm wondering how native thread implementations handle your case? I > don't see how remote_resume(), or any of the other resume functions can > know which thread to step since the only parameter available to them is > resume-ptid and you're indicating that that is NULL. Inferior_ptid is set in this case. That's the whole problem; they have access to it, but the remote implementation doesn't. The code from lin-lwp: /* Apparently the interpretation of PID is dependent on STEP: If STEP is non-zero, a specific PID means `step only this process id'. But if STEP is zero, then PID means `continue *all* processes, but give the signal only to this one'. */ resume_all = (PIDGET (ptid) == -1) || !step; if (resume_all) iterate_over_lwps (resume_set_callback, NULL); else iterate_over_lwps (resume_clear_callback, NULL); /* If PID is -1, it's the current inferior that should be handled specially. */ if (PIDGET (ptid) == -1) ptid = inferior_ptid; (I'm not quite sure about that comment; that might want to be revisited later... there should be a way to continue just one process. I thought I remembered that working, but I must have been mistaken.) -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer