Re: [PATCH v2 1/2] thread: add can_access_registers_ptid

Pedro Alves
2017-01-25T14:33:56Z

On 01/20/2017 02:38 PM, Markus Metzger wrote:

> +/* See gdbthread.h. */
> +
> +int
> +can_access_registers_ptid (ptid_t ptid)
> +{
> + /* No thread, no registers. */
> + if (ptid_equal (ptid, null_ptid))
> + return 0;
> +
> + /* Don't try to read from a dead thread. */
> + if (is_exited (ptid))
> + return 0;
> +
> + /* ... or from a spinning thread. FIXME: see validate_registers_access. */
> + if (is_executing (ptid))
> + return 0;
> +
> + return 1;
> +}

Use "bool" and true/false. OK with that change.

Thanks,
Pedro Alves