This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Target-specific thread switching backend
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