From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4zebIlGIwWNMGBYAWB0awg (envelope-from ) for ; Fri, 13 Jan 2023 11:35:29 -0500 Received: by simark.ca (Postfix, from userid 112) id 7FD521E128; Fri, 13 Jan 2023 11:35:29 -0500 (EST) 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=KYWvx7jd; 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=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 235861E110 for ; Fri, 13 Jan 2023 11:35:29 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B6E3384F00D for ; Fri, 13 Jan 2023 16:35:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B6E3384F00D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673627728; bh=Ldmc95AX96RoTrqFdH46N+m6A8yYr40WwDCnWv+0t7g=; h=To:Cc:Subject:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=KYWvx7jdlBLFh2z0RwMoLdK0q8w1WHywxTQpqqUHyalPyj63oLNq7PI5RpWmi7/nn Kvmw06WCNGV15jzIZCJlHvMGusBbtlWsajSvXP2u9OjBb/w2KGQ1SsZyLY3H9fkD41 cE/X5SS6oubOsGdZxKm41F4cO5Jq7AZHWQuruBYU= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B81A93858C39 for ; Fri, 13 Jan 2023 16:35:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B81A93858C39 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-341-GUJTh_k5PJuEND47K4PSww-1; Fri, 13 Jan 2023 11:35:06 -0500 X-MC-Unique: GUJTh_k5PJuEND47K4PSww-1 Received: by mail-wr1-f71.google.com with SMTP id d27-20020adfa35b000000b002bc813ba677so3182864wrb.6 for ; Fri, 13 Jan 2023 08:35:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G0kmh3JfpdzfUqnFiT0Yf5s2vY7PPPZBJyagyfje/a0=; b=olaMJGIh0CglOb4+SA4lEVJk/IHoKKoweVi/+comGoGG/VNkN8AcqlqpmLh/kmiZTI JAjOzulEfy6Wjno0RZG6I4QbnnwhE2RHtd7VLVNT2flxfHTRzrOWgMa7w9LiZ3fO27yo mcM7ZQ6n2E/r+I4g9RSqEreuiuBTuzeoP4+VPWzM+uEUVp6cUBCfVk9JB1AP8hA9ta6A cVoHkeeiM/Ojp2QiYxS1//fWfbr+Z9b0fbEGB4jgmVafPhP1iRlVQXaAI48vQg9V1zhg LZlptiu5IEz05dp86DgdyxJCtcorMyLjlL93UnxJff9G+wgzxWGn4d+YWDTW2LbXpabT cvvw== X-Gm-Message-State: AFqh2kqCs+GUV19muMwxs4YdPKcBYQb4Hzz07jxA5YM0oHOZM0I0trzH Cztz/+EsD5aXz/ahuaVSwmh4QEKmIC8x1GiLwBg49WC4i50XPMvYEjKpPEx77Yult5DeSCcUrMO nsaPQhLJ6XQLM+JbpWpFpjg== X-Received: by 2002:a5d:620f:0:b0:242:9e3:72b8 with SMTP id y15-20020a5d620f000000b0024209e372b8mr57112008wru.31.1673627704858; Fri, 13 Jan 2023 08:35:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKQkfBEMV/t+kOMzywxktnEdi37AYJqCs8Kx+PGuOl+Hc3KgETQxeRXXe6SwnHlJVxgFTRXw== X-Received: by 2002:a5d:620f:0:b0:242:9e3:72b8 with SMTP id y15-20020a5d620f000000b0024209e372b8mr57111999wru.31.1673627704651; Fri, 13 Jan 2023 08:35:04 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id n16-20020a5d4010000000b002bbed1388a5sm14027152wrp.15.2023.01.13.08.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 08:35:04 -0800 (PST) To: Lancelot SIX Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 01/12] gdb: int to bool conversion for normal_stop In-Reply-To: <20221104122010.tgwbzndjdrrufi7i@ubuntu.lan> References: <20221104122010.tgwbzndjdrrufi7i@ubuntu.lan> Date: Fri, 13 Jan 2023 16:35:03 +0000 Message-ID: <87wn5qfl54.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Lancelot SIX writes: > Hi Andrew, > > I=E2=80=AFbelieve 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 =3D true; > - int proceeded =3D 0; > + bool proceeded =3D false; > =20 > stop_all_threads_if_all_stop_mode (); > > Otherwise, this looks good to me. Thanks, I made this update and pushed this patch. The final version that I pushed is below. Thanks, Andrew --- commit 8dd08de7e48850496321548099ef86d3275679b9 Author: Andrew Burgess Date: Mon Oct 17 15:01:24 2022 +0100 gdb: int to bool conversion for normal_stop =20 Change the return type of normal_stop (infrun.c) from int to bool. Update callers. =20 I've also converted the (void) to () in the function declaration and definition, given I was changing those lines anyway. =20 There should be no user visible changes after this commit. diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 0497ad05091..7d5ec77ff57 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -885,12 +885,10 @@ step_1 (int skip_subroutines, int single_inst, const = char *count_string) proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT); else { - int proceeded; - /* Stepped into an inline frame. Pretend that we've =09 stopped. */ thr->thread_fsm ()->clean_up (thr); - proceeded =3D normal_stop (); + bool proceeded =3D normal_stop (); if (!proceeded) =09inferior_event_handler (INF_EXEC_COMPLETE); all_uis_check_sync_execution_done (); diff --git a/gdb/infrun.c b/gdb/infrun.c index 181d961d80d..1a2ef2d078b 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4219,7 +4219,7 @@ fetch_inferior_event () =09else =09 { =09 bool should_notify_stop =3D true; -=09 int proceeded =3D 0; +=09 bool proceeded =3D false; =20 =09 stop_all_threads_if_all_stop_mode (); =20 @@ -8582,8 +8582,8 @@ stop_context::changed () const =20 /* See infrun.h. */ =20 -int -normal_stop (void) +bool +normal_stop () { struct target_waitstatus last; =20 @@ -8742,7 +8742,7 @@ normal_stop (void) the observers would print a stop for the wrong thread/inferior. */ if (saved_context.changed ()) - return 1; + return true; =20 /* Notify observers about the stop. This is where the interpreters print the stop event. */ @@ -8764,7 +8764,7 @@ normal_stop (void) =09breakpoint_auto_delete (inferior_thread ()->control.stop_bpstat); } =20 - return 0; + return false; } =0C int diff --git a/gdb/infrun.h b/gdb/infrun.h index 19e68155ec4..43fd1b44f5a 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -149,7 +149,7 @@ extern process_stratum_target *user_visible_resume_targ= et (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 (); =20 /* Return the cached copy of the last target/ptid/waitstatus returned by target_wait(). The data is actually cached by handle_inferior_event= (),