Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 01/15] Whitespace changes
Date: Tue, 17 Jun 2014 14:13:00 -0000	[thread overview]
Message-ID: <1403014378-4349-2-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1403014378-4349-1-git-send-email-gbenson@redhat.com>

This commit fixes various whitespace differences between i386-nat.c
and i386-low.c.

gdb/
2014-06-17  Gary Benson  <gbenson@redhat.com>

	* i386-nat.c: Whitespace changes.

gdb/gdbserver/
2014-06-17  Gary Benson  <gbenson@redhat.com>

	* i386-low.c: Whitespace changes.
---
 gdb/ChangeLog            |    4 ++++
 gdb/gdbserver/ChangeLog  |    4 ++++
 gdb/gdbserver/i386-low.c |   16 ++++++++++------
 gdb/i386-nat.c           |   46 +++++++++++++++++++++++++++-------------------
 4 files changed, 45 insertions(+), 25 deletions(-)

diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c
index de2d11a..304d6f3 100644
--- a/gdb/gdbserver/i386-low.c
+++ b/gdb/gdbserver/i386-low.c
@@ -115,7 +115,7 @@
   } while (0)
 
 /* Set in DR7 the RW and LEN fields for the I'th debug register.  */
-#define I386_DR_SET_RW_LEN(state, i,rwlen) \
+#define I386_DR_SET_RW_LEN(state, i, rwlen) \
   do { \
     (state)->dr_control_mirror &= \
       ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \
@@ -136,7 +136,7 @@
 
 /* Types of operations supported by i386_handle_nonaligned_watchpoint.  */
 typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t;
-\f
+
 /* Implementation.  */
 
 /* Clear the reference counts and forget everything we knew about the
@@ -446,14 +446,16 @@ i386_low_insert_watchpoint (struct i386_debug_reg_state *state,
        && !(TARGET_HAS_DR_LEN_8 && len == 8))
       || addr % len != 0)
     {
-      retval = i386_handle_nonaligned_watchpoint (&local_state, WP_INSERT,
+      retval = i386_handle_nonaligned_watchpoint (&local_state,
+						  WP_INSERT,
 						  addr, len, type);
     }
   else
     {
       unsigned len_rw = i386_length_and_rw_bits (len, type);
 
-      retval = i386_insert_aligned_watchpoint (&local_state, addr, len_rw);
+      retval = i386_insert_aligned_watchpoint (&local_state,
+					       addr, len_rw);
     }
 
   if (retval == 0)
@@ -483,14 +485,16 @@ i386_low_remove_watchpoint (struct i386_debug_reg_state *state,
        && !(TARGET_HAS_DR_LEN_8 && len == 8))
       || addr % len != 0)
     {
-      retval = i386_handle_nonaligned_watchpoint (&local_state, WP_REMOVE,
+      retval = i386_handle_nonaligned_watchpoint (&local_state,
+						  WP_REMOVE,
 						  addr, len, type);
     }
   else
     {
       unsigned len_rw = i386_length_and_rw_bits (len, type);
 
-      retval = i386_remove_aligned_watchpoint (&local_state, addr, len_rw);
+      retval = i386_remove_aligned_watchpoint (&local_state,
+					       addr, len_rw);
     }
 
   if (retval == 0)
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index 2f80a6e..a56a116 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -39,7 +39,6 @@
 
 struct i386_dr_low_type i386_dr_low;
 
-
 /* Support for 8-byte wide hw watchpoints.  */
 #define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8)
 
@@ -90,7 +89,7 @@ struct i386_dr_low_type i386_dr_low;
    later processors do that automatically.  We set these flags for
    backwards compatibility.  */
 #define DR_LOCAL_SLOWDOWN	(0x100)
-#define DR_GLOBAL_SLOWDOWN     	(0x200)
+#define DR_GLOBAL_SLOWDOWN	(0x200)
 
 /* Fields reserved by Intel.  This includes the GD (General Detect
    Enable) flag, which causes a debug exception to be generated when a
@@ -106,7 +105,7 @@ struct i386_dr_low_type i386_dr_low;
 
 /* The I'th debug register is vacant if its Local and Global Enable
    bits are reset in the Debug Control register.  */
-#define I386_DR_VACANT(state, i)					\
+#define I386_DR_VACANT(state, i) \
   (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0)
 
 /* Locally enable the break/watchpoint in the I'th debug register.  */
@@ -322,7 +321,7 @@ i386_show_dr (struct i386_debug_reg_state *state,
     printf_unfiltered (" (addr=%lx, len=%d, type=%s)",
 		       /* This code is for ia32, so casting CORE_ADDR
 			  to unsigned long should be okay.  */
-		       (unsigned long)addr, len,
+		       (unsigned long) addr, len,
 		       type == hw_write ? "data-write"
 		       : (type == hw_read ? "data-read"
 			  : (type == hw_access ? "data-read/write"
@@ -335,14 +334,14 @@ i386_show_dr (struct i386_debug_reg_state *state,
   printf_unfiltered ("\tCONTROL (DR7): %s          STATUS (DR6): %s\n",
 		     phex (state->dr_control_mirror, 8),
 		     phex (state->dr_status_mirror, 8));
-  ALL_DEBUG_REGISTERS(i)
+  ALL_DEBUG_REGISTERS (i)
     {
       printf_unfiltered ("\
 \tDR%d: addr=0x%s, ref.count=%d  DR%d: addr=0x%s, ref.count=%d\n",
 			 i, phex (state->dr_mirror[i], addr_size),
 			 state->dr_ref_count[i],
 			 i + 1, phex (state->dr_mirror[i + 1], addr_size),
-			 state->dr_ref_count[i+1]);
+			 state->dr_ref_count[i + 1]);
       i++;
     }
 }
@@ -419,7 +418,7 @@ i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
   /* First, look for an occupied debug register with the same address
      and the same RW and LEN definitions.  If we find one, we can
      reuse it for this watchpoint as well (and save a register).  */
-  ALL_DEBUG_REGISTERS(i)
+  ALL_DEBUG_REGISTERS (i)
     {
       if (!I386_DR_VACANT (state, i)
 	  && state->dr_mirror[i] == addr
@@ -431,7 +430,7 @@ i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state,
     }
 
   /* Next, look for a vacant debug register.  */
-  ALL_DEBUG_REGISTERS(i)
+  ALL_DEBUG_REGISTERS (i)
     {
       if (I386_DR_VACANT (state, i))
 	break;
@@ -473,7 +472,7 @@ i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state,
 {
   int i, retval = -1;
 
-  ALL_DEBUG_REGISTERS(i)
+  ALL_DEBUG_REGISTERS (i)
     {
       if (!I386_DR_VACANT (state, i)
 	  && state->dr_mirror[i] == addr
@@ -548,7 +547,7 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state,
 	  else
 	    internal_error (__FILE__, __LINE__, _("\
 Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"),
-			    (int)what);
+			    (int) what);
 	  if (retval)
 	    break;
 	}
@@ -603,10 +602,14 @@ i386_insert_watchpoint (struct target_ops *self,
   if (type == hw_read)
     return 1; /* unsupported */
 
-  if (((len != 1 && len !=2 && len !=4) && !(TARGET_HAS_DR_LEN_8 && len == 8))
+  if (((len != 1 && len != 2 && len != 4)
+       && !(TARGET_HAS_DR_LEN_8 && len == 8))
       || addr % len != 0)
-    retval = i386_handle_nonaligned_watchpoint (&local_state,
-						WP_INSERT, addr, len, type);
+    {
+      retval = i386_handle_nonaligned_watchpoint (&local_state,
+						  WP_INSERT,
+						  addr, len, type);
+    }
   else
     {
       unsigned len_rw = i386_length_and_rw_bits (len, type);
@@ -639,10 +642,14 @@ i386_remove_watchpoint (struct target_ops *self,
      commit the change back to the inferior.  */
   struct i386_debug_reg_state local_state = *state;
 
-  if (((len != 1 && len !=2 && len !=4) && !(TARGET_HAS_DR_LEN_8 && len == 8))
+  if (((len != 1 && len != 2 && len != 4)
+       && !(TARGET_HAS_DR_LEN_8 && len == 8))
       || addr % len != 0)
-    retval = i386_handle_nonaligned_watchpoint (&local_state,
-						WP_REMOVE, addr, len, type);
+    {
+      retval = i386_handle_nonaligned_watchpoint (&local_state,
+						  WP_REMOVE,
+						  addr, len, type);
+    }
   else
     {
       unsigned len_rw = i386_length_and_rw_bits (len, type);
@@ -673,8 +680,8 @@ i386_region_ok_for_watchpoint (struct target_ops *self,
 
   /* Compute how many aligned watchpoints we would need to cover this
      region.  */
-  nregs = i386_handle_nonaligned_watchpoint (state,
-					     WP_COUNT, addr, len, hw_write);
+  nregs = i386_handle_nonaligned_watchpoint (state, WP_COUNT,
+					     addr, len, hw_write);
   return nregs <= DR_NADDR ? 1 : 0;
 }
 
@@ -726,7 +733,7 @@ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
      registers.  */
   status = i386_dr_low.get_status ();
 
-  ALL_DEBUG_REGISTERS(i)
+  ALL_DEBUG_REGISTERS (i)
     {
       if (!I386_DR_WATCH_HIT (status, i))
 	continue;
@@ -750,6 +757,7 @@ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
 	    i386_show_dr (state, "watchpoint_hit", addr, -1, hw_write);
 	}
     }
+
   if (maint_show_dr && addr == 0)
     i386_show_dr (state, "stopped_data_addr", 0, 0, hw_write);
 
-- 
1.7.1


  reply	other threads:[~2014-06-17 14:13 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 14:13 [PATCH 00/15] Refactor shared code in i386-{nat,low}.[ch] Gary Benson
2014-06-17 14:13 ` Gary Benson [this message]
2014-06-17 15:23   ` [PATCH 01/15] Whitespace changes Pedro Alves
2014-06-17 14:13 ` [PATCH 04/15] Comment changes Gary Benson
2014-06-17 15:45   ` Pedro Alves
2014-06-17 16:10     ` Gary Benson
2014-06-17 17:11       ` Pedro Alves
2014-06-17 14:13 ` [PATCH 03/15] Remove unused macro Gary Benson
2014-06-17 15:35   ` Pedro Alves
2014-06-17 14:40 ` [PATCH 14/15] Create nat/i386-dregs.c Gary Benson
2014-06-17 16:56   ` Pedro Alves
2014-06-18 13:43     ` Gary Benson
2014-06-17 14:40 ` [PATCH 06/15] Merge printing code Gary Benson
2014-06-17 16:01   ` Pedro Alves
2014-06-17 14:44 ` [PATCH 12/15] Create nat/i386-dregs.h Gary Benson
2014-06-17 16:48   ` Pedro Alves
2014-06-18 11:14     ` Gary Benson
2014-06-17 14:44 ` [PATCH 09/15] Merge i386_update_inferior_debug_regs Gary Benson
2014-06-17 16:06   ` Pedro Alves
2014-06-17 14:48 ` [PATCH 11/15] Rename functions and make nonstatic as necessary Gary Benson
2014-06-17 16:13   ` Pedro Alves
2014-06-18 10:25   ` Siva Chandra
2014-06-18 13:30     ` Gary Benson
2014-06-18 13:55       ` Pedro Alves
2014-06-18 14:03         ` Siva Chandra
2014-06-18 14:09         ` Gary Benson
2014-06-18 14:18           ` Pedro Alves
2014-06-17 14:48 ` [PATCH 07/15] Merge error handling Gary Benson
2014-06-17 16:02   ` Pedro Alves
2014-06-17 14:53 ` [PATCH 05/15] Add a const Gary Benson
2014-06-17 15:46   ` Pedro Alves
2014-06-17 14:53 ` [PATCH 10/15] Abstract i386_dr_low access Gary Benson
2014-06-17 16:10   ` Pedro Alves
2014-06-17 14:53 ` [PATCH 08/15] Rename maint_show_dr to debug_hw_points Gary Benson
2014-06-17 16:03   ` Pedro Alves
2014-06-17 14:53 ` [PATCH 02/15] Remove unnecessary prototypes Gary Benson
2014-06-17 15:26   ` Pedro Alves
2014-06-17 14:58 ` [PATCH 15/15] Buildsystem changes Gary Benson
2014-06-17 16:41   ` Pedro Alves
2014-06-17 14:58 ` [PATCH 13/15] Move macros from i386-{nat,low}.c to i386-{nat,low}.h Gary Benson
2014-06-17 16:54   ` Pedro Alves
2014-06-18 11:33     ` Gary Benson
2014-06-18 11:50       ` Pedro Alves
2014-06-17 17:00 ` [PATCH 00/15] Refactor shared code in i386-{nat,low}.[ch] Pedro Alves
2014-06-18 10:49   ` Gary Benson

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=1403014378-4349-2-git-send-email-gbenson@redhat.com \
    --to=gbenson@redhat.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