This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc][33/37] Eliminate builtin_type_ macros: Default target word size
- From: uweigand at de dot ibm dot com
- To: gdb-patches at sourceware dot org
- Date: Sun, 31 Aug 2008 19:51:18 +0200
- Subject: [rfc][33/37] Eliminate builtin_type_ macros: Default target word size
- References: <20080831175045.128504000@de.ibm.com>
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