gdb: add inferior::{arch, set_arch}

Make the inferior's gdbarch field private, and add getters and setters.
This helped me by allowing putting breakpoints on set_arch to know when
the inferior's arch was set.  A subsequent patch in this series also
adds more things in set_arch.

Change-Id: I0005bd1ef4cd6b612af501201cec44e457998eec
Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
Simon Marchi
2023-09-29 14:24:35 -04:00
parent ae0d827fa4
commit 27b1f19f8f
25 changed files with 63 additions and 55 deletions

View File

@@ -1375,7 +1375,7 @@ gdbpy_format_address (PyObject *self, PyObject *args, PyObject *kw)
/* Grab both of these from the current inferior, and its associated
default architecture. */
pspace = current_inferior ()->pspace;
gdbarch = current_inferior ()->gdbarch;
gdbarch = current_inferior ()->arch ();
}
else if (arch_obj == nullptr || pspace_obj == nullptr)
{