From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IhYqJXeu+F/xNwAAWB0awg (envelope-from ) for ; Fri, 08 Jan 2021 14:11:51 -0500 Received: by simark.ca (Postfix, from userid 112) id 846EA1E99A; Fri, 8 Jan 2021 14:11:51 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 375E71E590 for ; Fri, 8 Jan 2021 14:11:51 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B07D238438A3; Fri, 8 Jan 2021 19:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B07D238438A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610133110; bh=44EM/wGUvmCXa7nkI0duTsjS1r+HfJgaLFKHcvyjGbs=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tjObIF1nf5fInA/KnUFVRsi8ailTF6zjT/sMY7CCvhdsgyPUtLompCXcEjHxOae8X H/cBP5tMpEOSOJgKvM+N2qkipfV/GyK130pszVETGt43il1fCjCOBK+fXp4xkT9ZXy os7j0g3exGBwPEj1WD7q1cklbPAYYcMLktfavnkI= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3483438438A3 for ; Fri, 8 Jan 2021 19:11:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3483438438A3 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 108JBeRd006500 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Jan 2021 14:11:45 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 108JBeRd006500 Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5F8A31E590; Fri, 8 Jan 2021 14:11:40 -0500 (EST) Subject: Re: [PATCH v3 5/5] gdb: better handling of 'S' packets To: Andrew Burgess References: <20210108041734.3873826-1-simon.marchi@polymtl.ca> <20210108041734.3873826-6-simon.marchi@polymtl.ca> <20210108181945.GC2945@embecosm.com> Message-ID: Date: Fri, 8 Jan 2021 14:11:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210108181945.GC2945@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 8 Jan 2021 19:11:40 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >> + 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