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 2AED93858C83 for ; Tue, 18 Oct 2022 13:46:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AED93858C83 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-657-yJefWy0ZPdGbwJiuZqZOgg-1; Tue, 18 Oct 2022 09:46:41 -0400 X-MC-Unique: yJefWy0ZPdGbwJiuZqZOgg-1 Received: by mail-qv1-f69.google.com with SMTP id y14-20020a0cf14e000000b004afb3c6984bso8796947qvl.21 for ; Tue, 18 Oct 2022 06:46:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rzmG5KfjwBspHgFl5oTZeoqX7RQf3e2pDiEfdH/n20g=; b=xti3x1BDW6mn5PZoN+ym20kuOt8rnDzltwqeN9QBUs6XvQw3rRvpBONTc67k8y000q d/6OiARdiprVzgBkTdIY075MWweVWdct3kEo1hvV35uNtgiEAWH/yzn4ld9zUV2BUHBo p9DwdFgaskaskpQCBgqzczPtE5LW6I2ImvMz4xge3NIvhAse7LLOrm2kFwG/1RtLsMTp ZvEtiuOHgajIWvcT3JrgSJpf417kWqS8fl3A3rr5XE2LjoMqnjWdOBdlv2pW7OyxYwpq SXcHDOAktOX2avH1cJhVaO74PwSTIStfteMUwiwwzFqaUpaobyMD9rUvCwWekyvuv2UB HK9Q== X-Gm-Message-State: ACrzQf2XLvKJvqURkKuPHZIqkRxw1DV998o4hqrhqLIhaJ1hUU+6EtPY W2kR+84oMzc0g3/E61inCQdtyuJIA5XoNvrDS3NgQWtEdB/WAxbvO4bfjUVUhDtBSbI9l76myKC Kp+fceWhgB7VHypBx+Qt7cA== X-Received: by 2002:a05:6214:2461:b0:4b1:d15a:ce88 with SMTP id im1-20020a056214246100b004b1d15ace88mr2394038qvb.44.1666100800545; Tue, 18 Oct 2022 06:46:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6158x+/fLBqpXbXC7S/RS7KO2rdQwfwHAMrXMsx71FMWJ+eJoLPIrOToKuHrX6c/bPIEt6/A== X-Received: by 2002:a05:6214:2461:b0:4b1:d15a:ce88 with SMTP id im1-20020a056214246100b004b1d15ace88mr2394025qvb.44.1666100800308; Tue, 18 Oct 2022 06:46:40 -0700 (PDT) Received: from [192.168.0.45] (ip-62-245-66-121.bb.vodafone.cz. [62.245.66.121]) by smtp.gmail.com with ESMTPSA id u10-20020ac8750a000000b0039764587192sm1920181qtq.57.2022.10.18.06.46.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 06:46:39 -0700 (PDT) Message-ID: <3ad897fd-e0f1-d916-c902-f74c891321d9@redhat.com> Date: Tue, 18 Oct 2022 15:46:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 1/4] gdb: make some bp_location arguments const in breakpoint.c To: Andrew Burgess , gdb-patches@sourceware.org References: <0c8a73fc82f77704a4a065b0b251911aebae1322.1664962269.git.aburgess@redhat.com> From: Bruno Larsen In-Reply-To: <0c8a73fc82f77704a4a065b0b251911aebae1322.1664962269.git.aburgess@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, 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: Tue, 18 Oct 2022 13:46:50 -0000 On 05/10/2022 11:32, Andrew Burgess via Gdb-patches wrote: > 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. Hi Andrew, This patch no longer applies, because of commit d8a77e4c8043c645c3c7a07a042c112053715e95, which already made the change to find_loc_num_by_location. Other than this, this patch looks ok to me. Reviewed-By: Bruno Larsen Cheers, Bruno > --- > gdb/breakpoint.c | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 002f4a935b1..6e1a15e4f1b 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -125,11 +125,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, > @@ -2643,7 +2643,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) > { > @@ -4229,7 +4229,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 > @@ -5440,7 +5440,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 ()) > @@ -5974,7 +5974,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; > @@ -6933,8 +6933,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; > @@ -7045,8 +7045,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 > @@ -7064,8 +7064,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; > @@ -13157,7 +13157,7 @@ enable_disable_bp_num_loc (int bp_num, int loc_num, bool enable) > owner. 1-based indexing. -1 signals NOT FOUND. */ > > static int > -find_loc_num_by_location (bp_location *loc) > +find_loc_num_by_location (const bp_location *loc) > { > if (loc != nullptr && loc->owner != nullptr) > {