Fix Cell debugging regression
Commit
00431a78b28f ("Use thread_info and inferior pointers more
throughout") broke Cell multi-arch debugging, because it made the
proc-service routines (ps_lgetregs etc.) access registers using the
SPU architecture if GDB happens to interrupt SPU code. The
proc-service routines must always operate on the "main" (in this case
PowerPC) architecture, because that's the register set libthread_db
expects to be using.
Restore the previous behavior, but wrapped in a new
get_ps_regcache function with a describing comment.
Also, the ps_l*regs routines have an explicit lwpid parameter that
said commit missed; with the commit mentioned above, we started always
reading the registers off of the current thread, which is incorrect.
That is fixed by this commit too.
gdb/ChangeLog:
2018-06-27 Pedro Alves <palves@redhat.com>
* proc-service.c (get_ps_regcache): New.
(ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
(ps_lsetfpregs): Use it.