This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[rfc][33/37] Eliminate builtin_type_ macros: Default target word size


Hello,

default_auxv_parse and default_region_ok_for_hw_watchpoint used 
TYPE_LENGTH (builtin_type_void_data_ptr) to determine the default
target word size.

This patch changes them to use target_gdbarch instead.

Bye,
Ulrich


ChangeLog:

	* auxv.c (default_auxv_parse): Use gdbarch_ptr_bit (target_gdbarch)
	instead of builtin_type_void_data_ptr.
	* target.c (default_region_ok_for_hw_watchpoint): Likewise.


Index: gdb-head/gdb/auxv.c
===================================================================
--- gdb-head.orig/gdb/auxv.c
+++ gdb-head/gdb/auxv.c
@@ -82,7 +82,8 @@ int
 default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
 		   gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
 {
-  const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr);
+  const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch)
+				/ TARGET_CHAR_BIT;
   gdb_byte *ptr = *readptr;
 
   if (endptr == ptr)
Index: gdb-head/gdb/target.c
===================================================================
--- gdb-head.orig/gdb/target.c
+++ gdb-head/gdb/target.c
@@ -2152,7 +2152,7 @@ target_supports_non_stop ()
 static int
 default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
 {
-  return (len <= TYPE_LENGTH (builtin_type_void_data_ptr));
+  return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT);
 }
 
 static int

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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