From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20966 invoked by alias); 5 Dec 2007 15:22:48 -0000 Received: (qmail 20958 invoked by uid 22791); 5 Dec 2007 15:22:47 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Dec 2007 15:22:43 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1Izw59-0003iI-00; Wed, 05 Dec 2007 15:22:39 +0000 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1Izw54-0000N0-00; Wed, 05 Dec 2007 15:22:34 +0000 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1Izw54-0005ip-1s; Wed, 05 Dec 2007 15:22:34 +0000 Date: Wed, 05 Dec 2007 16:07:00 -0000 From: "Maciej W. Rozycki" To: Daniel Jacobowitz cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: Target-specific thread switching backend In-Reply-To: <20071205144031.GA19944@caradoc.them.org> Message-ID: References: <20071205144031.GA19944@caradoc.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com 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/msg00084.txt.bz2 On Wed, 5 Dec 2007, Daniel Jacobowitz wrote: > 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. Well, I found it cleaner for the hardware to follow what GDB thinks that the current thread is, but I suppose I can make the switch be done in the calls that access registers and hardware breakpoints as appropriate only and cache the last seen value of inferior_ptid within the target code to make it reasonably fast. It sounds worrying though, that the notion of the current thread within GDB is changed freely somewhere when there is a dedicated call to switch threads, hmm... Maciej