From: Simon Marchi <simark@simark.ca>
To: Kamil Rytarowski <n54@gmx.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v4] Add support for NetBSD threads in sparc-nat.c
Date: Tue, 17 Mar 2020 12:51:53 -0400 [thread overview]
Message-ID: <a8b31a02-dd93-0318-0102-71bf9c52e76e@simark.ca> (raw)
In-Reply-To: <20200317164603.10840-1-n54@gmx.com>
On 2020-03-17 12:46 p.m., Kamil Rytarowski wrote:
> NetBSD ptrace(2) accepts thread id (LWP) as the 4th argument for threads.
>
> This file is still shared with other targets that use different 4th argument
> type, that is always unused.
> ---
> gdb/sparc-nat.c | 50 ++++++++++++++++++++++---------------------------
> 1 file changed, 22 insertions(+), 28 deletions(-)
>
> diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
> index dff0f521565..10cc01375ed 100644
> --- a/gdb/sparc-nat.c
> +++ b/gdb/sparc-nat.c
> @@ -78,6 +78,19 @@ typedef struct fp_status fpregset_t;
> #define PTRACE_SETFPREGS PT_SETFPREGS
> #endif
>
> +static int
> +gdb_ptrace (int request, ptid_t pid, void *addr)
> +{
> +#ifdef __NetBSD__
> + /* Support for NetBSD threads: unlike other ptrace implementations in this
> + file, NetBSD requires that we pass both the pid and lwp. */
> + return ptrace (request, ptid (). pid (), addr, ptid ().lwp ());
Does that even build? ptid isn't the name of a parameter, and the parenthesis after
"ptid" should not be there. Rename the pid parameter to ptid, and replace the above
with "ptid.pid ()" and "ptid.lwp ()".
Simon
next prev parent reply other threads:[~2020-03-17 16:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 9:40 [PATCH] " Kamil Rytarowski
2020-03-17 15:10 ` [PATCH v3] " Kamil Rytarowski
2020-03-17 16:03 ` Simon Marchi
2020-03-17 16:46 ` [PATCH v4] " Kamil Rytarowski
2020-03-17 16:51 ` Simon Marchi [this message]
2020-03-17 16:59 ` Simon Marchi
2020-03-17 17:07 ` Kamil Rytarowski
2020-03-17 17:10 ` Simon Marchi
2020-03-17 18:14 ` Kamil Rytarowski
2020-03-17 18:18 ` [PATCH v5] " Kamil Rytarowski
2020-03-17 19:07 ` Simon Marchi
2020-03-17 19:09 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8b31a02-dd93-0318-0102-71bf9c52e76e@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=n54@gmx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).