This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Target-specific thread switching backend
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: gdb-patches at sourceware dot org, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Wed, 5 Dec 2007 09:40:31 -0500
- Subject: Re: Target-specific thread switching backend
- References: <Pine.LNX.4.61.0712051240360.26738@perivale.mips.com>
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