ping: [patch 4/4]#3 Remove redundant lp->siginfo
Pedro Alves
pedro@codesourcery.com
Thu May 19 18:51:00 GMT 2011
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
More information about the Gdb-patches
mailing list