From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27766 invoked by alias); 5 Dec 2007 14:40:44 -0000 Received: (qmail 27757 invoked by uid 22791); 5 Dec 2007 14:40:43 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Dec 2007 14:40:35 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 8789698349; Wed, 5 Dec 2007 14:40:33 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 5D6009833F; Wed, 5 Dec 2007 14:40:33 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1IzvQN-0005Gg-IN; Wed, 05 Dec 2007 09:40:31 -0500 Date: Wed, 05 Dec 2007 15:22:00 -0000 From: Daniel Jacobowitz To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: Target-specific thread switching backend Message-ID: <20071205144031.GA19944@caradoc.them.org> Mail-Followup-To: "Maciej W. Rozycki" , gdb-patches@sourceware.org, "Maciej W. Rozycki" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00083.txt.bz2 On Wed, Dec 05, 2007 at 02:13:18PM +0000, Maciej W. Rozycki wrote: > Hello, > > In preparation for submitting support for the MDI target I propose the > following enhancement to target_switch_to_thread(). The MDI implements a > multi-threaded target which remembers the currently selected thread within > itself. All the operations that have thread-local scope, such as > accessing of the CPU registers, use that thread identifier. Therefore I > think it is reasonable to propagate the thread-switch event down to the > target, which is what the following change implements. I don't see why this is necessary, or how it is safe. At every operation, the requested thread should be indicated by inferior_ptid (or a ptid_t argument in some cases). And switch_to_thread is usually but not always called when inferior_ptid is changed, e.g. regcache_raw_read. -- Daniel Jacobowitz CodeSourcery