Re: [PATCH 6/8] Make reinsert_breakpoint thread specific

Pedro Alves
2016-05-24T16:39:08Z

On 05/20/2016 04:12 PM, Yao Qi wrote:
> This patch makes reinsert_breakpoint thread specific, which means we
> insert and remove reinsert_breakpoint breakpoints for a specific
> thread. This motivation of this change is that I'll use
> reinsert_breakpoint for vCont;s on software single step target, so that
> GDBserver may insert one reinsert_breakpoint for step-over, and the
> other one for vCont;s.

Here I don't understand what you mean by "the other one".

> After the operation of one thread is finished,
> GDBserver must remove reinsert_breakpoint for that thread only.
>
> On the other hand, reinsert_breakpoint is used for step-over nowadays,
> which is an operation to one thread in one go.

"in one go" ? WDYM?

> In other words,
> reinsert_breakpoint is globally thread specific, but in an implicit way.

Right.

> index 4e45c0e..5d699c3 100644
> --- a/gdb/gdbserver/mem-break.c
> +++ b/gdb/gdbserver/mem-break.c
> @@ -211,6 +211,9 @@ struct other_breakpoint
> struct reinsert_breakpoint
> {
> struct breakpoint base;
> +
> + /* Thread the reinsert breakpoint belongs to. */
> + ptid_t id;

It's much more usual to call this "ptid". From the ChangeLog,
I first though you were adding a "breakpoint number" kind of id.

> };
>
> /* Return the breakpoint size from its kind. */
> @@ -1476,25 +1479,32 @@ gdb_breakpoint_here (CORE_ADDR where)
> }
>
> void
> -set_reinsert_breakpoint (CORE_ADDR stop_at)
> +set_reinsert_breakpoint (CORE_ADDR stop_at, ptid_t id)

Ditto. (Likewise other places.)

Otherwise LGTM.

Thanks,
Pedro Alves