diff options
author | Tom Tromey <tromey@adacore.com> | 2023-07-11 09:54:01 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-07-14 10:52:56 -0600 |
commit | cb26e4bbedbc9149507b0f59c2f137d9e213e8c9 (patch) | |
tree | f923428a64e74c4096073a97976642c5dbeb8ae4 /gdb/proc-service.c | |
parent | eeaffa60ebbfdbcdca3aa2deb1ac97c57460225d (diff) | |
download | binutils-cb26e4bbedbc9149507b0f59c2f137d9e213e8c9.zip binutils-cb26e4bbedbc9149507b0f59c2f137d9e213e8c9.tar.gz binutils-cb26e4bbedbc9149507b0f59c2f137d9e213e8c9.tar.bz2 |
Introduce scoped_restore_current_inferior_for_memory
This introduces a new class,
scoped_restore_current_inferior_for_memory, and arranges to use it in
a few places. This class is intended to handle setting up and
restoring the various globals that are needed to read or write memory
-- but without invalidating the frame cache.
I wasn't able to test the change to aix-thread.c.
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/proc-service.c')
-rw-r--r-- | gdb/proc-service.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/proc-service.c b/gdb/proc-service.c index 509836e..366e051 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -72,14 +72,8 @@ static ps_err_e ps_xfer_memory (const struct ps_prochandle *ph, psaddr_t addr, gdb_byte *buf, size_t len, int write) { - scoped_restore_current_inferior restore_inferior; - set_current_inferior (ph->thread->inf); - - scoped_restore_current_program_space restore_current_progspace; - set_current_program_space (ph->thread->inf->pspace); - - scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); - inferior_ptid = ph->thread->ptid; + scoped_restore_current_inferior_for_memory save_inferior (ph->thread->inf, + ph->thread->ptid); CORE_ADDR core_addr = ps_addr_to_core_addr (addr); |