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

uweigand
2008-08-31T17:52:39Z

[-- Attachment #1: diff-type-wordsize --]
[-- Type: text/plain, Size: 1463 bytes --]

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