Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 09/13] Rename placed_size to kind
Date: Wed, 31 Aug 2016 15:06:00 -0000	[thread overview]
Message-ID: <1472655965-12212-10-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1472655965-12212-1-git-send-email-yao.qi@linaro.org>

This patch renames placed_size to kind.

gdb:

2016-08-30  Yao Qi  <yao.qi@linaro.org>

	* breakpoint.h (struct bp_target_info) <placed_size>: Remove.
	<kind>: New field.
	Update all users.
---
 gdb/breakpoint.c |  4 ++--
 gdb/breakpoint.h | 10 +++-------
 gdb/mem-break.c  |  4 ++--
 gdb/remote.c     |  8 ++++----
 4 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f00c6c3..cc672f7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -2769,7 +2769,7 @@ insert_bp_location (struct bp_location *bl,
 		    {
 		      int val;
 
-		      bl->overlay_target_info.placed_size
+		      bl->overlay_target_info.kind
 			= breakpoint_kind (bl, &addr);
 		      bl->overlay_target_info.placed_address = addr;
 		      val = target_insert_breakpoint (bl->gdbarch,
@@ -13129,7 +13129,7 @@ bkpt_insert_location (struct bp_location *bl)
 {
   CORE_ADDR addr = bl->target_info.reqstd_address;
 
-  bl->target_info.placed_size = breakpoint_kind (bl, &addr);
+  bl->target_info.kind = breakpoint_kind (bl, &addr);
   bl->target_info.placed_address = addr;
 
   if (bl->loc_type == bp_loc_hardware_breakpoint)
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 4bdf0d5..95b5731 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -260,13 +260,9 @@ struct bp_target_info
   /* The length of the data cached in SHADOW_CONTENTS.  */
   int shadow_len;
 
-  /* The size of the placed breakpoint, according to
-     gdbarch_breakpoint_from_pc, when the breakpoint was inserted.
-     This is generally the same as SHADOW_LEN, unless we did not need
-     to read from the target to implement the memory breakpoint
-     (e.g. if a remote stub handled the details).  We may still need
-     the size to remove the breakpoint safely.  */
-  int placed_size;
+  /* The breakpoint's kind.  It is used in 'kind' parameter in Z
+     packets.  */
+  int kind;
 
   /* Vector of conditions the target should evaluate if it supports target-side
      breakpoint conditions.  */
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index dafe834..50f7d9c 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -44,7 +44,7 @@ default_memory_insert_breakpoint (struct gdbarch *gdbarch,
   int val;
 
   /* Determine appropriate breakpoint contents and size for this address.  */
-  bp = gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->placed_size, &bplen);
+  bp = gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->kind, &bplen);
 
   /* Save the memory contents in the shadow_contents buffer and then
      write the breakpoint instruction.  */
@@ -76,7 +76,7 @@ default_memory_remove_breakpoint (struct gdbarch *gdbarch,
 {
   int bplen;
 
-  gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->placed_size, &bplen);
+  gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->kind, &bplen);
 
   return target_write_raw_memory (bp_tgt->placed_address, bp_tgt->shadow_contents,
 				  bplen);
diff --git a/gdb/remote.c b/gdb/remote.c
index 9eb1d4b..9c85608 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9297,7 +9297,7 @@ remote_insert_breakpoint (struct target_ops *ops,
       *(p++) = ',';
       addr = (ULONGEST) remote_address_masked (addr);
       p += hexnumstr (p, addr);
-      xsnprintf (p, endbuf - p, ",%d", bp_tgt->placed_size);
+      xsnprintf (p, endbuf - p, ",%d", bp_tgt->kind);
 
       if (remote_supports_cond_breakpoints (ops))
 	remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf);
@@ -9353,7 +9353,7 @@ remote_remove_breakpoint (struct target_ops *ops,
 
       addr = (ULONGEST) remote_address_masked (bp_tgt->placed_address);
       p += hexnumstr (p, addr);
-      xsnprintf (p, endbuf - p, ",%d", bp_tgt->placed_size);
+      xsnprintf (p, endbuf - p, ",%d", bp_tgt->kind);
 
       putpkt (rs->buf);
       getpkt (&rs->buf, &rs->buf_size, 0);
@@ -9608,7 +9608,7 @@ remote_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
 
   addr = remote_address_masked (addr);
   p += hexnumstr (p, (ULONGEST) addr);
-  xsnprintf (p, endbuf - p, ",%x", bp_tgt->placed_size);
+  xsnprintf (p, endbuf - p, ",%x", bp_tgt->kind);
 
   if (remote_supports_cond_breakpoints (self))
     remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf);
@@ -9662,7 +9662,7 @@ remote_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
 
   addr = remote_address_masked (bp_tgt->placed_address);
   p += hexnumstr (p, (ULONGEST) addr);
-  xsnprintf (p, endbuf  - p, ",%x", bp_tgt->placed_size);
+  xsnprintf (p, endbuf  - p, ",%x", bp_tgt->kind);
 
   putpkt (rs->buf);
   getpkt (&rs->buf, &rs->buf_size, 0);
-- 
1.9.1


  parent reply	other threads:[~2016-08-31 15:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 15:06 [PATCH 00/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-08-31 15:06 ` [PATCH 02/13] Rename 'arch' by 'gdbarch' in m32c_gdbarch_init Yao Qi
2016-08-31 15:06 ` [PATCH 06/13] Add enum for mips breakpoint kinds Yao Qi
2016-10-27 14:54   ` Pedro Alves
2016-10-28 19:39     ` Maciej W. Rozycki
2016-08-31 15:06 ` [PATCH 05/13] Share enum arm_breakpoint_kinds Yao Qi
2016-08-31 15:06 ` [PATCH 08/13] New gdbarch methods breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-08-31 15:06 ` [PATCH 03/13] gdbarch_breakpoint_from_pc doesn't return NULL Yao Qi
2016-09-28 15:23   ` Michael Eager
2016-08-31 15:06 ` [PATCH 11/13] Add default_breakpoint_from_pc Yao Qi
2016-08-31 15:06 ` [PATCH 13/13] Remove arm_override_mode Yao Qi
2016-10-27 14:56   ` Pedro Alves
2016-08-31 15:06 ` [PATCH 07/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-10-10 10:05   ` Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-10-28 19:44     ` Maciej W. Rozycki
2016-08-31 15:06 ` [PATCH 01/13] Remove v850_dbtrap_breakpoint_from_pc Yao Qi
2016-08-31 15:06 ` [PATCH 12/13] Determine the kind of single step breakpoint Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-08-31 15:06 ` Yao Qi [this message]
2016-08-31 15:06 ` [PATCH 04/13] GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION Yao Qi
2016-08-31 15:06 ` [PATCH 10/13] Remove gdbarch_remote_breakpoint_from_pc Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-10-10 10:17 ` [PATCH 00/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-10-26 15:43   ` Yao Qi
2016-10-27 14:58     ` Pedro Alves
2016-10-27 15:41       ` Yao Qi
2016-10-27 17:55         ` Pedro Alves

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=1472655965-12212-10-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