labath added a comment.

I am somewhat worried about the direction this is taking. Maybe vanishing 
threads are fine for os-level debugging (because there the "real" threads are 
the cpu cores, and the os threads are somewhat imaginary), but I definitely 
wouldn't want to do it for regular debugging. If my process has 1000 threads 
(not completely uncommon) then I don't think my debugger would be doing me a 
service showing me just the three it thinks are interesting and completely 
disregarding the others. Having a mode (it could even be default) which only 
highlights the interesting ones -- yes, that would definitely be useful. Making 
sure it doesn't touch the other threads when it doesn't need to -- absolutely. 
But I don't think it should pretend the other threads don't exist at all, 
because I may still have a reason to inspect those threads (or just to know 
that they're there). In fact, I wouldn't be surprised if this happened to the 
said kernel folks too, and they end up adding a custom command, which would 
enumerate all "threads".

What was actually the slow part here? Was it the os plugin reading the thread 
lists from the kernel memory? Or the fact that lldb is slow when it is 
confronted with them?

If it is the latter, then maybe we should fix that. For example, I think I 
remember lldb likes to check the PC of every thread before it does any kind of 
a resume -- I am not convinced that is really needed.

If fetching the threads is slow, then perhaps we could have an api, where the 
os threads are produced incrementally, and we ensure that lldb does not query 
for os threads needlessly during the hot paths (e.g. internal stops for 
servicing thread plans).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75711



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

Reply via email to