From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29018 invoked by alias); 13 Jun 2007 18:32:16 -0000 Received: (qmail 28997 invoked by uid 22791); 13 Jun 2007 18:32:15 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Jun 2007 18:32:07 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5DIW2d9024926 for ; Wed, 13 Jun 2007 18:32:02 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 l5DIW2YK3866862 for ; Wed, 13 Jun 2007 20:32:02 +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 l5DIW2LJ017722 for ; Wed, 13 Jun 2007 20:32:02 +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 l5DIW1YY017711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jun 2007 20:32:02 +0200 Message-ID: <467037D0.2060804@de.ibm.com> Date: Wed, 13 Jun 2007 18:32: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: [ref] Remove macro DEPRECATED_REG_STRUCT_HAS_ADDR Content-Type: multipart/mixed; boundary="------------050007010703070502080301" 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/msg00257.txt.bz2 This is a multi-part message in MIME format. --------------050007010703070502080301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 567 Hello, this patch completely removes DEPRECATED_REG_STRUCT_HAS_ADDR. This was only used in infcall.c and was replaced by gdbarch_stabs_argument_has_addr. Build and tested on x86. Testsuite showed no regressions. ChangeLog: * infcall.c (call_function_by_hand): Remove DEPRECATED_REG_STRUCT_HAS_ADDR_P. Replace DEPRECATED_REG_STRUCT_HAS_ADDR by stabs_argument_has_addr. * gdbarch.sh (DEPRECATED_REG_STRUCT_HAS_ADDR): Remove. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit? -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------050007010703070502080301 Content-Type: text/plain; name="diff-remove-REG_STRUCT_HAS_ADDR" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-REG_STRUCT_HAS_ADDR" Content-length: 10431 diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-06-13 20:02:38.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-06-13 20:19:51.000000000 +0200 @@ -205,7 +205,6 @@ gdbarch_unwind_sp_ftype *unwind_sp; gdbarch_frame_num_args_ftype *frame_num_args; gdbarch_frame_align_ftype *frame_align; - gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr; gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr; int frame_red_zone_size; gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; @@ -329,7 +328,6 @@ 0, /* unwind_sp */ 0, /* frame_num_args */ 0, /* frame_align */ - 0, /* deprecated_reg_struct_has_addr */ default_stabs_argument_has_addr, /* stabs_argument_has_addr */ 0, /* frame_red_zone_size */ convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */ @@ -579,7 +577,6 @@ /* Skip verify of unwind_sp, has predicate */ /* Skip verify of frame_num_args, has predicate */ /* Skip verify of frame_align, has predicate */ - /* Skip verify of deprecated_reg_struct_has_addr, has predicate */ /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */ /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ /* Skip verify of addr_bits_remove, invalid_p == 0 */ @@ -767,24 +764,6 @@ fprintf_unfiltered (file, "gdbarch_dump: deprecated_function_start_offset = 0x%s\n", paddr_nz (current_gdbarch->deprecated_function_start_offset)); -#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_REG_STRUCT_HAS_ADDR_P()", - XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ())); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n", - gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch)); -#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)", - XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type))); -#endif - 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", @@ -2596,30 +2575,6 @@ } int -gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_reg_struct_has_addr != NULL; -} - -int -gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) -{ - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n"); - return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type); -} - -void -set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, - gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr) -{ - gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr; -} - -int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) { gdb_assert (gdbarch != NULL); diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-06-13 20:02:38.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-06-13 20:19:40.000000000 +0200 @@ -613,34 +613,6 @@ extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address); extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align); -/* DEPRECATED_REG_STRUCT_HAS_ADDR has been replaced by - stabs_argument_has_addr. */ - -#if defined (DEPRECATED_REG_STRUCT_HAS_ADDR) -/* Legacy for systems yet to multi-arch DEPRECATED_REG_STRUCT_HAS_ADDR */ -#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P) -#define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (1) -#endif -#endif - -extern int gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P) -#error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR" -#endif -#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P) -#define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch)) -#endif - -typedef int (gdbarch_deprecated_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); -extern int gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); -extern void set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr); -#if !defined (GDB_TM_FILE) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR) -#error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR" -#endif -#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR) -#define DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_deprecated_reg_struct_has_addr (current_gdbarch, gcc_p, type)) -#endif - typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type); extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type); extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr); diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-06-13 20:02:38.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-06-13 20:19:32.000000000 +0200 @@ -574,9 +574,6 @@ F::int:frame_num_args:struct frame_info *frame:frame # M::CORE_ADDR:frame_align:CORE_ADDR address:address -# DEPRECATED_REG_STRUCT_HAS_ADDR has been replaced by -# stabs_argument_has_addr. -F:=:int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type m::int:stabs_argument_has_addr:struct type *type:type::default_stabs_argument_has_addr::0 v::int:frame_red_zone_size # diff -urN src/gdb/infcall.c dev/gdb/infcall.c --- src/gdb/infcall.c 2007-06-08 05:38:50.000000000 +0200 +++ dev/gdb/infcall.c 2007-06-13 20:18:58.000000000 +0200 @@ -336,6 +336,7 @@ struct regcache *caller_regcache; struct cleanup *caller_regcache_cleanup; struct frame_id dummy_id; + int i; if (TYPE_CODE (ftype) == TYPE_CODE_PTR) ftype = check_typedef (TYPE_TARGET_TYPE (ftype)); @@ -520,7 +521,6 @@ error (_("too few arguments in function call")); { - int i; for (i = nargs - 1; i >= 0; i--) { int prototyped; @@ -582,60 +582,51 @@ } } - if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()) + /* This is a machine like the sparc, where we may need to pass a + pointer to the structure, not the structure itself. */ + for (i = nargs - 1; i >= 0; i--) { - int i; - /* This is a machine like the sparc, where we may need to pass a - pointer to the structure, not the structure itself. */ - for (i = nargs - 1; i >= 0; i--) - { - struct type *arg_type = check_typedef (value_type (args[i])); - if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT - || TYPE_CODE (arg_type) == TYPE_CODE_UNION - || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY - || TYPE_CODE (arg_type) == TYPE_CODE_STRING - || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING - || TYPE_CODE (arg_type) == TYPE_CODE_SET - || (TYPE_CODE (arg_type) == TYPE_CODE_FLT - && TYPE_LENGTH (arg_type) > 8) - ) - && DEPRECATED_REG_STRUCT_HAS_ADDR (using_gcc, arg_type)) - { - CORE_ADDR addr; - int len; /* = TYPE_LENGTH (arg_type); */ - int aligned_len; - arg_type = check_typedef (value_enclosing_type (args[i])); - len = TYPE_LENGTH (arg_type); - - aligned_len = len; - if (gdbarch_inner_than (current_gdbarch, 1, 2)) - { - /* stack grows downward */ - sp -= aligned_len; - /* ... so the address of the thing we push is the - stack pointer after we push it. */ - addr = sp; - } - else - { - /* The stack grows up, so the address of the thing - we push is the stack pointer before we push it. */ - addr = sp; - sp += aligned_len; - } - /* Push the structure. */ - write_memory (addr, value_contents_all (args[i]), len); - /* The value we're going to pass is the address of the - thing we just pushed. */ - /*args[i] = value_from_longest (lookup_pointer_type (values_type), - (LONGEST) addr); */ - args[i] = value_from_pointer (lookup_pointer_type (arg_type), - addr); - } - } + struct type *arg_type = check_typedef (value_type (args[i])); + if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT + || TYPE_CODE (arg_type) == TYPE_CODE_UNION + || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY + || TYPE_CODE (arg_type) == TYPE_CODE_STRING + || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING + || TYPE_CODE (arg_type) == TYPE_CODE_SET + || (TYPE_CODE (arg_type) == TYPE_CODE_FLT + && TYPE_LENGTH (arg_type) > 8)) + && gdbarch_stabs_argument_has_addr (current_gdbarch, arg_type)) + { + CORE_ADDR addr; + int len; /* = TYPE_LENGTH (arg_type); */ + int aligned_len; + arg_type = check_typedef (value_enclosing_type (args[i])); + len = TYPE_LENGTH (arg_type); + + aligned_len = len; + if (gdbarch_inner_than (current_gdbarch, 1, 2)) + { + /* stack grows downward */ + sp -= aligned_len; + /* ... so the address of the thing we push is the + stack pointer after we push it. */ + addr = sp; + } + else + { + /* The stack grows up, so the address of the thing + we push is the stack pointer before we push it. */ + addr = sp; + sp += aligned_len; + } + /* Push the structure. */ + write_memory (addr, value_contents_all (args[i]), len); + /* The value we're going to pass is the address of the + thing we just pushed. */ + args[i] = value_from_pointer (lookup_pointer_type (arg_type), addr); + } } - /* Reserve space for the return structure to be written on the stack, if necessary. Make certain that the value is correctly aligned. */ --------------050007010703070502080301--