aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/linux-arm-low.cc
diff options
context:
space:
mode:
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>2022-08-18 18:21:18 +0000
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>2023-02-01 20:42:50 +0000
commit43e5fbd8b78848c89c1d0305396464039e452688 (patch)
treef6018863dffb0433fb0631109440ba8689e45d8a /gdbserver/linux-arm-low.cc
parentcbd02f9fa521a6cb21c04b15ee7671c8bb4be55b (diff)
downloadgdb-43e5fbd8b78848c89c1d0305396464039e452688.zip
gdb-43e5fbd8b78848c89c1d0305396464039e452688.tar.gz
gdb-43e5fbd8b78848c89c1d0305396464039e452688.tar.bz2
gdbserver: Add PID parameter to linux_get_auxv and linux_get_hwcap
This patch doesn't change gdbserver behaviour, but after later changes are made it avoids a null pointer dereference when HWCAP needs to be obtained for a specific process while current_thread is nullptr. Fixing linux_read_auxv, linux_get_hwcap and linux_get_hwcap2 to take a PID parameter seems more correct than setting current_thread in one particular code path. Changes are propagated to allow passing the new parameter through the call chain. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdbserver/linux-arm-low.cc')
-rw-r--r--gdbserver/linux-arm-low.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc
index 98ba0e0..5975b44 100644
--- a/gdbserver/linux-arm-low.cc
+++ b/gdbserver/linux-arm-low.cc
@@ -958,7 +958,7 @@ get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
static const struct target_desc *
arm_read_description (void)
{
- unsigned long arm_hwcap = linux_get_hwcap (4);
+ unsigned long arm_hwcap = linux_get_hwcap (current_thread->id.pid (), 4);
if (arm_hwcap & HWCAP_IWMMXT)
return arm_linux_read_description (ARM_FP_TYPE_IWMMXT);