[PATCH v2 1/2] thread: add can_access_registers_ptid
Pedro Alves
palves@redhat.com
Wed Jan 25 14:33:00 GMT 2017
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
More information about the Gdb-patches
mailing list