public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
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	[thread overview]
Message-ID: <1436282578-8070-2-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1436282578-8070-1-git-send-email-yao.qi@linaro.org>

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  <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.
---
 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

  parent reply	other threads:[~2015-07-07 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 15:23 [PATCH 0/4] Move common aarch64 HW breakpoint/watchpoint code to nat/ Yao Qi
2015-07-07 15:23 ` [PATCH 2/4] Use debug_printf to print debug message Yao Qi
2015-07-14 14:02   ` Gary Benson
2015-07-07 15:23 ` Yao Qi [this message]
2015-07-07 15:23 ` [PATCH 3/4] Pass aarch64_debug_reg_state to functions Yao Qi
2015-07-07 15:23 ` [PATCH 4/4] Move common aarch64 HW breakpoint/watchpoint code to nat/ Yao Qi
2015-07-14 14:05 ` [PATCH 0/4] " Gary Benson
2015-07-17 13:36   ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436282578-8070-2-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).