From patchwork Fri Nov 18 17:19:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 60851 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EBF83853D4D for ; Fri, 18 Nov 2022 17:19:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EBF83853D4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668791998; bh=GaaVj2cPcwDhok5+dUiqsO5/fdwhaIsfzSlDy7Qd8hE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=soPvFG7XR+E6smSvzyNtOvSfl2IwpQlwf4oLC+2MA011VSGxGCSkxPtNUWML3dxTZ 68qGO80tTUeS1jMJ7blK7xrj+BGnTwmlPg5aV+9ih9LXEuRNLHWG+sNpDXVQ6w1GpV ZgXveGHvVtDJHwIe85QYP+F77xNwQmJiQbnCcNMA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 2D0063854551 for ; Fri, 18 Nov 2022 17:19:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0063854551 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 2AIHJSGT030912 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Nov 2022 12:19:32 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 2AIHJSGT030912 Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AC19D1E0D3; Fri, 18 Nov 2022 12:19:27 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdbserver/linux-x86: move lwp declaration out of __x86_64__ region Date: Fri, 18 Nov 2022 12:19:25 -0500 Message-Id: <20221118171925.944900-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 18 Nov 2022 17:19:28 +0000 X-Spam-Status: No, score=-3189.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" From: Simon Marchi Commit 4855cbdc3d8f ("gdbserver/linux-x86: make is_64bit_tdesc accept thread as a parameter") caused this when building in 32 bits / i386 mode: CXX linux-x86-low.o In file included from /home/smarchi/src/binutils-gdb/gdbserver/linux-x86-low.cc:24: /home/smarchi/src/binutils-gdb/gdbserver/linux-x86-low.cc: In member function ‘virtual int x86_target::low_get_thread_area(int, CORE_ADDR*)’: /home/smarchi/src/binutils-gdb/gdbserver/linux-x86-low.cc:357:47: error: ‘lwp’ was not declared in this scope 357 | struct thread_info *thr = get_lwp_thread (lwp); | ^~~ /home/smarchi/src/binutils-gdb/gdbserver/linux-low.h:709:31: note: in definition of macro ‘get_lwp_thread’ 709 | #define get_lwp_thread(lwp) ((lwp)->thread) | ^~~ This is because it moved the lwp variable declaration inside the __x86_64__ guard, making it unavailable when building in 32 bits mode. Move the lwp variable outside of the __x86_64__ region. Change-Id: I7fa3938c6b44b345c27a52c8b8d3ea12aba53e05 --- gdbserver/linux-x86-low.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: c0cb02a4cf590f3cb64cdcc1b5bf539196333160 diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 93f6da672937..b24791f21275 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -335,9 +335,9 @@ ps_get_thread_area (struct ps_prochandle *ph, int x86_target::low_get_thread_area (int lwpid, CORE_ADDR *addr) { -#ifdef __x86_64__ lwp_info *lwp = find_lwp_pid (ptid_t (lwpid)); gdb_assert (lwp != nullptr); +#ifdef __x86_64__ int use_64bit = is_64bit_tdesc (get_lwp_thread (lwp)); if (use_64bit)