diff options
author | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2022-08-18 18:21:18 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2023-02-01 20:42:50 +0000 |
commit | 43e5fbd8b78848c89c1d0305396464039e452688 (patch) | |
tree | f6018863dffb0433fb0631109440ba8689e45d8a /gdbserver/target.h | |
parent | cbd02f9fa521a6cb21c04b15ee7671c8bb4be55b (diff) | |
download | fsf-binutils-gdb-43e5fbd8b78848c89c1d0305396464039e452688.zip fsf-binutils-gdb-43e5fbd8b78848c89c1d0305396464039e452688.tar.gz fsf-binutils-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/target.h')
-rw-r--r-- | gdbserver/target.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdbserver/target.h b/gdbserver/target.h index 6d92f0f..01002c2 100644 --- a/gdbserver/target.h +++ b/gdbserver/target.h @@ -172,10 +172,10 @@ public: /* Return true if the read_auxv target op is supported. */ virtual bool supports_read_auxv (); - /* Read auxiliary vector data from the inferior process. + /* Read auxiliary vector data from the process with pid PID. Read LEN bytes at OFFSET into a buffer at MYADDR. */ - virtual int read_auxv (CORE_ADDR offset, unsigned char *myaddr, + virtual int read_auxv (int pid, CORE_ADDR offset, unsigned char *myaddr, unsigned int len); /* Returns true if GDB Z breakpoint type TYPE is supported, false |