From 7efb57c33d3a34339e53ed959d42e1e21c938ca2 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 29 Apr 1993 07:07:39 +0000 Subject: * 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. --- gdb/defs.h | 63 ++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 22 deletions(-) (limited to 'gdb/defs.h') diff --git a/gdb/defs.h b/gdb/defs.h index 58aa9f5..3d03b9a 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -506,29 +506,48 @@ enum val_prettyprint #define TARGET_PTR_BIT TARGET_INT_BIT #endif -/* Convert a LONGEST to an int. This is used in contexts (e.g. number - of arguments to a function, number in a value history, register - number, etc.) where the value must not be larger than can fit - in an int. */ -#if !defined (longest_to_int) -#if defined (LONG_LONG) -#define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \ - ? (error ("Value out of range."),0) : (int) (x)) -#else /* No LONG_LONG. */ -/* Assume sizeof (int) == sizeof (long). */ -#define longest_to_int(x) ((int) (x)) -#endif /* No LONG_LONG. */ -#endif /* No longest_to_int. */ - -/* This should not be a typedef, because "unsigned LONGEST" needs - to work. LONG_LONG is defined if the host has "long long". */ +/* Default to support for "long long" if the host compiler being used is gcc. + Config files must define CC_HAS_LONG_LONG to use other host compilers + that are capable of supporting "long long", and to cause gdb to use that + support. Not defining CC_HAS_LONG_LONG will suppress use of "long long" + regardless of what compiler is used. + + FIXME: For now, automatic selection of "long long" as the default when + gcc is used is disabled, pending further testing. Concerns include the + impact on gdb performance and the universality of bugfree long long + support on platforms that do have gcc. Compiling with FORCE_LONG_LONG + will select "long long" use for testing purposes. -fnf */ + +#ifndef CC_HAS_LONG_LONG +# if defined (__GNUC__) && defined (FORCE_LONG_LONG) /* See FIXME above */ +# define CC_HAS_LONG_LONG 1 +# endif +#endif + +/* LONGEST should not be a typedef, because "unsigned LONGEST" needs to work. + CC_HAS_LONG_LONG is defined if the host compiler supports "long long" + variables and we wish to make use of that support. */ #ifndef LONGEST -# ifdef LONG_LONG -# define LONGEST long long -# else -# define LONGEST long -# endif +# ifdef CC_HAS_LONG_LONG +# define LONGEST long long +# else +# define LONGEST long +# endif +#endif + +/* Convert a LONGEST to an int. This is used in contexts (e.g. number of + arguments to a function, number in a value history, register number, etc.) + where the value must not be larger than can fit in an int. */ + +#ifndef longest_to_int +# ifdef CC_HAS_LONG_LONG +# define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \ + ? (error ("Value out of range."),0) : (int) (x)) +# else + /* Assume sizeof (int) == sizeof (long). */ +# define longest_to_int(x) ((int) (x)) +# endif #endif /* If we picked up a copy of CHAR_BIT from a configuration file @@ -653,7 +672,7 @@ strsignal PARAMS ((int)); #ifndef PSIGNAL_IN_SIGNAL_H extern void -psignal PARAMS ((unsigned, char *)); +psignal PARAMS ((unsigned, const char *)); #endif /* For now, we can't include because it conflicts with -- cgit v1.1