aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-valprint.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:28:47 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:28:47 +0000
commitb806fb9a9bd4e0e47382c411d6e9321d1283445b (patch)
tree0b11c8ae8819ea9025164c82b62d0e109ebb35a4 /gdb/f-valprint.c
parent3e3b026fee8cd62ac6c2cfc7f86cec972d8f5676 (diff)
downloadgdb-b806fb9a9bd4e0e47382c411d6e9321d1283445b.zip
gdb-b806fb9a9bd4e0e47382c411d6e9321d1283445b.tar.gz
gdb-b806fb9a9bd4e0e47382c411d6e9321d1283445b.tar.bz2
* expprint.c (print_subexp_standard): Compare against builtin type
associated with exp->gdbarch instead of builtin_type_char. * f-valprint.c (f_val_print): Use extract_unsigned_integer to extract values of arbitrary logical type. Handle arbitrary complex types. * printcmd.c (float_type_from_length): New function. (print_scalar_formatted, printf_command): Use it.
Diffstat (limited to 'gdb/f-valprint.c')
-rw-r--r--gdb/f-valprint.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 9dbaf18..26aa83b 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -523,26 +523,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
print_scalar_formatted (valaddr, type, format, 0, stream);
else
{
- val = 0;
- switch (TYPE_LENGTH (type))
- {
- case 1:
- val = unpack_long (builtin_type_f_logical_s1, valaddr);
- break;
-
- case 2:
- val = unpack_long (builtin_type_f_logical_s2, valaddr);
- break;
-
- case 4:
- val = unpack_long (builtin_type_f_logical, valaddr);
- break;
-
- default:
- error (_("Logicals of length %d bytes not supported"),
- TYPE_LENGTH (type));
-
- }
+ val = extract_unsigned_integer (valaddr, TYPE_LENGTH (type));
if (val == 0)
fprintf_filtered (stream, ".FALSE.");
@@ -562,20 +543,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_COMPLEX:
- switch (TYPE_LENGTH (type))
- {
- case 8:
- type = builtin_type_f_real;
- break;
- case 16:
- type = builtin_type_f_real_s8;
- break;
- case 32:
- type = builtin_type_f_real_s16;
- break;
- default:
- error (_("Cannot print out complex*%d variables"), TYPE_LENGTH (type));
- }
+ type = TYPE_TARGET_TYPE (type);
fputs_filtered ("(", stream);
print_floating (valaddr, type, stream);
fputs_filtered (",", stream);