From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 3BF7C3858409; Tue, 26 Mar 2024 12:15:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BF7C3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711455300; bh=0MELVXmEnNEn/UdSTwO7qKsqoN7j2DOxszJleVWPYx8=; h=From:To:Subject:Date:From; b=t97CqfVL/jadXpJnaWl6kheyKDb9JUKVBxNUMGuw0JxBACZA5seDELTJoWg61DmOG FDWvke6qQMnIzN5MP7RDYxUXfy4a0O3moF2Wykds09FktHB4+IZiDbMPQufO4YVB0Y /LfGc+yvAOE9k0/mgb1Nnlua/9B+IQm6oID8X1V4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/gdbserver: fix some defined but unused function warnings X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 24df37a10f8773ad5db07dc000f694d6405e3a36 X-Git-Newrev: f4c19f89ef43dbce8065532c808e1aeb05d08994 Message-Id: <20240326121500.3BF7C3858409@sourceware.org> Date: Tue, 26 Mar 2024 12:15:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df4c19f89ef43= dbce8065532c808e1aeb05d08994 commit f4c19f89ef43dbce8065532c808e1aeb05d08994 Author: Andrew Burgess Date: Tue Mar 26 12:09:27 2024 +0000 gdb/gdbserver: fix some defined but unused function warnings =20 This commit: =20 commit 198ff6ff819c240545f9fc68b39636fd376d4ba9 Date: Tue Jan 30 15:37:23 2024 +0000 =20 gdb/gdbserver: share x86/linux tdesc caching =20 added some functions which are always defined, but their use is guarded within various #ifdef blocks. As a result we were seeing errors about defined, but unused, functions. =20 I've fixed this problem in this commit by wrapping the function definitions within #ifdef blocks. =20 I'm a little worried that there might be too many #ifdef blocks within this file, however, I'm going to commit this fix for now as this will fix the build, then I'll think about if there's a better way to split this file so we might avoid some of these #ifdef blocks. Diff: --- gdb/nat/x86-linux-tdesc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/nat/x86-linux-tdesc.c b/gdb/nat/x86-linux-tdesc.c index c438dfae84f..8a02f77fa6a 100644 --- a/gdb/nat/x86-linux-tdesc.c +++ b/gdb/nat/x86-linux-tdesc.c @@ -160,6 +160,8 @@ static constexpr x86_tdesc_feature x86_linux_all_tdesc_= features[] =3D { { X86_XSTATE_X87, true, false, false } }; =20 +#if defined __i386__ || !defined IN_PROCESS_AGENT + /* Return a compile time constant which is a mask of all the cpu features that are checked for when building an i386 target description. */ =20 @@ -175,6 +177,10 @@ x86_linux_i386_tdesc_feature_mask () return mask; } =20 +#endif /* __i386__ || !IN_PROCESS_AGENT */ + +#ifdef __x86_64__ + /* Return a compile time constant which is a mask of all the cpu features that are checked for when building an amd64 target description. */ =20 @@ -205,6 +211,8 @@ x86_linux_x32_tdesc_feature_mask () return mask; } =20 +#endif /* __x86_64__ */ + /* Return a compile time constant which is a count of the number of cpu features that are checked for when building an i386 target description.= */ =20 @@ -222,6 +230,8 @@ x86_linux_i386_tdesc_count () return (1 << count); } =20 +#if defined __x86_64__ || defined IN_PROCESS_AGENT + /* Return a compile time constant which is a count of the number of cpu features that are checked for when building an amd64 target description= . */ =20 @@ -256,6 +266,8 @@ x86_linux_x32_tdesc_count () return (1 << count); } =20 +#endif /* __x86_64__ || IN_PROCESS_AGENT */ + #ifdef IN_PROCESS_AGENT =20 /* See linux-x86-tdesc.h. */