[lldb] Remove logging from Platform::~Platform

Platform instances are stored in a function-local static list. However, the
logging code involves locking a function-local static mutex. This only works on
some implementations where the Log mutex is by accident destroyed *after* the
Platform list is destroyed.

This fixes randomly failing tests due to `recursive_mutex lock failed: Invalid
argument`.

Reviewed By: kastiglione

Differential Revision: https://reviews.llvm.org/D111816
This commit is contained in:
Raphael Isemann 2021-10-14 20:41:58 +02:00
parent 59dd418e89
commit e632e900ac
2 changed files with 1 additions and 12 deletions

View File

@ -73,11 +73,9 @@ public:
/// Default Constructor
Platform(bool is_host_platform);
/// Destructor.
///
/// The destructor is virtual since this class is designed to be inherited
/// from by the plug-in instance.
~Platform() override;
~Platform() override = default;
static void Initialize();

View File

@ -395,15 +395,6 @@ Platform::Platform(bool is_host)
LLDB_LOGF(log, "%p Platform::Platform()", static_cast<void *>(this));
}
/// Destructor.
///
/// The destructor is virtual since this class is designed to be
/// inherited from by the plug-in instance.
Platform::~Platform() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
LLDB_LOGF(log, "%p Platform::~Platform()", static_cast<void *>(this));
}
void Platform::GetStatus(Stream &strm) {
std::string s;
strm.Printf(" Platform: %s\n", GetPluginName().GetCString());