From: Jan Kratochvil Date: Sun, 9 Dec 2012 18:39:59 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74a0d9f6a586186cda0bc6bdd60dcd879716a8e9;p=binutils-gdb.git gdb/ * configure.ac (CC_HAS_LONG_LONG): Replace by AC_MSG_ERROR. * defs.h (LONGEST, ULONGEST): Remove conditionalization for CC_HAS_LONG_LONG. * dwarf2-frame.c (DW64_CIE_ID): Likewise. * dwarf2read.c (extract_cu_value): Remove the function. (create_cus_from_index_list): Make the return type void, inline the extract_cu_value caller, include new gdb_static_assert. (create_cus_from_index): Make the return type void, update the function comment, update the create_cus_from_index_list caller. (create_signatured_type_table_from_index): Make the return type void, inline the extract_cu_value caller, include new gdb_static_assert. (dwarf2_read_index): Update the create_cus_from_index and create_signatured_type_table_from_index caller. * printcmd.c (ui_printf): Remove conditionalizations for CC_HAS_LONG_LONG. * config.in: Regenerate. * configure: Regenerate. gdb/doc/ * gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa0338dff2b..67b710a2ad5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2012-12-09 Jan Kratochvil + + * configure.ac (CC_HAS_LONG_LONG): Replace by AC_MSG_ERROR. + * defs.h (LONGEST, ULONGEST): Remove conditionalization for + CC_HAS_LONG_LONG. + * dwarf2-frame.c (DW64_CIE_ID): Likewise. + * dwarf2read.c (extract_cu_value): Remove the function. + (create_cus_from_index_list): Make the return type void, inline the + extract_cu_value caller, include new gdb_static_assert. + (create_cus_from_index): Make the return type void, update the function + comment, update the create_cus_from_index_list caller. + (create_signatured_type_table_from_index): Make the return type void, + inline the extract_cu_value caller, include new gdb_static_assert. + (dwarf2_read_index): Update the create_cus_from_index and + create_signatured_type_table_from_index caller. + * printcmd.c (ui_printf): Remove conditionalizations for + CC_HAS_LONG_LONG. + * config.in: Regenerate. + * configure: Regenerate. + 2012-12-09 Jan Kratochvil * dwarf2read.c (struct dwarf2_cu): New field producer_is_gcc_lt_4_3. diff --git a/gdb/config.in b/gdb/config.in index b54d245328a..9e21325b1e9 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -12,9 +12,6 @@ /* Directory of programs. */ #undef BINDIR -/* Define to 1 if the compiler supports long long. */ -#undef CC_HAS_LONG_LONG - /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ diff --git a/gdb/configure b/gdb/configure index e34229bea4d..fdfd17cd148 100755 --- a/gdb/configure +++ b/gdb/configure @@ -11602,10 +11602,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5 $as_echo "$gdb_cv_c_long_long" >&6; } -if test $gdb_cv_c_long_long = yes; then - -$as_echo "#define CC_HAS_LONG_LONG 1" >>confdefs.h - +if test $gdb_cv_c_long_long != yes; then + # libdecnumber requires long long. + as_fn_error "Compiler must support long long for GDB." "$LINENO" 5 fi # Check if the compiler and runtime support printing long longs. diff --git a/gdb/configure.ac b/gdb/configure.ac index 2bfbe73e331..db528040d6b 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1556,9 +1556,9 @@ AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long, [[switch (foo & 2) { case 0: return 1; }]])], gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)]) -if test $gdb_cv_c_long_long = yes; then - AC_DEFINE(CC_HAS_LONG_LONG, 1, - [Define to 1 if the compiler supports long long.]) +if test $gdb_cv_c_long_long != yes; then + # libdecnumber requires long long. + AC_MSG_ERROR([Compiler must support long long for GDB.]) fi # Check if the compiler and runtime support printing long longs. diff --git a/gdb/defs.h b/gdb/defs.h index 5e8a68141f0..369ee7a6149 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -125,20 +125,8 @@ typedef bfd_vma CORE_ADDR; #else /* No BFD64 */ -#ifdef CC_HAS_LONG_LONG #define LONGEST long long #define ULONGEST unsigned long long -#else -#ifdef BFD_HOST_64_BIT -/* BFD_HOST_64_BIT is defined for some hosts that don't have long long - (e.g. i386-windows) so try it. */ -#define LONGEST BFD_HOST_64_BIT -#define ULONGEST BFD_HOST_U_64_BIT -#else -#define LONGEST long -#define ULONGEST unsigned long -#endif -#endif #endif /* No BFD64 */ diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 1f4aa551f72..245826f1c6f 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2012-12-09 Jan Kratochvil + + * gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG. + 2012-11-29 Tom Tromey * gdb.texinfo (SVR4 Process Information): Document missing diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 34b0bec07d3..5dbf7bf585c 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2761,11 +2761,6 @@ Substitute for isatty, if not available. @item FOPEN_RB Define this if binary files are opened the same way as text files. -@item CC_HAS_LONG_LONG -@cindex @code{long long} data type -Define this if the host C compiler supports @code{long long}. This is set -by the @code{configure} script. - @item PRINTF_HAS_LONG_LONG Define this if the host can handle printing of long long integers via the printf format conversion specifier @code{ll}. This is set by the diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index dcfbeb7be59..5662cc285f0 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -1805,11 +1805,7 @@ add_fde (struct dwarf2_fde_table *fde_table, struct dwarf2_fde *fde) fde_table->entries[fde_table->num_entries - 1] = fde; } -#ifdef CC_HAS_LONG_LONG #define DW64_CIE_ID 0xffffffffffffffffULL -#else -#define DW64_CIE_ID ~0 -#endif /* Defines the type of eh_frames that are expected to be decoded: CIE, FDE or any of them. */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 35e9bb4c747..6eea17e6981 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2356,33 +2356,10 @@ dw2_get_primary_cu (int index) return dwarf2_per_objfile->all_comp_units[index]; } -/* A helper function that knows how to read a 64-bit value in a way - that doesn't make gdb die. Returns 1 if the conversion went ok, 0 - otherwise. */ - -static int -extract_cu_value (const char *bytes, ULONGEST *result) -{ - if (sizeof (ULONGEST) < 8) - { - int i; - - /* Ignore the upper 4 bytes if they are all zero. */ - for (i = 0; i < 4; ++i) - if (bytes[i + 4] != 0) - return 0; - - *result = extract_unsigned_integer (bytes, 4, BFD_ENDIAN_LITTLE); - } - else - *result = extract_unsigned_integer (bytes, 8, BFD_ENDIAN_LITTLE); - return 1; -} - /* A helper for create_cus_from_index that handles a given list of CUs. */ -static int +static void create_cus_from_index_list (struct objfile *objfile, const gdb_byte *cu_list, offset_type n_elements, struct dwarf2_section_info *section, @@ -2396,9 +2373,9 @@ create_cus_from_index_list (struct objfile *objfile, struct dwarf2_per_cu_data *the_cu; ULONGEST offset, length; - if (!extract_cu_value (cu_list, &offset) - || !extract_cu_value (cu_list + 8, &length)) - return 0; + gdb_static_assert (sizeof (ULONGEST) >= 8); + offset = extract_unsigned_integer (cu_list, 8, BFD_ENDIAN_LITTLE); + length = extract_unsigned_integer (cu_list + 8, 8, BFD_ENDIAN_LITTLE); cu_list += 2 * 8; the_cu = OBSTACK_ZALLOC (&objfile->objfile_obstack, @@ -2412,15 +2389,12 @@ create_cus_from_index_list (struct objfile *objfile, the_cu->is_dwz = is_dwz; dwarf2_per_objfile->all_comp_units[base_offset + i / 2] = the_cu; } - - return 1; } /* Read the CU list from the mapped index, and use it to create all - the CU objects for this objfile. Return 0 if something went wrong, - 1 if everything went ok. */ + the CU objects for this objfile. */ -static int +static void create_cus_from_index (struct objfile *objfile, const gdb_byte *cu_list, offset_type cu_list_elements, const gdb_byte *dwz_list, offset_type dwz_elements) @@ -2433,21 +2407,20 @@ create_cus_from_index (struct objfile *objfile, dwarf2_per_objfile->n_comp_units * sizeof (struct dwarf2_per_cu_data *)); - if (!create_cus_from_index_list (objfile, cu_list, cu_list_elements, - &dwarf2_per_objfile->info, 0, 0)) - return 0; + create_cus_from_index_list (objfile, cu_list, cu_list_elements, + &dwarf2_per_objfile->info, 0, 0); if (dwz_elements == 0) - return 1; + return; dwz = dwarf2_get_dwz_file (); - return create_cus_from_index_list (objfile, dwz_list, dwz_elements, - &dwz->info, 1, cu_list_elements / 2); + create_cus_from_index_list (objfile, dwz_list, dwz_elements, &dwz->info, 1, + cu_list_elements / 2); } /* Create the signatured type hash table from the index. */ -static int +static void create_signatured_type_table_from_index (struct objfile *objfile, struct dwarf2_section_info *section, const gdb_byte *bytes, @@ -2470,9 +2443,10 @@ create_signatured_type_table_from_index (struct objfile *objfile, ULONGEST offset, type_offset_in_tu, signature; void **slot; - if (!extract_cu_value (bytes, &offset) - || !extract_cu_value (bytes + 8, &type_offset_in_tu)) - return 0; + gdb_static_assert (sizeof (ULONGEST) >= 8); + offset = extract_unsigned_integer (bytes, 8, BFD_ENDIAN_LITTLE); + type_offset_in_tu = extract_unsigned_integer (bytes + 8, 8, + BFD_ENDIAN_LITTLE); signature = extract_unsigned_integer (bytes + 16, 8, BFD_ENDIAN_LITTLE); bytes += 3 * 8; @@ -2495,8 +2469,6 @@ create_signatured_type_table_from_index (struct objfile *objfile, } dwarf2_per_objfile->signatured_types = sig_types_hash; - - return 1; } /* Read the address map data from the mapped index, and use it to @@ -2793,9 +2765,8 @@ dwarf2_read_index (struct objfile *objfile) } } - if (!create_cus_from_index (objfile, cu_list, cu_list_elements, - dwz_list, dwz_list_elements)) - return 0; + create_cus_from_index (objfile, cu_list, cu_list_elements, dwz_list, + dwz_list_elements); if (types_list_elements) { @@ -2809,10 +2780,8 @@ dwarf2_read_index (struct objfile *objfile) section = VEC_index (dwarf2_section_info_def, dwarf2_per_objfile->types, 0); - if (!create_signatured_type_table_from_index (objfile, section, - types_list, - types_list_elements)) - return 0; + create_signatured_type_table_from_index (objfile, section, types_list, + types_list_elements); } create_addrmap_from_index (objfile, &local_map); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 143bd0eaec8..25b14e1ccb8 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2221,7 +2221,7 @@ ui_printf (char *arg, struct ui_file *stream) error (_("long double not supported in printf")); #endif case long_long_arg: -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG { long long val = value_as_long (val_args[i]); @@ -2356,7 +2356,7 @@ ui_printf (char *arg, struct ui_file *stream) handle %p as glibc would: %#x or a literal "(nil)". */ char *p, *fmt, *fmt_p; -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG long long val = value_as_long (val_args[i]); #else long val = value_as_long (val_args[i]); @@ -2391,7 +2391,7 @@ ui_printf (char *arg, struct ui_file *stream) gdb_assert (*p == 'p' && *(p + 1) == '\0'); if (val != 0) { -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) +#ifdef PRINTF_HAS_LONG_LONG *fmt_p++ = 'l'; #endif *fmt_p++ = 'l';