static struct cmd_list_element *showspucmdlist = NULL;
/* Whether to stop for new SPE contexts. */
-static int spu_stop_on_load_p = 0;
+static bool spu_stop_on_load_p = false;
/* Whether to automatically flush the SW-managed cache. */
-static int spu_auto_flush_cache_p = 1;
+static bool spu_auto_flush_cache_p = true;
/* The tdep structure. */
a target address. The overlay section is mapped iff the target
integer at this location equals MAPPED_VAL. */
-static const struct objfile_data *spu_overlay_data;
-
struct spu_overlay_table
{
CORE_ADDR mapped_ptr;
CORE_ADDR mapped_val;
};
+static objfile_key<spu_overlay_table,
+ gdb::noop_deleter<spu_overlay_table>> spu_overlay_data;
+
/* Retrieve the overlay table for OBJFILE. If not already cached, read
the _ovly_table data structure from the target and initialize the
spu_overlay_table data structure from it. */
gdb_byte *ovly_table;
int i;
- tbl = (struct spu_overlay_table *) objfile_data (objfile, spu_overlay_data);
+ tbl = spu_overlay_data.get (objfile);
if (tbl)
return tbl;
continue;
ALL_OBJFILE_OSECTIONS (objfile, osect)
- if (vma == bfd_section_vma (objfile->obfd, osect->the_bfd_section)
+ if (vma == bfd_section_vma (osect->the_bfd_section)
&& pos == osect->the_bfd_section->filepos)
{
int ndx = osect - objfile->sections;
}
xfree (ovly_table);
- set_objfile_data (objfile, spu_overlay_data, tbl);
+ spu_overlay_data.set (objfile, tbl);
return tbl;
}
/* All sections. */
else
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
spu_overlay_update_osect (osect);
struct obj_section *osect;
/* If we've already touched this file, do nothing. */
- if (!objfile || objfile_data (objfile, spu_overlay_data) != NULL)
+ if (!objfile || spu_overlay_data.get (objfile) != NULL)
return;
/* Consider only SPU objfiles. */
int ndx = osect - objfile->sections;
if (ovly_table[ndx].mapped_ptr == 0)
- bfd_section_lma (obfd, bsect) = bfd_section_vma (obfd, bsect);
+ bfd_set_section_lma (bsect, bfd_section_vma (bsect));
else
- bfd_section_lma (obfd, bsect) = SPU_OVERLAY_LMA + bsect->filepos;
+ bfd_set_section_lma (bsect, SPU_OVERLAY_LMA + bsect->filepos);
}
}
if (cust != NULL)
{
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
- struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ const struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
struct symbol *sym;
struct symtab_and_line sal;
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
return NULL;
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->objfiles ())
{
if (obj->sections != obj->sections_end
&& SPUADDR_SPU (obj_section_addr (obj->sections)) == tdep->id)
if (current_uiout->is_mi_like_p ())
{
- current_uiout->field_int ("signal1_pending", signal1_pending);
+ current_uiout->field_signed ("signal1_pending", signal1_pending);
current_uiout->field_fmt ("signal1", "0x%s", phex_nz (signal1, 4));
- current_uiout->field_int ("signal1_type", signal1_type);
- current_uiout->field_int ("signal2_pending", signal2_pending);
+ current_uiout->field_signed ("signal1_type", signal1_type);
+ current_uiout->field_signed ("signal2_pending", signal2_pending);
current_uiout->field_fmt ("signal2", "0x%s", phex_nz (signal2, 4));
- current_uiout->field_int ("signal2_type", signal2_type);
+ current_uiout->field_signed ("signal2_type", signal2_type);
}
else
{
if (spu_mfc_opcode[mfc_cmd_opcode])
current_uiout->field_string ("opcode", spu_mfc_opcode[mfc_cmd_opcode]);
else
- current_uiout->field_int ("opcode", mfc_cmd_opcode);
+ current_uiout->field_signed ("opcode", mfc_cmd_opcode);
- current_uiout->field_int ("tag", mfc_cmd_tag);
- current_uiout->field_int ("tid", tclass_id);
- current_uiout->field_int ("rid", rclass_id);
+ current_uiout->field_signed ("tag", mfc_cmd_tag);
+ current_uiout->field_signed ("tid", tclass_id);
+ current_uiout->field_signed ("rid", rclass_id);
if (ea_valid_p)
current_uiout->field_fmt ("ea", "0x%s", phex (mfc_ea, 8));
/* Add ourselves to objfile event chain. */
gdb::observers::new_objfile.attach (spu_overlay_new_objfile);
- spu_overlay_data = register_objfile_data ();
/* Install spu stop-on-load handler. */
gdb::observers::new_objfile.attach (spu_catch_start);
/* Add various "info spu" commands. */
add_cmd ("event", class_info, info_spu_event_command,
- _("Display SPU event facility status.\n"),
+ _("Display SPU event facility status."),
&infospucmdlist);
add_cmd ("signal", class_info, info_spu_signal_command,
- _("Display SPU signal notification facility status.\n"),
+ _("Display SPU signal notification facility status."),
&infospucmdlist);
add_cmd ("mailbox", class_info, info_spu_mailbox_command,
- _("Display SPU mailbox facility status.\n"),
+ _("Display SPU mailbox facility status."),
&infospucmdlist);
add_cmd ("dma", class_info, info_spu_dma_command,
- _("Display MFC DMA status.\n"),
+ _("Display MFC DMA status."),
&infospucmdlist);
add_cmd ("proxydma", class_info, info_spu_proxydma_command,
- _("Display MFC Proxy-DMA status.\n"),
+ _("Display MFC Proxy-DMA status."),
&infospucmdlist);
}