From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 401D43854551; Fri, 18 Nov 2022 17:19:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 401D43854551 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668791957; bh=j1sxFFv7IIGF/1g17/ndK8e9arSvr9M3oxleVhYw4Yk=; h=From:To:Subject:Date:From; b=yCBO1MacN58ERV8BSRYugoNdGTYvBiHWZrhjtmt8q3TjwM++nkICgKawkUfe9yxUU G5GAh1FdIEW2WkU6r91QRDxKNpY6+aKK+jdcZh1PYPv2/QkcutUePHI3kRowmy/n6b qmDbBSkMcGu5DdZjbFUs8fhD7H32Ug4YlfwMtpHY= 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] gdbserver/linux-x86: move lwp declaration out of __x86_64__ region X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: c0cb02a4cf590f3cb64cdcc1b5bf539196333160 X-Git-Newrev: 5e219e0f46055281cfbc9351a3d27a05841be34d Message-Id: <20221118171917.401D43854551@sourceware.org> Date: Fri, 18 Nov 2022 17:19:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5e219e0f4605= 5281cfbc9351a3d27a05841be34d commit 5e219e0f46055281cfbc9351a3d27a05841be34d Author: Simon Marchi Date: Fri Nov 18 12:14:54 2022 -0500 gdbserver/linux-x86: move lwp declaration out of __x86_64__ region =20 Commit 4855cbdc3d8f ("gdbserver/linux-x86: make is_64bit_tdesc accept thread as a parameter") caused this when building in 32 bits / i386 mode: =20 CXX linux-x86-low.o In file included from /home/smarchi/src/binutils-gdb/gdbserver/linu= x-x86-low.cc:24: /home/smarchi/src/binutils-gdb/gdbserver/linux-x86-low.cc: In membe= r function =E2=80=98virtual int x86_target::low_get_thread_area(int, CORE_A= DDR*)=E2=80=99: /home/smarchi/src/binutils-gdb/gdbserver/linux-x86-low.cc:357:47: e= rror: =E2=80=98lwp=E2=80=99 was not declared in this scope 357 | struct thread_info *thr =3D get_lwp_thread (lwp); | ^~~ /home/smarchi/src/binutils-gdb/gdbserver/linux-low.h:709:31: note: = in definition of macro =E2=80=98get_lwp_thread=E2=80=99 709 | #define get_lwp_thread(lwp) ((lwp)->thread) | ^~~ =20 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. =20 Change-Id: I7fa3938c6b44b345c27a52c8b8d3ea12aba53e05 Diff: --- gdbserver/linux-x86-low.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 93f6da67293..b24791f2127 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 =3D find_lwp_pid (ptid_t (lwpid)); gdb_assert (lwp !=3D nullptr); +#ifdef __x86_64__ int use_64bit =3D is_64bit_tdesc (get_lwp_thread (lwp)); =20 if (use_64bit)