This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]