+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.
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,
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,
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)
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,
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;
}
dwarf2_per_objfile->signatured_types = sig_types_hash;
-
- return 1;
}
/* Read the address map data from the mapped index, and use it to
}
}
- 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)
{
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);