[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, thanks for the cleanup! (And also having the second list of comments no 
longer always stating 'SpringBoard' is even better).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87327

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


[Lldb-commits] [PATCH] D87345: [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87345

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


[Lldb-commits] [lldb] 4e4a3fe - [lldb][doc] Mention python3-dev instead of python2.7-dev in build docs

2020-09-09 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-09-09T09:31:27+02:00
New Revision: 4e4a3feecdb6bd56483b9c6ba9116609c20588aa

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

LOG: [lldb][doc] Mention python3-dev instead of python2.7-dev in build docs

Added: 


Modified: 
lldb/docs/resources/build.rst

Removed: 




diff  --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index c1cb6ec1a934..b5c1fb8cb001 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -71,7 +71,7 @@ commands below.
 ::
 
   > yum install libedit-devel libxml2-devel ncurses-devel python-devel swig
-  > sudo apt-get install build-essential subversion swig python2.7-dev 
libedit-dev libncurses5-dev
+  > sudo apt-get install build-essential subversion swig python3-dev 
libedit-dev libncurses5-dev
   > pkg install swig python
   > pkgin install swig python27 cmake ninja-build
   > brew install swig cmake ninja



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


[Lldb-commits] [lldb] 32c8da4 - [lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when trying to complete a forward decl

2020-09-09 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-09-09T10:05:57+02:00
New Revision: 32c8da41dc0cb99651823a1a21130c2cbdf688e1

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

LOG: [lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when 
trying to complete a forward decl

SemaSourceWithPriorities is a special SemaSource that wraps our normal LLDB
ExternalASTSource and the ASTReader (which is used for the C++ module loading).
It's only active when the `import-std-module` setting is turned on.

The `CompleteType` function there in `SemaSourceWithPriorities` is looping over
all ExternalASTSources and asks each to complete the type. However, that loop is
in another loop that keeps doing that until the type is complete. If that
function is ever called on a type that is a forward decl then that causes LLDB
to go into an infinite loop.

I remember I added that second loop and the comment because I thought I saw a
similar pattern in some other Clang code, but after some grepping I can't find
that code anywhere and it seems the rest of the code base only calls
CompleteType once (It would also be kinda silly to have calling it multiple
times). So it seems that's just a silly mistake.

The is implicitly tested by importing `std::pair`, but I also added a simpler
dedicated test that creates a dummy libc++ module with some forward declarations
and then imports them into the scratch AST context. At some point the
ASTImporter will check if one of the forward decls could be completed by the
ExternalASTSource, which will cause the `SemaSourceWithPriorities` to go into an
infinite loop once it receives the `CompleteType` call.

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D87289

Added: 

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/main.cpp

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/module.modulemap

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/vector

lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/libc_header.h

Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h

Removed: 




diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h 
b/lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
index 769b18d54ced..b70ec223df4d 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
@@ -359,15 +359,12 @@ class SemaSourceWithPriorities : public 
clang::ExternalSemaSource {
   }
 
   void CompleteType(clang::TagDecl *Tag) override {
-while (!Tag->isCompleteDefinition())
-  for (size_t i = 0; i < Sources.size(); ++i) {
-// FIXME: We are technically supposed to loop here too until
-// Tag->isCompleteDefinition() is true, but if our low quality source
-// is failing to complete the tag this code will deadlock.
-Sources[i]->CompleteType(Tag);
-if (Tag->isCompleteDefinition())
-  break;
-  }
+for (clang::ExternalSemaSource *S : Sources) {
+  S->CompleteType(Tag);
+  // Stop after the first source completed the type.
+  if (Tag->isCompleteDefinition())
+break;
+}
   }
 
   void CompleteType(clang::ObjCInterfaceDecl *Class) override {

diff  --git 
a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile
 
b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile
new file mode 100644
index ..4915cdae8764
--- /dev/null
+++ 
b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile
@@ -0,0 +1,9 @@
+# We don't have any standard include directories, so we can't
+# parse the test_common.h header we usually inject as it includes
+# system headers.
+NO_TEST_COMMON_H := 1
+
+CXXFLAGS_EXTRAS = -I $(SRCDIR)/root/usr/include/c++/v1/ -I 
$(SRCDIR)/root/usr/include/ -nostdinc -nostdinc++
+CXX_SOURCES := main.cpp
+
+include Makefile.rules

diff  --git 
a/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
 
b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
new file mode 100644
index ..48459abb9266
--- /dev/null
+++ 
b/lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
@@ -0,0 +1,39 @@
+"""
+Tests forward declarations coming fro

[Lldb-commits] [PATCH] D87289: [lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when trying to complete a forward decl

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG32c8da41dc0c: [lldb] Don't infinite loop in 
SemaSourceWithPriorities::CompleteType when… (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Changed prior to commit:
  https://reviews.llvm.org/D87289?vs=290492&id=290659#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87289

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/main.cpp
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/module.modulemap
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/vector
  
lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/libc_header.h

Index: lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/libc_header.h
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/libc_header.h
@@ -0,0 +1 @@
+struct libc_struct {};
Index: lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/vector
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/vector
@@ -0,0 +1,14 @@
+#include "libc_header.h"
+
+namespace std {
+  inline namespace __1 {
+// A forward decl of `vector`.
+template class vector;
+// Pretend to be a std::vector template we need to instantiate in LLDB
+// when import-std-module is enabled.
+template
+struct vector { class F; F *f; };
+// The definition of our forward declared nested class.
+template class vector::F { int x; };
+  }
+}
Index: lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/module.modulemap
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/module.modulemap
@@ -0,0 +1,3 @@
+module std {
+  module "vector" { header "vector" export * }
+}
Index: lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/main.cpp
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/main.cpp
@@ -0,0 +1,8 @@
+#include 
+
+int main(int argc, char **argv) {
+  // Makes sure we have the mock libc headers in the debug information.
+  libc_struct s;
+  std::vector v;
+  return 0; // Set break point at this line.
+}
Index: lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
@@ -0,0 +1,39 @@
+"""
+Tests forward declarations coming from the `std` module.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+import os
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+# We only emulate a fake libc++ in this test and don't use the real libc++,
+# but we still add the libc++ category so that this test is only run in
+# test configurations where libc++ is actually supposed to be tested.
+@add_test_categories(["libc++"])
+@skipIfRemote
+@skipIf(compiler=no_match("clang"))
+def test(self):
+self.build()
+
+sysroot = os.path.join(os.getcwd(), "root")
+
+# Set the sysroot where our dummy libc++ exists.
+self.runCmd("platform select --sysroot '" + sysroot + "' host", CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+# Print the dummy `std::vector`. It only has the dummy member in it
+# so the standard `std::vector` formatter can't format it. Instead use
+# the raw output so LLDB has to show the member variable.
+# Both `std::vector` and the type of the member have forward
+# declarations before their definitions.
+self.expect("expr --raw -- v",
+substrs=['(std::

[Lldb-commits] [lldb] 7866b91 - [lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl

2020-09-09 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-09-09T10:31:39+02:00
New Revision: 7866b91405693df5b4cf6ba770b3a92d48b0c508

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

LOG: [lldb] Fix a crash when the ASTImporter is giving us two Imported 
callbacks for the same target decl

The ASTImporter has an `Imported(From, To)` callback that notifies subclasses
that a declaration has been imported in some way. LLDB uses this in the
`CompleteTagDeclsScope` to see which records have been imported into the scratch
context. If the record was declared inside the expression, then the
`CompleteTagDeclsScope` will forcibly import the full definition of that record
to the scratch context so that the expression AST can safely be disposed later
(otherwise we might end up going back to the deleted AST to complete the
minimally imported record). The way this is implemented is that there is a list
of decls that need to be imported (`m_decls_to_complete`) and we keep completing
the declarations inside that list until the list is empty. Every `To` Decl we
get via the `Imported` callback will be added to the list of Decls to be
completed.

There are some situations where the ASTImporter will actually give us two
`Imported` calls with the same `To` Decl. One way where this happens is if the
ASTImporter decides to merge an imported definition into an already imported
one. Another way is that the ASTImporter just happens to get two calls to
`ASTImporter::Import` for the same Decl. This for example happens when importing
the DeclContext of a Decl requires importing the Decl itself, such as when
importing a RecordDecl that was declared inside a function.

The bug addressed in this patch is that when we end up getting two `Imported`
calls for the same `To` Decl, then we would crash in the
`CompleteTagDeclsScope`.  That's because the first time we complete the Decl we
remove the Origin tracking information (that maps the Decl back to from where it
came from). The next time we try to complete the same `To` Decl the Origin
tracking information is gone and we hit the `to_context_md->getOrigin(decl).ctx
== m_src_ctx` assert (`getOrigin(decl).ctx` is a nullptr the second time as the
Origin was deleted).

This is actually a regression coming from D72495. Before D72495
`m_decls_to_complete` was actually a set so every declaration in there could
only be queued once to be completed. The set was changed to a vector to make the
iteration over it deterministic, but that also causes that we now potentially
end up trying to complete a Decl twice.

This patch essentially just reverts D72495 and makes the `CompleteTagDeclsScope`
use a SetVector for the list of declarations to be completed. The SetVector
should filter out the duplicates (as the original `set` did) and also ensure 
that
the completion order is deterministic. I actually couldn't find any way to cause
LLDB to reproduce this bug by merging declarations (this would require that we
for example declare two namespaces in a non-top-level expression which isn't
possible). But the bug reproduces very easily by just declaring a class in an
expression, so that's what the test is doing.

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D85648

Added: 
lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py

Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp

Removed: 




diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index 73042c205a5a..e2601a059bb7 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -216,7 +216,12 @@ namespace {
 /// imported while completing the original Decls).
 class CompleteTagDeclsScope : public ClangASTImporter::NewDeclListener {
   ClangASTImporter::ImporterDelegateSP m_delegate;
-  llvm::SmallVector m_decls_to_complete;
+  /// List of declarations in the target context that need to be completed.
+  /// Every declaration should only be completed once and therefore should only
+  /// be once in this list.
+  llvm::SetVector m_decls_to_complete;
+  /// Set of declarations that already were successfully completed (not just
+  /// added to m_decls_to_complete).
   llvm::SmallPtrSet m_decls_already_completed;
   clang::ASTContext *m_dst_ctx;
   clang::ASTContext *m_src_ctx;
@@ -244,6 +249,9 @@ class CompleteTagDeclsScope : public 
ClangASTImporter::NewDeclListener {
   NamedDecl *decl = m_decls_to_complete.pop_back_val();
   m_decls_already_completed.insert(decl);
 
+  // The decl that should be completed has to be imported into the target
+  // context from some other context.
+  assert(to_contex

[Lldb-commits] [PATCH] D85648: [lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7866b9140569: [lldb] Fix a crash when the ASTImporter is 
giving us two Imported callbacks for… (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85648

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
  lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py


Index: lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py
===
--- /dev/null
+++ lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py
@@ -0,0 +1,34 @@
+"""
+Tests declaring RecordDecls in non-top-level expressions.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@no_debug_info_test
+def test_fwd_decl(self):
+# Declare a forward decl and import it to the scratch AST.
+self.expect_expr("struct S; S *s = nullptr; s", result_type="S *")
+
+@no_debug_info_test
+def test_struct(self):
+# Declare a struct and import it to the scratch AST.
+self.expect("expr struct S {}; S s; s", substrs=["= {}"])
+
+@no_debug_info_test
+def test_struct_with_fwd_decl(self):
+# Import the forward decl to the scratch AST.
+self.expect_expr("struct S; S *s = nullptr; s", result_type="S *")
+# Merge the definition into the scratch AST.
+self.expect("expr struct S {}; S s; s", substrs=["= {}"])
+
+@no_debug_info_test
+def test_struct_with_fwd_decl_same_expr(self):
+# Test both a forward decl and a definition in one expression and
+# import them into the scratch AST.
+self.expect("expr struct S; struct S{}; S s; s", substrs=["= {}"])
Index: lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
===
--- lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -216,7 +216,12 @@
 /// imported while completing the original Decls).
 class CompleteTagDeclsScope : public ClangASTImporter::NewDeclListener {
   ClangASTImporter::ImporterDelegateSP m_delegate;
-  llvm::SmallVector m_decls_to_complete;
+  /// List of declarations in the target context that need to be completed.
+  /// Every declaration should only be completed once and therefore should only
+  /// be once in this list.
+  llvm::SetVector m_decls_to_complete;
+  /// Set of declarations that already were successfully completed (not just
+  /// added to m_decls_to_complete).
   llvm::SmallPtrSet m_decls_already_completed;
   clang::ASTContext *m_dst_ctx;
   clang::ASTContext *m_src_ctx;
@@ -244,6 +249,9 @@
   NamedDecl *decl = m_decls_to_complete.pop_back_val();
   m_decls_already_completed.insert(decl);
 
+  // The decl that should be completed has to be imported into the target
+  // context from some other context.
+  assert(to_context_md->hasOrigin(decl));
   // We should only complete decls coming from the source context.
   assert(to_context_md->getOrigin(decl).ctx == m_src_ctx);
 
@@ -287,7 +295,8 @@
 // Check if we already completed this type.
 if (m_decls_already_completed.count(to_named_decl) != 0)
   return;
-m_decls_to_complete.push_back(to_named_decl);
+// Queue this type to be completed.
+m_decls_to_complete.insert(to_named_decl);
   }
 };
 } // namespace


Index: lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py
===
--- /dev/null
+++ lldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py
@@ -0,0 +1,34 @@
+"""
+Tests declaring RecordDecls in non-top-level expressions.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@no_debug_info_test
+def test_fwd_decl(self):
+# Declare a forward decl and import it to the scratch AST.
+self.expect_expr("struct S; S *s = nullptr; s", result_type="S *")
+
+@no_debug_info_test
+def test_struct(self):
+# Declare a struct and import it to the scratch AST.
+self.expect("expr struct S {}; S s; s", substrs=["= {}"])
+
+@no_debug_info_test
+def test_struct_with_fwd_decl(self):
+# Import the forward decl to the scratch AST.
+self.expect_expr("struct S; S *s = nullptr; s", result_type="S *")
+# Merge the definition into the scratch AST.
+self.expect("expr struct S {}; S s; s", substrs=["= {}"])
+
+@no_de

[Lldb-commits] [lldb] b852225 - [lldb] Enable std::pair in CxxModuleHandler

2020-09-09 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-09-09T10:49:53+02:00
New Revision: b85222520f861a1812f991d6bd65950dda22f31b

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

LOG: [lldb] Enable std::pair in CxxModuleHandler

This adds support for substituting std::pair instantiations with enabled
import-std-module.

With the fixes in parent revisions we can currently substitute a single pair
(however, a result that returns a second pair currently causes LLDB to crash
while importing the second template instantiation).

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D85141

Added: 
lldb/test/API/commands/expression/import-std-module/pair/Makefile

lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
lldb/test/API/commands/expression/import-std-module/pair/main.cpp

Modified: 
lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp

Removed: 




diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
index 2f8cf1846ee7..38d9f8d1e4b8 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
@@ -34,6 +34,7 @@ CxxModuleHandler::CxxModuleHandler(ASTImporter &importer, 
ASTContext *target)
   "weak_ptr",
   // utility
   "allocator",
+  "pair",
   };
   m_supported_templates.insert(supported_names.begin(), supported_names.end());
 }

diff  --git a/lldb/test/API/commands/expression/import-std-module/pair/Makefile 
b/lldb/test/API/commands/expression/import-std-module/pair/Makefile
new file mode 100644
index ..f938f7428468
--- /dev/null
+++ b/lldb/test/API/commands/expression/import-std-module/pair/Makefile
@@ -0,0 +1,3 @@
+USE_LIBCPP := 1
+CXX_SOURCES := main.cpp
+include Makefile.rules

diff  --git 
a/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
 
b/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
new file mode 100644
index ..4f5b1ea8028b
--- /dev/null
+++ 
b/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
@@ -0,0 +1,25 @@
+"""
+Test basic std::pair functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+def test(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+self.expect_expr("pair_int.first", result_type="int", 
result_value="1234")
+self.expect_expr("pair_int.second", result_type="int", 
result_value="5678")
+self.expect("expr pair_int", substrs=['first = 1234, second = 5678'])
\ No newline at end of file

diff  --git a/lldb/test/API/commands/expression/import-std-module/pair/main.cpp 
b/lldb/test/API/commands/expression/import-std-module/pair/main.cpp
new file mode 100644
index ..1363698f1fc7
--- /dev/null
+++ b/lldb/test/API/commands/expression/import-std-module/pair/main.cpp
@@ -0,0 +1,6 @@
+#include 
+
+int main(int argc, char **argv) {
+  std::pair pair_int(1234, 5678);
+  return 0; // Set break point at this line.
+}



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


[Lldb-commits] [PATCH] D85141: [lldb] Enable std::pair in CxxModuleHandler

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb85222520f86: [lldb] Enable std::pair in CxxModuleHandler 
(authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85141

Files:
  lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
  lldb/test/API/commands/expression/import-std-module/pair/Makefile
  
lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
  lldb/test/API/commands/expression/import-std-module/pair/main.cpp


Index: lldb/test/API/commands/expression/import-std-module/pair/main.cpp
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/main.cpp
@@ -0,0 +1,6 @@
+#include 
+
+int main(int argc, char **argv) {
+  std::pair pair_int(1234, 5678);
+  return 0; // Set break point at this line.
+}
Index: 
lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
===
--- /dev/null
+++ 
lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
@@ -0,0 +1,25 @@
+"""
+Test basic std::pair functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+def test(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+self.expect_expr("pair_int.first", result_type="int", 
result_value="1234")
+self.expect_expr("pair_int.second", result_type="int", 
result_value="5678")
+self.expect("expr pair_int", substrs=['first = 1234, second = 5678'])
\ No newline at end of file
Index: lldb/test/API/commands/expression/import-std-module/pair/Makefile
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/Makefile
@@ -0,0 +1,3 @@
+USE_LIBCPP := 1
+CXX_SOURCES := main.cpp
+include Makefile.rules
Index: lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
===
--- lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
@@ -34,6 +34,7 @@
   "weak_ptr",
   // utility
   "allocator",
+  "pair",
   };
   m_supported_templates.insert(supported_names.begin(), supported_names.end());
 }


Index: lldb/test/API/commands/expression/import-std-module/pair/main.cpp
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/main.cpp
@@ -0,0 +1,6 @@
+#include 
+
+int main(int argc, char **argv) {
+  std::pair pair_int(1234, 5678);
+  return 0; // Set break point at this line.
+}
Index: lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
@@ -0,0 +1,25 @@
+"""
+Test basic std::pair functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+def test(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+self.expect_expr("pair_int.first", result_type="int", result_value="1234")
+self.expect_expr("pair_int.second", result_type="int", result_value="5678")
+self.expect("expr pair_int", substrs=['first = 1234, second = 5678'])
\ No newline at end of file
Index: lldb/test/API/commands/expression/import-std-module/pair/Makefile
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/Makefile
@@ -0,0 +1,3 @@
+USE_LIBCPP := 1
+CXX_SOURCES := main.cpp
+include Makefile.rules
Index: lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
===
--- lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/CxxModu

[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Valentin Clement via Phabricator via lldb-commits
clementval created this revision.
clementval added reviewers: sscalpone, schweitz, jeanPerier, DavidTruby, 
jdoerfert.
Herald added subscribers: lldb-commits, rriddle.
Herald added a project: LLDB.
clementval requested review of this revision.
Herald added subscribers: stephenneuendorffer, JDevlieghere.

Lower OpenACCLoopConstruct and most of the clauses to the OpenACC acc.loop 
operation in MLIR.
This patch refelcts what can be upstream from PR 
flang-compiler/f18-llvm-project#419


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87389

Files:
  flang/include/flang/Optimizer/Dialect/FIRDialect.h
  flang/lib/Lower/OpenACC.cpp
  lldb/tools/lldb-vscode/VSCode.cpp

Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -38,8 +38,8 @@
{"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
{"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false), is_attach(false),
-  reverse_request_seq(0), waiting_for_run_in_terminal(false) {
+  stop_at_entry(false), is_attach(false), reverse_request_seq(0),
+  waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
 #if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
Index: flang/lib/Lower/OpenACC.cpp
===
--- flang/lib/Lower/OpenACC.cpp
+++ flang/lib/Lower/OpenACC.cpp
@@ -11,16 +11,202 @@
 //===--===//
 
 #include "flang/Lower/OpenACC.h"
+#include "flang/Common/idioms.h"
 #include "flang/Lower/Bridge.h"
 #include "flang/Lower/FIRBuilder.h"
 #include "flang/Lower/PFTBuilder.h"
 #include "flang/Parser/parse-tree.h"
+#include "flang/Semantics/tools.h"
+#include "mlir/Dialect/OpenACC/OpenACC.h"
 #include "llvm/Frontend/OpenACC/ACC.h.inc"
 
 #define TODO() llvm_unreachable("not yet implemented")
 
+static const Fortran::parser::Name *
+GetDesignatorNameIfDataRef(const Fortran::parser::Designator &designator) {
+  const auto *dataRef{std::get_if(&designator.u)};
+  return dataRef ? std::get_if(&dataRef->u) : nullptr;
+}
+
+static void genObjectList(const Fortran::parser::AccObjectList &objectList,
+  Fortran::lower::AbstractConverter &converter,
+  std::int32_t &objectsCount,
+  SmallVector &operands) {
+  for (const auto &accObject : objectList.v) {
+std::visit(
+Fortran::common::visitors{
+[&](const Fortran::parser::Designator &designator) {
+  if (const auto *name = GetDesignatorNameIfDataRef(designator)) {
+++objectsCount;
+const auto variable = converter.getSymbolAddress(*name->symbol);
+operands.push_back(variable);
+  }
+},
+[&](const Fortran::parser::Name &name) {
+  ++objectsCount;
+  const auto variable = converter.getSymbolAddress(*name.symbol);
+  operands.push_back(variable);
+}},
+accObject.u);
+  }
+}
+
+static void genACC(Fortran::lower::AbstractConverter &converter,
+   Fortran::lower::pft::Evaluation &eval,
+   const Fortran::parser::OpenACCLoopConstruct &loopConstruct) {
+
+  const auto &beginLoopDirective =
+  std::get(loopConstruct.t);
+  const auto &loopDirective =
+  std::get(beginLoopDirective.t);
+
+  if (loopDirective.v == llvm::acc::ACCD_loop) {
+auto &firOpBuilder = converter.getFirOpBuilder();
+auto currentLocation = converter.getCurrentLocation();
+llvm::ArrayRef argTy;
+
+// Add attribute extracted from clauses.
+const auto &accClauseList =
+std::get(beginLoopDirective.t);
+
+mlir::Value workerNum;
+mlir::Value vectorLength;
+mlir::Value gangNum;
+mlir::Value gangStatic;
+std::int32_t tileOperands = 0;
+std::int32_t privateOperands = 0;
+std::int32_t reductionOperands = 0;
+std::int64_t executionMapping = mlir::acc::OpenACCExecMapping::NONE;
+SmallVector operands;
+
+// Lower clauses values mapped to operands.
+for (const auto &clause : accClauseList.v) {
+  if (const auto *gangClause =
+  std::get_if(&clause.u)) {
+if (gangClause->v) {
+  const Fortran::parser::AccGangArgument &x = *gangClause->v;
+  if (const auto &gangNumValue =
+  std::get>(
+  x.t)) {
+gangNum = converter.genExprValue(
+*Fortran::semantics::GetExpr(gangNumValue.value()));
+operands.push_back(gangNum);
+  }
+  if (const auto &gangStaticValue =
+  std::get>(x.t)) {
+const au

[Lldb-commits] [PATCH] D87345: [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

2020-09-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.

Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87345

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


[Lldb-commits] [PATCH] D82064: [ARM64] Add QEMU testing environment setup guide for SVE testing

2020-09-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/docs/resources/test.rst:427
+actual hardware. QEMU helper scripts and README.txt document can be found under
+llvm-project/lldb/scripts/lldb-test-qemu which can help setup a virtual testing
+environment for LLDB using QEMU. These scripts currently work with Arm or

What's the reason you chose to refer to the README in the source tree instead 
of converting it to an RST page and linking to that page from here? I think 
it's good to have an entry here rather than the whole document, but I still 
think this should be a hyperlink to its own page. 


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

https://reviews.llvm.org/D82064

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


[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision.
teemperor added inline comments.
This revision now requires changes to proceed.



Comment at: lldb/tools/lldb-vscode/VSCode.cpp:41
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false), is_attach(false),
-  reverse_request_seq(0), waiting_for_run_in_terminal(false) {
+  stop_at_entry(false), is_attach(false), reverse_request_seq(0),
+  waiting_for_run_in_terminal(false) {

Unrelated reformatting?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87389

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


[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Valentin Clement via Phabricator via lldb-commits
clementval added inline comments.



Comment at: lldb/tools/lldb-vscode/VSCode.cpp:41
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false), is_attach(false),
-  reverse_request_seq(0), waiting_for_run_in_terminal(false) {
+  stop_at_entry(false), is_attach(false), reverse_request_seq(0),
+  waiting_for_run_in_terminal(false) {

teemperor wrote:
> Unrelated reformatting?
Sure it shouldn't be here. I'll remove it. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87389

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


[Lldb-commits] [PATCH] D87389: [flang][openacc] Lower clauses on loop construct to OpenACC dialect

2020-09-09 Thread Sourabh Singh Tomar via Phabricator via lldb-commits
SouraVX added a comment.

Since `bbc` based test can't be added here, would you mind adding a unit-test 
here ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87389

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


[Lldb-commits] [PATCH] D87345: [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

2020-09-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG447ba60a224f: [lldb/Docs] Correct LLDB_ENABLE_TESTS to 
LLDB_INCLUDE_TESTS (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87345

Files:
  lldb/docs/resources/build.rst


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -244,7 +244,7 @@
 
 On Windows the LLDB test suite requires lld. Either add ``lld`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``.
+``LLDB_INCLUDE_TESTS=OFF``.
 
 Although the following CMake variables are by no means Windows specific, they
 are commonly used on Windows.
@@ -300,7 +300,7 @@
 
 On macOS the LLDB test suite requires libc++. Either add ``libcxx`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``. Further useful options:
+``LLDB_INCLUDE_TESTS=OFF``. Further useful options:
 
 * ``LLDB_BUILD_FRAMEWORK:BOOL``: Builds the LLDB.framework.
 * ``LLDB_CODESIGN_IDENTITY:STRING``: Set the identity to use for code-signing


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -244,7 +244,7 @@
 
 On Windows the LLDB test suite requires lld. Either add ``lld`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``.
+``LLDB_INCLUDE_TESTS=OFF``.
 
 Although the following CMake variables are by no means Windows specific, they
 are commonly used on Windows.
@@ -300,7 +300,7 @@
 
 On macOS the LLDB test suite requires libc++. Either add ``libcxx`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``. Further useful options:
+``LLDB_INCLUDE_TESTS=OFF``. Further useful options:
 
 * ``LLDB_BUILD_FRAMEWORK:BOOL``: Builds the LLDB.framework.
 * ``LLDB_CODESIGN_IDENTITY:STRING``: Set the identity to use for code-signing
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 447ba60 - [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

2020-09-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2020-09-09T11:07:57-07:00
New Revision: 447ba60a224f63524a3bc40cdc1cfdbf1f8383db

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

LOG: [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

Fix references to LLDB_ENABLE_TESTS.

Differential Revision: https://reviews.llvm.org/D87345

Added: 


Modified: 
lldb/docs/resources/build.rst

Removed: 




diff  --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index b5c1fb8cb001..579f7574dac5 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -244,7 +244,7 @@ Windows
 
 On Windows the LLDB test suite requires lld. Either add ``lld`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``.
+``LLDB_INCLUDE_TESTS=OFF``.
 
 Although the following CMake variables are by no means Windows specific, they
 are commonly used on Windows.
@@ -300,7 +300,7 @@ macOS
 
 On macOS the LLDB test suite requires libc++. Either add ``libcxx`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``. Further useful options:
+``LLDB_INCLUDE_TESTS=OFF``. Further useful options:
 
 * ``LLDB_BUILD_FRAMEWORK:BOOL``: Builds the LLDB.framework.
 * ``LLDB_CODESIGN_IDENTITY:STRING``: Set the identity to use for code-signing



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


[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-09 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

@teemperor I'm not sure what these build errors mean, for example 
https://reviews.llvm.org/B70998. Also there's the linux build failure, but 
that's not relevant for debugserver, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87327

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


[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-09 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D87327#2263971 , @kastiglione wrote:

> @teemperor I'm not sure what these build errors mean, for example 
> https://reviews.llvm.org/B70998. Also there's the linux build failure, but 
> that's not relevant for debugserver, right?

You can usually ignore premerge checks that aren't clang-format complaining. 
And for linux buildbot failures I think that's also fine as they don't build 
debug server from what I know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87327

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


[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG55dd731b291c: [debugserver] Extract function for default 
launch flavor (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87327

Files:
  lldb/tools/debugserver/source/debugserver.cpp

Index: lldb/tools/debugserver/source/debugserver.cpp
===
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -156,18 +156,36 @@
   return eRNBRunLoopModeExit;
 }
 
-// Check the name to see if it ends with .app
-static bool is_dot_app (const char *app_name) {
-  size_t len = strlen(app_name);
-  if (len < 4)
+static nub_launch_flavor_t default_launch_flavor(const char *app_name) {
+#if defined(WITH_FBS) || defined(WITH_BKS) || defined(WITH_SPRINGBOARD)
+  // Check the name to see if it ends with .app
+  auto is_dot_app = [](const char *app_name) {
+size_t len = strlen(app_name);
+if (len < 4)
+  return false;
+
+if (app_name[len - 4] == '.' && app_name[len - 3] == 'a' &&
+app_name[len - 2] == 'p' && app_name[len - 1] == 'p')
+  return true;
 return false;
-  
-  if (app_name[len - 4] == '.' &&
-  app_name[len - 3] == 'a' && 
-  app_name[len - 2] == 'p' &&
-  app_name[len - 1] == 'p')
-return true;
-  return false;
+  };
+
+  if (is_dot_app(app_name)) {
+#if defined WITH_FBS
+// Check if we have an app bundle, if so launch using FrontBoard Services.
+return eLaunchFlavorFBS;
+#elif defined WITH_BKS
+// Check if we have an app bundle, if so launch using BackBoard Services.
+return eLaunchFlavorBKS;
+#elif defined WITH_SPRINGBOARD
+// Check if we have an app bundle, if so launch using SpringBoard.
+return eLaunchFlavorSpringBoard;
+#endif
+  }
+#endif
+
+  // Our default launch method is posix spawn
+  return eLaunchFlavorPosixSpawn;
 }
 
 // This run loop mode will wait for the process to launch and hit its
@@ -208,29 +226,8 @@
   // figure our how we are going to launch automatically.
 
   nub_launch_flavor_t launch_flavor = g_launch_flavor;
-  if (launch_flavor == eLaunchFlavorDefault) {
-// Our default launch method is posix spawn
-launch_flavor = eLaunchFlavorPosixSpawn;
-
-const bool dot_app = is_dot_app(inferior_argv[0]);
-(void)dot_app;
-#if defined WITH_FBS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorFBS;
-}
-#elif defined WITH_BKS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorBKS;
-}
-#elif defined WITH_SPRINGBOARD
-// Check if we have an app bundle, if so launch using SpringBoard.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorSpringBoard;
-}
-#endif
-  }
+  if (launch_flavor == eLaunchFlavorDefault)
+launch_flavor = default_launch_flavor(inferior_argv[0]);
 
   ctx.SetLaunchFlavor(launch_flavor);
   char resolved_path[PATH_MAX];
@@ -1509,27 +1506,8 @@
   timeout_ptr = &attach_timeout_abstime;
 }
 nub_launch_flavor_t launch_flavor = g_launch_flavor;
-if (launch_flavor == eLaunchFlavorDefault) {
-  // Our default launch method is posix spawn
-  launch_flavor = eLaunchFlavorPosixSpawn;
-
-#if defined WITH_FBS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorFBS;
-  }
-#elif defined WITH_BKS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorBKS;
-  }
-#elif defined WITH_SPRINGBOARD
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorSpringBoard;
-  }
-#endif
-}
+if (launch_flavor == eLaunchFlavorDefault)
+  launch_flavor = default_launch_flavor(waitfor_pid_name.c_str());
 
 ctx.SetLaunchFlavor(launch_flavor);
 bool ignore_existing = false;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 55dd731 - [debugserver] Extract function for default launch flavor

2020-09-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2020-09-09T11:35:44-07:00
New Revision: 55dd731b291c2d64f318f27c40a17d2255e16215

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

LOG: [debugserver] Extract function for default launch flavor

Extract a function for turning `eLaunchFlavorDefault` into a concreate 
`eLaunchFlavor` value.

This new function encapsulates the few compile time variables involved, and 
also prevents clang unused code diagnostics.

Differential Revision: https://reviews.llvm.org/D87327

Added: 


Modified: 
lldb/tools/debugserver/source/debugserver.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/debugserver.cpp 
b/lldb/tools/debugserver/source/debugserver.cpp
index 04cbd2c8b503..feb65eb6d3fb 100644
--- a/lldb/tools/debugserver/source/debugserver.cpp
+++ b/lldb/tools/debugserver/source/debugserver.cpp
@@ -156,18 +156,36 @@ RNBRunLoopMode RNBRunLoopGetStartModeFromRemote(RNBRemote 
*remote) {
   return eRNBRunLoopModeExit;
 }
 
-// Check the name to see if it ends with .app
-static bool is_dot_app (const char *app_name) {
-  size_t len = strlen(app_name);
-  if (len < 4)
+static nub_launch_flavor_t default_launch_flavor(const char *app_name) {
+#if defined(WITH_FBS) || defined(WITH_BKS) || defined(WITH_SPRINGBOARD)
+  // Check the name to see if it ends with .app
+  auto is_dot_app = [](const char *app_name) {
+size_t len = strlen(app_name);
+if (len < 4)
+  return false;
+
+if (app_name[len - 4] == '.' && app_name[len - 3] == 'a' &&
+app_name[len - 2] == 'p' && app_name[len - 1] == 'p')
+  return true;
 return false;
-  
-  if (app_name[len - 4] == '.' &&
-  app_name[len - 3] == 'a' && 
-  app_name[len - 2] == 'p' &&
-  app_name[len - 1] == 'p')
-return true;
-  return false;
+  };
+
+  if (is_dot_app(app_name)) {
+#if defined WITH_FBS
+// Check if we have an app bundle, if so launch using FrontBoard Services.
+return eLaunchFlavorFBS;
+#elif defined WITH_BKS
+// Check if we have an app bundle, if so launch using BackBoard Services.
+return eLaunchFlavorBKS;
+#elif defined WITH_SPRINGBOARD
+// Check if we have an app bundle, if so launch using SpringBoard.
+return eLaunchFlavorSpringBoard;
+#endif
+  }
+#endif
+
+  // Our default launch method is posix spawn
+  return eLaunchFlavorPosixSpawn;
 }
 
 // This run loop mode will wait for the process to launch and hit its
@@ -208,29 +226,8 @@ RNBRunLoopMode RNBRunLoopLaunchInferior(RNBRemote *remote,
   // figure our how we are going to launch automatically.
 
   nub_launch_flavor_t launch_flavor = g_launch_flavor;
-  if (launch_flavor == eLaunchFlavorDefault) {
-// Our default launch method is posix spawn
-launch_flavor = eLaunchFlavorPosixSpawn;
-
-const bool dot_app = is_dot_app(inferior_argv[0]);
-(void)dot_app;
-#if defined WITH_FBS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorFBS;
-}
-#elif defined WITH_BKS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorBKS;
-}
-#elif defined WITH_SPRINGBOARD
-// Check if we have an app bundle, if so launch using SpringBoard.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorSpringBoard;
-}
-#endif
-  }
+  if (launch_flavor == eLaunchFlavorDefault)
+launch_flavor = default_launch_flavor(inferior_argv[0]);
 
   ctx.SetLaunchFlavor(launch_flavor);
   char resolved_path[PATH_MAX];
@@ -1509,27 +1506,8 @@ int main(int argc, char *argv[]) {
   timeout_ptr = &attach_timeout_abstime;
 }
 nub_launch_flavor_t launch_flavor = g_launch_flavor;
-if (launch_flavor == eLaunchFlavorDefault) {
-  // Our default launch method is posix spawn
-  launch_flavor = eLaunchFlavorPosixSpawn;
-
-#if defined WITH_FBS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorFBS;
-  }
-#elif defined WITH_BKS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorBKS;
-  }
-#elif defined WITH_SPRINGBOARD
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorSpringBoard;
-  }
-#endif
-}
+if (launch_flavor == eLaunchFlavorDefault)
+  launch_flavor = default_launch_flavor(waitfor_pid_name.c_str());
 
 ctx.SetLaunchFlavor(launch_flavor);
 bool ignore_existing = fals

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-09 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht updated this revision to Diff 290799.
rupprecht added a comment.

- Don't use "localhost" to avoid dns latency. Instead, prefer either 127.0.0.1 
or ::1 directly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87333

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py
  lldb/test/API/tools/lldb-server/commandline/TestStubReverseConnect.py
  lldb/tools/lldb-server/lldb-gdbserver.cpp
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTestUtilities.cpp

Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- lldb/unittests/Host/SocketTestUtilities.cpp
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -101,13 +101,14 @@
  "Creating a canary {0} TCP socket failed: {1}.",
  Proto, Err)
  .str();
-  bool HasAddrNotAvail = false;
+  bool HasProtocolError = false;
   handleAllErrors(std::move(Err), [&](std::unique_ptr ECErr) {
-if (ECErr->convertToErrorCode() ==
-std::make_error_code(std::errc::address_not_available))
-  HasAddrNotAvail = true;
+std::error_code ec = ECErr->convertToErrorCode();
+if (ec == std::make_error_code(std::errc::address_family_not_supported) ||
+ec == std::make_error_code(std::errc::address_not_available))
+  HasProtocolError = true;
   });
-  if (HasAddrNotAvail) {
+  if (HasProtocolError) {
 GTEST_LOG_(WARNING)
 << llvm::formatv(
"Assuming the host does not support {0}. Skipping test.", Proto)
Index: lldb/unittests/Host/SocketTest.cpp
===
--- lldb/unittests/Host/SocketTest.cpp
+++ lldb/unittests/Host/SocketTest.cpp
@@ -14,12 +14,24 @@
 
 using namespace lldb_private;
 
-class SocketTest : public testing::Test {
+struct SocketTestParams {
+  bool is_ipv6;
+  std::string localhost_ip;
+};
+
+class SocketTest : public testing::TestWithParam {
 public:
   SubsystemRAII subsystems;
+
+protected:
+  bool HostSupportsProtocol() const {
+if (GetParam().is_ipv6)
+  return HostSupportsIPv6();
+return HostSupportsIPv4();
+  }
 };
 
-TEST_F(SocketTest, DecodeHostAndPort) {
+TEST_P(SocketTest, DecodeHostAndPort) {
   std::string host_str;
   std::string port_str;
   int32_t port;
@@ -86,7 +98,7 @@
 }
 
 #if LLDB_ENABLE_POSIX
-TEST_F(SocketTest, DomainListenConnectAccept) {
+TEST_P(SocketTest, DomainListenConnectAccept) {
   llvm::SmallString<64> Path;
   std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
   ASSERT_FALSE(EC);
@@ -102,18 +114,22 @@
 }
 #endif
 
-TEST_F(SocketTest, TCPListen0ConnectAccept) {
+TEST_P(SocketTest, TCPListen0ConnectAccept) {
+  if (!HostSupportsProtocol())
+return;
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  CreateTCPConnectedSockets("127.0.0.1", &socket_a_up, &socket_b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, &socket_a_up,
+&socket_b_up);
 }
 
-TEST_F(SocketTest, TCPGetAddress) {
+TEST_P(SocketTest, TCPGetAddress) {
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  if (!HostSupportsIPv4())
+  if (!HostSupportsProtocol())
 return;
-  CreateTCPConnectedSockets("127.0.0.1", &socket_a_up, &socket_b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, &socket_a_up,
+&socket_b_up);
 
   EXPECT_EQ(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetRemotePortNumber());
@@ -121,19 +137,26 @@
 socket_a_up->GetRemotePortNumber());
   EXPECT_NE(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetLocalPortNumber());
-  EXPECT_STREQ("127.0.0.1", socket_a_up->GetRemoteIPAddress().c_str());
-  EXPECT_STREQ("127.0.0.1", socket_b_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_a_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_b_up->GetRemoteIPAddress().c_str());
 }
 
-TEST_F(SocketTest, UDPConnect) {
-  llvm::Expected> socket =
-  UDPSocket::Connect("127.0.0.1:0", /*child_processes_inherit=*/false);
+TEST_P(SocketTest, UDPConnect) {
+  // UDPSocket::Connect() creates sockets with AF_INET (IPv4).
+  if (!HostSupportsIPv4())
+return;
+  llvm::Expected> socket = UDPSocket::Connect(
+  "127.0.0.1:0", /*child_processes_inherit=*/false);
 
   ASSERT_THAT_EXPECTED(socket, llvm::Succeeded());
   EXPECT_TRUE(socket.get()->IsValid());
 }
 
-TEST_F(SocketTest, TCPListen0GetPort) {
+TEST_P(SocketTest, TCPListen0GetPort) {
+  if (!HostSupportsIPv4())
+return;
   Predicate port_predicate;
   port_predicate.Set

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-09 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht updated this revision to Diff 290800.
rupprecht added a comment.

- clang-format


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87333

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py
  lldb/test/API/tools/lldb-server/commandline/TestStubReverseConnect.py
  lldb/tools/lldb-server/lldb-gdbserver.cpp
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTestUtilities.cpp

Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- lldb/unittests/Host/SocketTestUtilities.cpp
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -101,13 +101,14 @@
  "Creating a canary {0} TCP socket failed: {1}.",
  Proto, Err)
  .str();
-  bool HasAddrNotAvail = false;
+  bool HasProtocolError = false;
   handleAllErrors(std::move(Err), [&](std::unique_ptr ECErr) {
-if (ECErr->convertToErrorCode() ==
-std::make_error_code(std::errc::address_not_available))
-  HasAddrNotAvail = true;
+std::error_code ec = ECErr->convertToErrorCode();
+if (ec == std::make_error_code(std::errc::address_family_not_supported) ||
+ec == std::make_error_code(std::errc::address_not_available))
+  HasProtocolError = true;
   });
-  if (HasAddrNotAvail) {
+  if (HasProtocolError) {
 GTEST_LOG_(WARNING)
 << llvm::formatv(
"Assuming the host does not support {0}. Skipping test.", Proto)
Index: lldb/unittests/Host/SocketTest.cpp
===
--- lldb/unittests/Host/SocketTest.cpp
+++ lldb/unittests/Host/SocketTest.cpp
@@ -14,12 +14,24 @@
 
 using namespace lldb_private;
 
-class SocketTest : public testing::Test {
+struct SocketTestParams {
+  bool is_ipv6;
+  std::string localhost_ip;
+};
+
+class SocketTest : public testing::TestWithParam {
 public:
   SubsystemRAII subsystems;
+
+protected:
+  bool HostSupportsProtocol() const {
+if (GetParam().is_ipv6)
+  return HostSupportsIPv6();
+return HostSupportsIPv4();
+  }
 };
 
-TEST_F(SocketTest, DecodeHostAndPort) {
+TEST_P(SocketTest, DecodeHostAndPort) {
   std::string host_str;
   std::string port_str;
   int32_t port;
@@ -86,7 +98,7 @@
 }
 
 #if LLDB_ENABLE_POSIX
-TEST_F(SocketTest, DomainListenConnectAccept) {
+TEST_P(SocketTest, DomainListenConnectAccept) {
   llvm::SmallString<64> Path;
   std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
   ASSERT_FALSE(EC);
@@ -102,18 +114,22 @@
 }
 #endif
 
-TEST_F(SocketTest, TCPListen0ConnectAccept) {
+TEST_P(SocketTest, TCPListen0ConnectAccept) {
+  if (!HostSupportsProtocol())
+return;
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  CreateTCPConnectedSockets("127.0.0.1", &socket_a_up, &socket_b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, &socket_a_up,
+&socket_b_up);
 }
 
-TEST_F(SocketTest, TCPGetAddress) {
+TEST_P(SocketTest, TCPGetAddress) {
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  if (!HostSupportsIPv4())
+  if (!HostSupportsProtocol())
 return;
-  CreateTCPConnectedSockets("127.0.0.1", &socket_a_up, &socket_b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, &socket_a_up,
+&socket_b_up);
 
   EXPECT_EQ(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetRemotePortNumber());
@@ -121,11 +137,16 @@
 socket_a_up->GetRemotePortNumber());
   EXPECT_NE(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetLocalPortNumber());
-  EXPECT_STREQ("127.0.0.1", socket_a_up->GetRemoteIPAddress().c_str());
-  EXPECT_STREQ("127.0.0.1", socket_b_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_a_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_b_up->GetRemoteIPAddress().c_str());
 }
 
-TEST_F(SocketTest, UDPConnect) {
+TEST_P(SocketTest, UDPConnect) {
+  // UDPSocket::Connect() creates sockets with AF_INET (IPv4).
+  if (!HostSupportsIPv4())
+return;
   llvm::Expected> socket =
   UDPSocket::Connect("127.0.0.1:0", /*child_processes_inherit=*/false);
 
@@ -133,7 +154,9 @@
   EXPECT_TRUE(socket.get()->IsValid());
 }
 
-TEST_F(SocketTest, TCPListen0GetPort) {
+TEST_P(SocketTest, TCPListen0GetPort) {
+  if (!HostSupportsIPv4())
+return;
   Predicate port_predicate;
   port_predicate.SetValue(0, eBroadcastNever);
   llvm::Expected> sock =
@@ -143,12 +166,13 @@
   EXPECT_NE(sock.get()->GetLocalPortNumber(), 0);
 }
 
-TEST_F(SocketTest, TCPGetConnectURI) {
+TEST_P(SocketTest, TCPGetConnectURI) {
   std::u

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-09 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added a comment.

This is ready for review now after scrubbing out the "localhost" changes I had 
earlier.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-09 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Thanks for the extra work arounds! LGTM. Pavel?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87333

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


[Lldb-commits] [lldb] 2955a27 - [lldb] Pass the arch as part of the triple in the ARCH_CFLAGS

2020-09-09 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-09-09T14:41:25-07:00
New Revision: 2955a27abc25cd1b9d737c211c2cfe11e2a5de3e

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

LOG: [lldb] Pass the arch as part of the triple in the ARCH_CFLAGS

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/builders/darwin.py

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/builders/darwin.py 
b/lldb/packages/Python/lldbsuite/test/builders/darwin.py
index 4548217c3fab..236e4fac1368 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/darwin.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/darwin.py
@@ -78,7 +78,7 @@ def getExtraMakeArgs(self):
 {'{}="{}"'.format(key, value)
  for key, value in args.items()})
 
-def getArchCFlags(self, architecture):
+def getArchCFlags(self, arch):
 """Returns the ARCH_CFLAGS for the make system."""
 # Get the triple components.
 vendor, os, version, env = get_triple()
@@ -86,7 +86,7 @@ def getArchCFlags(self, architecture):
 return ""
 
 # Construct the triple from its components.
-triple = "{}-{}-{}-{}".format(vendor, os, version, env)
+triple = '-'.join([arch, vendor, os, version, env])
 
 # Construct min version argument
 version_min = ""



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