From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 0D48D3858D20; Fri, 3 Feb 2023 16:17:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D48D3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675441042; bh=VCgpNAou1APzjchUnjPuRaef9JhiXz0qhyQLKmYdEVw=; h=From:To:Subject:Date:From; b=OkjFVBHl+2egFHKlm5D+5E52JWyg36l8r8bEJxrmjIOGWB+nfDPGvGbHc8l7j4dJg xJxE+1yle63Iq3suFNk3DNEjvO5X8cJOSdxuw8DvbvI3ef+FT25BPLYfgisG4sFtVv UMl3EEHJdU87XNQ5JugcvsH62tOgtnbt7kv5y1ZM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: move target_desc_info to inferior.h X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: e3ee979c1f24984eb93b32822338aa425afbc2af X-Git-Newrev: 650160322c09b9b36d4415b56518ab9e71e8acba Message-Id: <20230203161722.0D48D3858D20@sourceware.org> Date: Fri, 3 Feb 2023 16:17:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D650160322c09= b9b36d4415b56518ab9e71e8acba commit 650160322c09b9b36d4415b56518ab9e71e8acba Author: Simon Marchi Date: Fri Feb 3 09:21:22 2023 -0500 gdb: move target_desc_info to inferior.h =20 In preparation for the following patch, where struct inferior needs to "see" struct target_desc_info, move target_desc_info to the header file. =20 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. =20 Change-Id: I3e81d04faafcad431e294357389f3d4c601ee83d Diff: --- 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 4d001b0ad50..5b5eab00546 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); =20 +/* 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 =3D 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 =3D 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 1a451c79b82..076feed0008 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 =3D NULL; }; =20 -/* 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 =3D 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 =3D 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. */