[Lldb-commits] [PATCH] D157556: Replace the singleton "ShadowListener" with a primary and N secondary listeners

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 9 16:12:22 PDT 2023


mib accepted this revision.
mib added a comment.
This revision is now accepted and ready to land.

LGTM with some comments :)



================
Comment at: lldb/source/Target/Process.cpp:372
 
+const int Process::g_all_event_bits = eBroadcastBitStateChanged 
+                              | eBroadcastBitInterrupt
----------------
nit: this could probably be `constexpr`


================
Comment at: lldb/source/Utility/Broadcaster.cpp:229-235
+  ListenerSP primary_listener_sp = hijacking_listener_sp;
+  bool is_hijack = false;
+  
+  if (primary_listener_sp)
+    is_hijack = true;
+  else
+    primary_listener_sp = m_primary_listener_sp;
----------------
nit: We could simplify the logic here a little bit


================
Comment at: lldb/source/Utility/Broadcaster.cpp:246
+    // listeners.
+    if (!is_hijack) {
+      for (auto &pair : GetListeners()) {
----------------
Then, as a follow-up to my suggestion, you could check `hijacking_listener_sp ` instead of checking the boolean.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157556



More information about the lldb-commits mailing list