This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RFA: minor watchpoint code cleanup



This is just a cosmetic change.  Let me know.

2000-03-17  Jim Blandy  <jimb@redhat.com>

	* i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
	two-dimensional array, instead of faking it with explicit index
	arithmetic.

Index: i386v-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386v-nat.c,v
retrieving revision 1.1.1.3
diff -c -c -b -F'^(' -r1.1.1.3 i386v-nat.c
*** i386v-nat.c	1999/12/08 02:50:38	1.1.1.3
--- i386v-nat.c	2000/03/17 23:57:07
***************
*** 229,240 ****
    int size;
    int rv;
  
!   static int size_try_array[16] =
    {
!     1, 1, 1, 1,			/* trying size one */
!     2, 1, 2, 1,			/* trying size two */
!     2, 1, 2, 1,			/* trying size three */
!     4, 1, 2, 1			/* trying size four */
    };
  
    rv = 0;
--- 229,240 ----
    int size;
    int rv;
  
!   static int size_try_array[4][4] =
    {
!     { 1, 1, 1, 1 },		/* trying size one */
!     { 2, 1, 2, 1 },		/* trying size two */
!     { 2, 1, 2, 1 },		/* trying size three */
!     { 4, 1, 2, 1 }		/* trying size four */
    };
  
    rv = 0;
***************
*** 242,249 ****
      {
        align = addr % 4;
        /* Four is the maximum length for 386.  */
!       size = (len > 4) ? 3 : len - 1;
!       size = size_try_array[size * 4 + align];
  
        rv = i386_insert_aligned_watchpoint (pid, waddr, addr, size, rw);
        if (rv)
--- 242,249 ----
      {
        align = addr % 4;
        /* Four is the maximum length for 386.  */
!       size = (len > 4) ? 4 : len;
!       size = size_try_array[size - 1][align];
  
        rv = i386_insert_aligned_watchpoint (pid, waddr, addr, size, rw);
        if (rv)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]