diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-16 17:16:26 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-16 17:16:26 +0000 |
commit | 594f77850bb22a2cec4e8fc44c7ea735a6270eb2 (patch) | |
tree | a088feb6477718ddfc0cd07b1640c05fd2253b9c /gdb/sol-thread.c | |
parent | 7cc23052d5eef14fae5d6c51a70f7814819532ad (diff) | |
download | gdb-594f77850bb22a2cec4e8fc44c7ea735a6270eb2.zip gdb-594f77850bb22a2cec4e8fc44c7ea735a6270eb2.tar.gz gdb-594f77850bb22a2cec4e8fc44c7ea735a6270eb2.tar.bz2 |
* regcache.c (struct regcache): Add ptid_t member.
(regcache_xmalloc): Initialize it.
(regcache_cpy_no_passthrough): Do not refer to current_regcache.
(regcache_dup): Likewise.
(regcache_dup_no_passthrough): Likewise.
(current_regcache): Make static.
(registers_ptid): Remove variable.
(get_thread_regcache): New function.
(get_current_regcache): New function.
(registers_changed): Implement by freeing current regcache.
(regcache_raw_read): Do not refer to current_regcache. Set
inferior_ptid to regcache->ptid while calling target routines.
(regcache_raw_write): Likewise.
(regcache_raw_supply): Do not refer to current_regcache.
(read_pc_pid): Use thread regcache. Do not modify inferior_ptid.
(write_pc_pid): Likewise.
(build_regcache): Remove.
(_initialize_regcache): Do not call DEPRECATED_REGISTER_GDBARCH_SWAP
or deprecated_register_gdbarch_swap. Do not initialize
registers_ptid.
* regcache.h (get_current_regcache): Add prototype.
(get_thread_regcache): Likewise.
(current_regcache): Remove declaration.
* corelow.c (core_open): Replace current_regcache by
get_current_regcache ().
* frame.c (frame_pop): Likewise.
(put_frame_register): Likewise.
(get_current_frame, create_new_frame): Likewise.
* mi/mi-main.c (mi_cmd_data_write_register_values): Likewise.
* stack.c (return_command): Likewise.
* infcall.c (call_function_by_hand): Likewise.
* infrun.c (resume): Likewise.
(save_inferior_status, restore_inferior_status): Likewise.
* linux-fork.c (fork_load_infrun_state): Likewise.
(fork_save_infrun_state): Likewise.
* win32-nat.c (win32_resume): Likewise.
* i386fbsd-nat.c (i386fbsd_resume): Likewise.
* monitor.c (monitor_wait): Likewise.
* remote.c (remote_wait): Likewise.
* remote-mips.c (mips_wait): Likewise.
* bsd-kvm.c (bsd_kvm_open): Likewise
(bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): Likewise.
* fbsd-nat.c (fbsd_make_corefile_notes): Likewise.
* i386-linux-nat.c (i386_linux_resume): Likewise.
* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
(ia64_linux_stopped_data_address): Likewise.
* frv-tdep.c (frv_fdpic_loadmap_addresses): Likewise.
* m32c-tdep.c (m32c_virtual_frame_pointer): Likewise.
* mep-tdep.c (current_me_module, current_options): Likewise.
* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Likewise.
* linux-nat.c (linux_nat_do_thread_registers): Use thread
regcache instead of current_regcache. Call target_fetch_registers.
(linux_nat_corefile_thread_callback): Update call site.
(linux_nat_do_registers): Likewise.
* procfs.c (procfs_do_thread_registers): Use thread regcache instead
of current_regcache.
(procfs_make_note_section): Likewise.
* proc-service.c (ps_lgetregs, ps_lsetregs): Likewise.
(ps_lgetfpregs, ps_lsetfpregs): Likewise.
* sol-thread.c (ps_lgetregs, ps_lsetregs): Likewise.
(ps_lgetfpregs, ps_lsetfpregs): Likewise.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r-- | gdb/sol-thread.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 4224d28..2cd66db 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1087,16 +1087,18 @@ ps_err_e ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) { struct cleanup *old_chain; + struct regcache *regcache; old_chain = save_inferior_ptid (); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); + regcache = get_thread_regcache (inferior_ptid); if (target_has_execution) - procfs_ops.to_fetch_registers (current_regcache, -1); + procfs_ops.to_fetch_registers (regcache, -1); else - orig_core_ops.to_fetch_registers (current_regcache, -1); - fill_gregset (current_regcache, (gdb_gregset_t *) gregset, -1); + orig_core_ops.to_fetch_registers (regcache, -1); + fill_gregset (regcache, (gdb_gregset_t *) gregset, -1); do_cleanups (old_chain); @@ -1110,16 +1112,18 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) { struct cleanup *old_chain; + struct regcache *regcache; old_chain = save_inferior_ptid (); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); + regcache = get_thread_regcache (inferior_ptid); - supply_gregset (current_regcache, (const gdb_gregset_t *) gregset); + supply_gregset (regcache, (const gdb_gregset_t *) gregset); if (target_has_execution) - procfs_ops.to_store_registers (current_regcache, -1); + procfs_ops.to_store_registers (regcache, -1); else - orig_core_ops.to_store_registers (current_regcache, -1); + orig_core_ops.to_store_registers (regcache, -1); do_cleanups (old_chain); @@ -1219,16 +1223,18 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prfpregset_t *fpregset) { struct cleanup *old_chain; + struct regcache *regcache; old_chain = save_inferior_ptid (); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); + regcache = get_thread_regcache (inferior_ptid); if (target_has_execution) - procfs_ops.to_fetch_registers (current_regcache, -1); + procfs_ops.to_fetch_registers (regcache, -1); else - orig_core_ops.to_fetch_registers (current_regcache, -1); - fill_fpregset (current_regcache, (gdb_fpregset_t *) fpregset, -1); + orig_core_ops.to_fetch_registers (regcache, -1); + fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1); do_cleanups (old_chain); @@ -1242,16 +1248,18 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prfpregset_t * fpregset) { struct cleanup *old_chain; + struct regcache *regcache; old_chain = save_inferior_ptid (); inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid)); + regcache = get_thread_regcache (inferior_ptid); - supply_fpregset (current_regcache, (const gdb_fpregset_t *) fpregset); + supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset); if (target_has_execution) - procfs_ops.to_store_registers (current_regcache, -1); + procfs_ops.to_store_registers (regcache, -1); else - orig_core_ops.to_store_registers (current_regcache, -1); + orig_core_ops.to_store_registers (regcache, -1); do_cleanups (old_chain); |