gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 9 Dec 2012 18:39:59 +0000 (18:39 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 9 Dec 2012 18:39:59 +0000 (18:39 +0000)
* 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.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/defs.h
gdb/doc/ChangeLog
gdb/doc/gdbint.texinfo
gdb/dwarf2-frame.c
gdb/dwarf2read.c
gdb/printcmd.c

index aa0338dff2b7467d61b01a2cecc9432508297489..67b710a2ad5e4b72337341297cec9f5c922e5946 100644 (file)
@@ -1,3 +1,23 @@
+2012-12-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * 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  <jan.kratochvil@redhat.com>
 
        * dwarf2read.c (struct dwarf2_cu): New field producer_is_gcc_lt_4_3.
index b54d245328acc35d523a0c56ce5fde9d1559e365..9e21325b1e90c76c17e16ab689708bd2f7833ba4 100644 (file)
@@ -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.
    */
index e34229bea4d9724ad6217e3aae25068f42bef170..fdfd17cd148f91275b4c05a4837d75f17d1d2ff2 100755 (executable)
@@ -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.
index 2bfbe73e331cfc817ebb6cb0bfa7a3e54cfe1ee1..db528040d6b57f21c8463485c95c795c4312fc1a 100644 (file)
@@ -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.
index 5e8a68141f0cdafd04cbc26b42456ae83957b086..369ee7a6149559337c43dd5343bbffc536d6ab66 100644 (file)
@@ -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 */
 
index 1f4aa551f72d04e43342605ec565049cff31d64b..245826f1c6f5152a2faf38b255011148cf326d16 100644 (file)
@@ -1,3 +1,7 @@
+2012-12-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG.
+
 2012-11-29  Tom Tromey  <tromey@redhat.com>
 
        * gdb.texinfo (SVR4 Process Information): Document missing
index 34b0bec07d3964c576ef4eea51e74c70de7bd26c..5dbf7bf585cb3fb03fddc6341a69987f64988ef3 100644 (file)
@@ -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
index dcfbeb7be596a747fc1b88f1da6ae9fffe4da1aa..5662cc285f07750ea5d71d8693d5bac777d1d6a0 100644 (file)
@@ -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.  */
index 35e9bb4c74799322431f31c4d95020faba4fcbd0..6eea17e69817a0971b8e647dbe9ee5b4611d8cbf 100644 (file)
@@ -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);
index 143bd0eaec80852da1e7a41ce43d31af5b74a23b..25b14e1ccb86a877092e2da46ba1c590d45c37b5 100644 (file)
@@ -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';
This page took 0.052915 seconds and 4 git commands to generate.