llvm-project/lldb/source
Jonas Devlieghere fc43703481
[lldb] Use objc_getRealizedClassList_trylock on macOS Ventura and later
In order to avoid stranding the Objective-C runtime lock, we switched
from objc_copyRealizedClassList to its non locking variant
objc_copyRealizedClassList_nolock. Not taking the lock was relatively
safe because we run this expression on one thread only, but it was still
possible that someone was in the middle of modifying this list while we
were trying to read it. Worst case that would result in a crash in the
inferior without side-effects and we'd unwind and try again later.

With the introduction of macOS Ventura, we can use
objc_getRealizedClassList_trylock instead. It has semantics similar to
objc_copyRealizedClassList_nolock, but instead of not locking at all,
the function returns if the lock is already taken, which avoids the
aforementioned crash without stranding the Objective-C runtime lock.
Because LLDB gets to allocate the underlying memory we also avoid
stranding the malloc lock.

rdar://89373233

Differential revision: https://reviews.llvm.org/D127252
2022-06-08 11:34:27 -07:00
..
API [lldb] const a couple of getters on MemoryRegionInfo 2022-05-18 09:00:00 +00:00
Breakpoint Revert "[lldb] Consider binary as module of last resort" 2022-05-23 11:19:48 +05:00
Commands CommandObjectRegexCommand shouldn't put two commands on the history stack. 2022-06-03 11:34:53 -07:00
Core Check that a FileSpec has a Directory component before using 2022-05-26 11:12:37 -07:00
DataFormatters [lldb] Add setting for max depth of value object printing (NFC) 2022-05-03 10:39:42 -07:00
Expression Decr pc when looking for DWARF loc list entry mid-stack 2022-04-29 14:34:06 -07:00
Host [lldb] Fix an unused function warning 2022-05-25 09:49:05 -07:00
Initialization [lldb] Remove FileSystem::Initialize from FileCollector 2022-03-03 13:22:38 -08:00
Interpreter Fix a copy-paste error in "br com add -s py -o 'some_python' BKPT_NAME" 2022-05-31 17:24:14 -07:00
Plugins [lldb] Use objc_getRealizedClassList_trylock on macOS Ventura and later 2022-06-08 11:34:27 -07:00
Symbol [NFC] Don't bother with unstripped binary w/ dSYM, don't DebugSymbols twice 2022-05-16 15:30:39 -07:00
Target Increase the default maximum stack walk 2022-05-28 13:12:57 -07:00
Utility Use static_cast from SmallString to std::string (NFC) 2022-06-04 22:09:27 -07:00
Version [lldb] Fix LLDB_FULL_VERSION_STRING 2022-01-19 14:20:22 -08:00
CMakeLists.txt [lldb] Make lldbVersion a full fledged library 2021-12-08 15:14:34 -08:00