public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbserver: update the comment of 'current_process'
Date: Tue, 25 Apr 2023 14:58:53 +0100	[thread overview]
Message-ID: <87sfcoawrm.fsf@redhat.com> (raw)
In-Reply-To: <20230425120948.2604327-1-tankut.baris.aktemur@intel.com>

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


  reply	other threads:[~2023-04-25 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 12:09 Tankut Baris Aktemur
2023-04-25 13:58 ` Andrew Burgess [this message]
2023-04-26 10:11   ` Aktemur, Tankut Baris

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=87sfcoawrm.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.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).