Introduce scoped_restore_current_inferior_for_memory
authorTom Tromey <tromey@adacore.com>
Tue, 11 Jul 2023 15:54:01 +0000 (09:54 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 14 Jul 2023 16:52:56 +0000 (10:52 -0600)
commitcb26e4bbedbc9149507b0f59c2f137d9e213e8c9
treef923428a64e74c4096073a97976642c5dbeb8ae4
parenteeaffa60ebbfdbcdca3aa2deb1ac97c57460225d
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>
gdb/aix-thread.c
gdb/inferior.h
gdb/proc-service.c