From 090a2205b5e921ae177193783a0a2614ea842d09 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 8 Jul 2001 20:42:15 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 11 +++++++++++ gdb/gdbtypes.c | 6 +++--- gdb/gdbtypes.h | 7 ++++--- gdb/utils.c | 8 ++++---- gdb/values.c | 5 +++-- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d36d73f2ab..e361e6e0df2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2001-07-07 Andrew Cagney + + * 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. + 2001-07-08 Andrew Cagney * remote-udi.c (udi_wait): Make type, instead of name, of first diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index f2fed5f5481..cfb5ffc4d25 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -73,7 +73,7 @@ struct type *builtin_type_v4si; 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_data_ptr; struct type *builtin_type_void_func_ptr; struct type *builtin_type_CORE_ADDR; struct type *builtin_type_bfd_vma; @@ -2956,7 +2956,7 @@ build_gdbtypes (void) 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_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 = @@ -3011,7 +3011,7 @@ _initialize_gdbtypes (void) 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_data_ptr); REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr); REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR); REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 981dbec4b7c..bc0f8fb9cba 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -846,9 +846,10 @@ extern struct type *builtin_type_string; 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 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 diff --git a/gdb/utils.c b/gdb/utils.c index 294ad426580..855f474c9f5 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -3000,19 +3000,19 @@ phex_nz (ULONGEST l, int sizeof_l) CORE_ADDR host_pointer_to_address (void *ptr) { - if (sizeof (ptr) != TYPE_LENGTH (builtin_type_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_ptr, &ptr); + 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_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_ptr, &ptr, addr); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr); return ptr; } diff --git a/gdb/values.c b/gdb/values.c index 43ff194c160..0d18c31cf44 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -595,9 +595,10 @@ value_as_pointer (value_ptr val) 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)) + && (TYPE_LENGTH (VALUE_TYPE (val)) + <= TYPE_LENGTH (builtin_type_void_data_ptr))) { - val = value_cast (builtin_type_ptr, val); + val = value_cast (builtin_type_void_data_ptr, val); } return unpack_long (VALUE_TYPE (val), VALUE_CONTENTS (val)); #endif -- 2.30.2