From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1DDAA3858D39 for ; Wed, 19 Oct 2022 13:07:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1DDAA3858D39 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-189-SOUyHEGqM1e-jFMwBYN8Sg-1; Wed, 19 Oct 2022 09:07:18 -0400 X-MC-Unique: SOUyHEGqM1e-jFMwBYN8Sg-1 Received: by mail-qv1-f69.google.com with SMTP id dn14-20020a056214094e00b004b1a231394eso10646860qvb.13 for ; Wed, 19 Oct 2022 06:07:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hb8Kp21eL3Y1Wr/VWxkV2K3hnweuHdznBgQ4SdRJWuY=; b=5Zpb4yarU53ZhJs/TY/u6ONFgILdXbG455AFr1mzufhg7tmEp7VY3qoGSm9v5VoENu 96m4v3KHFahrGYCy1YZ0ov4g+YIDp5k8VQ2BIzCpMqQxQrISGLgqvb++Q6EgKwhQ2+2a 2hlVoeCYBohNtySQxe1W8gCXHTnGuNa3XEi5nPkbsCT4jSFHKqM8a0GEoTpDvdhETIBB dsMVj7HSWbl1dfD/B/lMc7A1ra6s0hcYQFrdP/Ttovwa4YFaBwyVdP+Hr3vOsoOs493R ppV7Chd8BHY0qn3pJYzYLzvVmPcaQZHMQxdGbW8j76j100x8jH7QgiBH+c+YmT/Bzp32 aNuA== X-Gm-Message-State: ACrzQf1x1sQZYdEdPJJQzLQAhlbl1MoNNXaqFfWmRdmUWhCjshEa3Il7 7WWmRx3YU9+iOSf9QqNd+tc24QyRm7Qh8XCgLKbNv7pjh4v5NOzjFSuBXbAAS6uqvS/j0rTPl7L sUjYB4Z6GlgM/vPS/RTFhMZCWzPZg1wrS+NHJFhF5Wcc4TVl/FB74Sexh2OkZVe8g/cF7Mh16AQ == X-Received: by 2002:ad4:5dc8:0:b0:4b3:cf2b:b169 with SMTP id m8-20020ad45dc8000000b004b3cf2bb169mr6464863qvh.114.1666184837777; Wed, 19 Oct 2022 06:07:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FzDx1B1cl9PNBh5BRdiqJ+5Go0zMYkBiJzMnJ9QnWcZlgwPB3q9SYVAQEEjjVbkmrwfqeyw== X-Received: by 2002:ad4:5dc8:0:b0:4b3:cf2b:b169 with SMTP id m8-20020ad45dc8000000b004b3cf2bb169mr6464823qvh.114.1666184837476; Wed, 19 Oct 2022 06:07:17 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id n6-20020a05620a294600b006cfc7f9eea0sm4902117qkp.122.2022.10.19.06.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 06:07:17 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCHv2 1/4] gdb: make some bp_location arguments const in breakpoint.c Date: Wed, 19 Oct 2022 14:07:07 +0100 Message-Id: <5562b126ab70b130659a6b972d1e1874a4bea768.1666184729.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 19 Oct 2022 13:07:21 -0000 I spotted a few places where I could make some 'bp_location *' arguments constant in breakpoint.c. There should be no user visible changes after this commit. --- gdb/breakpoint.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 91e13a03360..e80a46cb01e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -121,11 +121,11 @@ static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch, enum bptype bptype, struct program_space *pspace); -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); -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 = false); static int breakpoint_location_address_match (struct bp_location *bl, @@ -2641,7 +2641,7 @@ build_target_command_list (struct bp_location *bl) registers state. */ 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 == bp_single_step) { @@ -4227,7 +4227,7 @@ moribund_breakpoint_here_p (const address_space *aspace, CORE_ADDR pc) ASPACE. */ 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 @@ -5453,7 +5453,7 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread) on the current target. */ 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 == 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. */ 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; @@ -6946,8 +6946,8 @@ bl_address_is_meaningful (bp_location *loc) true if LOC1 and LOC2 represent the same watchpoint location. */ static int -watchpoint_locations_match (struct bp_location *loc1, - struct bp_location *loc2) +watchpoint_locations_match (const struct bp_location *loc1, + const struct bp_location *loc2) { struct watchpoint *w1 = (struct watchpoint *) loc1->owner; struct watchpoint *w2 = (struct watchpoint *) loc2->owner; @@ -7058,8 +7058,8 @@ breakpoint_location_address_range_overlap (struct bp_location *bl, true, otherwise returns false. */ 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', tracepoint @@ -7077,8 +7077,8 @@ tracepoint_locations_match (struct bp_location *loc1, otherwise they don't. */ 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; -- 2.25.4