public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdbserver: update the comment of 'current_process'
@ 2023-04-25 12:09 Tankut Baris Aktemur
  2023-04-25 13:58 ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Tankut Baris Aktemur @ 2023-04-25 12:09 UTC (permalink / raw)
  To: gdb-patches

Since commit

  commit 7f8acedeebe295fc8cc1d11ed971cbfc1942618c
  Author: Pedro Alves <pedro@palves.net>
  Date:   Tue Apr 5 13:57:11 2022 +0100

    gdbserver: track current process as well as current thread

current process is tracked separately and may be non-null
while the current thread is null.  Update the comment of the
current_process function accordingly.
---
 gdbserver/inferiors.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdbserver/inferiors.h b/gdbserver/inferiors.h
index a0ba9906097..9a41e66cb39 100644
--- a/gdbserver/inferiors.h
+++ b/gdbserver/inferiors.h
@@ -92,9 +92,9 @@ pid_of (const process_info *proc)
   return proc->pid;
 }
 
-/* Return a pointer to the process that corresponds to the current
-   thread (current_thread).  It is an error to call this if there is
-   no current thread selected.  */
+/* Return a pointer to the current process.  Note that the current
+   process may be non-null while the current thread (current_thread)
+   is null.  */
 
 struct process_info *current_process (void);
 struct process_info *get_thread_process (const struct thread_info *);
-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdbserver: update the comment of 'current_process'
  2023-04-25 12:09 [PATCH] gdbserver: update the comment of 'current_process' Tankut Baris Aktemur
@ 2023-04-25 13:58 ` Andrew Burgess
  2023-04-26 10:11   ` Aktemur, Tankut Baris
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2023-04-25 13:58 UTC (permalink / raw)
  To: Tankut Baris Aktemur, gdb-patches

Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org>
writes:

> Since commit
>
>   commit 7f8acedeebe295fc8cc1d11ed971cbfc1942618c
>   Author: Pedro Alves <pedro@palves.net>
>   Date:   Tue Apr 5 13:57:11 2022 +0100
>
>     gdbserver: track current process as well as current thread
>
> current process is tracked separately and may be non-null
> while the current thread is null.  Update the comment of the
> current_process function accordingly.
> ---
>  gdbserver/inferiors.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gdbserver/inferiors.h b/gdbserver/inferiors.h
> index a0ba9906097..9a41e66cb39 100644
> --- a/gdbserver/inferiors.h
> +++ b/gdbserver/inferiors.h
> @@ -92,9 +92,9 @@ pid_of (const process_info *proc)
>    return proc->pid;
>  }
>  
> -/* Return a pointer to the process that corresponds to the current
> -   thread (current_thread).  It is an error to call this if there is
> -   no current thread selected.  */
> +/* Return a pointer to the current process.  Note that the current
> +   process may be non-null while the current thread (current_thread)
> +   is null.  */

I'm wondering if the bit about "It is an error to call this if there is
no current thread selected." should be retained, or at least changed to
"It is an error to call this if there is no current process selected." -
and that the assert (removed in 7f8acedeebe295 should be added back.

I've asked Pedro about this:

  https://sourceware.org/pipermail/gdb-patches/2023-April/199097.html

Thanks,
Andrew

>  
>  struct process_info *current_process (void);
>  struct process_info *get_thread_process (const struct thread_info *);
> -- 
> 2.25.1
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] gdbserver: update the comment of 'current_process'
  2023-04-25 13:58 ` Andrew Burgess
@ 2023-04-26 10:11   ` Aktemur, Tankut Baris
  0 siblings, 0 replies; 3+ messages in thread
From: Aktemur, Tankut Baris @ 2023-04-26 10:11 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On Tuesday, April 25, 2023 3:59 PM, Andrew Burgess wrote:
> Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org>
> writes:
> 
> > Since commit
> >
> >   commit 7f8acedeebe295fc8cc1d11ed971cbfc1942618c
> >   Author: Pedro Alves <pedro@palves.net>
> >   Date:   Tue Apr 5 13:57:11 2022 +0100
> >
> >     gdbserver: track current process as well as current thread
> >
> > current process is tracked separately and may be non-null
> > while the current thread is null.  Update the comment of the
> > current_process function accordingly.
> > ---
> >  gdbserver/inferiors.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/gdbserver/inferiors.h b/gdbserver/inferiors.h
> > index a0ba9906097..9a41e66cb39 100644
> > --- a/gdbserver/inferiors.h
> > +++ b/gdbserver/inferiors.h
> > @@ -92,9 +92,9 @@ pid_of (const process_info *proc)
> >    return proc->pid;
> >  }
> >
> > -/* Return a pointer to the process that corresponds to the current
> > -   thread (current_thread).  It is an error to call this if there is
> > -   no current thread selected.  */
> > +/* Return a pointer to the current process.  Note that the current
> > +   process may be non-null while the current thread (current_thread)
> > +   is null.  */
> 
> I'm wondering if the bit about "It is an error to call this if there is
> no current thread selected." should be retained, or at least changed to
> "It is an error to call this if there is no current process selected." -
> and that the assert (removed in 7f8acedeebe295 should be added back.
> 
> I've asked Pedro about this:
> 
>   https://sourceware.org/pipermail/gdb-patches/2023-April/199097.html
> 
> Thanks,
> Andrew
 
Thanks for the feedback, Andrew.  I replied to the other thread to
continue the discussion there.

Regards
-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-26 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-25 12:09 [PATCH] gdbserver: update the comment of 'current_process' Tankut Baris Aktemur
2023-04-25 13:58 ` Andrew Burgess
2023-04-26 10:11   ` Aktemur, Tankut Baris

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).