[lldb] Lock accesses to PathMappingLists's internals
authorAlex Langford <alangford@apple.com>
Fri, 14 Apr 2023 21:16:26 +0000 (14:16 -0700)
committerAlex Langford <alangford@apple.com>
Mon, 17 Apr 2023 21:48:16 +0000 (14:48 -0700)
commit43ac269bdd00d709005f8f3550db6b657b2bf940
treec59491215de7f0d0e0cb7fe2515430c4759fc5b0
parent64ce140fa60846b4dc17b1212c4c8e8a22965622
[lldb] Lock accesses to PathMappingLists's internals

This class is not safe in multithreaded code. It's possible for one
thread to modify a PathMappingList's `m_pair` vector while another
thread is iterating over it, effectively invalidating the iterator and
potentially leading to crashes or other difficult-to-diagnose bugs.

rdar://107695786

Differential Revision: https://reviews.llvm.org/D148380
lldb/include/lldb/Target/PathMappingList.h
lldb/source/Target/PathMappingList.cpp