[PATCH 2/2] gdb/infrun: stop all threads if there exists a non-stop target

Pedro Alves palves@redhat.com
Wed Apr 1 18:10:07 GMT 2020


Hi Tankut,

Thanks much for this, and I'm very sorry for the delay.

This looks good to me, with minor comments below.  Please push.

On 2/6/20 8:29 AM, Tankut Baris Aktemur wrote:

>  
>    if (debug_infrun)
>      fprintf_unfiltered (gdb_stdlog, "infrun: stop_all_threads\n");
> @@ -4713,6 +4713,18 @@ stop_all_threads (void)
>  	     to tell the target to stop.  */
>  	  for (thread_info *t : all_non_exited_threads ())
>  	    {
> +	      /* For a single-target setting with an all-stop target,
> +		 we would not even arrive here.  For a multi-target
> +		 setting, until GDB is able to handle a mixture of
> +		 all-stop and non-stop targets, simply skip all-stop
> +		 targets' threads.  This should be fine due to the
> +		 protection of commit
> +		 2f4fcf00399bc0ad5a4fed6b530128e8be4f40da  */

Missing period.  But also please mention here the protection of 
check_multi_target_resumption instead of the commit id, so that
people don't have to dig into the repo every time they need to
understand this.

> +
> +	      switch_to_thread_no_regs (t);
> +	      if (!target_is_non_stop_p ())
> +		continue;
> +

> +# GDB is expected to have stopped the other inferior.  Switch to the
> +# slow inferior's thread.  It should not be running.
> +gdb_test_multiple "thread 2.1" "check thread 2.1 is not running" {
> +    -re ".*\\(running\\)\[\r\n\]+$gdb_prompt" {

These leading ".*" are unnecessary -- they're implied.

> +	fail $gdb_test_name
> +    }
> +    -re ".*$gdb_prompt" {

Here too.

> +	pass $gdb_test_name
> +    }
> +}
> 
Thanks,
Pedro Alves



More information about the Gdb-patches mailing list