From patchwork Wed Oct 5 09:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 58378 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA8713857005 for ; Wed, 5 Oct 2022 09:34:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA8713857005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664962446; bh=W/sMV71BkO4sXhc1glgR4sYueQsAc/fUyHc+J6qjh2g=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Qy3A2FVEjOAZO1X5A3n5T24TGoT4cDj0I1m4vxdmDHgVJSJ9wj7M500rTeRhWuv0L SLYUIbEPTdrMTqNR1ZB5z3bxIwSDa2+0XN19wCJLdf3XBLq52LiB0dMnQDLMw1Ngh1 ifXeqxiJwd7Hxul7nDE0QHYc4PMO5pjswLsP/Ln0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8FB5B385782F for ; Wed, 5 Oct 2022 09:33:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FB5B385782F Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-260-QA4rkkjOPS6p-fHLiqdfqA-1; Wed, 05 Oct 2022 05:32:58 -0400 X-MC-Unique: QA4rkkjOPS6p-fHLiqdfqA-1 Received: by mail-wm1-f72.google.com with SMTP id c2-20020a1c3502000000b003b535aacc0bso712076wma.2 for ; Wed, 05 Oct 2022 02:32:57 -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=W/sMV71BkO4sXhc1glgR4sYueQsAc/fUyHc+J6qjh2g=; b=Q6AOFmWYmYAkPEg41hB+srdoV1w6OFvr5oVXxXZOjQtsN8ZlReX3+fYQHJfJMgwHaP 37R6bD9e34F8wdu33FuS4sqskAV44wh8C9eHDOIjL3O21VJFI6Y6hUdQkDTS5jViZFNc iZT8VlmyP2184ra2s1bSJiKunPTTrifyEQpB45FU3IQohXeUzjzDhripZBQeTnyWgg5s NV1tSAkLF+JXWpkeJtybLI92J6dsjOo7gsE99Ko0PR660l5tQBfky0CFFiaby4iSnjXc ohrpxYR3WPUzOxnXWO5SpLPMpou6n0tqbXpEDAvJXfKqokP7oS7v9bt+L8SWS4xOLN2B WerA== X-Gm-Message-State: ACrzQf1wVJbP2w86lbCpe6D7v3eDIuACGaD0Vm91JkG8VOOqPyD3/qO0 lWuG9AjJHlSBm70PnIG7Ka6jEjKdbaByTciXlG0h7nsmnJT54+AS8lZBd2FaWcyvoTNjK7uyZA/ J2ylspCIg1f8EOgDgFGbR0x4YwGWtmxedE5dFZDD9Lo3LNoa9zs+4Q1kq8U+NviTY50xAG4jhpg == X-Received: by 2002:adf:e641:0:b0:22c:fb86:4d9f with SMTP id b1-20020adfe641000000b0022cfb864d9fmr15331269wrn.348.1664962376703; Wed, 05 Oct 2022 02:32:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ktQei6hbn79H+2uEja2+eRr358n9oMpXG17TIDd6AZkWxiLRn65amCSHnW2mcxuANA3pQ+g== X-Received: by 2002:adf:e641:0:b0:22c:fb86:4d9f with SMTP id b1-20020adfe641000000b0022cfb864d9fmr15331251wrn.348.1664962376463; Wed, 05 Oct 2022 02:32:56 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id bi26-20020a05600c3d9a00b003b476cabf1csm1378728wmb.26.2022.10.05.02.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 02:32:55 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 1/4] gdb: make some bp_location arguments const in breakpoint.c Date: Wed, 5 Oct 2022 10:32:49 +0100 Message-Id: <0c8a73fc82f77704a4a065b0b251911aebae1322.1664962269.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 X-Spam-Status: No, score=-11.9 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, 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-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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. Reviewed-By: Bruno Larsen --- 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) {