Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
Based on a port by Sid Manning <sid@us.ibm.com>.
Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
Based on a port by Sid Manning <sid@us.ibm.com>.
return status;
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
memset (reg, 0, sizeof reg);
return status;
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
memset (reg, 0, sizeof reg);
- target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
if (status != REG_VALID)
return status;
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
if (status != REG_VALID)
return status;
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
- target_read (target_stack, TARGET_OBJECT_SPU, annex, buf, 0, 16);
+ target_read (current_top_target (), TARGET_OBJECT_SPU, annex, buf, 0, 16);
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
xsnprintf (reg, sizeof reg, "0x%s",
phex_nz (extract_unsigned_integer (buf, 4, byte_order), 4));
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
xsnprintf (reg, sizeof reg, "0x%s",
phex_nz (extract_unsigned_integer (buf, 4, byte_order), 4));
- target_write (target_stack, TARGET_OBJECT_SPU, annex,
+ target_write (current_top_target (), TARGET_OBJECT_SPU, annex,
case SPU_FPSCR_REGNUM:
regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
case SPU_FPSCR_REGNUM:
regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
- target_write (target_stack, TARGET_OBJECT_SPU, annex, buf, 0, 16);
+ target_write (current_top_target (), TARGET_OBJECT_SPU, annex, buf, 0, 16);
- regcache_cooked_write_part (regcache, regnum, preferred_slot, len, in);
+ regcache->cooked_write_part (regnum, preferred_slot, len, in);
- regcache_cooked_write_part (regcache, regnum, 0, len, in);
+ regcache->cooked_write_part (regnum, 0, len, in);
- regcache_cooked_read_part (regcache, regnum, preferred_slot, len, out);
+ regcache->cooked_read_part (regnum, preferred_slot, len, out);
- regcache_cooked_read_part (regcache, regnum, 0, len, out);
+ regcache->cooked_read_part (regnum, 0, len, out);
spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
/* Set the return address. */
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (bp_addr));
/* Set the return address. */
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (bp_addr));
/* If STRUCT_RETURN is true, then the struct return address (in
STRUCT_ADDR) will consume the first argument-passing register.
Both adjust the register count and store that value. */
/* If STRUCT_RETURN is true, then the struct return address (in
STRUCT_ADDR) will consume the first argument-passing register.
Both adjust the register count and store that value. */
{
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr));
{
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr));
target_write_memory (sp, buf, 16);
/* Finally, update all slots of the SP register. */
target_write_memory (sp, buf, 16);
/* Finally, update all slots of the SP register. */
CORE_ADDR sp_slot = extract_unsigned_integer (buf + 4*i, 4, byte_order);
store_unsigned_integer (buf + 4*i, 4, byte_order, sp_slot + sp_delta);
}
CORE_ADDR sp_slot = extract_unsigned_integer (buf + 4*i, 4, byte_order);
store_unsigned_integer (buf + 4*i, 4, byte_order, sp_slot + sp_delta);
}
- regcache_cooked_write_part (regcache, SPU_ARG1_REGNUM, 2, 2, in);
+ regcache->cooked_write_part (SPU_ARG1_REGNUM, 2, 2, in);
else
spu_value_to_regcache (regcache, SPU_ARG1_REGNUM, type, in);
break;
else
spu_value_to_regcache (regcache, SPU_ARG1_REGNUM, type, in);
break;
- regcache_cooked_read_part (regcache, SPU_ARG1_REGNUM, 2, 2, out);
+ regcache->cooked_read_part (SPU_ARG1_REGNUM, 2, 2, out);
else
spu_regcache_to_value (regcache, SPU_ARG1_REGNUM, type, out);
break;
else
spu_regcache_to_value (regcache, SPU_ARG1_REGNUM, type, out);
break;
-- this is not the correct behaviour.
The workaround is to check whether the PID we are asked to remove this
-- this is not the correct behaviour.
The workaround is to check whether the PID we are asked to remove this
PID of the current inferior (i.e. current_inferior ()->pid). This is only
true in the context of detach_breakpoints. If so, we simply do nothing.
[ Note that for the fork child process, it does not matter if breakpoints
remain inserted, because those SPU contexts are not runnable anyway --
the Linux kernel allows only the original process to invoke spu_run. */
PID of the current inferior (i.e. current_inferior ()->pid). This is only
true in the context of detach_breakpoints. If so, we simply do nothing.
[ Note that for the fork child process, it does not matter if breakpoints
remain inserted, because those SPU contexts are not runnable anyway --
the Linux kernel allows only the original process to invoke spu_run. */
- regcache_raw_read_part (regcache, reg, 0, 4, buf);
+ regcache->raw_read_part (reg, 0, 4, buf);
CORE_ADDR pos = extract_unsigned_integer (ovly_table + 16*i + 8,
4, byte_order);
CORE_ADDR buf = extract_unsigned_integer (ovly_table + 16*i + 12,
CORE_ADDR pos = extract_unsigned_integer (ovly_table + 16*i + 8,
4, byte_order);
CORE_ADDR buf = extract_unsigned_integer (ovly_table + 16*i + 12,
- struct objfile *objfile;
-
- ALL_OBJSECTIONS (objfile, osect)
- if (section_is_overlay (osect))
- spu_overlay_update_osect (osect);
+ for (objfile *objfile : current_program_space->objfiles ())
+ ALL_OBJFILE_OSECTIONS (objfile, osect)
+ if (section_is_overlay (osect))
+ spu_overlay_update_osect (osect);
{
struct gdbarch *gdbarch = get_frame_arch (frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
{
struct gdbarch *gdbarch = get_frame_arch (frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
{
if (obj->sections != obj->sections_end
&& SPUADDR_SPU (obj_section_addr (obj->sections)) == tdep->id)
{
if (obj->sections != obj->sections_end
&& SPUADDR_SPU (obj_section_addr (obj->sections)) == tdep->id)
- call_function_by_hand (value_from_pointer (type, addr), NULL, 0, NULL);
+ call_function_by_hand (value_from_pointer (type, addr), NULL, {});
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/event_status", id);
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/event_status", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_status."));
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_status."));
event_status = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/event_mask", id);
event_status = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/event_mask", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_mask."));
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_mask."));
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/signal1", id);
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/signal1", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex, buf, 0, 4);
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU,
+ annex, buf, 0, 4);
}
xsnprintf (annex, sizeof annex, "%d/signal1_type", id);
}
xsnprintf (annex, sizeof annex, "%d/signal1_type", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal1_type."));
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal1_type."));
signal1_type = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/signal2", id);
signal1_type = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/signal2", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex, buf, 0, 4);
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU,
+ annex, buf, 0, 4);
}
xsnprintf (annex, sizeof annex, "%d/signal2_type", id);
}
xsnprintf (annex, sizeof annex, "%d/signal2_type", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal2_type."));
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal2_type."));
ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoMailbox");
xsnprintf (annex, sizeof annex, "%d/mbox_info", id);
ui_out_emit_tuple tuple_emitter (current_uiout, "SPUInfoMailbox");
xsnprintf (annex, sizeof annex, "%d/mbox_info", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
"mbox", "SPU Outbound Mailbox");
xsnprintf (annex, sizeof annex, "%d/ibox_info", id);
"mbox", "SPU Outbound Mailbox");
xsnprintf (annex, sizeof annex, "%d/ibox_info", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
"ibox", "SPU Outbound Interrupt Mailbox");
xsnprintf (annex, sizeof annex, "%d/wbox_info", id);
"ibox", "SPU Outbound Interrupt Mailbox");
xsnprintf (annex, sizeof annex, "%d/wbox_info", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/dma_info", id);
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/dma_info", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/proxydma_info", id);
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/proxydma_info", id);
- len = target_read (target_stack, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,