From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: Andrew Burgess <aburgess@redhat.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 1/1] gdb, infrun: refactor part of `proceed` into separate function
Date: Thu, 8 Jun 2023 09:18:10 +0000 [thread overview]
Message-ID: <CY4PR11MB20050040E3CD0B0A804AF422F950A@CY4PR11MB2005.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87mt1b1h8f.fsf@redhat.com>
Hi Andrew,
Thanks a lot for your feedback.
> -----Original Message-----
> From: Andrew Burgess <aburgess@redhat.com>
> Sent: Wednesday, June 7, 2023 4:26 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> patches@sourceware.org
> Subject: Re: [PATCH 1/1] gdb, infrun: refactor part of `proceed` into separate
> function
>
> Christina Schimpe via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> > From: Mihails Strasuns <mihails.strasuns@intel.com>
> >
> > Split thread resuming block into separate function.
> > ---
> > gdb/infrun.c | 119
> > ++++++++++++++++++++++++++-------------------------
> > 1 file changed, 60 insertions(+), 59 deletions(-)
> >
> > diff --git a/gdb/infrun.c b/gdb/infrun.c index
> > 58da1cef29e..571cf29ef32 100644
> > --- a/gdb/infrun.c
> > +++ b/gdb/infrun.c
> > @@ -3268,6 +3268,63 @@ check_multi_target_resumption
> (process_stratum_target *resume_target)
> > }
> > }
> >
> > +/* Helper function for `proceed`, does bunch of checks to see
> > + if a thread can be resumed right now, switches to that thread
> > + and moves on to `keep_going_pass_signal`. */
>
> Function comments are suppose to mention the function arguments. So I'd
> prefer something like:
>
> /* Helper function for `proceed`. Check if thread TP is suitable for
> resuming, and, if it is, switch to the thread and call
> `keep_going_pass_signal`. If TP is not suitable for resuming then
> this function will just return without switching threads. */
>
> > +
> > +static void
> > +proceed_resume_thread_checked (thread_info *tp) {
> > + if (!tp->inf->has_execution ())
> > + {
> > + infrun_debug_printf ("[%s] target has no execution",
> > + tp->ptid.to_string ().c_str ());
> > + return;
> > + }
> > +
> > + if (tp->resumed ())
> > + {
> > + infrun_debug_printf ("[%s] resumed",
> > + tp->ptid.to_string ().c_str ());
> > + gdb_assert (tp->executing () || tp->has_pending_waitstatus ());
> > + return;
> > + }
> > +
> > + if (thread_is_in_step_over_chain (tp))
> > + {
> > + infrun_debug_printf ("[%s] needs step-over",
> > + tp->ptid.to_string ().c_str ());
> > + return;
> > + }
> > +
> > + /* If a thread of that inferior is waiting for a vfork-done
> > + (for a detached vfork child to exec or exit), breakpoints are
> > + removed. We must not resume any thread of that inferior, other
> > + than the one waiting for the vfork-done.
> > + In non-stop, forbid resuming a thread if some other thread of
> > + that inferior is waiting for a vfork-done event (this means
> > + breakpoints are out for this inferior). */
>
> It feels like there's duplication between the two parts of this comment now.
> I think you need to rewrite this as a single comment block that explains the
> new merged logic here.
>
I agree with all your comments and will post a v2 asap.
Christina
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
prev parent reply other threads:[~2023-06-08 9:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 7:09 Christina Schimpe
2023-06-07 9:26 ` Bruno Larsen
2023-06-07 14:21 ` Andrew Burgess
2023-06-07 17:24 ` Bruno Larsen
2023-06-08 15:32 ` Schimpe, Christina
2023-06-09 7:16 ` Bruno Larsen
2023-06-08 18:41 ` Andrew Burgess
2023-06-12 7:45 ` Schimpe, Christina
2023-06-07 14:26 ` Andrew Burgess
2023-06-08 9:18 ` Schimpe, Christina [this message]
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=CY4PR11MB20050040E3CD0B0A804AF422F950A@CY4PR11MB2005.namprd11.prod.outlook.com \
--to=christina.schimpe@intel.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/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).