+2007-06-06 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (ADDRESS_TO_POINTER): Replace by
+ gdbarch_address_to_pointer.
+ * findvar.c (store_typed_address): Likewise.
+ * gdbtypes.c (make_pointer_type): Likewise (comment).
+ * procfs.c (procfs_address_to_host_pointer): Likewise.
+ * std-regs.c (value_of_builtin_frame_reg): Likewise.
+ (value_of_builtin_frame_fp_reg): Likewise.
+ (value_of_builtin_frame_pc_reg): Likewise.
+ * utils.c (paddress): Likewise (comment).
+ * gdbarch.sh (POINTER_TO_ADDRESS): Replace by
+ gdbarch_pointer_to_address.
+ * findvar.c (extract_typed_address): Likewise.
+ * gdbtypes.c (make_pointer_type): Likewise (comment).
+ * valops.c (value_cast): Likewise (comment).
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-06 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (GET_LONGJMP_TARGET): Replace by gdbarch_get_longjmp_target.
_("extract_typed_address: "
"type is not a pointer or reference"));
- return POINTER_TO_ADDRESS (type, buf);
+ return gdbarch_pointer_to_address (current_gdbarch, type, buf);
}
_("store_typed_address: "
"type is not a pointer or reference"));
- ADDRESS_TO_POINTER (type, buf, addr);
+ gdbarch_address_to_pointer (current_gdbarch, type, buf, addr);
}
fprintf_unfiltered (file,
"gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
(long) current_gdbarch->address_class_type_flags_to_name);
-#ifdef ADDRESS_TO_POINTER
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "ADDRESS_TO_POINTER(type, buf, addr)",
- XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: address_to_pointer = <0x%lx>\n",
(long) current_gdbarch->address_to_pointer);
fprintf_unfiltered (file,
"gdbarch_dump: pc_regnum = %s\n",
paddr_d (current_gdbarch->pc_regnum));
-#ifdef POINTER_TO_ADDRESS
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "POINTER_TO_ADDRESS(type, buf)",
- XSTRING (POINTER_TO_ADDRESS (type, buf)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: pointer_to_address = <0x%lx>\n",
(long) current_gdbarch->pointer_to_address);
/ addr_bit will be set from it.
If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
- also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+ also need to set gdbarch_pointer_to_address and gdbarch_address_to_pointer
+ as well.
ptr_bit is the size of a pointer on the target */
typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const gdb_byte *buf);
extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
-#if !defined (GDB_TM_FILE) && defined (POINTER_TO_ADDRESS)
-#error "Non multi-arch definition of POINTER_TO_ADDRESS"
-#endif
-#if !defined (POINTER_TO_ADDRESS)
-#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
-#endif
typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, gdb_byte *buf, CORE_ADDR addr);
extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
-#if !defined (GDB_TM_FILE) && defined (ADDRESS_TO_POINTER)
-#error "Non multi-arch definition of ADDRESS_TO_POINTER"
-#endif
-#if !defined (ADDRESS_TO_POINTER)
-#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr))
-#endif
extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
# / addr_bit will be set from it.
#
# If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
-# also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+# also need to set gdbarch_pointer_to_address and gdbarch_address_to_pointer
+# as well.
#
# ptr_bit is the size of a pointer on the target
v:TARGET_PTR_BIT:int:ptr_bit:::8 * sizeof (void*):TARGET_INT_BIT::0
# (but not the value contents) filled in.
f::struct value *:value_from_register:struct type *type, int regnum, struct frame_info *frame:type, regnum, frame::default_value_from_register::0
#
-f:=:CORE_ADDR:pointer_to_address:struct type *type, const gdb_byte *buf:type, buf::unsigned_pointer_to_address::0
-f:=:void:address_to_pointer:struct type *type, gdb_byte *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0
+f::CORE_ADDR:pointer_to_address:struct type *type, const gdb_byte *buf:type, buf::unsigned_pointer_to_address::0
+f::void:address_to_pointer:struct type *type, gdb_byte *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0
M::CORE_ADDR:integer_to_address:struct type *type, const gdb_byte *buf:type, buf
# It has been suggested that this, well actually its predecessor,
TYPE_CODE (ntype) = TYPE_CODE_PTR;
/* Mark pointers as unsigned. The target converts between pointers
- and addresses (CORE_ADDRs) using POINTER_TO_ADDRESS() and
- ADDRESS_TO_POINTER(). */
+ and addresses (CORE_ADDRs) using gdbarch_pointer_to_address and
+ gdbarch_address_to_pointer. */
TYPE_FLAGS (ntype) |= TYPE_FLAG_UNSIGNED;
if (!TYPE_POINTER_TYPE (type)) /* Remember it, if don't have one. */
void *ptr;
gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
+ gdbarch_address_to_pointer (current_gdbarch, builtin_type_void_data_ptr,
+ &ptr, addr);
return ptr;
}
memset (buf, 0, TYPE_LENGTH (value_type (val)));
/* frame.base. */
if (frame != NULL)
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_base (frame));
+ gdbarch_address_to_pointer (current_gdbarch, builtin_type_void_data_ptr,
+ buf, get_frame_base (frame));
buf += TYPE_LENGTH (builtin_type_void_data_ptr);
/* frame.XXX. */
return val;
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_base_address (frame));
+ gdbarch_address_to_pointer (current_gdbarch, builtin_type_void_data_ptr,
+ buf, get_frame_base_address (frame));
return val;
}
}
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_pc (frame));
+ gdbarch_address_to_pointer (current_gdbarch, builtin_type_void_data_ptr,
+ buf, get_frame_pc (frame));
return val;
}
}
when it won't occur. */
/* NOTE: This assumes that the significant address information is
kept in the least significant bits of ADDR - the upper bits were
- either zero or sign extended. Should ADDRESS_TO_POINTER() or
+ either zero or sign extended. Should gdbarch_address_to_pointer or
some ADDRESS_TO_PRINTABLE() be used to do the conversion? */
int addr_bit = TARGET_ADDR_BIT;
LONGEST longest;
/* When we cast pointers to integers, we mustn't use
- POINTER_TO_ADDRESS to find the address the pointer
+ gdbarch_pointer_to_address to find the address the pointer
represents, as value_as_long would. GDB should evaluate
expressions just as the compiler would --- and the compiler
sees a cast as a simple reinterpretation of the pointer's