mgorny marked an inline comment as done.
mgorny added a comment.

In D64647#1583429 <https://reviews.llvm.org/D64647#1583429>, @krytarowski wrote:

> Something that we do not cover here is that once a tracee reports a signal 
> (like someone poked it with SIGUSR1) and we want to pass it over to the 
> tracee, we will reset siginfo.
>
> This scenario should be covered by a test and we should handle it properly..
>
> The solution in NetBSD for passing over signals without changing siginfo, is 
> to not calling PT_SET_SIGINFO as the default one will be kept by the kernel. 
> Optionally pick old siginfo with PT_GET_SIGINFO and optionally change 
> destination lwp.


How is 'properly'? Should we reject resuming with a signal when there's already 
another signal pending?



================
Comment at: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:354
+      if (signal != LLDB_INVALID_SIGNAL_NUMBER && signal != action->signal)
+        return Status("NetBSD does not support passing multiple signals 
simultaneously");
 
----------------
labath wrote:
> krytarowski wrote:
> > mgorny wrote:
> > > labath wrote:
> > > > Is this "passing multiple signals simultaneously", or "passing multiple 
> > > > *distinct* signals simultaneously". (E.g,. thread 1 gets a SIGALRM, 
> > > > thread 2 gets SIGIO, etc.).
> > > The former. Basically there's one siginfo slot, so you can either put a 
> > > signal for whole process, or for one LWP.
> > Once we emit a single signal to all threads, it's still technically a 
> > single signal that hits the process.
> Ok, that makes sense. But I don't think that's what the code does right now 
> (IIUC, this line will only fire if the current signal is different that the 
> signal sent to the previous thread).
There's a second `if` on line 400 that verifies the number of threads signaled.

The idea is that we have either:
* exactly one thread signaled,
* all threads signaled with the same signal.

Here we check for the 'same signal' condition.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64647/new/

https://reviews.llvm.org/D64647



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to