This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Target-specific thread switching backend


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]