summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2002-07-31 17:01:01 +0000
committerKevin Buettner <kevinb@redhat.com>2002-07-31 17:01:01 +0000
commit81b888c1b8b95b72845bc410d83c71405eb1ceb9 (patch)
tree01976c300d3803c97b54439cd01aa80f28d5d795
parentb91d03e1ea1f91b1b52cacd4abfe4c1c6b6b3ebc (diff)
downloadgdb-81b888c1b8b95b72845bc410d83c71405eb1ceb9.tar.gz
* utils.c (host_pointer_to_address, address_to_host_pointer):
Use gdb_assert() instead of explicit call to internal_error().
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/utils.c9
2 files changed, 8 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b61a1dade39..ef18e71b1a9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (host_pointer_to_address, address_to_host_pointer):
+ Use gdb_assert() instead of explicit call to internal_error().
+
2002-07-30 Kevin Buettner <kevinb@redhat.com>
* Makefile.in (rs6000-nat.o): Update dependencies.
diff --git a/gdb/utils.c b/gdb/utils.c
index 50cab720602..01b9dbc52a1 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2462,9 +2462,7 @@ phex_nz (ULONGEST l, int sizeof_l)
CORE_ADDR
host_pointer_to_address (void *ptr)
{
- if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
- internal_error (__FILE__, __LINE__,
- "host_pointer_to_address: bad cast");
+ gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr);
}
@@ -2472,9 +2470,8 @@ void *
address_to_host_pointer (CORE_ADDR addr)
{
void *ptr;
- if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
- internal_error (__FILE__, __LINE__,
- "address_to_host_pointer: bad cast");
+
+ gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
return ptr;
}