diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-09-29 14:24:35 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-10-10 10:44:35 -0400 |
commit | 27b1f19f8f5cc46faba4bb2142547df074a82a29 (patch) | |
tree | 732d6d243fc7f90780e2a7b469cf9e97990d47f4 /gdb/python | |
parent | ae0d827fa483c4e569803d99f8dff14794c63a17 (diff) | |
download | gdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.zip gdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.tar.gz gdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.tar.bz2 |
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>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-inferior.c | 2 | ||||
-rw-r--r-- | gdb/python/python.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 1f20b9a..50d20c3 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -788,7 +788,7 @@ infpy_architecture (PyObject *self, PyObject *args) INFPY_REQUIRE_VALID (inf); - return gdbarch_to_arch_object (inf->inferior->gdbarch); + return gdbarch_to_arch_object (inf->inferior->arch ()); } /* Implement repr() for gdb.Inferior. */ diff --git a/gdb/python/python.c b/gdb/python/python.c index faa7e0c..e56d246 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -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) { |