From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26854 invoked by alias); 10 Aug 2002 02:40:56 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26847 invoked from network); 10 Aug 2002 02:40:56 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 10 Aug 2002 02:40:56 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DC2FF3CF7; Fri, 9 Aug 2002 22:40:53 -0400 (EDT) Message-ID: <3D547D35.6050003@ges.redhat.com> Date: Fri, 09 Aug 2002 19:40:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020802 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa:i386] Eliminate register_byte() and register_raw_size() References: <3D5477D2.6090403@ges.redhat.com> Content-Type: multipart/mixed; boundary="------------000302090209020706010405" X-SW-Source: 2002-08/txt/msg00234.txt.bz2 This is a multi-part message in MIME format. --------------000302090209020706010405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 312 ulgh, with attached patch .... > Hello, > > This patch eliminates the register_byte() and register_raw_size() architecture methods from the i386. > > (It was either that or modify the code so that it included MMX registers :-) > > ok to commit? > Andrew > > (My redhat 7.3 i386 system shows no regressions) --------------000302090209020706010405 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 6708 2002-08-09 Andrew Cagney * i386-linux-tdep.c (i386_linux_register_byte): Delete function. (i386_linux_register_raw_size): Delete function. (i386_linux_init_abi): Update. * i386-tdep.c (i386_register_raw_size): Delete function. (i386_register_byte): Delete function. (i386_gdbarch_init): Update. (i386_register_size): Delete array. (i386_register_offset): Delete array. * config/i386/tm-symmetry.h (REGISTER_BYTE): Delete macro. (REGISTER_RAW_SIZE): Delete macro. * config/i386/tm-ptx.h (REGISTER_RAW_SIZE): Delete macro. (REGISTER_BYTE): Delete macro. Index: i386-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v retrieving revision 1.16 diff -u -r1.16 i386-linux-tdep.c --- i386-linux-tdep.c 2 Jul 2002 13:48:16 -0000 1.16 +++ i386-linux-tdep.c 10 Aug 2002 02:11:26 -0000 @@ -47,27 +47,6 @@ return i386_register_name (reg); } - -static int -i386_linux_register_byte (int reg) -{ - /* Deal with the extra "orig_eax" pseudo register. */ - if (reg == I386_LINUX_ORIG_EAX_REGNUM) - return (i386_register_byte (I386_LINUX_ORIG_EAX_REGNUM - 1) - + i386_register_raw_size (I386_LINUX_ORIG_EAX_REGNUM - 1)); - - return i386_register_byte (reg); -} - -static int -i386_linux_register_raw_size (int reg) -{ - /* Deal with the extra "orig_eax" pseudo register. */ - if (reg == I386_LINUX_ORIG_EAX_REGNUM) - return 4; - - return i386_register_raw_size (reg); -} /* Recognizing signal handler frames. */ @@ -458,8 +437,6 @@ set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1); set_gdbarch_register_name (gdbarch, i386_linux_register_name); set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4); - set_gdbarch_register_byte (gdbarch, i386_linux_register_byte); - set_gdbarch_register_raw_size (gdbarch, i386_linux_register_raw_size); tdep->jb_pc_offset = 20; /* From . */ Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.73 diff -u -r1.73 i386-tdep.c --- i386-tdep.c 24 Jul 2002 14:38:55 -0000 1.73 +++ i386-tdep.c 10 Aug 2002 02:11:26 -0000 @@ -56,27 +56,6 @@ "mxcsr" }; -/* i386_register_offset[i] is the offset into the register file of the - start of register number i. We initialize this from - i386_register_size. */ -static int i386_register_offset[I386_SSE_NUM_REGS]; - -/* i386_register_size[i] is the number of bytes of storage in GDB's - register array occupied by register i. */ -static int i386_register_size[I386_SSE_NUM_REGS] = { - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 4, 4, 4, 4, - 10, 10, 10, 10, - 10, 10, 10, 10, - 4, 4, 4, 4, - 4, 4, 4, 4, - 16, 16, 16, 16, - 16, 16, 16, 16, - 4 -}; - /* Return the name of register REG. */ const char * @@ -90,23 +69,6 @@ return i386_register_names[reg]; } -/* Return the offset into the register array of the start of register - number REG. */ -int -i386_register_byte (int reg) -{ - return i386_register_offset[reg]; -} - -/* Return the number of bytes of storage in GDB's register array - occupied by register REG. */ - -int -i386_register_raw_size (int reg) -{ - return i386_register_size[reg]; -} - /* Convert stabs register number REG to the appropriate register number used by GDB. */ @@ -1439,8 +1401,6 @@ set_gdbarch_register_name (gdbarch, i386_register_name); set_gdbarch_register_size (gdbarch, 4); set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS); - set_gdbarch_register_byte (gdbarch, i386_register_byte); - set_gdbarch_register_raw_size (gdbarch, i386_register_raw_size); set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE); set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE); set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type); @@ -1545,19 +1505,6 @@ _initialize_i386_tdep (void) { register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init); - - /* Initialize the table saying where each register starts in the - register file. */ - { - int i, offset; - - offset = 0; - for (i = 0; i < I386_SSE_NUM_REGS; i++) - { - i386_register_offset[i] = offset; - offset += i386_register_size[i]; - } - } tm_print_insn = gdb_print_insn_i386; tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach; Index: config/i386/tm-ptx.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-ptx.h,v retrieving revision 1.5 diff -u -r1.5 tm-ptx.h --- config/i386/tm-ptx.h 14 Jun 2002 22:55:45 -0000 1.5 +++ config/i386/tm-ptx.h 10 Aug 2002 02:11:27 -0000 @@ -149,24 +149,6 @@ #undef REGISTER_BYTES #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) -/* Index within `registers' of the first byte of the space for register N. */ - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ -(((N) < ST0_REGNUM) ? ((N) * 4) : \ - ((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \ - (40 + 80 + (((N) - FP1_REGNUM) * 4))) - -/* Number of bytes of storage in the actual machine representation for - register N. All registers are 4 bytes, except 387 st(0) - st(7), - which are 80 bits each. */ - -#undef REGISTER_RAW_SIZE -#define REGISTER_RAW_SIZE(N) \ -(((N) < ST0_REGNUM) ? 4 : \ - ((N) < FP1_REGNUM) ? 10 : \ - 4) - /* Largest value REGISTER_RAW_SIZE can have. */ #undef MAX_REGISTER_RAW_SIZE Index: config/i386/tm-symmetry.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-symmetry.h,v retrieving revision 1.8 diff -u -r1.8 tm-symmetry.h --- config/i386/tm-symmetry.h 14 Jun 2002 22:55:45 -0000 1.8 +++ config/i386/tm-symmetry.h 10 Aug 2002 02:11:27 -0000 @@ -225,30 +225,6 @@ #undef REGISTER_BYTES #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) -/* Index within `registers' of the first byte of the space for - register N. */ - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ -(((N) < 3) ? ((N) * 4) : \ -((N) < 5) ? ((((N) - 2) * 10) + 2) : \ -((N) < 8) ? ((((N) - 5) * 4) + 32) : \ -((N) < 14) ? ((((N) - 8) * 10) + 44) : \ - ((((N) - 14) * 4) + 104)) - -/* Number of bytes of storage in the actual machine representation - * for register N. All registers are 4 bytes, except 387 st(0) - st(7), - * which are 80 bits each. - */ - -#undef REGISTER_RAW_SIZE -#define REGISTER_RAW_SIZE(N) \ -(((N) < 3) ? 4 : \ -((N) < 5) ? 10 : \ -((N) < 8) ? 4 : \ -((N) < 14) ? 10 : \ - 4) - /* Nonzero if register N requires conversion from raw format to virtual format. */ --------------000302090209020706010405--