clayborg added a comment.

Patch looks good, just a question of what timeout to use by default and 
possible adding an option to lldb-server in case users want faster or slower 
polling.



================
Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:344
+  // TODO: Make the polling interval configurable.
+  std::chrono::milliseconds polling_interval = std::chrono::seconds(1);
+
----------------
We probably want this to be quite a bit shorter than 1 second. Why? Because if 
you don't find the process right away, 1 second is a long time for the system 
to wait and your program can execute quite a few instructions in 1 second. By 
the time you attach, you might have missed your breakpoint at main. Nothing 
will guarantee hitting a breakpoint, but I would suggest making a smaller 
timeout, maybe like 1 millisecond. It would be good to benchmark this a bit by 
waiting for a process and not launching a new process to see how much CPU 
lldb-server takes up with a shorter timeout.

Adding a command line option might be nice is someone could specify 
"--wait-poll-msec 0" to constantly poll the system as fast as possible in case 
they do need to catch the process as early as possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93895

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

Reply via email to