[Lldb-commits] [PATCH] D66392: Fix `TestDataFormatterStdList` regression + D66174 follow-up/cleanup

2019-08-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: JDevlieghere, labath, jingham, clayborg.
jankratochvil added a project: LLDB.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Since D66174  I see failures of 
`TestDataFormatterStdList` in about 50% of runs on Fedora 30 x86_64 libstdc++.
I have found out that LLDB internally expects these `RegularExpression`s to be 
matched in their alphabetical order:

  ^std::(__cxx11::)?list<.+>(( )?&)?$
  ^std::__[[:alnum:]]+::list<.+>(( )?&)?$

But since D66174  they are sometimes matched 
in reverse order. In fact it was only some luck it worked before as there is 
internally `std::map` 
(`FormattersContainer`).
So I have changed the key `RegularExpressionSP` -> `RegularExpression` and 
moved it everywhere as rvalue where possible (so that I am not accused of a 
performance regression; except for 2 cases needing real copy-ctor).

Then there is a second problem that the new `RegularExpression` from D66174 
 IMO contains stale string references:

  bool RegularExpression::Compile(llvm::StringRef str) {
m_regex_text = str;
m_regex = llvm::Regex(str);

Caller will pass a string reference which `RegularExpression` stores locally 
but its `Regex` still points to the caller's string. Maybe currently the caller 
really keeps the string lifetime valid (although what is for example 
`lldb/source/Commands/CommandCompletions.cpp` the line 451 stale reference?) 
but I find it still fragile. If the caller's string lifetime is really 
guaranteed to be remain valid then why isn't `m_regex_text` a `StringRef`? If 
we rather change the `Regex` to reference `m_regex_text` instead then it will 
reference stale memory after executing its default move-ctor:

  RegularExpression(RegularExpression &&rhs) = default;

In the patch below I copy the string to local `m_regex_text` and initializing 
`Regex` only lazily and dropping/forgetting it during move©&assignment 
ctors.
BTW there was forgotten unused inheritance: `class RegularExpression : public 
llvm::Regex`
I have changed (IMO simplified) the `RegularExpression` API a bit for easier 
laziness of its `Regex`. Callers were using the `Compile` method without 
checking its return code which would defeat the laziness without any purpose.
The patch is big addressing two different issues (`FormattersContainer` 
ordering and `RegularExpression` stale string references) but I find it double 
the work just to separate it into 2 patches.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66392

Files:
  lldb/include/lldb/Breakpoint/BreakpointResolverName.h
  lldb/include/lldb/DataFormatters/FormattersContainer.h
  lldb/include/lldb/DataFormatters/TypeCategory.h
  lldb/include/lldb/Interpreter/OptionValueRegex.h
  lldb/include/lldb/Target/Target.h
  lldb/include/lldb/Utility/RegularExpression.h
  lldb/source/API/SBTarget.cpp
  lldb/source/API/SBTypeCategory.cpp
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Core/AddressResolverName.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/FormattersHelpers.cpp
  lldb/source/Interpreter/CommandObjectRegexCommand.cpp
  lldb/source/Interpreter/OptionValueRegex.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/ThreadPlanStepInRange.cpp
  lldb/source/Utility/RegularExpression.cpp
  llvm/include/llvm/Support/Regex.h

Index: llvm/include/llvm/Support/Regex.h
===
--- llvm/include/llvm/Support/Regex.h
+++ llvm/include/llvm/Support/Regex.h
@@ -58,6 +58,9 @@
 /// matching, if any.
 bool isValid(std::string &Error) const;
 
+// Return whether constructor has been called with no parameters.
+bool empty() const { return preg == nullptr; }
+
 /// getNumMatches - In a valid regex, return the number of parenthesized
 /// matches it contains.  The number filled in by match will include this
 /// many entries plus one for the whole regex (as element 0).
Index: lldb/source/Utility/RegularExpression.cpp
===
--- lldb/source/Utility/RegularExpression.cpp
+++ lldb/source/Utility/RegularExpression.cpp
@@ -12,26 +12,36 @@
 
 using namespace lldb_private;
 
-RegularExpression::RegularExpression(llvm::StringRef str) { Compile(str); }
+RegularExpression:

[Lldb-commits] [PATCH] D66392: Fix `TestDataFormatterStdList` regression + D66174 follow-up/cleanup

2019-08-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 215780.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66392

Files:
  lldb/include/lldb/Breakpoint/BreakpointResolverName.h
  lldb/include/lldb/DataFormatters/FormattersContainer.h
  lldb/include/lldb/DataFormatters/TypeCategory.h
  lldb/include/lldb/Interpreter/OptionValueRegex.h
  lldb/include/lldb/Target/Target.h
  lldb/include/lldb/Utility/RegularExpression.h
  lldb/source/API/SBTarget.cpp
  lldb/source/API/SBTypeCategory.cpp
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Core/AddressResolverName.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/FormattersHelpers.cpp
  lldb/source/Interpreter/CommandObjectRegexCommand.cpp
  lldb/source/Interpreter/OptionValueRegex.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/ThreadPlanStepInRange.cpp
  lldb/source/Utility/RegularExpression.cpp
  llvm/include/llvm/Support/Regex.h

Index: llvm/include/llvm/Support/Regex.h
===
--- llvm/include/llvm/Support/Regex.h
+++ llvm/include/llvm/Support/Regex.h
@@ -58,6 +58,9 @@
 /// matching, if any.
 bool isValid(std::string &Error) const;
 
+// Return whether constructor has been called with no parameters.
+bool empty() const { return preg == nullptr; }
+
 /// getNumMatches - In a valid regex, return the number of parenthesized
 /// matches it contains.  The number filled in by match will include this
 /// many entries plus one for the whole regex (as element 0).
Index: lldb/source/Utility/RegularExpression.cpp
===
--- lldb/source/Utility/RegularExpression.cpp
+++ lldb/source/Utility/RegularExpression.cpp
@@ -12,26 +12,43 @@
 
 using namespace lldb_private;
 
-RegularExpression::RegularExpression(llvm::StringRef str) { Compile(str); }
+RegularExpression::RegularExpression(llvm::StringRef str) {
+  m_regex_text = str;
+}
 
+// m_regex must not be copied as it contains pointers to RHS m_regex_text.
 RegularExpression::RegularExpression(const RegularExpression &rhs)
-: RegularExpression() {
-  Compile(rhs.GetText());
+: RegularExpression(rhs.m_regex_text) {}
+
+// m_regex must not be moved as it contains pointers to RHS m_regex_text.
+RegularExpression::RegularExpression(RegularExpression &&rhs)
+: RegularExpression(std::move(rhs.m_regex_text)) {}
+
+// m_regex must not be copied as it contains pointers to RHS m_regex_text.
+RegularExpression &RegularExpression::operator=(const RegularExpression &rhs) {
+  m_regex_text = rhs.m_regex_text;
+  m_regex = llvm::Regex();
+  return *this;
 }
 
-bool RegularExpression::Compile(llvm::StringRef str) {
-  m_regex_text = str;
-  m_regex = llvm::Regex(str);
-  return IsValid();
+// m_regex must not be moved as it contains pointers to RHS m_regex_text.
+RegularExpression &RegularExpression::operator=(RegularExpression &&rhs) {
+  m_regex_text = std::move(rhs.m_regex_text);
+  m_regex = llvm::Regex();
+  return *this;
 }
 
 bool RegularExpression::Execute(
 llvm::StringRef str,
 llvm::SmallVectorImpl *matches) const {
+  if (!IsValid())
+return false;
   return m_regex.match(str, matches);
 }
 
 bool RegularExpression::IsValid() const {
+  if (m_regex.empty())
+m_regex = llvm::Regex(m_regex_text);
   std::string discarded;
   return m_regex.isValid(discarded);
 }
@@ -39,6 +56,8 @@
 llvm::StringRef RegularExpression::GetText() const { return m_regex_text; }
 
 llvm::Error RegularExpression::GetError() const {
+  if (m_regex.empty())
+m_regex = llvm::Regex(m_regex_text);
   std::string error;
   if (!m_regex.isValid(error))
 return llvm::make_error(llvm::inconvertibleErrorCode(),
Index: lldb/source/Target/ThreadPlanStepInRange.cpp
===
--- lldb/source/Target/ThreadPlanStepInRange.cpp
+++ lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -315,8 +315,8 @@
   auto name_ref = llvm::StringRef::withNullAsEmpty(name);
   if (!m_avoid_regexp_up)
 m_avoid_regexp_up.reset(new RegularExpression(name_ref));
-
-  m_avoid_regexp_up->Compile(name_ref);
+  else
+*m_avoid_regexp_up = RegularExpression(name_ref);
 }
 
 void ThreadPlanStepInRange::SetDefaultFlagValue(uint32_t new_value) {
Index: lldb/source/Target/Target.cpp
===
--- 

[Lldb-commits] [PATCH] D66392: 1/2: D66174 `RegularExpression` follow-up/cleanup

2019-08-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 215794.
jankratochvil retitled this revision from "Fix `TestDataFormatterStdList` 
regression + D66174 follow-up/cleanup" to "D66174 `RegularExpression` 
follow-up/cleanup".
jankratochvil edited the summary of this revision.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66392

Files:
  lldb/include/lldb/Interpreter/OptionValueRegex.h
  lldb/include/lldb/Utility/RegularExpression.h
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Core/AddressResolverName.cpp
  lldb/source/Interpreter/CommandObjectRegexCommand.cpp
  lldb/source/Interpreter/OptionValueRegex.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Target/ThreadPlanStepInRange.cpp
  lldb/source/Utility/RegularExpression.cpp
  llvm/include/llvm/Support/Regex.h

Index: llvm/include/llvm/Support/Regex.h
===
--- llvm/include/llvm/Support/Regex.h
+++ llvm/include/llvm/Support/Regex.h
@@ -58,6 +58,9 @@
 /// matching, if any.
 bool isValid(std::string &Error) const;
 
+// Return whether constructor has been called with no parameters.
+bool empty() const { return preg == nullptr; }
+
 /// getNumMatches - In a valid regex, return the number of parenthesized
 /// matches it contains.  The number filled in by match will include this
 /// many entries plus one for the whole regex (as element 0).
Index: lldb/source/Utility/RegularExpression.cpp
===
--- lldb/source/Utility/RegularExpression.cpp
+++ lldb/source/Utility/RegularExpression.cpp
@@ -12,26 +12,43 @@
 
 using namespace lldb_private;
 
-RegularExpression::RegularExpression(llvm::StringRef str) { Compile(str); }
+RegularExpression::RegularExpression(llvm::StringRef str) {
+  m_regex_text = str;
+}
 
+// m_regex must not be copied as it contains pointers to RHS m_regex_text.
 RegularExpression::RegularExpression(const RegularExpression &rhs)
-: RegularExpression() {
-  Compile(rhs.GetText());
+: RegularExpression(rhs.m_regex_text) {}
+
+// m_regex must not be moved as it contains pointers to RHS m_regex_text.
+RegularExpression::RegularExpression(RegularExpression &&rhs)
+: RegularExpression(std::move(rhs.m_regex_text)) {}
+
+// m_regex must not be copied as it contains pointers to RHS m_regex_text.
+RegularExpression &RegularExpression::operator=(const RegularExpression &rhs) {
+  m_regex_text = rhs.m_regex_text;
+  m_regex = llvm::Regex();
+  return *this;
 }
 
-bool RegularExpression::Compile(llvm::StringRef str) {
-  m_regex_text = str;
-  m_regex = llvm::Regex(str);
-  return IsValid();
+// m_regex must not be moved as it contains pointers to RHS m_regex_text.
+RegularExpression &RegularExpression::operator=(RegularExpression &&rhs) {
+  m_regex_text = std::move(rhs.m_regex_text);
+  m_regex = llvm::Regex();
+  return *this;
 }
 
 bool RegularExpression::Execute(
 llvm::StringRef str,
 llvm::SmallVectorImpl *matches) const {
+  if (!IsValid())
+return false;
   return m_regex.match(str, matches);
 }
 
 bool RegularExpression::IsValid() const {
+  if (m_regex.empty())
+m_regex = llvm::Regex(m_regex_text);
   std::string discarded;
   return m_regex.isValid(discarded);
 }
@@ -39,6 +56,8 @@
 llvm::StringRef RegularExpression::GetText() const { return m_regex_text; }
 
 llvm::Error RegularExpression::GetError() const {
+  if (m_regex.empty())
+m_regex = llvm::Regex(m_regex_text);
   std::string error;
   if (!m_regex.isValid(error))
 return llvm::make_error(llvm::inconvertibleErrorCode(),
Index: lldb/source/Target/ThreadPlanStepInRange.cpp
===
--- lldb/source/Target/ThreadPlanStepInRange.cpp
+++ lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -315,8 +315,8 @@
   auto name_ref = llvm::StringRef::withNullAsEmpty(name);
   if (!m_avoid_regexp_up)
 m_avoid_regexp_up.reset(new RegularExpression(name_ref));
-
-  m_avoid_regexp_up->Compile(name_ref);
+  else
+*m_avoid_regexp_up = RegularExpression(name_ref);
 }
 
 void ThreadPlanStepInRange::SetDefaultFlagValue(uint32_t new_value) {
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -332,11 +332,12 @@
 std::string regex_str = "^";
 regex_str += echo_packet;
 regex_

[Lldb-commits] [PATCH] D66398: 2/2: Fix `TestDataFormatterStdList` regression

2019-08-18 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: JDevlieghere, labath, jingham, clayborg.
jankratochvil added a project: LLDB.
Herald added a reviewer: jdoerfert.
jankratochvil added a parent revision: D66392: 1/2: D66174 `RegularExpression` 
follow-up/cleanup.

Since D66174  I see failures of 
`TestDataFormatterStdList` in about 50% of runs on Fedora 30 x86_64 libstdc++.
I have found out that LLDB internally expects these `RegularExpression`s to be 
matched in their alphabetical order:

  ^std::(__cxx11::)?list<.+>(( )?&)?$
  ^std::__[[:alnum:]]+::list<.+>(( )?&)?$

But since D66174  they are sometimes matched 
in reverse order. A simple ugly workaround is to just sort it for ite
ration . The 
overlapping matches one can see by another debug patch on top of it 
.
In fact it was only some luck it worked before as there is internally 
`std::map` (`FormattersContainer`).
So I have changed the key `RegularExpressionSP` -> `RegularExpression` and 
moved it everywhere as rvalue where possible (so that I am not accused of a 
performance regression; except for 2 cases needing real copy-ctor).


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66398

Files:
  lldb/include/lldb/Breakpoint/BreakpointResolverName.h
  lldb/include/lldb/DataFormatters/FormattersContainer.h
  lldb/include/lldb/DataFormatters/TypeCategory.h
  lldb/include/lldb/Target/Target.h
  lldb/source/API/SBTarget.cpp
  lldb/source/API/SBTypeCategory.cpp
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/FormattersHelpers.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Target/Target.cpp

Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -307,14 +307,14 @@
 const FileSpecList *containingModules,
 const FileSpecList *source_file_spec_list,
 const std::unordered_set &function_names,
-RegularExpression &source_regex, bool internal, bool hardware,
+RegularExpression &&source_regex, bool internal, bool hardware,
 LazyBool move_to_nearest_code) {
   SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList(
   containingModules, source_file_spec_list));
   if (move_to_nearest_code == eLazyBoolCalculate)
 move_to_nearest_code = GetMoveToNearestCode() ? eLazyBoolYes : eLazyBoolNo;
   BreakpointResolverSP resolver_sp(new BreakpointResolverFileRegex(
-  nullptr, source_regex, function_names,
+  nullptr, std::move(source_regex), function_names,
   !static_cast(move_to_nearest_code)));
 
   return CreateBreakpoint(filter_sp, resolver_sp, internal, hardware, true);
@@ -549,7 +549,7 @@
 
 BreakpointSP Target::CreateFuncRegexBreakpoint(
 const FileSpecList *containingModules,
-const FileSpecList *containingSourceFiles, RegularExpression &func_regex,
+const FileSpecList *containingSourceFiles, RegularExpression &&func_regex,
 lldb::LanguageType requested_language, LazyBool skip_prologue,
 bool internal, bool hardware) {
   SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList(
@@ -558,7 +558,7 @@
   ? GetSkipPrologue()
   : static_cast(skip_prologue);
   BreakpointResolverSP resolver_sp(new BreakpointResolverName(
-  nullptr, func_regex, requested_language, 0, skip));
+  nullptr, std::move(func_regex), requested_language, 0, skip));
 
   return CreateBreakpoint(filter_sp, resolver_sp, internal, hardware, true);
 }
Index: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -547,8 +547,8 @@
   ConstString("^std::__[[:alnum:]]+::atomic<.+>$"), stl_synth_flags, true);
 
   cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
-  RegularExpressionSP(new RegularExpression(
-  llvm::StringRef("^(std::__[[:alnum:]]+::)deque<.+>(( )?&)?$"))),
+  RegularExpression(
+  llvm::StringRef("^(std::__[[:alnum:]]+::)deque<.+>(( )?&)?$")),
   SyntheticChildrenSP(new ScriptedSyntheticChildren(
   stl_synth_flags,
   "lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));
@@ -744,38 +744,32 @@
   false);
 
   cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
-  RegularExpressionSP(
-  new RegularExpression(llvm::StringRef("^std::vector<.+>(( )?&)?$"))),
+  RegularExpression(llvm::StringRef("^std::vector<.+>(( )?&)?$")),
   SyntheticChildrenSP(new Scripted

[Lldb-commits] [PATCH] D66392: 1/2: D66174 `RegularExpression` follow-up/cleanup

2019-08-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

This code review seems to address a few things. I think it might have been 
easier to discuss if they were separate patches, but here are my comments:

- Thanks for removing the stale inheritance! (LGTM)
- Thanks for adding the relational operator back. I couldn't find why they were 
needed (because they weren't used if I understand D66398 
 correctly). (LGTM)
- While I was doing the transition I considered the lifetime and came to the 
conclusion that the regex input string (the StringRef) does not need to outlive 
the regex compilation (`regcomp`). The interface of `llvm::Regex` gives the 
same impression. Is this not correct?
- I'm not a fan of the laziness. Do we really need it? What's the cost of 
compiling an empty regex for the default constructed object? Now we have to 
(lazily) recompile the regex after every move, even though an `llvm::Regex` was 
designed to be movable.




Comment at: lldb/include/lldb/Utility/RegularExpression.h:74
   /// Return an error if the regular expression failed to compile.
+  /// The value is not valid if the object has been copy/move-ctored.
   llvm::Error GetError() const;

This doesn't sound right, we return the error by value and llvm::StringError 
stores the error string. 


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66392



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r369220 - [CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.

2019-08-18 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Sun Aug 18 14:54:26 2019
New Revision: 369220

URL: http://llvm.org/viewvc/llvm-project?rev=369220&view=rev
Log:
[CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.

After LLVM moved to C++14, the RWMutex implementation was removed in
favor of std::shared_timed_mutex, which is only available on macOS
10.12 and later. As a workaround for older deployment targets, I added
   the original RWMutexImpl again, guarded by the deployment target.

When doing a standalone build of LLDB using the Xcode generator, the
CMake cache specifies a minimum deployment target. However, LLVM and
Clang might have been built with a different minimum deployment target.

This is exactly what happened for the Xcode build. LLVM was built with a
minimum deployment target newer than 10.12, using
std::shared_timed_mutex. LLDB on the other hand was built with a minimum
deployment target of 10.11, using the old RWMutexImpl, resulting in
undefined symbols at link-time.

This patch changes the minimum deployment target for the Xcode build to
10.12 to work around this problem. A better solution would involve
synchronizing the minimum deployment or even not setting one at all.

Modified:
lldb/trunk/cmake/caches/Apple-lldb-Xcode.cmake

Modified: lldb/trunk/cmake/caches/Apple-lldb-Xcode.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/caches/Apple-lldb-Xcode.cmake?rev=369220&r1=369219&r2=369220&view=diff
==
--- lldb/trunk/cmake/caches/Apple-lldb-Xcode.cmake (original)
+++ lldb/trunk/cmake/caches/Apple-lldb-Xcode.cmake Sun Aug 18 14:54:26 2019
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
 
 set(CMAKE_GENERATOR Xcode CACHE STRING "")
-set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "")
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "")
 set(CMAKE_XCODE_GENERATE_SCHEME ON CACHE BOOL "")
 
 set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits