From patchwork Mon Oct 23 13:33:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 23762 Received: (qmail 5231 invoked by alias); 23 Oct 2017 13:33:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5200 invoked by uid 89); 23 Oct 2017 13:33:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=watched, 126017, H*r:sk:static. X-HELO: mail-wr0-f193.google.com Received: from mail-wr0-f193.google.com (HELO mail-wr0-f193.google.com) (209.85.128.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 13:33:36 +0000 Received: by mail-wr0-f193.google.com with SMTP id g90so17383885wrd.6 for ; Mon, 23 Oct 2017 06:33:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=MPPKX+opA1c+AtErCk2DlJarpU2+LQyx29PB8g9pqho=; b=iXw1/bhhbsENmSZaPWgdISlx4s1LwrPTtFt/wUVvx6lgK6WXrbppCTFr8Gy1yIJ/K4 bU5O/YTLIuMPGh72GOeav/xU2O4K/sKeDoawBaiMOaYzVHjOpAwLqi6ooETsF3rf319/ C2dZgXIonmBG582CIsssQpzuTCy9s7Jz329jrQ8AnDhD0no8euM0oXVedIs1wPP9UP8T ELmOjDSZ91PEpk7++ToR2rsRp6gONrcQr4mk0Uu210cZWW9lT78504gH2ZOa1qFasnO2 oyH37UnfpogtZ5AB2SVOeCEUeKm5Gi5sc3om7urxt0FvQ8aOQm2If8j20DlzcOy5J1qe 3xcA== X-Gm-Message-State: AMCzsaV6o9tHZGD0D/jMxRmR43g8991luah8hqWs6FVJIWlwZhYIGa5x Dyf8COBmtgRSictv89UJNXLDsA== X-Google-Smtp-Source: ABhQp+S3d6PZtmQ/+w8I2cwBCu07e70+TvSGIqWD89dqrWB9H5dM3wxdCd+45GhkqNY66IJMlohnsA== X-Received: by 10.223.142.97 with SMTP id n88mr3612355wrb.244.1508765614362; Mon, 23 Oct 2017 06:33:34 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id h185sm11100828wma.19.2017.10.23.06.33.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Oct 2017 06:33:33 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 2/2] const-fy breakpoint_ops->breakpoint_hit parameter aspace Date: Mon, 23 Oct 2017 14:33:29 +0100 Message-Id: <1508765609-31149-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1508765609-31149-1-git-send-email-yao.qi@linaro.org> References: <1508765609-31149-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes gdb: 2017-10-23 Yao Qi * break-catch-sig.c (signal_catchpoint_breakpoint_hit): Make aspace const. * break-catch-syscall.c (breakpoint_hit_catch_syscall): Likewise. * breakpoint.c (bpstat_check_location): Remove cast. (breakpoint_hit_catch_fork): Make aspce const. (breakpoint_hit_catch_solib): Likewise. (breakpoint_hit_catch_exec): Likewise. (breakpoint_hit_ranged_breakpoint): Likewise. (breakpoint_hit_watchpoint): Likewise. (base_breakpoint_breakpoint_hit): Likewise. (bkpt_breakpoint_hit): Likewise. (dprintf_breakpoint_hit): Likewise. (tracepoint_breakpoint_hit): Likewise. * breakpoint.h (breakpoint_ops) : Likewise. --- gdb/break-catch-sig.c | 2 +- gdb/break-catch-syscall.c | 2 +- gdb/breakpoint.c | 23 +++++++++++------------ gdb/breakpoint.h | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c index 5bc3aed..5ab7cd3 100644 --- a/gdb/break-catch-sig.c +++ b/gdb/break-catch-sig.c @@ -145,7 +145,7 @@ signal_catchpoint_remove_location (struct bp_location *bl, static int signal_catchpoint_breakpoint_hit (const struct bp_location *bl, - struct address_space *aspace, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index 82d3e36..b0ed4d2 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -157,7 +157,7 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason) static int breakpoint_hit_catch_syscall (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { /* We must check if we are catching specific syscalls in this diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fb9ceaf..7ccf542 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5072,8 +5072,7 @@ bpstat_check_location (const struct bp_location *bl, /* BL is from an existing breakpoint. */ gdb_assert (b != NULL); - return b->ops->breakpoint_hit (bl, const_cast (aspace), - bp_addr, ws); + return b->ops->breakpoint_hit (bl, aspace, bp_addr, ws); } /* Determine if the watched values have actually changed, and we @@ -7828,7 +7827,7 @@ remove_catch_fork (struct bp_location *bl, enum remove_bp_reason reason) static int breakpoint_hit_catch_fork (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner; @@ -7944,7 +7943,7 @@ remove_catch_vfork (struct bp_location *bl, enum remove_bp_reason reason) static int breakpoint_hit_catch_vfork (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner; @@ -8072,7 +8071,7 @@ remove_catch_solib (struct bp_location *ignore, enum remove_bp_reason reason) static int breakpoint_hit_catch_solib (const struct bp_location *bl, - struct address_space *aspace, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { @@ -8378,7 +8377,7 @@ remove_catch_exec (struct bp_location *bl, enum remove_bp_reason reason) static int breakpoint_hit_catch_exec (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { struct exec_catchpoint *c = (struct exec_catchpoint *) bl->owner; @@ -9796,7 +9795,7 @@ agent_printf_command (char *arg, int from_tty) static int breakpoint_hit_ranged_breakpoint (const struct bp_location *bl, - struct address_space *aspace, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { @@ -10257,7 +10256,7 @@ remove_watchpoint (struct bp_location *bl, enum remove_bp_reason reason) static int breakpoint_hit_watchpoint (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { struct breakpoint *b = bl->owner; @@ -12434,7 +12433,7 @@ base_breakpoint_remove_location (struct bp_location *bl, static int base_breakpoint_breakpoint_hit (const struct bp_location *bl, - struct address_space *aspace, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { @@ -12602,7 +12601,7 @@ bkpt_remove_location (struct bp_location *bl, enum remove_bp_reason reason) static int bkpt_breakpoint_hit (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { if (ws->kind != TARGET_WAITKIND_STOPPED @@ -12623,7 +12622,7 @@ bkpt_breakpoint_hit (const struct bp_location *bl, static int dprintf_breakpoint_hit (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { if (dprintf_style == dprintf_style_agent @@ -12983,7 +12982,7 @@ tracepoint_re_set (struct breakpoint *b) static int tracepoint_breakpoint_hit (const struct bp_location *bl, - struct address_space *aspace, CORE_ADDR bp_addr, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws) { /* By definition, the inferior does not report stops at diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index c4e55ea..63e879c 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -540,7 +540,7 @@ struct breakpoint_ops which the inferior stopped, and WS is the target_waitstatus describing the event. */ int (*breakpoint_hit) (const struct bp_location *bl, - struct address_space *aspace, + const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws);