From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qBUGD2JYXWR/ZwcAWB0awg (envelope-from ) for ; Thu, 11 May 2023 17:04:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 3B2D01E11D; Thu, 11 May 2023 17:04:34 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QU3zNMxN; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [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 B6DBD1E0D4 for ; Thu, 11 May 2023 17:04:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22A173856DDF for ; Thu, 11 May 2023 21:04:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22A173856DDF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683839072; bh=szNu88hjeSIuhJ374xzZ5tsX5rlyq/ipOk9SFCgXrqk=; h=Date:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=QU3zNMxNrWh64XEK5HjuI+FYyeKBGRQIMivk2JH8LI5F/fhOu7aRAnnEcgMULEQnw 1ElGiEU47C0CIxSxNqI6BDPAfWns0l2unWNSdgonHnGeI16YDh6aBptYDKIlD4/nlk X9xjyWxX9oKm8o95las7E7f2VUidNZRqrCBKqRQk= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2448A3858C54 for ; Thu, 11 May 2023 21:04:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2448A3858C54 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-80-qDjKRqumNMGL_VSzgcykVg-1; Thu, 11 May 2023 17:04:09 -0400 X-MC-Unique: qDjKRqumNMGL_VSzgcykVg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BE5E85A5A3; Thu, 11 May 2023 21:04:09 +0000 (UTC) Received: from f37-zws-nv (unknown [10.22.10.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E73B063F8F; Thu, 11 May 2023 21:04:08 +0000 (UTC) Date: Thu, 11 May 2023 14:04:07 -0700 To: Cc: gdb-patches@sourceware.org, Subject: Re: [PATCH] [patch] gdbserver assert error on arm platform Message-ID: <20230511140407.0a0977fb@f37-zws-nv> In-Reply-To: <20230511062001.2745878-1-zhiyong.yan@windriver.com> References: <20230511062001.2745878-1-zhiyong.yan@windriver.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" I have some formatting nits as well as a request for a test case. See below... On Thu, 11 May 2023 14:20:01 +0800 wrote: > From: Zhiyong Yan > > Bugzilla 30387 has given the steps of producing this issue on arm platform. > Gdb should not assume pending threads always generate ___a non-gdbserver trap event___, a ___Signal 17___ event could happen. > Now that resume_stopped_resumed_lwps() -> may_hw_step() assumes that the break point must already exist, resume_one_thread() should ensure the software breaking point is installed although the thread is pending. In addition to the provided patch, could you also add a test case? > > LINK: https://sourceware.org/bugzilla/show_bug.cgi?id=30387 s/LINK/Bug/ > > Signed-off-by: Zhiyong Yan zhiyong.yan@windriver.com > --- > gdbserver/linux-low.cc | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc > index e6a39202a98..543daf66376 100644 > --- a/gdbserver/linux-low.cc > +++ b/gdbserver/linux-low.cc > @@ -4670,8 +4670,16 @@ linux_process_target::resume_one_thread (thread_info *thread, > > proceed_one_lwp (thread, NULL); > } > - else > - threads_debug_printf ("leaving LWP %ld stopped", lwpid_of (thread)); > + else{ > + threads_debug_printf ("leaving LWP %ld stopped", lwpid_of (thread)); > + if(thread->last_resume_kind == resume_step){ Missing space before left paren and after right paren. > + /* > + * If resume_step is required by GDB, install single-step breakpoint. > + */ Format the above comment as: /* If resume_step is required by GDB, install single-step breakpoint. */ If you want to use a block comment, don't prefix each line with a '*'. Also, the trailing '*/' should be placed at the end of the last line in the block comment. Likewise for the leading '/*'. > + if (supports_software_single_step()) Missing space before '()'. > + install_software_single_step_breakpoints (lwp); > + } > + } > > thread->last_status.set_ignore (); > lwp->resume = NULL; > -- > 2.25.1 >