[Lldb-commits] [lldb] b590e9a - [lldb] Remove Listener::SetShadow (#97555)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 03:06:35 PDT 2024


Author: Pavel Labath
Date: 2024-07-08T12:06:32+02:00
New Revision: b590e9a5aedabeceb00d81d49897abbf02ab3b87

URL: https://github.com/llvm/llvm-project/commit/b590e9a5aedabeceb00d81d49897abbf02ab3b87
DIFF: https://github.com/llvm/llvm-project/commit/b590e9a5aedabeceb00d81d49897abbf02ab3b87.diff

LOG: [lldb] Remove Listener::SetShadow (#97555)

It's not used since https://reviews.llvm.org/D157556.

Added: 
    

Modified: 
    lldb/include/lldb/Utility/Listener.h
    lldb/source/API/SBAttachInfo.cpp
    lldb/source/API/SBLaunchInfo.cpp
    lldb/source/Utility/Listener.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/Listener.h b/lldb/include/lldb/Utility/Listener.h
index eec8af023f263..d48816ec0ea4d 100644
--- a/lldb/include/lldb/Utility/Listener.h
+++ b/lldb/include/lldb/Utility/Listener.h
@@ -94,8 +94,6 @@ class Listener : public std::enable_shared_from_this<Listener> {
 
   size_t HandleBroadcastEvent(lldb::EventSP &event_sp);
 
-  void SetShadow(bool is_shadow) { m_is_shadow = is_shadow; }
-
 private:
   // Classes that inherit from Listener can see and modify these
   struct BroadcasterInfo {
@@ -132,7 +130,6 @@ class Listener : public std::enable_shared_from_this<Listener> {
   std::mutex m_events_mutex; // Protects m_broadcasters and m_events
   std::condition_variable m_events_condition;
   broadcaster_manager_collection m_broadcaster_managers;
-  bool m_is_shadow = false;
 
   void BroadcasterWillDestruct(Broadcaster *);
 

diff  --git a/lldb/source/API/SBAttachInfo.cpp b/lldb/source/API/SBAttachInfo.cpp
index 8ce1f1d65c496..a9f712c79c7fe 100644
--- a/lldb/source/API/SBAttachInfo.cpp
+++ b/lldb/source/API/SBAttachInfo.cpp
@@ -266,13 +266,7 @@ SBListener SBAttachInfo::GetShadowListener() {
 void SBAttachInfo::SetShadowListener(SBListener &listener) {
   LLDB_INSTRUMENT_VA(this, listener);
 
-  ListenerSP listener_sp = listener.GetSP();
-  if (listener_sp && listener.IsValid())
-    listener_sp->SetShadow(true);
-  else
-    listener_sp = nullptr;
-
-  m_opaque_sp->SetShadowListener(listener_sp);
+  m_opaque_sp->SetShadowListener(listener.GetSP());
 }
 
 const char *SBAttachInfo::GetScriptedProcessClassName() const {

diff  --git a/lldb/source/API/SBLaunchInfo.cpp b/lldb/source/API/SBLaunchInfo.cpp
index d5f935083e6c1..d6b52e8a67a49 100644
--- a/lldb/source/API/SBLaunchInfo.cpp
+++ b/lldb/source/API/SBLaunchInfo.cpp
@@ -402,11 +402,5 @@ SBListener SBLaunchInfo::GetShadowListener() {
 void SBLaunchInfo::SetShadowListener(SBListener &listener) {
   LLDB_INSTRUMENT_VA(this, listener);
 
-  ListenerSP listener_sp = listener.GetSP();
-  if (listener_sp && listener.IsValid())
-    listener_sp->SetShadow(true);
-  else
-    listener_sp = nullptr;
-
-  m_opaque_sp->SetShadowListener(listener_sp);
+  m_opaque_sp->SetShadowListener(listener.GetSP());
 }

diff  --git a/lldb/source/Utility/Listener.cpp b/lldb/source/Utility/Listener.cpp
index 6265c30af0d18..1efaad392502c 100644
--- a/lldb/source/Utility/Listener.cpp
+++ b/lldb/source/Utility/Listener.cpp
@@ -18,22 +18,16 @@
 using namespace lldb;
 using namespace lldb_private;
 
-Listener::Listener(const char *name)
-    : m_name(name), m_broadcasters(), m_broadcasters_mutex(), m_events(),
-      m_events_mutex(), m_is_shadow() {
-  Log *log = GetLog(LLDBLog::Object);
-  if (log != nullptr)
-    LLDB_LOGF(log, "%p Listener::Listener('%s')", static_cast<void *>(this),
-              m_name.c_str());
+Listener::Listener(const char *name) : m_name(name) {
+  LLDB_LOGF(GetLog(LLDBLog::Object), "%p Listener::Listener('%s')",
+            static_cast<void *>(this), m_name.c_str());
 }
 
 Listener::~Listener() {
-  Log *log = GetLog(LLDBLog::Object);
-
   // Don't call Clear() from here as that can cause races. See #96750.
 
-  LLDB_LOGF(log, "%p Listener::%s('%s')", static_cast<void *>(this),
-            __FUNCTION__, m_name.c_str());
+  LLDB_LOGF(GetLog(LLDBLog::Object), "%p Listener::%s('%s')",
+            static_cast<void *>(this), __FUNCTION__, m_name.c_str());
 }
 
 void Listener::Clear() {


        


More information about the lldb-commits mailing list