From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 69DF2385042A; Thu, 20 Oct 2022 15:45:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69DF2385042A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666280742; bh=nVRH4/79W0vJ+0iVq1hi7lVjgBASNYJH7fkDE/iHBhc=; h=From:To:Subject:Date:From; b=jJ472pvHnFRP3oyq/s80IXpeJ2Hd7MgSxRL1vK7AaBEvyiBljQMtN0KrpJ/rTn31e eHJU8V2ZTTw2zix4gF6RRarTD+L1n3wSFSuMZUYxRD1KCbbqjcly+QJplyGDxH8Dwz t2Lhy8kT7kSwV7lqCzUOeJcjGD68jCWA4KTbVX+g= 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: make some bp_location arguments const in breakpoint.c X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 1c232ab030476db2037894600ef5eba9a6de5645 X-Git-Newrev: b2ff9ed3050491f72529beeea14859abda3afb4a Message-Id: <20221020154542.69DF2385042A@sourceware.org> Date: Thu, 20 Oct 2022 15:45:42 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db2ff9ed30504= 91f72529beeea14859abda3afb4a commit b2ff9ed3050491f72529beeea14859abda3afb4a Author: Andrew Burgess Date: Tue Oct 4 13:51:32 2022 +0100 gdb: make some bp_location arguments const in breakpoint.c =20 I spotted a few places where I could make some 'bp_location *' arguments constant in breakpoint.c. =20 There should be no user visible changes after this commit. =20 Approved-By: Simon Marchi Diff: --- gdb/breakpoint.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 0eace4f9f03..8c5c5f5569e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -121,11 +121,11 @@ static CORE_ADDR adjust_breakpoint_address (struct gd= barch *gdbarch, enum bptype bptype, struct program_space *pspace); =20 -static int watchpoint_locations_match (struct bp_location *loc1, - struct bp_location *loc2); +static int watchpoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2); =20 -static int breakpoint_locations_match (struct bp_location *loc1, - struct bp_location *loc2, +static int breakpoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2, bool sw_hw_bps_match =3D false); =20 static int breakpoint_location_address_match (struct bp_location *bl, @@ -2641,7 +2641,7 @@ build_target_command_list (struct bp_location *bl) registers state. */ =20 static int -breakpoint_kind (struct bp_location *bl, CORE_ADDR *addr) +breakpoint_kind (const struct bp_location *bl, CORE_ADDR *addr) { if (bl->owner->type =3D=3D bp_single_step) { @@ -4227,7 +4227,7 @@ moribund_breakpoint_here_p (const address_space *aspa= ce, CORE_ADDR pc) ASPACE. */ =20 static int -bp_location_inserted_here_p (struct bp_location *bl, +bp_location_inserted_here_p (const struct bp_location *bl, const address_space *aspace, CORE_ADDR pc) { if (bl->inserted @@ -5452,7 +5452,7 @@ bpstat_check_breakpoint_conditions (bpstat *bs, threa= d_info *thread) on the current target. */ =20 static int -need_moribund_for_location_type (struct bp_location *loc) +need_moribund_for_location_type (const struct bp_location *loc) { return ((loc->loc_type =3D=3D bp_loc_software_breakpoint && !target_supports_stopped_by_sw_breakpoint ()) @@ -5987,7 +5987,7 @@ bp_condition_evaluator (const breakpoint *b) similar to bp_condition_evaluator, but for locations. */ =20 static const char * -bp_location_condition_evaluator (struct bp_location *bl) +bp_location_condition_evaluator (const struct bp_location *bl) { if (bl && !is_breakpoint (bl->owner)) return NULL; @@ -6945,8 +6945,8 @@ bl_address_is_meaningful (bp_location *loc) true if LOC1 and LOC2 represent the same watchpoint location. */ =20 static int -watchpoint_locations_match (struct bp_location *loc1,=20 - struct bp_location *loc2) +watchpoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2) { struct watchpoint *w1 =3D (struct watchpoint *) loc1->owner; struct watchpoint *w2 =3D (struct watchpoint *) loc2->owner; @@ -7057,8 +7057,8 @@ breakpoint_location_address_range_overlap (struct bp_= location *bl, true, otherwise returns false. */ =20 static int -tracepoint_locations_match (struct bp_location *loc1, - struct bp_location *loc2) +tracepoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2) { if (is_tracepoint (loc1->owner) && is_tracepoint (loc2->owner)) /* Since tracepoint locations are never duplicated with others', trace= point @@ -7076,8 +7076,8 @@ tracepoint_locations_match (struct bp_location *loc1, otherwise they don't. */ =20 static int -breakpoint_locations_match (struct bp_location *loc1, - struct bp_location *loc2, +breakpoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2, bool sw_hw_bps_match) { int hw_point1, hw_point2;