This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: ping: [patch 4/4]#3 Remove redundant lp->siginfo
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Thu, 19 May 2011 19:51:11 +0100
- Subject: Re: ping: [patch 4/4]#3 Remove redundant lp->siginfo
- References: <20100921225026.GE20130@host1.dyn.jankratochvil.net> <20110518192248.GB6042@host1.jankratochvil.net>
Looks good.
On Wednesday 18 May 2011 20:22:48, Jan Kratochvil wrote:
> struct siginfo *
> linux_nat_get_siginfo (ptid_t ptid)
Minor nit. I'd've preferred to have the interface changed
to something like
int
linux_nat_get_siginfo (ptid_t ptid, struct siginfo *siginfo)
(and make the callers pass in a pointer to a siginfo to fill,
mirroring the PTRACE_GETSIGINFO interface)
> {
> - struct lwp_info *lp = find_lwp_pid (ptid);
> + static struct siginfo siginfo;
than having a hidden static, but it's fine with me to leave
as is if you prefer that way.
> + int pid;
>
> - gdb_assert (lp != NULL);
> + pid = GET_LWP (ptid);
> + if (pid == 0)
> + pid = GET_PID (ptid);
> +
> + errno = 0;
> + ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
> + if (errno != 0)
> + memset (&siginfo, 0, sizeof (siginfo));
>
--
Pedro Alves