public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: palves@redhat.com (Pedro Alves)
Cc: tom@tromey.com (Tom Tromey), gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix Cell debugging regression (Re: [PATCH] Use thread_info and inferior pointers more throughout)
Date: Wed, 27 Jun 2018 13:12:00 -0000	[thread overview]
Message-ID: <20180627131239.5F0D5D801C0@oc3748833570.ibm.com> (raw)
In-Reply-To: <e823724c-9f29-d2f8-af84-7a8e08a75649@redhat.com> from "Pedro Alves" at Jun 27, 2018 01:43:42 PM

Pedro Alves wrote:

> > 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 ...
> Sorry, missed that.  Some comments here would be helpful.

Agreed.  :-)
 
> gdb/ChangeLog:
> 2018-06-27  Pedro Alves  <palves@redhat.com>
> 
> 	* proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
> 	(ps_lsetfpregs): Use get_thread_main_regcache.
> 	* regcache.c (get_thread_main_regcache): Define.
> 	* regcache.h (get_thread_main_regcache): Declare.

This looks good to me as far as the architecture is concerned.

In the meantime I also noticed another potential issue (which is
not related to multi-arch at all):

>  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 also assumes that ph->thread is the same thread
as the one indicated by lwpid.  Looking at the callers of the
various libthread_db routines that might result in a callback
to the ps_...regs routines, it is not immediately obvious to
me that this is actually true.  Are you sure this can never
be called to look up registers of another thread?

Bye,
Ulrich

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

  reply	other threads:[~2018-06-27 13:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 18:07 [PATCH] Use thread_info and inferior pointers more throughout Pedro Alves
2018-06-07 18:28 ` Tom Tromey
2018-06-21 15:57   ` Pedro Alves
2018-06-21 16:21     ` Pedro Alves
2018-06-25 10:18       ` Ulrich Weigand
2018-06-25 10:23         ` Pedro Alves
2018-06-27 11:34       ` Ulrich Weigand
2018-06-27 12:43         ` [PATCH] Fix Cell debugging regression (Re: [PATCH] Use thread_info and inferior pointers more throughout) Pedro Alves
2018-06-27 13:12           ` Ulrich Weigand [this message]
2018-06-27 13:17             ` Pedro Alves
2018-06-27 15:30               ` [PATCH v2] " Pedro Alves
2018-06-27 16:05                 ` Ulrich Weigand
2018-06-27 16:25                   ` Pedro Alves
2019-02-14 15:45       ` [PATCH] Use thread_info and inferior pointers more throughout Thomas Schwinge
2018-06-27 18:16 ` Possible regression on gdb.multi/multi-arch-exec.exp (was: Re: [PATCH] Use thread_info and inferior pointers more throughout) Sergio Durigan Junior
2018-06-27 18:39   ` Keith Seitz
2018-06-28 12:09   ` Possible regression on gdb.multi/multi-arch-exec.exp Pedro Alves
2018-06-28 16:02     ` [pushed] Fix follow-exec regression / crash (Re: Possible regression on gdb.multi/multi-arch-exec.exp) Pedro Alves
2018-06-28 16:37       ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180627131239.5F0D5D801C0@oc3748833570.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).