Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 11/18] Implement all-stop on top of a target running non-stop mode
Date: Fri, 22 May 2015 18:35:00 -0000	[thread overview]
Message-ID: <047d7b2e4e86aaa0ff0516afeb5c@google.com> (raw)

Pedro Alves writes:
> ...
  > gdb/ChangeLog:
  > 2015-05-21  Pedro Alves  <palves@redhat.com>
  >
  > 	* NEWS: Mention "maint set/show target-non-stop".
  > 	* breakpoint.c (update_global_location_list): Check
  > 	target_is_non_stop_p instead of non_stop.
  > 	* infcmd.c (attach_command_post_wait, attach_command): Likewise.
  > 	* infrun.c (show_can_use_displaced_stepping)
  > 	(can_use_displaced_stepping_p, start_step_over_inferior):
  > 	Likewise.
  > 	(resume): Always resume a single thread if the target is in
  > 	non-stop mode.
  > 	(proceed): Check target_is_non_stop_p instead of non_stop.  If in
  > 	all-stop mode but the target is always in non-stop mode, start all
  > 	the other threads that are implicitly resumed too.
  > 	(for_each_just_stopped_thread, fetch_inferior_event)
  > 	(adjust_pc_after_break, stop_all_threads): Check
  > 	target_is_non_stop_p instead of non_stop.
  > 	(handle_inferior_event): Likewise.  Handle detach-fork in all-stop
  > 	with the target always in non-stop mode.
  > 	(handle_signal_stop) <random signal>: Check target_is_non_stop_p
  > 	instead of non_stop.
  > 	(switch_back_to_stepped_thread): Check target_is_non_stop_p
  > 	instead of non_stop.
  > 	(keep_going_stepped_thread): Always resume a single thread if the
  > 	target is in non-stop mode.
  > 	(stop_waiting): If in all-stop mode, and the target is in non-stop
  > 	mode, stop all threads.
  > 	(keep_going_pass): Likewise, when starting a new in-line step-over
  > 	sequence.
  > 	* linux-nat.c (get_pending_status, select_event_lwp)
  > 	(linux_nat_filter_event, linux_nat_wait_1, linux_nat_wait): Check
  > 	target_is_non_stop_p instead of non_stop.
  > 	(linux_nat_always_non_stop_p): New function.
  > 	(linux_nat_stop): Check target_is_non_stop_p instead of non_stop.
  > 	(linux_nat_add_target): Install linux_nat_always_non_stop_p.
  > 	* target-delegates.c: Regenerate.
  > 	* target.c (target_is_non_stop_p): New function.
  > 	(target_non_stop_enabled, target_non_stop_enabled_1): New globals.
  > 	(maint_set_target_non_stop_command)
  > 	(maint_show_target_non_stop_command): New functions.
  > 	(_initilize_target): Install "maint set/show target-non-stop"
  > 	commands.
  > 	* target.h (struct target_ops) <to_always_non_stop_p>: New field.
  > 	(target_non_stop_enabled): New declaration.
  > 	(target_is_non_stop_p): New declaration.
  >
  > gdb/doc/ChangeLog:
  > 2015-05-21  Pedro Alves  <palves@redhat.com>
  >
  > 	* gdb.texinfo (Maintenance Commands): Document "maint set/show
  > 	target-non-stop".
  >
> ...
  > diff --git a/gdb/infrun.c b/gdb/infrun.c
  > index 75c5080..d9fc4e5 100644
  > --- a/gdb/infrun.c
  > +++ b/gdb/infrun.c
> ...
  > @@ -2383,7 +2384,15 @@ resume (enum gdb_signal sig)
  >  	      insert_single_step_breakpoint (gdbarch, aspace, pc);
  >  	      insert_breakpoints ();
  >
  > -	      resume_ptid = user_visible_resume_ptid (user_step);
  > +	      /* In non-stop, we always control threads individually.
  > +		 Note that the target may always work in non-stop mode
  > +		 even with "set non-stop off", in which case
  > +		 user_visible_resume_ptid could return a wildcard
  > +		 ptid.  */
  > +	      if (target_is_non_stop_p ())
  > +		resume_ptid = inferior_ptid;
  > +	      else
  > +		resume_ptid = user_visible_resume_ptid (user_step);
  >  	      do_target_resume (resume_ptid, 0, GDB_SIGNAL_0);
  >  	      discard_cleanups (old_cleanups);
  >  	      tp->resumed = 1;

re: improved comment:
Better, thanks.

I found another instance in keep_going_stepped_thread:

       if (target_is_non_stop_p ())
         resume_ptid = inferior_ptid;
       else
         resume_ptid = user_visible_resume_ptid  
(tp->control.stepping_command);

Can you add a comment here too?
Thanks.
[An alternative would be to add a utility function that
contained this code and then put the comment there,
but I'll leave it to you to decide if you want
such a function.]


             reply	other threads:[~2015-05-22 18:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 18:35 Doug Evans [this message]
2015-05-23 15:29 ` Pedro Alves
2015-05-28 18:56   ` Doug Evans
  -- strict thread matches above, loose matches on Subject: below --
2015-05-21 23:19 [PATCH v4 00/18] All-stop on top of non-stop Pedro Alves
2015-05-21 23:19 ` [PATCH 11/18] Implement all-stop on top of a target running non-stop mode Pedro Alves
2015-09-11 20:53   ` Jan Kratochvil
2015-09-14 14:24     ` Pedro Alves

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=047d7b2e4e86aaa0ff0516afeb5c@google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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