This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] s/extract_address/.../ for *lang*
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 23 May 2003 23:02:42 -0400
- Subject: [commit] s/extract_address/.../ for *lang*
More of the same.
Andrew
2003-05-23 Andrew Cagney <cagney@redhat.com>
* p-valprint.c (pascal_val_print): Replace extract_address with
the inline equivalent extract_unsigned_integer.
* jv-valprint.c (java_value_print): Ditto.
* ada-valprint.c (ada_val_print_1): Ditto.
* ada-lang.h (EXTRACT_ADDRESS): Ditto.
Index: ada-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.h,v
retrieving revision 1.5
diff -u -r1.5 ada-lang.h
--- ada-lang.h 14 May 2003 17:43:15 -0000 1.5
+++ ada-lang.h 24 May 2003 02:20:52 -0000
@@ -27,9 +27,9 @@
struct block;
-/* A macro to reorder the bytes of an address depending on the endiannes
- of the target */
-#define EXTRACT_ADDRESS(x) ((void *) extract_address (&(x), sizeof (x)))
+/* A macro to reorder the bytes of an address depending on the
+ endiannes of the target. */
+#define EXTRACT_ADDRESS(x) ((void *) extract_unsigned_integer (&(x), sizeof (x)))
/* A macro to reorder the bytes of an int depending on the endiannes
of the target */
#define EXTRACT_INT(x) ((int) extract_signed_integer (&(x), sizeof (x)))
Index: ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.8
diff -u -r1.8 ada-valprint.c
--- ada-valprint.c 15 May 2003 22:18:42 -0000 1.8
+++ ada-valprint.c 24 May 2003 02:20:54 -0000
@@ -742,9 +742,11 @@
if (addressprint)
{
fprintf_filtered (stream, "@");
+ /* Extract an address, assume that the address is unsigned. */
print_address_numeric
- (extract_address (valaddr,
- TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
+ (extract_unsigned_integer (valaddr,
+ TARGET_PTR_BIT / HOST_CHAR_BIT),
+ 1, stream);
if (deref_ref)
fputs_filtered (": ", stream);
}
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.13
diff -u -r1.13 jv-valprint.c
--- jv-valprint.c 15 May 2003 22:18:42 -0000 1.13
+++ jv-valprint.c 24 May 2003 02:21:00 -0000
@@ -110,14 +110,22 @@
{
read_memory (address, buf, sizeof (buf));
address += TARGET_PTR_BIT / HOST_CHAR_BIT;
- element = extract_address (buf, sizeof (buf));
+ /* FIXME: cagney/2003-05-24: Bogus or what. It
+ pulls a host sized pointer out of the target and
+ then extracts that as an address (while assuming
+ that the address is unsigned)! */
+ element = extract_unsigned_integer (buf, sizeof (buf));
}
for (reps = 1; i + reps < length; reps++)
{
read_memory (address, buf, sizeof (buf));
address += TARGET_PTR_BIT / HOST_CHAR_BIT;
- next_element = extract_address (buf, sizeof (buf));
+ /* FIXME: cagney/2003-05-24: Bogus or what. It
+ pulls a host sized pointer out of the target and
+ then extracts that as an address (while assuming
+ that the address is unsigned)! */
+ next_element = extract_unsigned_integer (buf, sizeof (buf));
if (next_element != element)
break;
}
@@ -468,7 +476,8 @@
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
- print_address_demangle (extract_address (valaddr, TYPE_LENGTH (type)),
+ /* Extract an address, assume that it is unsigned. */
+ print_address_demangle (extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
stream, demangle);
break;
}
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.18
diff -u -r1.18 p-valprint.c
--- p-valprint.c 15 May 2003 22:18:43 -0000 1.18
+++ p-valprint.c 24 May 2003 02:21:00 -0000
@@ -141,7 +141,8 @@
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
- print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
+ /* Extract the address, assume that it is unsigned. */
+ print_address_demangle (extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type)),
stream, demangle);
break;
}
@@ -272,9 +273,11 @@
if (addressprint)
{
fprintf_filtered (stream, "@");
+ /* Extract the address, assume that it is unsigned. */
print_address_numeric
- (extract_address (valaddr + embedded_offset,
- TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
+ (extract_unsigned_integer (valaddr + embedded_offset,
+ TARGET_PTR_BIT / HOST_CHAR_BIT),
+ 1, stream);
if (deref_ref)
fputs_filtered (": ", stream);
}
@@ -312,10 +315,11 @@
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */
- print_address_demangle (extract_address (
- valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
- TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
- stream, demangle);
+ /* Extract the address, assume that it is unsigned. */
+ print_address_demangle
+ (extract_unsigned_integer (valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+ TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
+ stream, demangle);
}
else
{