aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-09-29 14:24:35 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-10 10:44:35 -0400
commit27b1f19f8f5cc46faba4bb2142547df074a82a29 (patch)
tree732d6d243fc7f90780e2a7b469cf9e97990d47f4 /gdb/inferior.h
parentae0d827fa483c4e569803d99f8dff14794c63a17 (diff)
downloadgdb-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/inferior.h')
-rw-r--r--gdb/inferior.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 29c90d1..29e26a5 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -553,6 +553,14 @@ public:
return m_cwd;
}
+ /* Set this inferior's arch. */
+ void set_arch (gdbarch *arch)
+ { m_gdbarch = arch; }
+
+ /* Get this inferior's arch. */
+ gdbarch *arch ()
+ { return m_gdbarch; }
+
/* Convenient handle (GDB inferior id). Unique across all
inferiors. */
int num = 0;
@@ -648,19 +656,6 @@ public:
user supplied description's filename, if any; etc.). */
target_desc_info tdesc_info;
- /* The architecture associated with the inferior through the
- connection to the target.
-
- The architecture vector provides some information that is really
- a property of the inferior, accessed through a particular target:
- ptrace operations; the layout of certain RSP packets; the
- solib_ops vector; etc. To differentiate architecture accesses to
- per-inferior/target properties from
- per-thread/per-frame/per-objfile properties, accesses to
- per-inferior/target properties should be made through
- this gdbarch. */
- struct gdbarch *gdbarch = NULL;
-
/* Data related to displaced stepping. */
displaced_step_inferior_state displaced_step_state;
@@ -687,6 +682,19 @@ private:
/* The current working directory that will be used when starting
this inferior. */
std::string m_cwd;
+
+ /* The architecture associated with the inferior through the
+ connection to the target.
+
+ The architecture vector provides some information that is really
+ a property of the inferior, accessed through a particular target:
+ ptrace operations; the layout of certain RSP packets; the
+ solib_ops vector; etc. To differentiate architecture accesses to
+ per-inferior/target properties from
+ per-thread/per-frame/per-objfile properties, accesses to
+ per-inferior/target properties should be made through
+ this gdbarch. */
+ gdbarch *m_gdbarch = nullptr;
};
/* Add an inferior to the inferior list, print a message that a new