summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2015-07-17 14:32:40 +0100
committerYao Qi <yao.qi@linaro.org>2015-07-17 14:32:40 +0100
commit2ecd81c23cd070cb66073f726bddf2a7083bdaf1 (patch)
tree776eacefcbb521d43c6363ce732a12ffd6ac1014
parente53b69389a7d743fe888926475d46167e91b1157 (diff)
downloadbinutils-gdb-2ecd81c23cd070cb66073f726bddf2a7083bdaf1.tar.gz
int -> enum target_hw_bp_type in aarch64-linux-nat.c
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-17 Yao Qi <yao.qi@linaro.org> * 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.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/aarch64-linux-nat.c17
2 files changed, 20 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6bf9d40965e..6f068b5e3c7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2015-07-17 Yao Qi <yao.qi@linaro.org>
+ * 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.
+
+2015-07-17 Yao Qi <yao.qi@linaro.org>
+
* aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Call
ptid_get_pid instead of get_thread_id.
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 628ffe893d2..5b20f803abd 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -1163,7 +1163,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;
@@ -1235,7 +1236,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;
@@ -1290,7 +1292,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;
@@ -1318,7 +1321,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
@@ -1351,7 +1354,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
@@ -1376,8 +1379,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));