[PATCH] Use thread_info and inferior pointers more throughout

Ulrich Weigand uweigand@de.ibm.com
Wed Jun 27 11:34:00 GMT 2018


Pedro Alves wrote:

>  ps_err_e
>  ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
>  {
> -  ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
> -  struct regcache *regcache
> -    = get_thread_arch_regcache (ptid, target_gdbarch ());
> +  struct regcache *regcache = get_thread_regcache (ph->thread);

This change (and the related ones in the following routines
completely break Cell multi-arch debugging.  The point of using
get_thread_arch_regcache with target_gdbarch() instead of just
plain get_thread_regcache is that the proc-service routines
must always operated on the "main" (in this case PowerPC)
architecture, because that's the register set libthread_db
expects to be using.

The change above switches the behavior to use the SPU architecture
if GDB happens to interrupt SPU code.  This is wrong and causes
internal GDB errors pretty much instantly when starting an SPU ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list