From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oKMoEae8AmYs0BYAWB0awg (envelope-from ) for ; Tue, 26 Mar 2024 08:16:39 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WJXHWIDq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 411501E0C0; Tue, 26 Mar 2024 08:16:39 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2EC6E1E030 for ; Tue, 26 Mar 2024 08:16:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B69A03858410 for ; Tue, 26 Mar 2024 12:16:36 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 51076385840C for ; Tue, 26 Mar 2024 12:16:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51076385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51076385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711455374; cv=none; b=Ad1ftF1QCTCwfCB+JUhrNGGrPfFT96BLrZeDqPkOVvQ0QVPY8mXR2pelNEKSdnLgoptBbDslNtmfD8lgblIct6yFy/Igw5rjT3S1IfHfXShR3dwVT9BOmoTW1E8n4XLFKZl/cxlyvNKgV2px1REwKtYZ4BklB6RmyqDrScPu0AM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711455374; c=relaxed/simple; bh=60eROUrYzzd2O5fHp7Tn0/gR0qrDcU5clH6F8V0aKuY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mFCm5H1ymu0Ogrh/bPe2en1PQBH3KS4Wjq1hM1+CtuiTtbQG/PwZDYjezZcMQEgU2v7Enlch4CsGOGs0Qs3gZY/1+NuK/L/RDhqMtGjXhA03aljaXna2fb3DafN4RhV/bzW43KU6PbLqYEycaC3XfRukPDWsLcM68/jqef29ROg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711455363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ltd1iAhVdq2rKyX3FxYe82AgFqEPMZJuhkVR8xA6BGQ=; b=WJXHWIDqgONlfpeWtVEVNybvFkSbSxXQ+HXFWsrJ9B1npy+l1FIgg9ghSIXhGh6NArv4d5 ZXdxFsGDESwr4If00teF3LyZ6iP20FtBU/47yhmu+uKHmAFiYWbuaBsajdG/MJoS+beUtG Zp6l0soqlIt9fne1j8ai3+2TSBee0zE= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-eFbRfa1XPQGCtsuqU3tEMw-1; Tue, 26 Mar 2024 08:16:02 -0400 X-MC-Unique: eFbRfa1XPQGCtsuqU3tEMw-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-568b1075d18so3139895a12.3 for ; Tue, 26 Mar 2024 05:16:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711455361; x=1712060161; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ltd1iAhVdq2rKyX3FxYe82AgFqEPMZJuhkVR8xA6BGQ=; b=ayXVQKIrYJNKdiBo3vD6jsE0tItlF5ZRwX2isDOc68/+BBsHWhPTtIuFPr0/IIKjWk /PYfjDF8OW7Aznc51jluZfmC9AYafgvAV13tpMMB+p8o6RWMuEg5eV4y/8qbTSJ+8YZN zAQBlCKEWZ0OJ95cDNxbJzT9/zzzYkeErNrucsWhzu+njcJ4+Kfvi7Cr2NSn3Q6LJ4vM JsH0AJtwc6tr3/+3EvBZV80qmyYxVfQJSR5QLA4FcJrteFfJjU7j0/J6EppofDcUC17a Va1T2ArIKOfmhSuj8tl25Cf2yphd7wqEIo2AWSnF2LNn+iHhn+7W5YlR/LUxAcAIKZWs WsLw== X-Forwarded-Encrypted: i=1; AJvYcCWdgaW5GHZ1e0yTxePl8FAS2/dTEujdi4GRNV24ASdumvndF+7n2r81srWS8Bwj3/CL2BuMGeylhPyD6py9GGGCb2LFoXrOc4wx2Q== X-Gm-Message-State: AOJu0YwizfVPqYCty6pnjuB33ckbJTAtybYFkamARtS/0JBQzLZM12DL 5kVgQT6/6I0XN7ubEMt117wYDt1/WZ+LoTLkWOtAGsrPyL2D1nhrEd9EN+5YLdG05zPQPbnh37x NxjrI/KrcV4lRQONM48wzXwllYavsG4Cv8yF9PgnEFgf6PBxQgoC+5czcr4QQGQQ4/Ag= X-Received: by 2002:a50:d6dd:0:b0:568:a9f3:b3fb with SMTP id l29-20020a50d6dd000000b00568a9f3b3fbmr803948edj.8.1711455361042; Tue, 26 Mar 2024 05:16:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmztUUJ18b4i4hWjhUjIi7lK6pnGXQj1pzZ9AAzpa0cg0wOZNO+3mpqCmOhgyx7w4Jzmknuw== X-Received: by 2002:a50:d6dd:0:b0:568:a9f3:b3fb with SMTP id l29-20020a50d6dd000000b00568a9f3b3fbmr803913edj.8.1711455360081; Tue, 26 Mar 2024 05:16:00 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id ig4-20020a056402458400b00568b6d731e1sm4031693edb.4.2024.03.26.05.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 05:15:59 -0700 (PDT) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: hjl.tools@gmail.com Subject: Re: [PATCHv3 0/8] x86/Linux Target Description Changes In-Reply-To: <413a66aa-e035-41cf-9af4-040685f89204@simark.ca> References: <8734seteht.fsf@redhat.com> <413a66aa-e035-41cf-9af4-040685f89204@simark.ca> Date: Tue, 26 Mar 2024 12:15:59 +0000 Message-ID: <87a5ml5gu8.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Simon Marchi writes: > On 3/25/24 13:20, Andrew Burgess wrote: >> Andrew Burgess writes: >> >>> In v3: >>> >>> - Rebased. Nasty merge conflict with 4bb20a6244b7091 which I think >>> I've resolved, but am unable to test. Reposting so the author of >>> that other commit can validate. >>> >>> - Initial testing looks good. Full tests are still running. >> >> Testing completed with no issues. H.J. Lu confirmed that this versions >> didn't break the x32 behaviour. I've gone ahead and pushed these >> patches. >> >> If anything crops up then do let me know. >> >> Thanks, >> Andrew >> > > Hi Andrew, > > I think your series introduces some build failures with Clang. One is > easy, it's a missing `-x c++` in gdbserver/Makefile.in. Thanks for fixing this one. > > The other is: > > CXX nat/x86-linux-tdesc-ipa.o > /home/smarchi/src/binutils-gdb/gdbserver/../gdb/nat/x86-linux-tdesc.c:167:1: error: unused function 'x86_linux_i386_tdesc_feature_mask' [-Werror,-Wunused-function] > 167 | x86_linux_i386_tdesc_feature_mask () > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > It's possible that this function just needs to be moved in the same > "#ifdef" as where it's used, but since I didn't follow your work > closely, I prefer to let you fix it, in case I'm missing something. Sorry for the breakage. I pushed the patch below to resolve this issue. Thanks, Andrew -- commit f4c19f89ef43dbce8065532c808e1aeb05d08994 Author: Andrew Burgess Date: Tue Mar 26 12:09:27 2024 +0000 gdb/gdbserver: fix some defined but unused function warnings This commit: commit 198ff6ff819c240545f9fc68b39636fd376d4ba9 Date: Tue Jan 30 15:37:23 2024 +0000 gdb/gdbserver: share x86/linux tdesc caching 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. I've fixed this problem in this commit by wrapping the function definitions within #ifdef blocks. 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 --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[] = { { X86_XSTATE_X87, true, false, false } }; +#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. */ @@ -175,6 +177,10 @@ x86_linux_i386_tdesc_feature_mask () return mask; } +#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. */ @@ -205,6 +211,8 @@ x86_linux_x32_tdesc_feature_mask () return mask; } +#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. */ @@ -222,6 +230,8 @@ x86_linux_i386_tdesc_count () return (1 << count); } +#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. */ @@ -256,6 +266,8 @@ x86_linux_x32_tdesc_count () return (1 << count); } +#endif /* __x86_64__ || IN_PROCESS_AGENT */ + #ifdef IN_PROCESS_AGENT /* See linux-x86-tdesc.h. */