[1/5] gdbserver: Use current_process in handle_qxfer_auxv
Commit Message
Commit 43e5fbd8b788 ("gdbserver: Add PID parameter to linux_get_auxv and
linux_get_hwcap") changed the functions for reading auxv from using
current_thread to accepting a PID argument. Pedro then suggested: "Since
we're removing the thread dependency, I think that check should be replaced
by current_process() == NULL instead".
This patch implements his suggestion.
Suggested-by: Pedro Alves <pedro@palves.net>
---
gdbserver/server.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
@@ -1445,11 +1445,10 @@ handle_qxfer_auxv (const char *annex,
if (!the_target->supports_read_auxv () || writebuf != NULL)
return -2;
- if (annex[0] != '\0' || current_thread == NULL)
+ if (annex[0] != '\0' || current_process () == nullptr)
return -1;
- return the_target->read_auxv (current_thread->id.pid (), offset, readbuf,
- len);
+ return the_target->read_auxv (current_process ()->pid, offset, readbuf, len);
}
/* Handle qXfer:exec-file:read. */