From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28596 invoked by alias); 18 Jun 2007 09:03:56 -0000 Received: (qmail 28584 invoked by uid 22791); 18 Jun 2007 09:03:55 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 18 Jun 2007 09:03:53 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5I93owd162836 for ; Mon, 18 Jun 2007 09:03:50 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l5I93oJ34014158 for ; Mon, 18 Jun 2007 11:03:50 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l5I93nEC024204 for ; Mon, 18 Jun 2007 11:03:50 +0200 Received: from [9.152.248.39] (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l5I93mSH024133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Jun 2007 11:03:49 +0200 Message-ID: <46764A23.7020101@de.ibm.com> Date: Mon, 18 Jun 2007 09:03:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: GDB Patches CC: Ulrich Weigand Subject: [rfc] [4/6] Replace DEPRECATED_REGISTER_SIZE Content-Type: multipart/mixed; boundary="------------050803070001030106010505" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00329.txt.bz2 This is a multi-part message in MIME format. --------------050803070001030106010505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 419 Hello, this patch replaces DEPRECATED_REGISTER_SIZE by gdbarch_deprecated_register_size ChangeLog: * gdbarch.sh (DEPRECATED_REGISTER_SIZE): Replace by gdbarch_deprecated_register_size. * arm-tdep.c (arm_push_dummy_call, thumb_get_next_pc) (arm_return_in_memory): Likewise. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit ? -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------050803070001030106010505 Content-Type: text/plain; name="diff-remove-REGISTER_SIZE" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-REGISTER_SIZE" Content-length: 6123 diff -urN src/gdb/arm-tdep.c dev/gdb/arm-tdep.c --- src/gdb/arm-tdep.c 2007-06-18 05:36:40.000000000 +0200 +++ dev/gdb/arm-tdep.c 2007-06-18 10:06:09.000000000 +0200 @@ -1282,7 +1282,9 @@ registers and stack. */ while (len > 0) { - int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE; + int partial_len + = len < gdbarch_deprecated_register_size (current_gdbarch) + ? len : gdbarch_deprecated_register_size (current_gdbarch); if (argreg <= ARM_LAST_ARG_REGNUM) { @@ -1294,7 +1296,9 @@ argnum, gdbarch_register_name (current_gdbarch, argreg), - phex (regval, DEPRECATED_REGISTER_SIZE)); + phex (regval, + gdbarch_deprecated_register_size + (current_gdbarch))); regcache_cooked_write_unsigned (regcache, argreg, regval); argreg++; } @@ -1304,8 +1308,10 @@ if (arm_debug) fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n", argnum, nstack); - si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE); - nstack += DEPRECATED_REGISTER_SIZE; + si = push_stack_item (si, val, + gdbarch_deprecated_register_size + (current_gdbarch)); + nstack += gdbarch_deprecated_register_size (current_gdbarch); } len -= partial_len; @@ -1622,7 +1628,8 @@ /* Fetch the saved PC from the stack. It's stored above all of the other registers. */ - offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE; + offset = bitcount (bits (inst1, 0, 7)) + * gdbarch_deprecated_register_size (current_gdbarch); sp = get_frame_register_unsigned (frame, ARM_SP_REGNUM); nextpc = (CORE_ADDR) read_memory_unsigned_integer (sp + offset, 4); nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc); @@ -2138,7 +2145,7 @@ /* In the ARM ABI, "integer" like aggregate types are returned in registers. For an aggregate type to be integer like, its size - must be less than or equal to DEPRECATED_REGISTER_SIZE and the + must be less than or equal to gdbarch_deprecated_register_size and the offset of each addressable subfield must be zero. Note that bit fields are not addressable, and all addressable subfields of unions always start at offset zero. @@ -2155,7 +2162,7 @@ /* All aggregate types that won't fit in a register must be returned in memory. */ - if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE) + if (TYPE_LENGTH (type) > gdbarch_deprecated_register_size (current_gdbarch)) { return 1; } @@ -2182,7 +2189,7 @@ int i; /* Need to check if this struct/union is "integer" like. For this to be true, its size must be less than or equal to - DEPRECATED_REGISTER_SIZE and the offset of each addressable + gdbarch_deprecated_register_size and the offset of each addressable subfield must be zero. Note that bit fields are not addressable, and unions always start at offset zero. If any of the subfields is a floating point type, the struct/union diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-06-18 10:02:08.000000000 +0200 @@ -777,11 +777,6 @@ fprintf_unfiltered (file, "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n", (long) current_gdbarch->deprecated_reg_struct_has_addr); -#ifdef DEPRECATED_REGISTER_SIZE - fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n", - XSTRING (DEPRECATED_REGISTER_SIZE)); -#endif fprintf_unfiltered (file, "gdbarch_dump: deprecated_register_size = %s\n", paddr_d (current_gdbarch->deprecated_register_size)); diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-06-18 10:01:58.000000000 +0200 @@ -300,16 +300,10 @@ extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call); -/* DEPRECATED_REGISTER_SIZE can be deleted. */ +/* deprecated_register_size can be deleted. */ extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch); extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_REGISTER_SIZE) -#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE" -#endif -#if !defined (DEPRECATED_REGISTER_SIZE) -#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch)) -#endif extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-06-18 05:36:42.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-06-18 10:01:53.000000000 +0200 @@ -467,8 +467,8 @@ # See gdbint.texinfo. See infcall.c. M::CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr -# DEPRECATED_REGISTER_SIZE can be deleted. -v:=:int:deprecated_register_size +# deprecated_register_size can be deleted. +v::int:deprecated_register_size v::int:call_dummy_location::::AT_ENTRY_POINT::0 M::CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache --------------050803070001030106010505--