]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move target_desc_info to inferior.h
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 3 Feb 2023 14:21:22 +0000 (09:21 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 3 Feb 2023 16:06:26 +0000 (11:06 -0500)
In preparation for the following patch, where struct inferior needs to
"see" struct target_desc_info, move target_desc_info to the header file.

I initially moved the structure to target-descriptions.h, and later made
inferior.h include target-descriptions.h.  This worked, but it then
occured to me that target_desc_info is really an inferior property that
involves a target description, so I think it makes sense to have it in
inferior.h.

Change-Id: I3e81d04faafcad431e294357389f3d4c601ee83d

gdb/inferior.h
gdb/target-descriptions.c

index 4d001b0ad50e73ea1e5a428128d858d06630a2af..5b5eab00546c6eead6538c68e1d05cbea045ac0c 100644 (file)
@@ -340,6 +340,29 @@ extern void set_current_inferior (inferior *);
    selected.  */
 extern void switch_to_inferior_no_thread (inferior *inf);
 
+/* Info about an inferior's target description.  There's one of these
+   for each inferior.  */
+
+struct target_desc_info
+{
+  /* A flag indicating that a description has already been fetched
+     from the target, so it should not be queried again.  */
+  bool fetched = false;
+
+  /* The description fetched from the target, or NULL if the target
+     did not supply any description.  Only valid when
+     FETCHED is set.  Only the description initialization
+     code should access this; normally, the description should be
+     accessed through the gdbarch object.  */
+  const struct target_desc *tdesc = nullptr;
+
+  /* If not empty, the filename to read a target description from, as set by
+     "set tdesc filename ...".
+
+     If empty, there is not filename specified by the user.  */
+  std::string filename;
+};
+
 /* GDB represents the state of each program execution with an object
    called an inferior.  An inferior typically corresponds to a process
    but is more general and applies also to targets that do not have a
index 1a451c79b824ffd6998511ae620f4d45bf6c5806..076feed0008c07bd3ae83cf4a59309df862f4fd8 100644 (file)
@@ -436,32 +436,6 @@ struct tdesc_arch_data
   gdbarch_register_reggroup_p_ftype *pseudo_register_reggroup_p = NULL;
 };
 
-/* Info about an inferior's target description.  There's one of these
-   for each inferior.  */
-
-struct target_desc_info
-{
-  /* A flag indicating that a description has already been fetched
-     from the target, so it should not be queried again.  */
-
-  bool fetched = false;
-
-  /* The description fetched from the target, or NULL if the target
-     did not supply any description.  Only valid when
-     FETCHED is set.  Only the description initialization
-     code should access this; normally, the description should be
-     accessed through the gdbarch object.  */
-
-  const struct target_desc *tdesc = nullptr;
-
-  /* If not empty, the filename to read a target description from, as set by
-     "set tdesc filename ...".
-
-     If empty, there is not filename specified by the user.  */
-
-  std::string filename;
-};
-
 /* Get the inferior INF's target description info, allocating one on
    the stop if necessary.  */