aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-05-05 13:24:49 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-05-05 13:24:49 +0000
commitfb14de7bbddf9dc2f97af953b95b5aa5ea9889c4 (patch)
tree8c3aed3cae160e56394d2cdd183b3427f5e92dd0 /gdb/remote-mips.c
parent738a79f66913b32e392c15c1373c1ea39f808914 (diff)
downloadgdb-fb14de7bbddf9dc2f97af953b95b5aa5ea9889c4.zip
gdb-fb14de7bbddf9dc2f97af953b95b5aa5ea9889c4.tar.gz
gdb-fb14de7bbddf9dc2f97af953b95b5aa5ea9889c4.tar.bz2
* inferior.h (read_pc, write_pc): Remove.
* regcache.c (read_pc, write_pc): Remove. * infrun.c (displaced_step_fixup): Use regcache_read_pc instead of read_pc. (handle_inferior_event): Use regcache_read_pc instead of read_pc when determining value of stop_pc. Replace subsequent uses of read_pc by inspecting already-retrieved stop_pc value. (keep_going): Use regcache_read_pc instead of read_pc. * breakpoint.c (watchpoint_check): Use current frame architecture and PC instead of current_gdbarch and read_pc (). * tracepoint.c (set_traceframe_context): Replace PC argument with FRAME argument. (trace_start_command, finish_tfind_command): Update calls. (finish_tfind_command): Compare frame IDs to identify transitions between frames. (trace_find_pc_command): Use regcache_read_pc instead of read_pc. * rs6000-nat.c (exec_one_dummy_insn): Pass in regcache instead of gdbarch. Use regcache_read_pc and regcache_write_pc instead of read_pc and write_pc. (store_register): Make regcache argument non-const. Update call to exec_one_dummy_insn. * thread.c (switch_to_thread): Use regcache_read_pc instead of read_pc. * infcmd.c (post_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-sunos.c (sunos_solib_create_inferior_hook): Likewise. * solib-svr4.c (enable_break, svr4_relocate_main_executable): Likewise. * linux-fork.c (fork_load_infrun_state): Likewise. * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Likewise. * record.c (record_wait): Likewise. * procfs.c (procfs_wait): Likewise. * remote-mips.c (common_open, mips_wait): Likewise. * remote-m32r-sdi.c (m32r_resume): Likewise. * symfile.c (generic_load): Use regcache_write_pc instead of write_pc. * monitor.c (monitor_create_inferior, monitor_load): Likewise. * m32r-rom.c (m32r_load, m32r_upload_command): Likewise. * remote-m32r-sdi.c (m32r_create_inferior, m32r_load): Likewise. * remote-mips.c (mips_create_inferior, mips_load): Likewise. * solib-darwin.c: Include "regcache.h". * solib-pa64.c: Include "regcache.h". * solib-svr4.c: Include "regcache.h.". * symfile.c: Do not mention read_pc or write_pc in comments. * dink32-rom.c: Likewise. * m32r-rom.c: Likewise. * mips-tdep.c: Likewise.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r--gdb/remote-mips.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index b35bb62..152fb37 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1573,7 +1573,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
reinit_frame_cache ();
registers_changed ();
- stop_pc = read_pc ();
+ stop_pc = regcache_read_pc (get_current_regcache ());
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
xfree (serial_port_name);
}
@@ -1792,7 +1792,7 @@ mips_wait (struct target_ops *ops,
fetch breakpoint, not a data watchpoint. FIXME when PMON
provides some way to tell us what type of breakpoint it is. */
int i;
- CORE_ADDR pc = read_pc ();
+ CORE_ADDR pc = regcache_read_pc (get_current_regcache ());
hit_watchpoint = 1;
for (i = 0; i < MAX_LSI_BREAKPOINTS; i++)
@@ -1843,7 +1843,7 @@ mips_wait (struct target_ops *ops,
{
char *func_name;
CORE_ADDR func_start;
- CORE_ADDR pc = read_pc ();
+ CORE_ADDR pc = regcache_read_pc (get_current_regcache ());
find_pc_partial_function (pc, &func_name, &func_start, NULL);
if (func_name != NULL && strcmp (func_name, "_exit") == 0
@@ -2204,7 +2204,7 @@ Can't pass arguments to remote MIPS board; arguments ignored.");
/* FIXME: Should we set inferior_ptid here? */
- write_pc (entry_pt);
+ regcache_write_pc (get_current_regcache (), entry_pt);
}
/* Clean up after a process. Actually nothing to do. */
@@ -3258,6 +3258,8 @@ pmon_load_fast (char *file)
static void
mips_load (char *file, int from_tty)
{
+ struct regcache *regcache;
+
/* Get the board out of remote debugging mode. */
if (mips_exit_debug ())
error ("mips_load: Couldn't get into monitor mode.");
@@ -3270,17 +3272,17 @@ mips_load (char *file, int from_tty)
mips_initialize ();
/* Finally, make the PC point at the start address */
+ regcache = get_current_regcache ();
if (mips_monitor != MON_IDT)
{
/* Work around problem where PMON monitor updates the PC after a load
to a different value than GDB thinks it has. The following ensures
- that the write_pc() WILL update the PC value: */
- struct regcache *regcache = get_current_regcache ();
+ that the regcache_write_pc() WILL update the PC value: */
regcache_invalidate (regcache,
gdbarch_pc_regnum (get_regcache_arch (regcache)));
}
if (exec_bfd)
- write_pc (bfd_get_start_address (exec_bfd));
+ regcache_write_pc (regcache, bfd_get_start_address (exec_bfd));
inferior_ptid = null_ptid; /* No process now */