[0/2] Change find_thread_ptid functions to be methods

Message ID 20230327165355.89228-1-simon.marchi@efficios.com
Headers
Series Change find_thread_ptid functions to be methods |

Message

Simon Marchi March 27, 2023, 4:53 p.m. UTC
  I thought it would make sense for the that the find_thread_ptid
functions to be methods of inferior and process_stratum_target.
Especially the inferior one, as it searches in data that is private
(conceptually) to the inferior class.  I changed the
process_stratum_target one too, while at it.

Simon Marchi (2):
  gdb: make find_thread_ptid an inferior method
  gdb: make find_thread_ptid a process_stratum_target method

 gdb/aarch64-tdep.c           |  4 +---
 gdb/ada-tasks.c              |  8 ++++----
 gdb/aix-thread.c             |  8 ++++----
 gdb/amd-dbgapi-target.c      |  4 ++--
 gdb/bsd-uthread.c            |  4 ++--
 gdb/btrace.c                 |  2 +-
 gdb/darwin-nat.c             |  2 +-
 gdb/fbsd-nat.c               |  2 +-
 gdb/gdbthread.h              |  7 -------
 gdb/gnu-nat.c                |  3 +--
 gdb/infcmd.c                 |  2 +-
 gdb/inferior.c               | 12 ++++++++++++
 gdb/inferior.h               |  3 +++
 gdb/infrun.c                 | 16 ++++++++--------
 gdb/linux-fork.c             |  2 +-
 gdb/linux-nat.c              | 14 +++++++-------
 gdb/linux-thread-db.c        | 14 +++++++-------
 gdb/mi/mi-interp.c           |  2 +-
 gdb/netbsd-nat.c             |  2 +-
 gdb/nto-procfs.c             |  6 +++---
 gdb/process-stratum-target.c | 11 +++++++++++
 gdb/process-stratum-target.h |  3 +++
 gdb/procfs.c                 |  6 +++---
 gdb/python/py-threadevent.c  |  3 +--
 gdb/ravenscar-thread.c       |  8 ++++----
 gdb/record-btrace.c          |  4 ++--
 gdb/remote.c                 | 18 +++++++++---------
 gdb/sol-thread.c             |  4 ++--
 gdb/thread-iter.c            |  2 +-
 gdb/thread.c                 | 35 +++++------------------------------
 gdb/windows-nat.c            |  4 ++--
 31 files changed, 104 insertions(+), 111 deletions(-)
  

Comments

Tom Tromey April 4, 2023, 6:44 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> I thought it would make sense for the that the find_thread_ptid
Simon> functions to be methods of inferior and process_stratum_target.
Simon> Especially the inferior one, as it searches in data that is private
Simon> (conceptually) to the inferior class.  I changed the
Simon> process_stratum_target one too, while at it.

These seem fine to me.  Thanks.

Reviewed-By: Tom Tromey <tom@tromey.com>

Tom
  
Simon Marchi April 5, 2023, 1:06 a.m. UTC | #2
On 4/4/23 14:44, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> I thought it would make sense for the that the find_thread_ptid
> Simon> functions to be methods of inferior and process_stratum_target.
> Simon> Especially the inferior one, as it searches in data that is private
> Simon> (conceptually) to the inferior class.  I changed the
> Simon> process_stratum_target one too, while at it.
> 
> These seem fine to me.  Thanks.
> 
> Reviewed-By: Tom Tromey <tom@tromey.com>

Thanks, pushed.

Simon