- struct regcache *regcache = current_regcache;
- int pid;
-
- /* NOTE: cagney/2002-12-03: This code assumes that the currently
- selected light weight processes' registers can be written
- directly into the selected thread's register cache. This works
- fine when given an 1:1 LWP:thread model (such as found on
- GNU/Linux) but will, likely, have problems when used on an N:1
- (userland threads) or N:M (userland multiple LWP) model. In the
- case of the latter two, the LWP's registers do not necessarily
- belong to the selected thread (the LWP could be in the middle of
- executing the thread switch code).
-
- These functions should instead be paramaterized with an explicit
- object (struct regcache, struct thread_info?) into which the LWPs
- registers can be written. */
- pid = TIDGET (inferior_ptid);
- if (pid == 0)
- pid = PIDGET (inferior_ptid);