This is the mail archive of the gdb-patches@sources.redhat.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]

[patch] s/builtin_type_ptr/builtin_type_void_data_ptr/


Hello,

Per e-mail exchange with JimB over consitent naming.  I've checked in 
the attached.

	Andrew
2001-07-07  Andrew Cagney  <ac131313@redhat.com>

	* gdbtypes.h (builtin_type_void_data_ptr): Rename
	builtin_type_ptr.
	* gdbtypes.c (builtin_type_void_data_ptr): Update.
	(build_gdbtypes): Update.
	(_initialize_gdbtypes): Update.
	* values.c (value_as_pointer): Update.
	* utils.c (host_pointer_to_address): Update.
	(address_to_host_pointer): Update.

Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.22
diff -p -r1.22 gdbtypes.c
*** gdbtypes.c	2001/07/06 14:44:19	1.22
--- gdbtypes.c	2001/07/08 20:35:23
*************** struct type *builtin_type_v4si;
*** 73,79 ****
  struct type *builtin_type_v8qi;
  struct type *builtin_type_v4hi;
  struct type *builtin_type_v2si;
! struct type *builtin_type_ptr;
  struct type *builtin_type_void_func_ptr;
  struct type *builtin_type_CORE_ADDR;
  struct type *builtin_type_bfd_vma;
--- 73,79 ----
  struct type *builtin_type_v8qi;
  struct type *builtin_type_v4hi;
  struct type *builtin_type_v2si;
! struct type *builtin_type_void_data_ptr;
  struct type *builtin_type_void_func_ptr;
  struct type *builtin_type_CORE_ADDR;
  struct type *builtin_type_bfd_vma;
*************** build_gdbtypes (void)
*** 2956,2962 ****
       target type for a value the target will never see.  It's only
       used to hold the values of (typeless) linker symbols, which are
       indeed in the unified virtual address space.  */
!   builtin_type_ptr = make_pointer_type (builtin_type_void, NULL);
    builtin_type_void_func_ptr
      = lookup_pointer_type (lookup_function_type (builtin_type_void));
    builtin_type_CORE_ADDR =
--- 2956,2962 ----
       target type for a value the target will never see.  It's only
       used to hold the values of (typeless) linker symbols, which are
       indeed in the unified virtual address space.  */
!   builtin_type_void_data_ptr = make_pointer_type (builtin_type_void, NULL);
    builtin_type_void_func_ptr
      = lookup_pointer_type (lookup_function_type (builtin_type_void));
    builtin_type_CORE_ADDR =
*************** _initialize_gdbtypes (void)
*** 3011,3017 ****
    register_gdbarch_swap (&builtin_type_v8qi, sizeof (struct type *), NULL);
    register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
    register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
!   REGISTER_GDBARCH_SWAP (builtin_type_ptr);
    REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr);
    REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
    REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
--- 3011,3017 ----
    register_gdbarch_swap (&builtin_type_v8qi, sizeof (struct type *), NULL);
    register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
    register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
!   REGISTER_GDBARCH_SWAP (builtin_type_void_data_ptr);
    REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr);
    REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
    REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.10
diff -p -r1.10 gdbtypes.h
*** gdbtypes.h	2001/07/06 14:44:19	1.10
--- gdbtypes.h	2001/07/08 20:35:27
*************** extern struct type *builtin_type_string;
*** 846,854 ****
  extern struct type *builtin_type_bool;
  
  /* Address/pointer types: */
! /* (C) Language pointer type. Some target platforms use an implicitly
!    {sign,zero} -extended 32 bit C language pointer on a 64 bit ISA. */
! extern struct type *builtin_type_ptr;
  
  /* (C) Language `pointer to function returning void' type.  Since
     ANSI, C standards have explicitly said that pointers to functions
--- 846,855 ----
  extern struct type *builtin_type_bool;
  
  /* Address/pointer types: */
! /* (C) Language `pointer to data' type.  Some target platforms use an
!    implicitly {sign,zero} -extended 32 bit C language pointer on a 64
!    bit ISA.  */
! extern struct type *builtin_type_void_data_ptr;
  
  /* (C) Language `pointer to function returning void' type.  Since
     ANSI, C standards have explicitly said that pointers to functions
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.41
diff -p -r1.41 utils.c
*** utils.c	2001/06/10 16:25:51	1.41
--- utils.c	2001/07/08 20:35:35
*************** phex_nz (ULONGEST l, int sizeof_l)
*** 3000,3018 ****
  CORE_ADDR
  host_pointer_to_address (void *ptr)
  {
!   if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr))
      internal_error (__FILE__, __LINE__,
  		    "core_addr_to_void_ptr: bad cast");
!   return POINTER_TO_ADDRESS (builtin_type_ptr, &ptr);
  }
  
  void *
  address_to_host_pointer (CORE_ADDR addr)
  {
    void *ptr;
!   if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr))
      internal_error (__FILE__, __LINE__,
  		    "core_addr_to_void_ptr: bad cast");
!   ADDRESS_TO_POINTER (builtin_type_ptr, &ptr, addr);
    return ptr;
  }
--- 3000,3018 ----
  CORE_ADDR
  host_pointer_to_address (void *ptr)
  {
!   if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
      internal_error (__FILE__, __LINE__,
  		    "core_addr_to_void_ptr: bad cast");
!   return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr);
  }
  
  void *
  address_to_host_pointer (CORE_ADDR addr)
  {
    void *ptr;
!   if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
      internal_error (__FILE__, __LINE__,
  		    "core_addr_to_void_ptr: bad cast");
!   ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
    return ptr;
  }
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.19
diff -p -r1.19 values.c
*** values.c	2001/06/15 19:19:23	1.19
--- values.c	2001/07/08 20:35:40
*************** value_as_pointer (value_ptr val)
*** 595,603 ****
       can be different and may require different integer to pointer
       conversions. */
    if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
!       && TYPE_LENGTH (VALUE_TYPE (val)) <= TYPE_LENGTH (builtin_type_ptr))
      {
!       val = value_cast (builtin_type_ptr, val);
      }
    return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val));
  #endif
--- 595,604 ----
       can be different and may require different integer to pointer
       conversions. */
    if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
!       && (TYPE_LENGTH (VALUE_TYPE (val))
! 	  <= TYPE_LENGTH (builtin_type_void_data_ptr)))
      {
!       val = value_cast (builtin_type_void_data_ptr, val);
      }
    return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val));
  #endif

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