This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use thread_info and inferior pointers more throughout
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: palves at redhat dot com (Pedro Alves)
- Cc: tom at tromey dot com (Tom Tromey), gdb-patches at sourceware dot org
- Date: Wed, 27 Jun 2018 13:33:46 +0200 (CEST)
- Subject: Re: [PATCH] Use thread_info and inferior pointers more throughout
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