On 10/07, Roland McGrath wrote:
>
> >     void set_stop_code(struct ptrace_context *ctx, int event)
> >     {
> >             ctx->stop_code = (event << 8) | SIGTRAP;
> >     }
> >
> >     void set_syscall_code(struct ptrace_context *ctx, int event)
> >     {
> >             set_stop_code(ctx, event);
> >             if (PTRACE_O_TRACESYSGOOD)
> >                     ctx->stop_code |= 0x80;
> >     }
>
> Very good (that's what I had in mind first, really).  (statics, of course.)

Great, will do.

> > This way ptrace_report_signal() can use __set_stop_code() too.
>
> It sure feels cleaner just to use event=0 for the "signal" event
> so it just uses plain "ctx->stop_code = signr" there.

Cough. I am afraid you may be right again (yes yes yes, ev_array
was really bad idea).

But so far I disagree. I like the fact we can distinguish
PTRACE_EVENT_SIGTRAP and PTRACE_EVENT_SIGNAL. And get_stop_event()
logic becomes simpler.

OK, at least these two events do not add a lot of uglification,
it will be simple to kill them later.

Oleg.

Reply via email to