+2019-05-08 Tom Tromey <tom@tromey.com>
+
+ * hppa-tdep.c (hppa_objfile_priv_data): Change type.
+ (hppa_init_objfile_priv_data, read_unwind_info)
+ (find_unwind_entry, _initialize_hppa_tdep): Update.
+
2019-05-08 Tom Tromey <tom@tromey.com>
* elfread.c (elf_objfile_gnu_ifunc_cache_data): Change type.
that separately and make this static. The solib data is probably hpux-
specific, so we can create a separate extern objfile_data that is registered
by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */
-static const struct objfile_data *hppa_objfile_priv_data = NULL;
+static const struct objfile_key<hppa_objfile_private,
+ gdb::noop_deleter<hppa_objfile_private>>
+ hppa_objfile_priv_data;
/* Get at various relevent fields of an instruction word. */
#define MASK_5 0x1f
hppa_objfile_private *priv
= OBSTACK_ZALLOC (&objfile->objfile_obstack, hppa_objfile_private);
- set_objfile_data (objfile, hppa_objfile_priv_data, priv);
+ hppa_objfile_priv_data.set (objfile, priv);
return priv;
}
compare_unwind_entries);
/* Keep a pointer to the unwind information. */
- obj_private = (struct hppa_objfile_private *)
- objfile_data (objfile, hppa_objfile_priv_data);
+ obj_private = hppa_objfile_priv_data.get (objfile);
if (obj_private == NULL)
obj_private = hppa_init_objfile_priv_data (objfile);
{
struct hppa_unwind_info *ui;
ui = NULL;
- priv = ((struct hppa_objfile_private *)
- objfile_data (objfile, hppa_objfile_priv_data));
+ priv = hppa_objfile_priv_data.get (objfile);
if (priv)
ui = ((struct hppa_objfile_private *) priv)->unwind_info;
if (!ui)
{
read_unwind_info (objfile);
- priv = ((struct hppa_objfile_private *)
- objfile_data (objfile, hppa_objfile_priv_data));
+ priv = hppa_objfile_priv_data.get (objfile);
if (priv == NULL)
error (_("Internal error reading unwind information."));
ui = ((struct hppa_objfile_private *) priv)->unwind_info;
{
gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
- hppa_objfile_priv_data = register_objfile_data ();
-
add_cmd ("unwind", class_maintenance, unwind_command,
_("Print unwind table entry at given address."),
&maintenanceprintlist);