From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5649 invoked by alias); 29 Feb 2004 16:48:58 -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 5642 invoked from network); 29 Feb 2004 16:48:57 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 29 Feb 2004 16:48:57 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AxU7d-00049h-7Z for ; Sun, 29 Feb 2004 11:48:57 -0500 Date: Sun, 29 Feb 2004 16:48:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [patch/gdbserver] Avoid a nasty little problem in the remote protocol T packet Message-ID: <20040229164857.GD15749@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20040228182203.GA16995@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040228182203.GA16995@nevyn.them.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00891.txt.bz2 On Sat, Feb 28, 2004 at 01:22:03PM -0500, Daniel Jacobowitz wrote: > The documentation for the T packet is not especially clear on when thread: > may be omitted. Gdbserver has been assuming that if the thread was omitted, > then the same thread used for the previous T packet will be used again. > This is, unfortunately, wrong; if no thread is supplied by number, > remote_wait returns inferior_ptid. It's not practical to track everything > that GDB might do which changes inferior_ptid, since not all of them are > communicated to the remote target; so the only thing we can do is always > report the thread. > > Without this, gdb could misinterpret which thread has stopped. It then > may omit sending an Hg packet, request registers, and get the registers for > a different thread than it wants. This results in info thread changing > the stack pointer. schedlock.exp catches this - it's the "step without lock > changes thread" test. > > Will commit in a bit. > 2004-02-28 Daniel Jacobowitz > > * remote-utils.c (prepare_resume_reply): Always supply "thread:". I've committed this to HEAD. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer