From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 9F7A63856DEA; Fri, 20 May 2022 19:42:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F7A63856DEA Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] ranged_breakpoint: use install_breakpoint X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: f317d1eb2a7a7b9ec724630a7d70b51f435ff116 X-Git-Newrev: 27a62b4359a2718012eaf86bbeedb8662ec9f41b Message-Id: <20220520194243.9F7A63856DEA@sourceware.org> Date: Fri, 20 May 2022 19:42:43 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 19:42:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D27a62b4359a2= 718012eaf86bbeedb8662ec9f41b commit 27a62b4359a2718012eaf86bbeedb8662ec9f41b Author: Pedro Alves Date: Fri May 6 22:45:21 2022 +0100 ranged_breakpoint: use install_breakpoint =20 This commit replaces a chunk of code in break_range_command by an equivalent call to install_breakpoint. =20 Change-Id: I31c06cabd36f5be91740aab029265f678aa78e35 Diff: --- gdb/breakpoint.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f9332e1f998..ced976ca39d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9356,7 +9356,6 @@ break_range_command (const char *arg, int from_tty) struct linespec_result canonical_start, canonical_end; int bp_count, can_use_bp, length; CORE_ADDR end; - struct breakpoint *b; =20 /* We don't support software ranged breakpoints. */ if (target_ranged_break_num_registers () < 0) @@ -9440,18 +9439,12 @@ break_range_command (const char *arg, int from_tty) /* Now set up the breakpoint. */ std::unique_ptr br (new ranged_breakpoint (get_current_arch = ())); br->add_location (sal_start); - b =3D add_to_breakpoint_chain (std::move (br)); - - set_breakpoint_count (breakpoint_count + 1); - b->number =3D breakpoint_count; - b->disposition =3D disp_donttouch; - b->location =3D std::move (start_location); - b->location_range_end =3D std::move (end_location); - b->loc->length =3D length; + br->disposition =3D disp_donttouch; + br->location =3D std::move (start_location); + br->location_range_end =3D std::move (end_location); + br->loc->length =3D length; =20 - mention (b); - gdb::observers::breakpoint_created.notify (b); - update_global_location_list (UGLL_MAY_INSERT); + install_breakpoint (false, std::move (br), true); } =20 /* Return non-zero if EXP is verified as constant. Returned zero