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 3/9 v7] Introduce target_{stop,continue}_ptid


On 08/29/2014 02:51 PM, Gary Benson wrote:


> +/* See target/target.h.  */
> +
> +void
> +target_stop_ptid (ptid_t ptid)
> +{
> +  struct target_waitstatus status;
> +  int was_non_stop = non_stop;
> +
> +  non_stop = 1;
> +  target_stop (ptid);
> +
> +  memset (&status, 0, sizeof (status));
> +  target_wait (ptid, &status, 0);
> +
> +  non_stop = was_non_stop;
> +}

One thing that was bugging me was that given that the names
of target_stop and target_stop_ptid are so similar and that
they have the same signature is ripe for confusion.

I just now noticed the elephant in the room -- target_stop is
asynchronous, doesn't wait for a stop, while and target_stop_ptid
is synchronous.  Would you mind renaming this to target_stop_wait
or some such?  And then add an explicit "and wait for it to stop"
or some such to the function's description.

Thanks,
Pedro Alves


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