Re: [PATCH v3 5/5] gdb: better handling of 'S' packets

Simon Marchi via Gdb-patches
2021-01-08T19:11:51Z

>> + bool multiple_resumed_thread = false;
>
> This might be better named 'multiple_resumed_threads'. Apologies if
> this was just copied from my original code.

Agreed, fixed.

>>
>> - /* If no thread/process was reported by the stub then use the first
>> - non-exited thread in the current target. */
>> - if (ptid == null_ptid)
>> + /* Consider all non-exited threads of the target, find the first resumed
>> + one. */
>> + for (thread_info *thr : all_non_exited_threads (this))
>> {
>> - /* Some stop events apply to all threads in an inferior, while others
>> - only apply to a single thread. */
>> - bool is_stop_for_all_threads
>> - = (status->kind == TARGET_WAITKIND_EXITED
>> - || status->kind == TARGET_WAITKIND_SIGNALLED);
>> + remote_thread_info *remote_thr =get_remote_thread_info (thr);
>
> Missing space after '='.

Fixed.

>> +/* Called when it is decided that STOP_REPLY holds the info of the
>> + event that is to be returned to the core. This function always
>> + destroys STOP_REPLY. */
>> +
>> +ptid_t
>> +remote_target::process_stop_reply (struct stop_reply *stop_reply,
>> + struct target_waitstatus *status)
>> +{
>> + ptid_t ptid;
>
> Shouldn't this just be inline below?

Fixed.

>> diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.c b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.c
>> new file mode 100644
>> index 000000000000..01f6d3c07ff4
>> --- /dev/null
>> +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.c
>> @@ -0,0 +1,77 @@
>> +/* This testcase is part of GDB, the GNU debugger.
>> +
>> + Copyright 2020 Free Software Foundation, Inc.
>
> The copyright year will need updating now.

Oh, we now live in the future!

>> diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
>> new file mode 100644
>> index 000000000000..f394ca8ed0c4
>> --- /dev/null
>> +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
>> @@ -0,0 +1,136 @@
>> +# This testcase is part of GDB, the GNU debugger.
>> +#
>> +# Copyright 2020 Free Software Foundation, Inc.
>
> And again.

Fixed too.

Thanks for the comments. I'll give a bit more time for people to
comment. But at this point, patches 1, 2 and 5 were looked at and
agreed with, so I'll push these eventually at least if nothing else
comes up.

Simon