/* Write shortcut information. */
static void
-write_shortcuts_table (cooked_index *table, data_buf& shortcuts,
- data_buf& cpool)
+write_shortcuts_table (cooked_index *table, data_buf &shortcuts,
+ data_buf &cpool)
{
const auto main_info = table->get_main ();
size_t main_name_offset = 0;
- dwarf_source_language dw_lang = (dwarf_source_language)0;
+ dwarf_source_language dw_lang = (dwarf_source_language) 0;
if (main_info != nullptr)
{
}
}
- shortcuts.append_uint (4, BFD_ENDIAN_LITTLE, dw_lang);
+ shortcuts.append_offset (dw_lang);
shortcuts.append_offset (main_name_offset);
}
set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile,
mapped_gdb_index *index)
{
- const auto expected_size = 4 + sizeof (offset_type);
+ const auto expected_size = 2 * sizeof (offset_type);
if (index->shortcut_table.size () < expected_size)
/* The data in the section is not present, is corrupted or is in a version
- * we don't know about. Regardless, we can't make use of it. */
+ we don't know about. Regardless, we can't make use of it. */
return;
auto ptr = index->shortcut_table.data ();
if (dw_lang == 0)
{
/* Don't bother if the language for the main symbol was not known or if
- * there was no main symbol at all when the index was built. */
+ there was no main symbol at all when the index was built. */
return;
}
ptr += 4;
const auto name_offset = extract_unsigned_integer (ptr,
sizeof (offset_type),
BFD_ENDIAN_LITTLE);
- const auto name = (const char*) (index->constant_pool.data () + name_offset);
+ const auto name = (const char *) (index->constant_pool.data () + name_offset);
set_objfile_main_name (per_objfile->objfile, name, (enum language) lang);
}
/* Set the language we're debugging. */
attr = dwarf2_attr (comp_unit_die, DW_AT_language, cu);
enum language lang;
- dwarf_source_language dw_lang = (dwarf_source_language)0;
+ dwarf_source_language dw_lang = (dwarf_source_language) 0;
if (cu->producer != nullptr
&& strstr (cu->producer, "IBM XL C for OpenCL") != NULL)
{
else if (attr != nullptr)
{
lang = dwarf_lang_to_enum_language (attr->constant_value (0));
- dw_lang = (dwarf_source_language)attr->constant_value (0);
+ dw_lang = (dwarf_source_language) attr->constant_value (0);
}
else
lang = pretend_language;
std::vector <dwarf2_per_cu_data *> *imported_symtabs = nullptr;
/* The original DW_LANG_* value of the CU, as provided to us by
- * DW_AT_language. It is interesting to keep this value around in cases where
- * we can't use the values from the language enum, as the mapping to them is
- * lossy, and, while that is usually fine, things like the index have an
- * understandable bias towards not exposing internal GDB structures to the
- * outside world, and so prefer to use DWARF constants in their stead. */
+ DW_AT_language. It is interesting to keep this value around in cases where
+ we can't use the values from the language enum, as the mapping to them is
+ lossy, and, while that is usually fine, things like the index have an
+ understandable bias towards not exposing internal GDB structures to the
+ outside world, and so prefer to use DWARF constants in their stead. */
dwarf_source_language dw_lang;
/* Return true of IMPORTED_SYMTABS is empty or not yet allocated. */