From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24387 invoked by alias); 7 Jul 2015 15:23:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24297 invoked by uid 89); 7 Jul 2015 15:23:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Jul 2015 15:23:05 +0000 Received: by pacws9 with SMTP id ws9so116291666pac.0 for ; Tue, 07 Jul 2015 08:23:03 -0700 (PDT) X-Received: by 10.70.17.66 with SMTP id m2mr10054045pdd.49.1436282583558; Tue, 07 Jul 2015 08:23:03 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id hl6sm15661493pdb.28.2015.07.07.08.23.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 08:23:02 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/4] int -> enum target_hw_bp_type in aarch64-linux-nat.c Date: Tue, 07 Jul 2015 15:23:00 -0000 Message-Id: <1436282578-8070-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1436282578-8070-1-git-send-email-yao.qi@linaro.org> References: <1436282578-8070-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00174.txt.bz2 This patch is to use 'enum target_hw_bp_type' instead of int for breakpoint type, in order to make some functions in GDB and GDBserver looks similar. gdb: 2015-07-06 Yao Qi * aarch64-linux-nat.c (aarch64_dr_state_insert_one_point): Change argument type's type to 'enum target_hw_bp_type'. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_linux_insert_hw_breakpoint): Likewise. (aarch64_linux_remove_hw_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise. --- gdb/aarch64-linux-nat.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 9959b81..94093fc 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -1036,7 +1036,8 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) static int aarch64_dr_state_insert_one_point (struct aarch64_debug_reg_state *state, - int type, CORE_ADDR addr, int len) + enum target_hw_bp_type type, CORE_ADDR addr, + int len) { int i, idx, num_regs, is_watchpoint; unsigned int ctrl, *dr_ctrl_p, *dr_ref_count; @@ -1108,7 +1109,8 @@ aarch64_dr_state_insert_one_point (struct aarch64_debug_reg_state *state, static int aarch64_dr_state_remove_one_point (struct aarch64_debug_reg_state *state, - int type, CORE_ADDR addr, int len) + enum target_hw_bp_type type, CORE_ADDR addr, + int len) { int i, num_regs, is_watchpoint; unsigned int ctrl, *dr_ctrl_p, *dr_ref_count; @@ -1163,7 +1165,8 @@ aarch64_dr_state_remove_one_point (struct aarch64_debug_reg_state *state, /* Implement insertion and removal of a single breakpoint. */ static int -aarch64_handle_breakpoint (int type, CORE_ADDR addr, int len, int is_insert) +aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, + int len, int is_insert) { struct aarch64_debug_reg_state *state; @@ -1191,7 +1194,7 @@ aarch64_linux_insert_hw_breakpoint (struct target_ops *self, int ret; CORE_ADDR addr = bp_tgt->placed_address = bp_tgt->reqstd_address; const int len = 4; - const int type = hw_execute; + const enum target_hw_bp_type type = hw_execute; if (show_debug_regs) fprintf_unfiltered @@ -1224,7 +1227,7 @@ aarch64_linux_remove_hw_breakpoint (struct target_ops *self, int ret; CORE_ADDR addr = bp_tgt->placed_address; const int len = 4; - const int type = hw_execute; + const enum target_hw_bp_type type = hw_execute; if (show_debug_regs) fprintf_unfiltered @@ -1249,8 +1252,8 @@ aarch64_linux_remove_hw_breakpoint (struct target_ops *self, from that it is an aligned watchpoint to be handled. */ static int -aarch64_handle_aligned_watchpoint (int type, CORE_ADDR addr, int len, - int is_insert) +aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, + int len, int is_insert) { struct aarch64_debug_reg_state *state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); -- 1.9.1