public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 1/5] gdb: move target_desc_info to inferior.h
Date: Fri,  3 Feb 2023 09:21:22 -0500	[thread overview]
Message-ID: <20230203142126.286866-2-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20230203142126.286866-1-simon.marchi@polymtl.ca>

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            | 23 +++++++++++++++++++++++
 gdb/target-descriptions.c | 26 --------------------------
 2 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/gdb/inferior.h b/gdb/inferior.h
index 4d001b0ad50e..5b5eab00546c 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -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
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 1a451c79b824..076feed0008c 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -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.  */
 
-- 
2.39.1


  reply	other threads:[~2023-02-03 14:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 14:21 [PATCH 0/5] Some target_desc_info cleanups Simon Marchi
2023-02-03 14:21 ` Simon Marchi [this message]
2023-02-03 14:21 ` [PATCH 2/5] gdb: change inferior::tdesc_info to non-pointer Simon Marchi
2023-02-03 14:21 ` [PATCH 3/5] gdb: remove get_tdesc_info Simon Marchi
2023-02-03 15:53   ` Andrew Burgess
2023-02-03 16:05     ` Simon Marchi
2023-02-03 14:21 ` [PATCH 4/5] gdb: remove copy_inferior_target_desc_info Simon Marchi
2023-02-03 15:54   ` Andrew Burgess
2023-02-03 16:05     ` Simon Marchi
2023-02-03 14:21 ` [PATCH 5/5] gdb: make target_desc_info_from_user_p a method of target_desc_info Simon Marchi
2023-02-06 18:41   ` Pedro Alves
2023-02-06 19:13     ` Simon Marchi
2023-02-03 15:56 ` [PATCH 0/5] Some target_desc_info cleanups Andrew Burgess
2023-02-03 16:07   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230203142126.286866-2-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).