From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 549B33858D20; Fri, 3 Feb 2023 16:17:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 549B33858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675441062; bh=2Wb31Ip5EQANB+ZlsyrdK3U1pJeq0lGd8A2vzWKvcyA=; h=From:To:Subject:Date:From; b=ljCYxkswxgszBlygZUgpWl4MUCS8rfvctPd4DcsKwkazyD5K3EVy+LCoQCUfE6cmm 8KMVy+wMhkE1Sz3MnXOkMm2Xijeve0c1YTLi6z+bTXrWjj8wTF80hDVJSOE6JwD8MR 8x8UGLQlGcWcIAV0H9cmXVBsZQbSBc+Z2fzuwMHo= 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: make target_desc_info_from_user_p a method of target_desc_info X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 57768366319b362bc54bd2175e09b210ce195688 X-Git-Newrev: 5a19bfd673d88184b5426b732178042ec24b248d Message-Id: <20230203161742.549B33858D20@sourceware.org> Date: Fri, 3 Feb 2023 16:17:42 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5a19bfd673d8= 8184b5426b732178042ec24b248d commit 5a19bfd673d88184b5426b732178042ec24b248d Author: Simon Marchi Date: Fri Feb 3 09:21:26 2023 -0500 gdb: make target_desc_info_from_user_p a method of target_desc_info =20 Move the implementation over to target_desc_info. Remove the target_desc_info forward declaration in target-descriptions.h, it's no longer needed. =20 Change-Id: Ic95060341685afe0b73af591ca6efe32f5e7e892 Diff: --- gdb/inferior.c | 2 +- gdb/inferior.h | 5 +++++ gdb/target-descriptions.c | 8 -------- gdb/target-descriptions.h | 8 -------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index 65863440b9c..a1e3c79d8a2 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -961,7 +961,7 @@ clone_inferior_command (const char *args, int from_tty) =20 /* If the original inferior had a user specified target description, make the clone use it too. */ - if (target_desc_info_from_user_p (&inf->tdesc_info)) + if (inf->tdesc_info.from_user_p ()) inf->tdesc_info =3D orginf->tdesc_info; =20 clone_program_space (pspace, orginf->pspace); diff --git a/gdb/inferior.h b/gdb/inferior.h index d902881bfe2..bac483f0f78 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -345,6 +345,11 @@ extern void switch_to_inferior_no_thread (inferior *in= f); =20 struct target_desc_info { + /* Returns true if INFO indicates the target description had been suppli= ed by + the user. */ + bool from_user_p () + { return !this->filename.empty (); } + /* A flag indicating that a description has already been fetched from the target, so it should not be queried again. */ bool fetched =3D false; diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 6defd5bbe86..b08a185dfa2 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -451,14 +451,6 @@ get_arch_data (struct gdbarch *gdbarch) return result; } =20 -/* See target-descriptions.h. */ - -int -target_desc_info_from_user_p (struct target_desc_info *info) -{ - return info !=3D nullptr && !info->filename.empty (); -} - /* The string manipulated by the "set tdesc filename ..." command. */ =20 static std::string tdesc_filename_cmd_string; diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index b835e144c68..ee48fdfaa0c 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -26,9 +26,6 @@ =20 struct tdesc_arch_data; struct target_ops; -/* An inferior's target description info is stored in this opaque - object. There's one such object per inferior. */ -struct target_desc_info; struct inferior; =20 /* Fetch the current inferior's description, and switch its current @@ -48,11 +45,6 @@ void target_clear_description (void); =20 const struct target_desc *target_current_description (void); =20 -/* Returns true if INFO indicates the target description had been - supplied by the user. */ - -int target_desc_info_from_user_p (struct target_desc_info *info); - /* Record architecture-specific functions to call for pseudo-register support. If tdesc_use_registers is called and gdbarch_num_pseudo_regs is greater than zero, then these should be called as well.