This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] utils.c: Revise a couple of internal_error() messages
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 26 Jul 2002 19:08:03 -0700
- Subject: [PATCH] utils.c: Revise a couple of internal_error() messages
I've just committed the patch below.
In some work that I've been doing recently, I was seeing one of these
internal errors. Unfortunately, the message string was identical for
both host_pointer_to_address() and address_to_host_pointer(), making
it difficult to tell which function was responsible. I've changed the
messages to indicate the actual function responsible for the internal
error. (I suspect that one of these functions was originally named
core_addr_to_void_ptr, but got renamed somewhere along the way without
a change to the error message.)
* utils.c (host_pointer_to_address, address_to_host_pointer):
Change internal_error() message to indicate function responsible
for the error.
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.73
diff -u -p -r1.73 utils.c
--- utils.c 24 Jul 2002 17:58:46 -0000 1.73
+++ utils.c 27 Jul 2002 01:59:47 -0000
@@ -2464,7 +2464,7 @@ host_pointer_to_address (void *ptr)
{
if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
internal_error (__FILE__, __LINE__,
- "core_addr_to_void_ptr: bad cast");
+ "host_pointer_to_address: bad cast");
return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr);
}
@@ -2474,7 +2474,7 @@ address_to_host_pointer (CORE_ADDR addr)
void *ptr;
if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
internal_error (__FILE__, __LINE__,
- "core_addr_to_void_ptr: bad cast");
+ "address_to_host_pointer: bad cast");
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
return ptr;
}