From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 4647038543B3; Fri, 13 Jan 2023 16:34:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4647038543B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673627664; bh=NTLTOIX2CFSmuAZGU1FLgpzFlVQCq/wTRAiJol0BInw=; h=From:To:Subject:Date:From; b=GhkfZYkqnV4kunQXhj3H7P7nGw7qezYuJQo36pkAtiwA5NrSail8Q05/+i6b+32uo 7WTyd5hpVfn2B8k7eQ+DxmV6ETapZUPEDDzNgvWYblIlfD5UCOFtAHeE/6BcbU5zbH E2hry7M5EBBxpqZvRMA7t4b2ZsetPD9x4lThEUE8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: int to bool conversion for normal_stop X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 6f9f448118eaeaf006f867a25699aef7d8c72770 X-Git-Newrev: 8dd08de7e48850496321548099ef86d3275679b9 Message-Id: <20230113163424.4647038543B3@sourceware.org> Date: Fri, 13 Jan 2023 16:34:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8dd08de7e488= 50496321548099ef86d3275679b9 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: --- gdb/infcmd.c | 4 +--- gdb/infrun.c | 10 +++++----- gdb/infrun.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) 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 stopped. */ thr->thread_fsm ()->clean_up (thr); - proceeded =3D normal_stop (); + bool proceeded =3D normal_stop (); if (!proceeded) inferior_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 () else { bool should_notify_stop =3D true; - int proceeded =3D 0; + bool proceeded =3D false; =20 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) breakpoint_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= (),