/* See dwarf-index-cache.h. */
void
-index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
+index_cache::store (dwarf2_per_objfile *per_objfile)
{
- objfile *obj = dwarf2_per_objfile->objfile;
+ objfile *obj = per_objfile->objfile;
if (!enabled ())
return;
/* Get build id of dwz file, if present. */
gdb::optional<std::string> dwz_build_id_str;
- const dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile);
+ const dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
const char *dwz_build_id_ptr = NULL;
if (dwz != nullptr)
/* Write the index itself to the directory, using the build id as the
filename. */
- write_psymtabs_to_index (dwarf2_per_objfile, m_dir.c_str (),
+ write_psymtabs_to_index (per_objfile, m_dir.c_str (),
build_id_str.c_str (), dwz_build_id_ptr,
dw_index_kind::GDB_INDEX);
}
return m_dir + SLASH_STRING + build_id_str + suffix;
}
-/* "set index-cache" handler. */
-
-static void
-set_index_cache_command (const char *arg, int from_tty)
-{
- printf_unfiltered (_("\
-Missing arguments. See \"help set index-cache\" for help.\n"));
-}
-
/* True when we are executing "show index-cache". This is used to improve the
printout a little bit. */
static bool in_show_index_cache_command = false;
auto restore_flag = make_scoped_restore (&in_show_index_cache_command, true);
/* Call all "show index-cache" subcommands. */
- cmd_show_list (show_index_cache_prefix_list, from_tty, "");
+ cmd_show_list (show_index_cache_prefix_list, from_tty);
printf_unfiltered ("\n");
printf_unfiltered
warning (_("Couldn't determine a path for the index cache directory."));
/* set index-cache */
- add_prefix_cmd ("index-cache", class_files, set_index_cache_command,
- _("Set index-cache options."), &set_index_cache_prefix_list,
- "set index-cache ", false, &setlist);
+ add_basic_prefix_cmd ("index-cache", class_files,
+ _("Set index-cache options."),
+ &set_index_cache_prefix_list,
+ "set index-cache ", false, &setlist);
/* show index-cache */
add_prefix_cmd ("index-cache", class_files, show_index_cache_command,