From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 03DDA3857C49; Fri, 29 Apr 2022 22:24:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03DDA3857C49 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove allocate_bp_location X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: a678887d09c00cecb9aec39cd15f8c65e603078e X-Git-Newrev: ee89d0a4e82399e6e857a67e8bef81bfbe6e7df4 Message-Id: <20220429222447.03DDA3857C49@sourceware.org> Date: Fri, 29 Apr 2022 22:24:47 +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, 29 Apr 2022 22:24:47 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dee89d0a4e823= 99e6e857a67e8bef81bfbe6e7df4 commit ee89d0a4e82399e6e857a67e8bef81bfbe6e7df4 Author: Tom Tromey Date: Sun Jan 16 19:28:19 2022 -0700 Remove allocate_bp_location =20 allocate_bp_location is just a small wrapper for a method call, so inline it everywhere. Diff: --- gdb/breakpoint.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index c3568883ea9..17ab0f030cd 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -175,8 +175,6 @@ static void enable_breakpoint_disp (struct breakpoint *= , enum bpdisp, =20 static void decref_bp_location (struct bp_location **loc); =20 -static struct bp_location *allocate_bp_location (struct breakpoint *bpt); - static std::vector bkpt_probe_decode_location (struct breakpoint *b, struct event_location *location, @@ -1829,7 +1827,7 @@ software_watchpoint_add_no_memory_location (struct br= eakpoint *b, { gdb_assert (b->type =3D=3D bp_watchpoint && b->loc =3D=3D NULL); =20 - b->loc =3D allocate_bp_location (b); + b->loc =3D b->allocate_location (); b->loc->pspace =3D pspace; b->loc->address =3D -1; b->loc->length =3D -1; @@ -2082,7 +2080,7 @@ update_watchpoint (struct watchpoint *b, int reparse) else if (b->type =3D=3D bp_access_watchpoint) type =3D hw_access; =20 - loc =3D allocate_bp_location (b); + loc =3D b->allocate_location (); for (tmp =3D &(b->loc); *tmp !=3D NULL; tmp =3D &((*tmp)->next)) ; *tmp =3D loc; @@ -7196,14 +7194,6 @@ bp_location::bp_location (breakpoint *owner) { } =20 -/* Allocate a struct bp_location. */ - -static struct bp_location * -allocate_bp_location (struct breakpoint *bpt) -{ - return bpt->allocate_location (); -} - /* Decrement reference count. If the reference count reaches 0, destroy the bp_location. Sets *BLP to NULL. */ =20 @@ -8034,7 +8024,7 @@ momentary_breakpoint_from_master (struct breakpoint *= orig, struct breakpoint *copy; =20 copy =3D set_raw_breakpoint_without_location (orig->gdbarch, type, ops); - copy->loc =3D allocate_bp_location (copy); + copy->loc =3D copy->allocate_location (); set_breakpoint_location_function (copy->loc); =20 copy->loc->gdbarch =3D orig->loc->gdbarch; @@ -8165,7 +8155,7 @@ add_location_to_breakpoint (struct breakpoint *b, loc_gdbarch =3D b->gdbarch; =20 /* Adjust the breakpoint's address prior to allocating a location. - Once we call allocate_bp_location(), that mostly uninitialized + Once we call allocate_location(), that mostly uninitialized location will be placed on the location chain. Adjustment of the breakpoint may cause target_read_memory() to be called and we do not want its scan of the location chain to find a breakpoint and @@ -8174,7 +8164,7 @@ add_location_to_breakpoint (struct breakpoint *b, sal->pc, b->type); =20 /* Sort the locations by their ADDRESS. */ - loc =3D allocate_bp_location (b); + loc =3D b->allocate_location (); for (tmp =3D &(b->loc); *tmp !=3D NULL && (*tmp)->address <=3D adjusted_= address; tmp =3D &((*tmp)->next)) ;