aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-04-29 07:07:39 +0000
committerFred Fish <fnf@specifix.com>1993-04-29 07:07:39 +0000
commit7efb57c33d3a34339e53ed959d42e1e21c938ca2 (patch)
tree4f3721162f566308e7ea6928a0ac8521932e909f /gdb/values.c
parent3602ba816321c98552a25ed520495e8c6443909c (diff)
downloadgdb-7efb57c33d3a34339e53ed959d42e1e21c938ca2.zip
gdb-7efb57c33d3a34339e53ed959d42e1e21c938ca2.tar.gz
gdb-7efb57c33d3a34339e53ed959d42e1e21c938ca2.tar.bz2
* defs.h (CC_HAS_LONG_LONG): Set up to define CC_HAS_LONG_LONG
when compiling with gcc, but disable it for now. See comment. * defs.h (LONGEST): Define as either "long" or "long long" based on CC_HAS_LONG_LONG. * defs.h (longest_to_int): Use CC_HAS_LONG_LONG to control how longest_to_int is defined. * c-valprint.c (c_val_print): Call print_longest. * expprint.c (dump_expression): Use PRINTF_HAS_LONG_LONG instead of LONG_LONG. * {printcmd.c, gdbtypes.h} (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * printcmd.c (print_scalar_formatted): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * typeprint.c (print_type_scalar): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * valprint.c (val_print_type_code_int): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * stabsread.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * value.h (struct value): Replace usage of LONG_LONG with CC_HAS_LONG_LONG. * value.h (print_longest): Add prototype. * values.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * values.c (unpack_double): Collapse code that was unnecessarily dependent on CC_HAS_LONG_LONG. Use LONGEST instead of direct types. * values.c (value_from_longest): Remove dependency on CC_HAS_LONG_LONG and just use LONGEST. * solib.c (solib_map_sections): Use bfd_get_filename to access filename field. * solib.c (clear_solib): Save filename and free it later, after bfd_close, since bfd_close may reference it. Use bfd_get_filename to access the field. * config/convex/xm-convex.h (LONG_LONG): Replace with CC_HAS_LONG_LONG. Add define for PRINTF_HAS_LONG_LONG. * doc/gdbint.texinfo (LONG_LONG): Replace with CC_HAS_LONG_LONG. Add PRINTF_HAS_LONG_LONG references.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 58c19bf..c4a04ff 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -637,7 +637,7 @@ unpack_long (type, valaddr)
SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
return retval;
}
-#ifdef LONG_LONG
+#ifdef CC_HAS_LONG_LONG
if (len == sizeof (long long))
{
unsigned long long retval;
@@ -685,7 +685,7 @@ unpack_long (type, valaddr)
return retval;
}
-#ifdef LONG_LONG
+#ifdef CC_HAS_LONG_LONG
if (len == sizeof (long long))
{
long long retval;
@@ -717,6 +717,15 @@ unpack_long (type, valaddr)
SWAP_TARGET_AND_HOST (&retval, len);
return retval;
}
+#ifdef CC_HAS_LONG_LONG
+ else if (len == sizeof(long long))
+ {
+ unsigned long long retval;
+ memcpy (&retval, valaddr, len);
+ SWAP_TARGET_AND_HOST (&retval, len);
+ return retval;
+ }
+#endif
}
else if (code == TYPE_CODE_MEMBER)
error ("not implemented: member types in unpack_long");
@@ -775,11 +784,7 @@ unpack_double (type, valaddr, invp)
}
else if (nosign) {
/* Unsigned -- be sure we compensate for signed LONGEST. */
-#ifdef LONG_LONG
- return (unsigned long long) unpack_long (type, valaddr);
-#else
- return (unsigned long ) unpack_long (type, valaddr);
-#endif
+ return (unsigned LONGEST) unpack_long (type, valaddr);
} else {
/* Signed -- we are OK with unpack_long. */
return unpack_long (type, valaddr);
@@ -1393,10 +1398,8 @@ value_from_longest (type, num)
* (int *) VALUE_CONTENTS_RAW (val) = num;
else if (len == sizeof (long))
* (long *) VALUE_CONTENTS_RAW (val) = num;
-#ifdef LONG_LONG
- else if (len == sizeof (long long))
- * (long long *) VALUE_CONTENTS_RAW (val) = num;
-#endif
+ else if (len == sizeof (LONGEST))
+ * (LONGEST *) VALUE_CONTENTS_RAW (val) = num;
else
error ("Integer type encountered with unexpected data length.");
}