From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id algECbQDZWNYARQAWB0awg (envelope-from ) for ; Fri, 04 Nov 2022 08:21:08 -0400 Received: by simark.ca (Postfix, from userid 112) id 181961E124; Fri, 4 Nov 2022 08:21:08 -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=kWzM3+Sc; 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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 6D7141E0CB for ; Fri, 4 Nov 2022 08:21:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F0DE3858431 for ; Fri, 4 Nov 2022 12:21:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F0DE3858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667564465; bh=cS5JPhZtjdrzAgIKpmQyKCy/wZKH51kTpZwRcXP/mwo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kWzM3+Sc5YS4sW/1xSGn8vqsY2Pq50t/e0ln1EW52VOCVv08R1JOB14MSaQiW0Zjy SBtiwor/aTBdILvJO+Qdn229LUAhvdemhhptGxFdfZvWarSFO2kPvSM8zO9AYYc0EN Tcw2KZwLK1CLBBVv9444yvKpZ5UV0IwDmE8sqG3I= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 9CD8D385840B for ; Fri, 4 Nov 2022 12:20:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CD8D385840B Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 88BFD80013; Fri, 4 Nov 2022 12:20:42 +0000 (UTC) Date: Fri, 4 Nov 2022 12:20:10 +0000 To: Andrew Burgess Subject: Re: [PATCH 01/12] gdb: int to bool conversion for normal_stop Message-ID: <20221104122010.tgwbzndjdrrufi7i@ubuntu.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 04 Nov 2022 12:20:42 +0000 (UTC) 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: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Andrew, I believe there is one more callsite which can be updated in infrun.c:fetch_inferior_event: diff --git a/gdb/infrun.c b/gdb/infrun.c index 3660272ef11..666c1c17f15 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4248,7 +4248,7 @@ fetch_inferior_event () else { bool should_notify_stop = true; - int proceeded = 0; + bool proceeded = false; stop_all_threads_if_all_stop_mode (); Otherwise, this looks good to me. Best, Lancelot. On Fri, Oct 21, 2022 at 09:43:37AM +0100, Andrew Burgess via Gdb-patches wrote: > Change the return type of normal_stop (infrun.c) from int to bool. > Update callers. > > There should be no user visible changes after this commit. > --- > gdb/infcmd.c | 2 +- > gdb/infrun.c | 6 +++--- > gdb/infrun.h | 2 +- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index d729732c81c..6af11ac0cb6 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -873,7 +873,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string) > proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT); > else > { > - int proceeded; > + bool proceeded; > > /* Stepped into an inline frame. Pretend that we've > stopped. */ > diff --git a/gdb/infrun.c b/gdb/infrun.c > index cdfe02393f5..39840ef32c8 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -8614,7 +8614,7 @@ stop_context::changed () const > > /* See infrun.h. */ > > -int > +bool > normal_stop (void) > { > struct target_waitstatus last; > @@ -8774,7 +8774,7 @@ normal_stop (void) > the observers would print a stop for the wrong > thread/inferior. */ > if (saved_context.changed ()) > - return 1; > + return true; > > /* Notify observers about the stop. This is where the interpreters > print the stop event. */ > @@ -8796,7 +8796,7 @@ normal_stop (void) > breakpoint_auto_delete (inferior_thread ()->control.stop_bpstat); > } > > - return 0; > + return false; > } > > int > diff --git a/gdb/infrun.h b/gdb/infrun.h > index c711b9b21cc..11a18583e68 100644 > --- a/gdb/infrun.h > +++ b/gdb/infrun.h > @@ -149,7 +149,7 @@ extern process_stratum_target *user_visible_resume_target (ptid_t resume_ptid); > appropriate messages, remove breakpoints, give terminal our modes, > and run the stop hook. Returns true if the stop hook proceeded the > target, false otherwise. */ > -extern int normal_stop (void); > +extern bool normal_stop (void); > > /* Return the cached copy of the last target/ptid/waitstatus returned > by target_wait(). The data is actually cached by handle_inferior_event(), > -- > 2.25.4 >