summaryrefslogtreecommitdiff
path: root/gdbserver/linux-x86-low.cc
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-11-18 12:14:54 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-11-18 12:18:53 -0500
commit5e219e0f46055281cfbc9351a3d27a05841be34d (patch)
tree9ea7d25eea82a76e320cde8ef5e0eda769fbe8b9 /gdbserver/linux-x86-low.cc
parentc0cb02a4cf590f3cb64cdcc1b5bf539196333160 (diff)
downloadbinutils-gdb-5e219e0f46055281cfbc9351a3d27a05841be34d.tar.gz
gdbserver/linux-x86: move lwp declaration out of __x86_64__ region
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
Diffstat (limited to 'gdbserver/linux-x86-low.cc')
-rw-r--r--gdbserver/linux-x86-low.cc2
1 files changed, 1 insertions, 1 deletions
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 = 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)