Trying to understand what ptrace_report_signal() should do, a couple
of questions...


Why does utrace_signal_handler() set ->signal_handler when !stepping?

If I understand correctly, the logic is

        if (stepping)
                make sure that before return to user-space
                UTRACE_SIGNAL_HANDLER will be reported.

                This is understandable. More or less.
        else
                make sure that UTRACE_SIGNAL_REPORT is not
                possible before we return to user-space,
                UTRACE_SIGNAL_HANDLER should be used instead.

                Why? I mean, why this is useful?



Another question. How can ->report_signal(info) change info->si_signo
(or other data in *info) when we have multiple engines? I mean, how
can engines cooperate if they want to change ->si_signo.

For example, ptrace_report_signal() sets ->si_signo = SIGTRAP. But
if we have another engine attached before ptrace-engine, then its
->report_signal() was already called. This means that engine can't
know about this SIGTRAP?

In short. If any engine changes *info, how should it take into account
other engines attached before?


ptrace also changes *info via ->last_siginfo. IOW, the owner of engine
plays with info, not ->report_signal(). I assume that ptrace is the only
engine which "has rights" to play with *info outside of ->report_signal(),
right?

Oleg.

Reply via email to