[Lldb-commits] [lldb] r343545 - Enable C++ tests to run in the -gmodules configuration on Darwin.

2018-10-01 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Oct  1 15:27:42 2018
New Revision: 343545

URL: http://llvm.org/viewvc/llvm-project?rev=343545&view=rev
Log:
Enable C++ tests to run in the -gmodules configuration on Darwin.

This addresses PR36048 (http://llvm.org/bugs/show_bug.cgi?id=36048)

rdar://problem/36776281

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=343545&r1=343544&r2=343545&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
 Mon Oct  1 15:27:42 2018
@@ -51,8 +51,6 @@ class LibcxxVectorDataFormatterTestCase(
 substrs=['1234'])
 
 @add_test_categories(["libc++"])
-@skipIf(debug_info="gmodules",
-bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048";)
 def test_with_run_command(self):
 """Test that that file and class static variables display correctly."""
 self.build()
@@ -180,8 +178,6 @@ class LibcxxVectorDataFormatterTestCase(
 substrs=['vector has 0 items'])
 
 @add_test_categories(["libc++"])
-@skipIf(debug_info="gmodules",
-bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048";)
 def test_ref_and_ptr(self):
 """Test that that file and class static variables display correctly."""
 self.build()

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=343545&r1=343544&r2=343545&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Mon Oct  1 
15:27:42 2018
@@ -246,6 +246,10 @@ MANDATORY_MODULE_BUILD_CFLAGS := -fmodul
 
 ifeq "$(MAKE_GMODULES)" "YES"
CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
+   CXXFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
+   ifeq "$(OS)" "Darwin"
+   CXXFLAGS += -fcxx-modules
+   endif
 endif
 
 CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS)


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


[Lldb-commits] [lldb] r343612 - DWARFExpression: Resolve file addresses in the linked module

2018-10-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Oct  2 10:50:42 2018
New Revision: 343612

URL: http://llvm.org/viewvc/llvm-project?rev=343612&view=rev
Log:
DWARFExpression: Resolve file addresses in the linked module

This is a follow-up to https://reviews.llvm.org/D46362.

When evaluating a complex expression in DWARFExpression::Evaluate,
file addresses must be resolved to load addresses before we can
perform operations such as DW_OP_deref on them.

For this the address goes through three steps

1. Read the file address as stored in the DWARF
2. Link/relocate the file address (when reading from a .dSYM, this is a no-op)
3. Convert the file address to a load address.

D46362 implemented step (3) by resolving the file address using the
Module that the original DWARF came from. In the case of a dSYM that
is correct, but when reading from .o files, we need to look up
relocated/linked addresses, so the right place to look them up is the
current frame's module. This patch fixes that by setting the
expression's Module to point to the linked debugmap object.

A word a bout the unorthodox testcase: The motivating testcase for
this fix is in Swift, but I managed to hand-modify LLVM-IR for a
trivial C program to exhibit the same problem, so we can fix this in
llvm.org.

rdar://problem/44689915

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

Added:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll
Modified:
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=343612&r1=343611&r2=343612&view=diff
==
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Tue Oct  2 10:50:42 
2018
@@ -152,6 +152,8 @@ public:
   lldb::addr_t GetLocation_DW_OP_addr(uint32_t op_addr_idx, bool &error) const;
 
   bool Update_DW_OP_addr(lldb::addr_t file_addr);
+  
+  void SetModule(const lldb::ModuleSP &module) { m_module_wp = module; }
 
   bool ContainsThreadLocalStorage() const;
 

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/Makefile?rev=343612&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/Makefile 
(added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/Makefile 
Tue Oct  2 10:50:42 2018
@@ -0,0 +1,10 @@
+LEVEL = ../../make
+
+include $(LEVEL)/Makefile.rules
+
+a.out: globals.ll
+   $(CC) $(CFLAGS) -g -c $^ -o globals.o
+   $(LD) $(LDFLAGS) -g globals.o -o $@
+
+clean::
+   rm -rf globals.o a.out *.dSYM

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py?rev=343612&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
 Tue Oct  2 10:50:42 2018
@@ -0,0 +1,22 @@
+"""
+Test that target var can resolve complex DWARF expressions.
+"""
+
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class targetCommandTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+@skipIfDarwinEmbedded   # needs x86_64
+@skipIf(debug_info="gmodules")  # not relevant
+def testTargetVarExpr(self):
+self.build()
+lldbutil.run_to_name_breakpoint(self, 'main')
+self.expect("target variable i", substrs=['i', '42'])

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.c?rev=343612&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.c 
(added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/

[Lldb-commits] [lldb] r343624 - Remove unnecessary field

2018-10-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Oct  2 13:14:12 2018
New Revision: 343624

URL: http://llvm.org/viewvc/llvm-project?rev=343624&view=rev
Log:
Remove unnecessary field

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll?rev=343624&r1=343623&r2=343624&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/globals.ll 
Tue Oct  2 13:14:12 2018
@@ -23,7 +23,7 @@ attributes #0 = { noinline nounwind optn
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression(DW_OP_deref))
 !1 = distinct !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 1, type: 
!9, isLocal: false, isDefinition: true)
-!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, emissionKind: 
FullDebug, globals: !5, nameTableKind: None)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, emissionKind: 
FullDebug, globals: !5)
 !3 = !DIFile(filename: "globals.c", directory: "/")
 !4 = !{}
 !5 = !{!0, !6}


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


[Lldb-commits] [lldb] r343695 - Skip test with older versions of clang

2018-10-03 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Oct  3 09:24:14 2018
New Revision: 343695

URL: http://llvm.org/viewvc/llvm-project?rev=343695&view=rev
Log:
Skip test with older versions of clang

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py?rev=343695&r1=343694&r2=343695&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_var/TestTargetVar.py
 Wed Oct  3 09:24:14 2018
@@ -16,6 +16,7 @@ class targetCommandTestCase(TestBase):
 @skipUnlessDarwin
 @skipIfDarwinEmbedded   # needs x86_64
 @skipIf(debug_info="gmodules")  # not relevant
+@skipIf(compiler="clang", compiler_version=['<', '7.0'])
 def testTargetVarExpr(self):
 self.build()
 lldbutil.run_to_name_breakpoint(self, 'main')


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


[Lldb-commits] [lldb] r344557 - Convert code to use early exits in prepraration for future changes. (NFC)

2018-10-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Oct 15 14:35:45 2018
New Revision: 344557

URL: http://llvm.org/viewvc/llvm-project?rev=344557&view=rev
Log:
Convert code to use early exits in prepraration for future changes. (NFC)

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=344557&r1=344556&r2=344557&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 Mon Oct 15 14:35:45 2018
@@ -204,71 +204,71 @@ bool ItaniumABILanguageRuntime::GetDynam
 
   // Only a pointer or reference type can have a different dynamic and static
   // type:
-  if (CouldHaveDynamicValue(in_value)) {
-// First job, pull out the address at 0 offset from the object.
-AddressType address_type;
-lldb::addr_t original_ptr = in_value.GetPointerValue(&address_type);
-if (original_ptr == LLDB_INVALID_ADDRESS)
-  return false;
-
-ExecutionContext exe_ctx(in_value.GetExecutionContextRef());
-
-Process *process = exe_ctx.GetProcessPtr();
-
-if (process == nullptr)
-  return false;
-
-Status error;
-const lldb::addr_t vtable_address_point =
-process->ReadPointerFromMemory(original_ptr, error);
-
-if (!error.Success() || vtable_address_point == LLDB_INVALID_ADDRESS) {
-  return false;
-}
-
-class_type_or_name = GetTypeInfoFromVTableAddress(in_value, original_ptr,
-  vtable_address_point);
-
-if (class_type_or_name) {
-  TypeSP type_sp = class_type_or_name.GetTypeSP();
-  // There can only be one type with a given name, so we've just found
-  // duplicate definitions, and this one will do as well as any other. We
-  // don't consider something to have a dynamic type if it is the same as
-  // the static type.  So compare against the value we were handed.
-  if (type_sp) {
-if (ClangASTContext::AreTypesSame(in_value.GetCompilerType(),
-  type_sp->GetForwardCompilerType())) {
-  // The dynamic type we found was the same type, so we don't have a
-  // dynamic type here...
-  return false;
-}
-
-// The offset_to_top is two pointers above the vtable pointer.
-const uint32_t addr_byte_size = process->GetAddressByteSize();
-const lldb::addr_t offset_to_top_location =
-vtable_address_point - 2 * addr_byte_size;
-// Watch for underflow, offset_to_top_location should be less than
-// vtable_address_point
-if (offset_to_top_location >= vtable_address_point)
-  return false;
-const int64_t offset_to_top = process->ReadSignedIntegerFromMemory(
-offset_to_top_location, addr_byte_size, INT64_MIN, error);
-
-if (offset_to_top == INT64_MIN)
-  return false;
-// So the dynamic type is a value that starts at offset_to_top above
-// the original address.
-lldb::addr_t dynamic_addr = original_ptr + offset_to_top;
-if (!process->GetTarget().GetSectionLoadList().ResolveLoadAddress(
-dynamic_addr, dynamic_address)) {
-  dynamic_address.SetRawAddress(dynamic_addr);
-}
-return true;
-  }
-}
+  if (!CouldHaveDynamicValue(in_value))
+return false;
+
+  // First job, pull out the address at 0 offset from the object.
+  AddressType address_type;
+  lldb::addr_t original_ptr = in_value.GetPointerValue(&address_type);
+  if (original_ptr == LLDB_INVALID_ADDRESS)
+return false;
+
+  ExecutionContext exe_ctx(in_value.GetExecutionContextRef());
+
+  Process *process = exe_ctx.GetProcessPtr();
+
+  if (process == nullptr)
+return false;
+
+  Status error;
+  const lldb::addr_t vtable_address_point =
+  process->ReadPointerFromMemory(original_ptr, error);
+
+  if (!error.Success() || vtable_address_point == LLDB_INVALID_ADDRESS)
+return false;
+
+  class_type_or_name = GetTypeInfoFromVTableAddress(in_value, original_ptr,
+vtable_address_point);
+
+  if (!class_type_or_name)
+return false;
+
+  TypeSP type_sp = class_type_or_name.GetTypeSP();
+  // There can only be one type with a given name, so we've just found
+  // duplicate definitions, and this one will do as well as any other. We
+  // don't consider something to have a dynamic type if it is the same as
+  // the static type.  So compare against the value we were handed.
+  if (!type_sp)
+return true;
+
+  if (ClangASTContext:

[Lldb-commits] [lldb] r344648 - Delete commented-out code.

2018-10-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Oct 16 15:01:49 2018
New Revision: 344648

URL: http://llvm.org/viewvc/llvm-project?rev=344648&view=rev
Log:
Delete commented-out code.

Modified:
lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=344648&r1=344647&r2=344648&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Oct 16 15:01:49 2018
@@ -662,8 +662,6 @@ ValueObject *ValueObject::CreateChildAtI
 child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset,
 child_is_base_class, child_is_deref_of_parent, eAddressTypeInvalid,
 language_flags);
-// if (valobj)
-//valobj->SetAddressTypeOfChildren(eAddressTypeInvalid);
   }
 
   return valobj;


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


[Lldb-commits] [lldb] r345274 - Fix a bug PlatformDarwin::SDKSupportsModule.

2018-10-25 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Oct 25 08:30:43 2018
New Revision: 345274

URL: http://llvm.org/viewvc/llvm-project?rev=345274&view=rev
Log:
Fix a bug PlatformDarwin::SDKSupportsModule.

This fixes a bug PlatformDarwin::SDKSupportsModule introduced by
https://reviews.llvm.org/D47889.  VersionTuple::tryParse() can deal
with an optional third (micro) component, but the parse will fail when
there are extra characters after the version number (e.g.: trying to
parse the substring "12.0.sdk" out of "iPhoneSimulator12.0.sdk" fails
after that patch).  Fixed here by stripping the ".sdk" suffix first.

(Part of) rdar://problem/45041492

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

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/trunk/source/Utility/ArchSpec.cpp
lldb/trunk/unittests/Platform/PlatformDarwinTest.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=345274&r1=345273&r2=345274&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Oct 25 
08:30:43 2018
@@ -1402,14 +1402,11 @@ bool PlatformDarwin::SDKSupportsModules(
   if (last_path_component) {
 const llvm::StringRef sdk_name = last_path_component.GetStringRef();
 
-llvm::StringRef version_part;
-
-if (sdk_name.startswith(sdk_strings[(int)desired_type])) {
-  version_part =
-  sdk_name.drop_front(strlen(sdk_strings[(int)desired_type]));
-} else {
+if (!sdk_name.startswith(sdk_strings[(int)desired_type]))
   return false;
-}
+auto version_part =
+sdk_name.drop_front(strlen(sdk_strings[(int)desired_type]));
+version_part.consume_back(".sdk");
 
 llvm::VersionTuple version;
 if (version.tryParse(version_part))

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=345274&r1=345273&r2=345274&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Thu Oct 25 
08:30:43 2018
@@ -85,6 +85,12 @@ public:
   static std::tuple
   ParseVersionBuildDir(llvm::StringRef str);
 
+  enum class SDKType {
+MacOSX = 0,
+iPhoneSimulator,
+iPhoneOS,
+  };
+
 protected:
   void ReadLibdispatchOffsetsAddress(lldb_private::Process *process);
 
@@ -95,12 +101,6 @@ protected:
   const lldb_private::FileSpecList *module_search_paths_ptr,
   lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr);
 
-  enum class SDKType {
-MacOSX = 0,
-iPhoneSimulator,
-iPhoneOS,
-  };
-
   static bool SDKSupportsModules(SDKType sdk_type, llvm::VersionTuple version);
 
   static bool SDKSupportsModules(SDKType desired_type,

Modified: lldb/trunk/source/Utility/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ArchSpec.cpp?rev=345274&r1=345273&r2=345274&view=diff
==
--- lldb/trunk/source/Utility/ArchSpec.cpp (original)
+++ lldb/trunk/source/Utility/ArchSpec.cpp Thu Oct 25 08:30:43 2018
@@ -1029,6 +1029,11 @@ static bool isCompatibleEnvironment(llvm
   rhs == llvm::Triple::UnknownEnvironment)
 return true;
 
+  // If any of the environment is unknown then they are compatible
+  if (lhs == llvm::Triple::UnknownEnvironment ||
+  rhs == llvm::Triple::UnknownEnvironment)
+return true;
+
   // If one of the environment is Android and the other one is EABI then they
   // are considered to be compatible. This is required as a workaround for
   // shared libraries compiled for Android without the NOTE section indicating

Modified: lldb/trunk/unittests/Platform/PlatformDarwinTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Platform/PlatformDarwinTest.cpp?rev=345274&r1=345273&r2=345274&view=diff
==
--- lldb/trunk/unittests/Platform/PlatformDarwinTest.cpp (original)
+++ lldb/trunk/unittests/Platform/PlatformDarwinTest.cpp Thu Oct 25 08:30:43 
2018
@@ -18,6 +18,13 @@
 using namespace lldb;
 using namespace lldb_private;
 
+struct PlatformDarwinTester : public PlatformDarwin {
+  static bool SDKSupportsModules(SDKType desired_type,
+ const lldb_private::FileSpec &sdk_path) {
+return PlatformDarwin::SDKSupportsModules(desired_type, sdk_path);
+  }
+};
+
 TEST(PlatformDarwinTest, TestParseVersionBuildDir) {
   llvm::VersionTuple V;
   llvm::StringRef D;
@@ -44,4 +51,23 @@ TES

[Lldb-commits] [lldb] r345278 - Get rid of casts. (NFC)

2018-10-25 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Oct 25 09:15:17 2018
New Revision: 345278

URL: http://llvm.org/viewvc/llvm-project?rev=345278&view=rev
Log:
Get rid of casts. (NFC)

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

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=345278&r1=345277&r2=345278&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Oct 25 
09:15:17 2018
@@ -1402,10 +1402,10 @@ bool PlatformDarwin::SDKSupportsModules(
   if (last_path_component) {
 const llvm::StringRef sdk_name = last_path_component.GetStringRef();
 
-if (!sdk_name.startswith(sdk_strings[(int)desired_type]))
+if (!sdk_name.startswith(sdk_strings[desired_type]))
   return false;
 auto version_part =
-sdk_name.drop_front(strlen(sdk_strings[(int)desired_type]));
+sdk_name.drop_front(strlen(sdk_strings[desired_type]));
 version_part.consume_back(".sdk");
 
 llvm::VersionTuple version;

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=345278&r1=345277&r2=345278&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Thu Oct 25 
09:15:17 2018
@@ -85,7 +85,7 @@ public:
   static std::tuple
   ParseVersionBuildDir(llvm::StringRef str);
 
-  enum class SDKType {
+  enum SDKType : unsigned {
 MacOSX = 0,
 iPhoneSimulator,
 iPhoneOS,


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


[Lldb-commits] [lldb] r345287 - Remove accidentally committed duplicate code

2018-10-25 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Oct 25 10:36:05 2018
New Revision: 345287

URL: http://llvm.org/viewvc/llvm-project?rev=345287&view=rev
Log:
Remove accidentally committed duplicate code

Modified:
lldb/trunk/source/Utility/ArchSpec.cpp

Modified: lldb/trunk/source/Utility/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ArchSpec.cpp?rev=345287&r1=345286&r2=345287&view=diff
==
--- lldb/trunk/source/Utility/ArchSpec.cpp (original)
+++ lldb/trunk/source/Utility/ArchSpec.cpp Thu Oct 25 10:36:05 2018
@@ -1029,11 +1029,6 @@ static bool isCompatibleEnvironment(llvm
   rhs == llvm::Triple::UnknownEnvironment)
 return true;
 
-  // If any of the environment is unknown then they are compatible
-  if (lhs == llvm::Triple::UnknownEnvironment ||
-  rhs == llvm::Triple::UnknownEnvironment)
-return true;
-
   // If one of the environment is Android and the other one is EABI then they
   // are considered to be compatible. This is required as a workaround for
   // shared libraries compiled for Android without the NOTE section indicating


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


[Lldb-commits] [lldb] r345768 - Makefile.rules: Don't use code signing on macOS; it isn't necessary.

2018-10-31 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Oct 31 12:42:02 2018
New Revision: 345768

URL: http://llvm.org/viewvc/llvm-project?rev=345768&view=rev
Log:
Makefile.rules: Don't use code signing on macOS; it isn't necessary.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=345768&r1=345767&r2=345768&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Wed Oct 31 
12:42:02 2018
@@ -64,6 +64,7 @@ ifneq "$(TRIPLE)" ""
TRIPLE_VERSION =$(word 2, $(triple_os_and_version))
ifeq "$(TRIPLE_VENDOR)" "apple"
ifeq "$(TRIPLE_OS)" "ios"
+   CODESIGN := codesign
ifeq "$(SDKROOT)" ""
# Set SDKROOT if it wasn't set
ifneq (,$(findstring arm,$(ARCH)))
@@ -82,7 +83,8 @@ ifneq "$(TRIPLE)" ""
endif
endif
ifeq "$(TRIPLE_OS)" "watchos"
-   ifeq "$(SDKROOT)" ""
+   CODESIGN := codesign
+   ifeq "$(SDKROOT)" ""
# Set SDKROOT if it wasn't set
ifneq (,$(findstring arm,$(ARCH)))
SDKROOT = $(shell xcrun --sdk watchos 
--show-sdk-path)
@@ -153,7 +155,6 @@ ifeq "$(OS)" "Darwin"
DSYM = $(EXE).dSYM
AR := $(CROSS_COMPILE)libtool
ARFLAGS := -static -o
-   CODESIGN = codesign
 else
AR := $(CROSS_COMPILE)ar
# On non-Apple platforms, -arch becomes -m


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


[Lldb-commits] [lldb] r346165 - Fix (and improve) the support for C99 variable length array types

2018-11-05 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Nov  5 12:49:07 2018
New Revision: 346165

URL: http://llvm.org/viewvc/llvm-project?rev=346165&view=rev
Log:
Fix (and improve) the support for C99 variable length array types

Clang recently improved its DWARF support for C VLA types. The DWARF
now looks like this:

0x0051: DW_TAG_variable [4]
 DW_AT_location( fbreg -32 )
 DW_AT_name( "__vla_expr" )
 DW_AT_type( {0x00d3} ( long unsigned int ) )
 DW_AT_artificial( true )
...
0x00da: DW_TAG_array_type [10] *
 DW_AT_type( {0x00cc} ( int ) )

0x00df: DW_TAG_subrange_type [11]
 DW_AT_type( {0x00e9} ( __ARRAY_SIZE_TYPE__ ) )
 DW_AT_count( {0x0051} )

Without this patch LLDB will naively interpret the DIE offset 0x51 as
the static size of the array, which is clearly wrong.  This patch
extends ValueObject::GetNumChildren to query the dynamic properties of
incomplete array types.

See the testcase for an example:

   4   int foo(int a) {
   5 int vla[a];
   6   for (int i = 0; i < a; ++i)
   7   vla[i] = i;
   8
-> 9pause(); // break here
   10   return vla[a-1];
   11   }

(lldb) fr v vla
(int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3)
(lldb) quit

rdar://problem/21814005

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

Added:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/Makefile
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/main.c
Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/Core/ValueObjectCast.cpp
lldb/trunk/source/Core/ValueObjectChild.cpp
lldb/trunk/source/Core/ValueObjectConstResult.cpp
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Core/ValueObjectRegister.cpp
lldb/trunk/source/Core/ValueObjectVariable.cpp
lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Symbol/Variable.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=346165&r1=346164&r2=346165&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Nov  5 12:49:07 2018
@@ -744,7 +744,8 @@ public:
   size_t GetTypeBitAlign(lldb::opaque_compiler_type_t type) override;
 
   uint32_t GetNumChildren(lldb::opaque_compiler_type_t type,
-  bool omit_empty_base_classes) override;
+  bool omit_empty_base_classes,
+  const ExecutionContext *exe_ctx) override;
 
   CompilerType GetBuiltinTypeByName(const ConstString &name) override;
 

Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=346165&r1=346164&r2=346165&view=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Nov  5 12:49:07 2018
@@ -301,7 +301,8 @@ public:
 
   size_t GetTypeBitAlign() const;
 
-  uint32_t GetNumChildren(bool omit_empty_base_classes) const;
+  uint32_t GetNumChildren(bool omit_empty_base_classes,
+  const ExecutionContext *exe_ctx) const;
 
   lldb::BasicType Get

[Lldb-commits] [lldb] r346172 - Skip this test on older versions of clang.

2018-11-05 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Nov  5 14:19:22 2018
New Revision: 346172

URL: http://llvm.org/viewvc/llvm-project?rev=346172&view=rev
Log:
Skip this test on older versions of clang.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346172&r1=346171&r2=346172&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov  5 
14:19:22 2018
@@ -7,6 +7,7 @@ class TestVLA(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@skipIf(compiler="clang", compiler_version=['<', '8.0'])
 def test_vla(self):
 self.build()
 _, process, _, _ = lldbutil.run_to_source_breakpoint(


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


Re: [Lldb-commits] [lldb] r346186 - [TestVLA] Fix a python decorator.

2018-11-05 Thread Adrian Prantl via lldb-commits

Thanks!!

You could also change the import line to

> from lldbsuite.test.decorators import *

and leave the decorator as-is.

-- adrian


> On Nov 5, 2018, at 4:21 PM, Davide Italiano  wrote:
> 
> @Adrian, this should be fairly straightforward, but a post-commit
> review is always appreciated.
> On Mon, Nov 5, 2018 at 4:20 PM Davide Italiano via lldb-commits
>  wrote:
>> 
>> Author: davide
>> Date: Mon Nov  5 16:18:17 2018
>> New Revision: 346186
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=346186&view=rev
>> Log:
>> [TestVLA] Fix a python decorator.
>> 
>> Modified:
>>lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
>> 
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=346186&r1=346185&r2=346186&view=diff
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py 
>> (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Mon Nov  
>> 5 16:18:17 2018
>> @@ -1,5 +1,6 @@
>> import lldb
>> from lldbsuite.test.lldbtest import *
>> +from lldbsuite.test import decorators
>> import lldbsuite.test.lldbutil as lldbutil
>> 
>> 
>> @@ -7,7 +8,7 @@ class TestVLA(TestBase):
>> 
>> mydir = TestBase.compute_mydir(__file__)
>> 
>> -@skipIf(compiler="clang", compiler_version=['<', '8.0'])
>> +@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0'])
>> def test_vla(self):
>> self.build()
>> _, process, _, _ = lldbutil.run_to_source_breakpoint(
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r346456 - Fix CMake build when building with -fmodules-local-submodule-visibility.

2018-11-08 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Nov  8 16:49:18 2018
New Revision: 346456

URL: http://llvm.org/viewvc/llvm-project?rev=346456&view=rev
Log:
Fix CMake build when building with -fmodules-local-submodule-visibility.

Modified:
lldb/trunk/source/Host/CMakeLists.txt

Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=346456&r1=346455&r2=346456&view=diff
==
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Thu Nov  8 16:49:18 2018
@@ -11,7 +11,9 @@ endmacro()
 # Objective-C++ files in lldb (which slows down the build process).
 macro(remove_module_flags)
   string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS 
"${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules-local-submodule-visibility" "" 
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-gmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 endmacro()
 


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


[Lldb-commits] [lldb] r346519 - Annotate switch with LLVM_FALLTHROUGH

2018-11-09 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov  9 09:11:17 2018
New Revision: 346519

URL: http://llvm.org/viewvc/llvm-project?rev=346519&view=rev
Log:
Annotate switch with LLVM_FALLTHROUGH

Modified:
lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp?rev=346519&r1=346518&r2=346519&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp Fri Nov  9 09:11:17 
2018
@@ -156,6 +156,7 @@ void DNBRegisterValueClass::Dump(const c
 DNBLogError(
 "unsupported vector format %d, defaulting to hex bytes.",
 info.format);
+LLVM_FALLTHROUGH;
   case VectorOfUInt8:
 snprintf(str, sizeof(str), "%s", "uint8   { ");
 pos = str + strlen(str);

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=346519&r1=346518&r2=346519&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Nov  9 09:11:17 2018
@@ -3690,7 +3690,7 @@ rnb_err_t RNBRemote::HandlePacket_v(cons
   return HandlePacket_ILLFORMED(
   __FILE__, __LINE__, p, "Could not parse signal in vCont packet");
   // Fall through to next case...
-
+LLVM_FALLTHROUGH;
   case 'c':
 // Continue
 thread_action.state = eStateRunning;
@@ -3703,7 +3703,7 @@ rnb_err_t RNBRemote::HandlePacket_v(cons
   return HandlePacket_ILLFORMED(
   __FILE__, __LINE__, p, "Could not parse signal in vCont packet");
   // Fall through to next case...
-
+LLVM_FALLTHROUGH;
   case 's':
 // Step
 thread_action.state = eStateStepping;


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


[Lldb-commits] [lldb] r346525 - Add missing include

2018-11-09 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov  9 09:44:20 2018
New Revision: 346525

URL: http://llvm.org/viewvc/llvm-project?rev=346525&view=rev
Log:
Add missing include

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

Modified: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp?rev=346525&r1=346524&r2=346525&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp Fri Nov  9 09:44:20 
2018
@@ -13,6 +13,7 @@
 
 #include "DNBRegisterInfo.h"
 #include "DNBLog.h"
+#include 
 #include 
 
 DNBRegisterValueClass::DNBRegisterValueClass(const DNBRegisterInfo *regInfo) {


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


[Lldb-commits] [lldb] r346527 - Add missing include

2018-11-09 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov  9 09:58:05 2018
New Revision: 346527

URL: http://llvm.org/viewvc/llvm-project?rev=346527&view=rev
Log:
Add missing include

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

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=346527&r1=346526&r2=346527&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Nov  9 09:58:05 2018
@@ -50,6 +50,7 @@
 #include 
 #endif
 
+#include 
 #include  // for endianness predefines
 #include 
 #include 


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


[Lldb-commits] [lldb] r346572 - Add extra diagnostics to test

2018-11-09 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov  9 16:16:39 2018
New Revision: 346572

URL: http://llvm.org/viewvc/llvm-project?rev=346572&view=rev
Log:
Add extra diagnostics to test

Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=346572&r1=346571&r2=346572&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Fri Nov  9 16:16:39 2018
@@ -61,6 +61,8 @@ class ExecTestCase(TestBase):
 None, None, self.get_process_working_directory())
 self.assertTrue(process, PROCESS_IS_VALID)
 
+if self.TraceOn():
+self.runCmd("settings show target.process.stop-on-exec", 
check=False)
 if skip_exec:
 self.dbg.HandleCommand("settings set target.process.stop-on-exec 
false")
 def cleanup():
@@ -94,6 +96,8 @@ class ExecTestCase(TestBase):
 process.Continue()
 
 if not skip_exec:
+self.assertFalse(process.GetState() == lldb.eStateExited,
+ "Process should not have exited!")
 self.assertTrue(process.GetState() == lldb.eStateStopped,
 "Process should be stopped at __dyld_start")
 


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


[Lldb-commits] [lldb] r346812 - Fix a bug in the parsing of the LC_BUILD_VERSION Mach-O load command.

2018-11-13 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Nov 13 15:14:37 2018
New Revision: 346812

URL: http://llvm.org/viewvc/llvm-project?rev=346812&view=rev
Log:
Fix a bug in the parsing of the LC_BUILD_VERSION Mach-O load command.

LC_BUILD_VERSION records are of variable length. The original code
would use uninitialized memory when the size of a record was exactly 24.

rdar://problem/46032185

Added:
lldb/trunk/lit/Modules/lc_build_version_notools.yaml
  - copied, changed from r346787, 
lldb/trunk/lit/Modules/lc_build_version.yaml
Modified:
lldb/trunk/lit/Modules/lc_build_version.yaml
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/lit/Modules/lc_build_version.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lc_build_version.yaml?rev=346812&r1=346811&r2=346812&view=diff
==
--- lldb/trunk/lit/Modules/lc_build_version.yaml (original)
+++ lldb/trunk/lit/Modules/lc_build_version.yaml Tue Nov 13 15:14:37 2018
@@ -1,6 +1,6 @@
 # RUN: yaml2obj %s > %t.out
 # RUN: lldb-test symbols %t.out | FileCheck %s
-# REQUIRES: darwin
+# REQUIRES: system-darwin
 # Test that the deployment target is parsed from the load commands.
 # CHECK: x86_64-apple-macosx10.14.0
 --- !mach-o

Copied: lldb/trunk/lit/Modules/lc_build_version_notools.yaml (from r346787, 
lldb/trunk/lit/Modules/lc_build_version.yaml)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lc_build_version_notools.yaml?p2=lldb/trunk/lit/Modules/lc_build_version_notools.yaml&p1=lldb/trunk/lit/Modules/lc_build_version.yaml&r1=346787&r2=346812&rev=346812&view=diff
==
--- lldb/trunk/lit/Modules/lc_build_version.yaml (original)
+++ lldb/trunk/lit/Modules/lc_build_version_notools.yaml Tue Nov 13 15:14:37 
2018
@@ -1,6 +1,6 @@
 # RUN: yaml2obj %s > %t.out
 # RUN: lldb-test symbols %t.out | FileCheck %s
-# REQUIRES: darwin
+# REQUIRES: system-darwin
 # Test that the deployment target is parsed from the load commands.
 # CHECK: x86_64-apple-macosx10.14.0
 --- !mach-o
@@ -10,7 +10,7 @@ FileHeader:
   cpusubtype:  0x8003
   filetype:0x0002
   ncmds:   14
-  sizeofcmds:  744
+  sizeofcmds:  738
   flags:   0x00200085
   reserved:0x
 LoadCommands:
@@ -119,14 +119,11 @@ LoadCommands:
 cmdsize: 24
 uuid:8F41E140-23B9-3720-AC28-4E7AF9D159BA
   - cmd: LC_BUILD_VERSION
-cmdsize: 32
+cmdsize: 24
 platform:1
 minos:   658944
 sdk: 658944
-ntools:  1
-Tools:   
-  - tool:3
-version: 26738944
+ntools:  0
   - cmd: LC_SOURCE_VERSION
 cmdsize: 16
 version: 0

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=346812&r1=346811&r2=346812&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Nov 13 
15:14:37 2018
@@ -5027,24 +5027,28 @@ bool ObjectFileMachO::GetArchitecture(co
 const lldb::offset_t cmd_offset = offset;
 if (data.GetU32(&offset, &load_cmd, 2) == NULL)
   break;
-
-if (load_cmd.cmd == llvm::MachO::LC_BUILD_VERSION) {
-  struct build_version_command build_version;
-  if (load_cmd.cmdsize != sizeof(build_version))
+do {
+  if (load_cmd.cmd == llvm::MachO::LC_BUILD_VERSION) {
+struct build_version_command build_version;
+if (load_cmd.cmdsize < sizeof(build_version)) {
+  // Malformed load command.
+  break;
+}
 if (data.ExtractBytes(cmd_offset, sizeof(build_version),
   data.GetByteOrder(), &build_version) == 0)
-  continue;
-  MinOS min_os(build_version.minos);
-  OSEnv os_env(build_version.platform);
-  if (os_env.os_type.empty())
-continue;
-  os << os_env.os_type << min_os.major_version << '.'
- << min_os.minor_version << '.' << min_os.patch_version;
-  triple.setOSName(os.str());
-  if (!os_env.environment.empty())
-triple.setEnvironmentName(os_env.environment);
-  return true;
-}
+  break;
+MinOS min_os(build_version.minos);
+OSEnv os_env(build_version.platform);
+if (os_env.os_type.empty())
+  break;
+os << os_env.os_type << min_os.major_version << '.'
+   << min_os.minor_version << '.' << min_os.patch_version;
+tr

[Lldb-commits] [lldb] r346906 - Remove the expectedFlakeyDsym decorator. It's not useful anymore.

2018-11-14 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Nov 14 14:54:43 2018
New Revision: 346906

URL: http://llvm.org/viewvc/llvm-project?rev=346906&view=rev
Log:
Remove the expectedFlakeyDsym decorator. It's not useful anymore.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=346906&r1=346905&r2=346906&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Nov 14 14:54:43 
2018
@@ -457,12 +457,6 @@ def expectedFlakey(expected_fn, bugnumbe
 return expectedFailure_impl
 
 
-def expectedFlakeyDsym(bugnumber=None):
-def fn(self):
-return self.getDebugInfo() == "dwarf"
-return expectedFlakey(fn, bugnumber)
-
-
 def expectedFlakeyOS(oslist, bugnumber=None, compilers=None):
 def fn(self):
 return (self.getPlatform() in oslist and

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py?rev=346906&r1=346905&r2=346906&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
 Wed Nov 14 14:54:43 2018
@@ -28,7 +28,6 @@ class ExprCommandCallUserDefinedFunction
 'main.cpp',
 '// Please test these expressions while stopped at this line:')
 
-@expectedFlakeyDsym("llvm.org/pr20274")
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24489: Name lookup not working correctly on 
Windows")


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


[Lldb-commits] [lldb] r346981 - Port the Darwin universal binary testcase to x86_64.

2018-11-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Nov 15 11:15:03 2018
New Revision: 346981

URL: http://llvm.org/viewvc/llvm-project?rev=346981&view=rev
Log:
Port the Darwin universal binary testcase to x86_64.

Xcode 10 doesn't ship with an i386 SDK any more. This patch ports the
testcase from an i386/x86_64 -> x86_64/x86_64h universal binary.

rdar://problem/46099343

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/Makefile
lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/Makefile?rev=346981&r1=346980&r2=346981&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/Makefile 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/Makefile Thu Nov 
15 11:15:03 2018
@@ -1,21 +1,25 @@
-CC ?= clang
+LEVEL := ../../make
+
+EXE := testit
+
+include $(LEVEL)/Makefile.rules
 
 all: testit
 
-testit: testit.i386 testit.x86_64
+testit: testit.x86_64h testit.x86_64
lipo -create -o testit $^
 
-testit.i386: testit.i386.o
-   $(CC) -arch i386 -o testit.i386 $<
+testit.x86_64h: testit.x86_64h.o
+   $(CC) -arch x86_64h -o testit.x86_64h $<
 
 testit.x86_64: testit.x86_64.o
$(CC) -arch x86_64 -o testit.x86_64 $<
 
-testit.i386.o: main.c
-   $(CC) -g -O0 -arch i386 -c -o testit.i386.o $<
+testit.x86_64h.o: main.c
+   $(CC) -g -O0 -arch x86_64h -c -o testit.x86_64h.o $<
 
 testit.x86_64.o: main.c
$(CC) -g -O0 -arch x86_64 -c -o testit.x86_64.o $<
 
-clean:
+clean::
rm -rf $(wildcard testit* *~)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py?rev=346981&r1=346980&r2=346981&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py 
Thu Nov 15 11:15:03 2018
@@ -11,9 +11,13 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+def haswellOrLater():
+features = subprocess.check_output(["sysctl", "machdep.cpu"])
+return "AVX2" in features.split()
 
 class UniversalTestCase(TestBase):
 
+NO_DEBUG_INFO_TESTCASE = True
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
@@ -24,8 +28,8 @@ class UniversalTestCase(TestBase):
 
 @add_test_categories(['pyapi'])
 @skipUnlessDarwin
-@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in [
-  'i386', 'x86_64'], "requires i386 or x86_64")
+@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in
+  ['x86_64'], "requires x86_64")
 @skipIfDarwinEmbedded # this test file assumes we're targetting an x86 
system
 def test_sbdebugger_create_target_with_file_and_target_triple(self):
 """Test the SBDebugger.CreateTargetWithFileAndTargetTriple() API."""
@@ -37,8 +41,9 @@ class UniversalTestCase(TestBase):
 
 # Create a target by the debugger.
 target = self.dbg.CreateTargetWithFileAndTargetTriple(
-exe, "i386-apple-macosx")
+exe, "x86_64-apple-macosx")
 self.assertTrue(target, VALID_TARGET)
+self.expect("image list -A -b", substrs=["x86_64 testit"])
 
 # Now launch the process, and do not stop at entry point.
 process = target.LaunchSimple(
@@ -46,13 +51,16 @@ class UniversalTestCase(TestBase):
 self.assertTrue(process, PROCESS_IS_VALID)
 
 @skipUnlessDarwin
-@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in [
-  'i386', 'x86_64'], "requires i386 or x86_64")
+@unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in
+  ['x86_64'], "requires x86_64")
 @skipIfDarwinEmbedded # this test file assumes we're targetting an x86 
system
 def test_process_launch_for_universal(self):
 """Test process launch of a universal binary."""
 from lldbsuite.test.lldbutil import print_registers
 
+if not haswellOrLater():
+return
+
 # Invoke the default build rule.
 self.build()
 
@@ -62,69 +70,54 @@ class UniversalTestCase(TestBase):
 # By default, x86_64 is assumed if no architecture is specified.
 self.expect("file " + exe, CURRENT_EXECUTABLE_SET,
 startstr="Current executable set to ",
-substrs=["testit' (x86_64)."])
+substrs=["testit' (x86_64h)."])
 
 # Break inside the main.
 lldbutil.ru

[Lldb-commits] [lldb] r347058 - Typo

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 08:19:08 2018
New Revision: 347058

URL: http://llvm.org/viewvc/llvm-project?rev=347058&view=rev
Log:
Typo

Modified:
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=347058&r1=347057&r2=347058&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Fri Nov 16 08:19:08 2018
@@ -127,6 +127,6 @@ endif ()
 add_dependencies(check-lldb check-lldb-lit)
 
 add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
-# This will add LLDB's test dependencies to the depenednecies for check-all and
+# This will add LLDB's test dependencies to the dependencies for check-all and
 # include them in the test-depends target.
 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})


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


[Lldb-commits] [lldb] r347056 - Makefile.rules: Use a shared clang module cache directory.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 08:19:07 2018
New Revision: 347056

URL: http://llvm.org/viewvc/llvm-project?rev=347056&view=rev
Log:
Makefile.rules: Use a shared clang module cache directory.

Just to be safe, up until now each test used its own Clang module
cache directory. Since the compiler within one testsuite doesn't
change it is just as safe to share a clang module directory inside the
LLDB test build directory. This saves us from compiling tens of
gigabytes of redundant Darwin and Foundation .pcm files and also
speeds up running the test suite quite significantly.

rdar://problem/36002081

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

Modified:
lldb/trunk/lit/lit.cfg.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=347056&r1=347055&r2=347056&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Fri Nov 16 08:19:07 2018
@@ -4,9 +4,9 @@ import os
 import sys
 import re
 import platform
+import shutil
 import subprocess
 
-
 import lit.util
 import lit.formats
 from lit.llvm import llvm_config
@@ -124,3 +124,12 @@ llvm_config.feature_config(
  ('--build-mode', {'DEBUG': 'debug'}),
  ('--targets-built', calculate_arch_features)
  ])
+
+# Clean the module caches in the test build directory.  This is
+# necessary in an incremental build whenever clang changes underneath,
+# so doing it once per lit.py invocation is close enough.
+for i in ['module-cache-clang']:
+cachedir = os.path.join(config.llvm_obj_root, 'lldb-test-build.noindex', i)
+if os.path.isdir(cachedir):
+print("Deleting module cache at %s."%cachedir)
+shutil.rmtree(cachedir)

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=347056&r1=347055&r2=347056&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Fri Nov 16 
08:19:07 2018
@@ -33,7 +33,6 @@ BUILDDIR := $(shell pwd)
 THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/
 LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
 
-
 #--
 # If OS is not defined, use 'uname -s' to determine the OS name.
 #
@@ -253,7 +252,16 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
 endif
 
+# Use a shared module cache when building in the default test build directory.
+ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
 CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
+else
+CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
+endif
+
+ifeq "$(CLANG_MODULE_CACHE_DIR)" ""
+$(error failed to set the shared clang module cache dir)
+endif
 
 MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules 
-fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
 


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


[Lldb-commits] [lldb] r347057 - Use a shared module cache directory for LLDB.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 08:19:07 2018
New Revision: 347057

URL: http://llvm.org/viewvc/llvm-project?rev=347057&view=rev
Log:
Use a shared module cache directory for LLDB.

This saves about 3 redundant gigabytes from the Objective-C test build
directories. Tests that must do unsavory things with the LLDB clang
module cache, already specify a per-test module cache in their .py
test instructions.



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

Modified:
lldb/trunk/lit/lit.cfg.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=347057&r1=347056&r2=347057&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Fri Nov 16 08:19:07 2018
@@ -128,7 +128,7 @@ llvm_config.feature_config(
 # Clean the module caches in the test build directory.  This is
 # necessary in an incremental build whenever clang changes underneath,
 # so doing it once per lit.py invocation is close enough.
-for i in ['module-cache-clang']:
+for i in ['module-cache-clang', 'module-cache-lldb']:
 cachedir = os.path.join(config.llvm_obj_root, 'lldb-test-build.noindex', i)
 if os.path.isdir(cachedir):
 print("Deleting module cache at %s."%cachedir)

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=347057&r1=347056&r2=347057&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Nov 16 08:19:07 
2018
@@ -1862,8 +1862,9 @@ class TestBase(Base):
 # decorators.
 Base.setUp(self)
 
-# Set the clang modules cache path.
-mod_cache = os.path.join(self.getBuildDir(), "module-cache-lldb")
+# Set the clang modules cache path used by LLDB.
+mod_cache = os.path.join(os.path.join(os.environ["LLDB_BUILD"],
+  "module-cache-lldb"))
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
 % mod_cache)
 


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


[Lldb-commits] [lldb] r347071 - Make path more robust so it also works with out-of-tree builds.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 10:43:16 2018
New Revision: 347071

URL: http://llvm.org/viewvc/llvm-project?rev=347071&view=rev
Log:
Make path more robust so it also works with out-of-tree builds.

Modified:
lldb/trunk/lit/lit.cfg.py

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=347071&r1=347070&r2=347071&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Fri Nov 16 10:43:16 2018
@@ -128,8 +128,10 @@ llvm_config.feature_config(
 # Clean the module caches in the test build directory.  This is
 # necessary in an incremental build whenever clang changes underneath,
 # so doing it once per lit.py invocation is close enough.
+
 for i in ['module-cache-clang', 'module-cache-lldb']:
-cachedir = os.path.join(config.llvm_obj_root, 'lldb-test-build.noindex', i)
+cachedir = os.path.join(config.lldb_libs_dir, '..',
+'lldb-test-build.noindex', i)
 if os.path.isdir(cachedir):
 print("Deleting module cache at %s."%cachedir)
 shutil.rmtree(cachedir)


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


[Lldb-commits] [lldb] r347104 - Makefile.rules: Degrade gracefully on Windows machines without sed.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 14:44:57 2018
New Revision: 347104

URL: http://llvm.org/viewvc/llvm-project?rev=347104&view=rev
Log:
Makefile.rules: Degrade gracefully on Windows machines without sed.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=347104&r1=347103&r2=347104&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Fri Nov 16 
14:44:57 2018
@@ -253,14 +253,11 @@ ifeq "$(MAKE_DWO)" "YES"
 endif
 
 # Use a shared module cache when building in the default test build directory.
-ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
-CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
-else
 CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
-endif
 
-ifeq "$(CLANG_MODULE_CACHE_DIR)" ""
-$(error failed to set the shared clang module cache dir)
+ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
+CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
+$(warning failed to set the shared clang module cache dir)
 endif
 
 MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules 
-fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)


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


[Lldb-commits] [lldb] r347120 - Makefile.rules: Fix the windows-sed-quoting issue harder.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 16:45:58 2018
New Revision: 347120

URL: http://llvm.org/viewvc/llvm-project?rev=347120&view=rev
Log:
Makefile.rules: Fix the windows-sed-quoting issue harder.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=347120&r1=347119&r2=347120&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Fri Nov 16 
16:45:58 2018
@@ -252,8 +252,18 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
 endif
 
+ifeq "$(HOST_OS)" "Windows_NT"
+   JOIN_CMD = &
+   QUOTE = "
+   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = "
+else
+   JOIN_CMD = ;
+   QUOTE = '
+   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = '
+endif
+
 # Use a shared module cache when building in the default test build directory.
-CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
+CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
$(QUOTE)s,lldb-test-build.noindex.*,lldb-test-build.noindex\/module-cache-clang,$(QUOTE))
 
 ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
 CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
@@ -623,14 +633,6 @@ endif
 # the compiler -MM option. The -M option will list all system headers,
 # and the -MM option will list all non-system dependencies.
 #--
-ifeq "$(HOST_OS)" "Windows_NT"
-   JOIN_CMD = &
-   QUOTE = "
-else
-   JOIN_CMD = ;
-   QUOTE = '
-endif
-
 %.d: %.c
@rm -f $@ $(JOIN_CMD) \
$(CC) -M $(CFLAGS) $< > $@.tmp && \


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


[Lldb-commits] [lldb] r347124 - Revert "Makefile.rules: Fix the windows-sed-quoting issue harder."

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 17:27:46 2018
New Revision: 347124

URL: http://llvm.org/viewvc/llvm-project?rev=347124&view=rev
Log:
Revert "Makefile.rules: Fix the windows-sed-quoting issue harder."

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=347124&r1=347123&r2=347124&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Fri Nov 16 
17:27:46 2018
@@ -252,18 +252,8 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
 endif
 
-ifeq "$(HOST_OS)" "Windows_NT"
-   JOIN_CMD = &
-   QUOTE = "
-   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = "
-else
-   JOIN_CMD = ;
-   QUOTE = '
-   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = '
-endif
-
 # Use a shared module cache when building in the default test build directory.
-CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
$(QUOTE)s,lldb-test-build.noindex.*,lldb-test-build.noindex\/module-cache-clang,$(QUOTE))
+CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
 
 ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
 CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
@@ -633,6 +623,16 @@ endif
 # the compiler -MM option. The -M option will list all system headers,
 # and the -MM option will list all non-system dependencies.
 #--
+ifeq "$(HOST_OS)" "Windows_NT"
+   JOIN_CMD = &
+   QUOTE = "
+   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = "
+else
+   JOIN_CMD = ;
+   QUOTE = '
+   FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = '
+endif
+
 %.d: %.c
@rm -f $@ $(JOIN_CMD) \
$(CC) -M $(CFLAGS) $< > $@.tmp && \


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


[Lldb-commits] [lldb] r347125 - Just don't even attempt to invoke sed on Windows.

2018-11-16 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Nov 16 17:27:47 2018
New Revision: 347125

URL: http://llvm.org/viewvc/llvm-project?rev=347125&view=rev
Log:
Just don't even attempt to invoke sed on Windows.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=347125&r1=347124&r2=347125&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Fri Nov 16 
17:27:47 2018
@@ -253,7 +253,12 @@ ifeq "$(MAKE_DWO)" "YES"
 endif
 
 # Use a shared module cache when building in the default test build directory.
+ifeq "$(OS)" "Windows_NT"
+CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
+else
+# FIXME: Get sed to work on Windows here.
 CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 
's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
+endif
 
 ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
 CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache


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


[Lldb-commits] [lldb] r348440 - Add a unit test for ArchSpec matching to document how it behaves (and test it).

2018-12-05 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Dec  5 16:43:55 2018
New Revision: 348440

URL: http://llvm.org/viewvc/llvm-project?rev=348440&view=rev
Log:
Add a unit test for ArchSpec matching to document how it behaves (and test it).

Modified:
lldb/trunk/source/Utility/ArchSpec.cpp
lldb/trunk/unittests/Utility/ArchSpecTest.cpp

Modified: lldb/trunk/source/Utility/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ArchSpec.cpp?rev=348440&r1=348439&r2=348440&view=diff
==
--- lldb/trunk/source/Utility/ArchSpec.cpp (original)
+++ lldb/trunk/source/Utility/ArchSpec.cpp Wed Dec  5 16:43:55 2018
@@ -1019,7 +1019,7 @@ bool ArchSpec::IsCompatibleMatch(const A
   return IsEqualTo(rhs, false);
 }
 
-static bool isCompatibleEnvironment(llvm::Triple::EnvironmentType lhs,
+static bool IsCompatibleEnvironment(llvm::Triple::EnvironmentType lhs,
 llvm::Triple::EnvironmentType rhs) {
   if (lhs == rhs)
 return true;
@@ -1096,7 +1096,7 @@ bool ArchSpec::IsEqualTo(const ArchSpec
 const llvm::Triple::EnvironmentType rhs_triple_env =
 rhs_triple.getEnvironment();
 
-if (!isCompatibleEnvironment(lhs_triple_env, rhs_triple_env))
+if (!IsCompatibleEnvironment(lhs_triple_env, rhs_triple_env))
   return false;
 return true;
   }

Modified: lldb/trunk/unittests/Utility/ArchSpecTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ArchSpecTest.cpp?rev=348440&r1=348439&r2=348440&view=diff
==
--- lldb/trunk/unittests/Utility/ArchSpecTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ArchSpecTest.cpp Wed Dec  5 16:43:55 2018
@@ -171,3 +171,53 @@ TEST(ArchSpecTest, MergeFromMachOUnknown
   A.MergeFrom(B);
   ASSERT_EQ(A.GetCore(), ArchSpec::eCore_uknownMach64);
 }
+
+TEST(ArchSpecTest, Compatibility) {
+  {
+ArchSpec A("x86_64-apple-macosx10.12");
+ArchSpec B("x86_64-apple-macosx10.12");
+ASSERT_TRUE(A.IsExactMatch(B));
+ASSERT_TRUE(A.IsCompatibleMatch(B));
+  }
+  {
+// The version information is auxiliary to support availablity but
+// doesn't affect compatibility.
+ArchSpec A("x86_64-apple-macosx10.11");
+ArchSpec B("x86_64-apple-macosx10.12");
+ASSERT_TRUE(A.IsExactMatch(B));
+ASSERT_TRUE(A.IsCompatibleMatch(B));
+  }
+  {
+ArchSpec A("x86_64-apple-macosx10.13");
+ArchSpec B("x86_64h-apple-macosx10.13");
+ASSERT_FALSE(A.IsExactMatch(B));
+ASSERT_TRUE(A.IsCompatibleMatch(B));
+  }
+  {
+ArchSpec A("x86_64-apple-macosx");
+ArchSpec B("x86_64-apple-ios-simulator");
+ASSERT_FALSE(A.IsExactMatch(B));
+ASSERT_FALSE(A.IsCompatibleMatch(B));
+  }
+  {
+ArchSpec A("x86_64-*-*");
+ArchSpec B("x86_64-apple-ios-simulator");
+ASSERT_FALSE(A.IsExactMatch(B));
+ASSERT_FALSE(A.IsCompatibleMatch(B));
+  }
+  {
+ArchSpec A("arm64-*-*");
+ArchSpec B("arm64-apple-ios");
+ASSERT_FALSE(A.IsExactMatch(B));
+// FIXME: This looks unintuitive and we should investigate whether
+// thi is the desired behavior.
+ASSERT_FALSE(A.IsCompatibleMatch(B));
+  }
+  {
+ArchSpec A("x86_64-*-*");
+ArchSpec B("x86_64-apple-ios-simulator");
+ASSERT_FALSE(A.IsExactMatch(B));
+// FIXME: See above, though the extra environment complicates things.
+ASSERT_FALSE(A.IsCompatibleMatch(B));
+  }
+}


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


[Lldb-commits] [lldb] r348502 - Add another ArchSpec unit test.

2018-12-06 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Dec  6 09:11:45 2018
New Revision: 348502

URL: http://llvm.org/viewvc/llvm-project?rev=348502&view=rev
Log:
Add another ArchSpec unit test.

Modified:
lldb/trunk/unittests/Utility/ArchSpecTest.cpp

Modified: lldb/trunk/unittests/Utility/ArchSpecTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ArchSpecTest.cpp?rev=348502&r1=348501&r2=348502&view=diff
==
--- lldb/trunk/unittests/Utility/ArchSpecTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ArchSpecTest.cpp Thu Dec  6 09:11:45 2018
@@ -210,7 +210,7 @@ TEST(ArchSpecTest, Compatibility) {
 ArchSpec B("arm64-apple-ios");
 ASSERT_FALSE(A.IsExactMatch(B));
 // FIXME: This looks unintuitive and we should investigate whether
-// thi is the desired behavior.
+// this is the desired behavior.
 ASSERT_FALSE(A.IsCompatibleMatch(B));
   }
   {
@@ -220,4 +220,11 @@ TEST(ArchSpecTest, Compatibility) {
 // FIXME: See above, though the extra environment complicates things.
 ASSERT_FALSE(A.IsCompatibleMatch(B));
   }
+  {
+ArchSpec A("x86_64");
+ArchSpec B("x86_64-apple-macosx10.14");
+// FIXME: The exact match also looks unintuitive.
+ASSERT_TRUE(A.IsExactMatch(B));
+ASSERT_TRUE(A.IsCompatibleMatch(B));
+  }
 }


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


[Lldb-commits] [lldb] r348808 - Rewrite pexpect-based test in LIT/FileCheck.

2018-12-10 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Dec 10 14:57:47 2018
New Revision: 348808

URL: http://llvm.org/viewvc/llvm-project?rev=348808&view=rev
Log:
Rewrite pexpect-based test in LIT/FileCheck.

pexecpt-based tests are flakey because they involve timeouts and this
test is eprfectly serializable.

Added:
lldb/trunk/lit/Driver/Inputs/convenience.in
lldb/trunk/lit/Driver/Inputs/hello.c
lldb/trunk/lit/Driver/TestConvenienceVariables.test
Removed:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/main.c

Added: lldb/trunk/lit/Driver/Inputs/convenience.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/convenience.in?rev=348808&view=auto
==
--- lldb/trunk/lit/Driver/Inputs/convenience.in (added)
+++ lldb/trunk/lit/Driver/Inputs/convenience.in Mon Dec 10 14:57:47 2018
@@ -0,0 +1,9 @@
+breakpoint set -f hello.c -p Hello
+run
+script print(lldb.debugger)
+script print(lldb.target)
+script print(lldb.process)
+script print(lldb.thread.GetStopDescription(100))
+script lldb.frame.GetLineEntry().GetLine()
+script lldb.frame.GetLineEntry().GetFileSpec().GetFilename()
+script lldb.frame.GetFunctionName()

Added: lldb/trunk/lit/Driver/Inputs/hello.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/hello.c?rev=348808&view=auto
==
--- lldb/trunk/lit/Driver/Inputs/hello.c (added)
+++ lldb/trunk/lit/Driver/Inputs/hello.c Mon Dec 10 14:57:47 2018
@@ -0,0 +1,5 @@
+int puts(const char*);
+int main(int argc, char **argv) {
+  puts("Hello World\n");
+  return 0;
+}

Added: lldb/trunk/lit/Driver/TestConvenienceVariables.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/TestConvenienceVariables.test?rev=348808&view=auto
==
--- lldb/trunk/lit/Driver/TestConvenienceVariables.test (added)
+++ lldb/trunk/lit/Driver/TestConvenienceVariables.test Mon Dec 10 14:57:47 2018
@@ -0,0 +1,22 @@
+RUN: %clang %p/Inputs/hello.c -g -o %t
+RUN: %lldb %t -s %p/Inputs/convenience.in -o quit | FileCheck %s
+
+script print(lldb.debugger)
+
+CHECK: stop reason = breakpoint 1.1
+CHECK: Debugger (instance: {{.*}}, id: {{[0-9]+}})
+CHECK: script print(lldb.target)
+CHECK: TestConvenienceVariables.test
+CHECK: script print(lldb.process)
+CHECK: SBProcess: pid = {{[0-9]+}},
+CHECK-SAME:   state = stopped,
+CHECK-SAME:   threads = {{[0-9]+}},
+CHECK-SAME:   executable = TestConvenienceVariables.test
+CHECK: script print(lldb.thread.GetStopDescription(100))
+CHECK: breakpoint 1.1
+CHECK: script lldb.frame.GetLineEntry().GetLine()
+CHECK: 3
+CHECK: script lldb.frame.GetLineEntry().GetFileSpec().GetFilename()
+CHECK: hello.c
+CHECK: script lldb.frame.GetFunctionName()
+CHECK: main
\ No newline at end of file

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/Makefile?rev=348807&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/Makefile
 (removed)
@@ -1,5 +0,0 @@
-LEVEL = ../../make
-
-C_SOURCES := main.c
-
-include $(LEVEL)/Makefile.rules

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py?rev=348807&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
 (removed)
@@ -1,108 +0,0 @@
-"""Test convenience variables when you drop in from lldb prompt into an 
embedded interpreter."""
-
-from __future__ import print_function
-
-
-import os
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class ConvenienceVariablesCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Find the line number to break on inside main.cpp.
-self.line = line_number('main.c', 'Hello world.')
-
-@ski

[Lldb-commits] [lldb] r349194 - Remove the Disassembly benchmarks.

2018-12-14 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Dec 14 13:06:00 2018
New Revision: 349194

URL: http://llvm.org/viewvc/llvm-project?rev=349194&view=rev
Log:
Remove the Disassembly benchmarks.

While I was out hunting for remaining pexpect-based tests, I came
across these tests that can't possibly work an any modern system, as
they rely on having gdb available in /Developer.

This patch simply removes the test without replacement.

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

Removed:

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py

lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py?rev=349193&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
 (removed)
@@ -1,165 +0,0 @@
-"""Disassemble lldb's Driver::MainLoop() functions comparing lldb against 
gdb."""
-
-from __future__ import print_function
-
-
-import os
-import sys
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbbench import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-def is_exe(fpath):
-"""Returns true if fpath is an executable."""
-return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
-
-
-class DisassembleDriverMainLoop(BenchBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-"""
-Note that lldbtest_config.lldbExec can be specified with the LLDB_EXEC 
env variable (see
-dotest.py), and gdbExec can be specified with the GDB_EXEC env 
variable.
-This provides a flexibility in specifying different versions of gdb for
-comparison purposes.
-"""
-BenchBase.setUp(self)
-# If env var GDB_EXEC is specified, use it; otherwise, use gdb in your
-# PATH env var.
-if "GDB_EXEC" in os.environ and is_exe(os.environ["GDB_EXEC"]):
-self.gdbExec = os.environ["GDB_EXEC"]
-else:
-self.gdbExec = "gdb"
-
-self.exe = lldbtest_config.lldbExec
-self.function = 'Driver::MainLoop()'
-self.lldb_avg = None
-self.gdb_avg = None
-self.count = 5
-
-@benchmarks_test
-@no_debug_info_test
-@expectedFailureAll(
-oslist=["windows"],
-bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
-def test_run_lldb_then_gdb(self):
-"""Test disassembly on a large function with lldb vs. gdb."""
-print()
-print("lldb path: %s" % lldbtest_config.lldbExec)
-print("gdb path: %s" % self.gdbExec)
-
-print()
-self.run_lldb_disassembly(self.exe, self.function, self.count)
-print("lldb benchmark:", self.stopwatch)
-self.run_gdb_disassembly(self.exe, self.function, self.count)
-print("gdb benchmark:", self.stopwatch)
-print("lldb_avg/gdb_avg: %f" % (self.lldb_avg / self.gdb_avg))
-
-@benchmarks_test
-@no_debug_info_test
-@expectedFailureAll(
-oslist=["windows"],
-bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
-def test_run_gdb_then_lldb(self):
-"""Test disassembly on a large function with lldb vs. gdb."""
-print()
-print("lldb path: %s" % lldbtest_config.lldbExec)
-print("gdb path: %s" % self.gdbExec)
-
-print()
-self.run_gdb_disassembly(self.exe, self.function, self.count)
-print("gdb benchmark:", self.stopwatch)
-self.run_lldb_disassembly(self.exe, self.function, self.count)
-print("lldb benchmark:", self.stopwatch)
-print("lldb_avg/gdb_avg: %f" % (self.lldb_avg / self.gdb_avg))
-
-def run_lldb_disassembly(self, exe, function, count):
-import pexpect
-# Set self.child_prompt, which is "(lldb) ".
-self.child_prompt = '(lldb) '
-prompt = self.child_prompt
-
-# So that the child gets torn down after the test.
-self.child = pexpect.spawn(
-'%s %s %s' %
-(lldbtest_config.lldbExec, self.lldbOption, exe))
-child = self.child
-
-# Turn on logging for what the child sends back.
-if self.TraceOn():
-child.logfile_read = sys.stdout
-
-child.expect_exact(prompt)
-child.sendline('breakpoint set -F %s' % function)
-child.expect_exact(prompt)
-child.sendline('run')
-child.expect_exact(prompt)
-
-# Reset the stopwatch now.
- 

[Lldb-commits] [lldb] r349366 - Make crashlog.py work when a .dSYM is present, but a binary is missing

2018-12-17 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Dec 17 09:25:57 2018
New Revision: 349366

URL: http://llvm.org/viewvc/llvm-project?rev=349366&view=rev
Log:
Make crashlog.py work when a .dSYM is present, but a binary is missing

Often users have a crash log an d a .dSYM bundle, but not the original
application binary. It turns out that for crash symbolication, we can
safely fall back to using the binary inside the .dSYM bundle.

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

Modified:
lldb/trunk/examples/python/crashlog.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=349366&r1=349365&r2=349366&view=diff
==
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Mon Dec 17 09:25:57 2018
@@ -246,6 +246,25 @@ class CrashLog(symbolication.Symbolicato
 self.identifier = identifier
 self.version = version
 
+def find_matching_slice(self):
+dwarfdump_cmd_output = commands.getoutput(
+'dwarfdump --uuid "%s"' % self.path)
+self_uuid = self.get_uuid()
+for line in dwarfdump_cmd_output.splitlines():
+match = self.dwarfdump_uuid_regex.search(line)
+if match:
+dwarf_uuid_str = match.group(1)
+dwarf_uuid = uuid.UUID(dwarf_uuid_str)
+if self_uuid == dwarf_uuid:
+self.resolved_path = self.path
+self.arch = match.group(2)
+return True
+if not self.resolved_path:
+self.unavailable = True
+print("error\nerror: unable to locate '%s' with UUID %s"
+  % (self.path, uuid_str))
+return False
+
 def locate_module_and_debug_symbols(self):
 # Don't load a module twice...
 if self.resolved:
@@ -277,22 +296,25 @@ class CrashLog(symbolication.Symbolicato
 plist['DBGSymbolRichExecutable'])
 self.resolved_path = self.path
 if not self.resolved_path and os.path.exists(self.path):
-dwarfdump_cmd_output = commands.getoutput(
-'dwarfdump --uuid "%s"' % self.path)
-self_uuid = self.get_uuid()
-for line in dwarfdump_cmd_output.splitlines():
-match = self.dwarfdump_uuid_regex.search(line)
-if match:
-dwarf_uuid_str = match.group(1)
-dwarf_uuid = uuid.UUID(dwarf_uuid_str)
-if self_uuid == dwarf_uuid:
-self.resolved_path = self.path
-self.arch = match.group(2)
-break
-if not self.resolved_path:
-self.unavailable = True
-print "error\nerror: unable to locate '%s' with UUID 
%s" % (self.path, uuid_str)
+if not self.find_matching_slice():
 return False
+if not self.resolved_path and not os.path.exists(self.path):
+try:
+import subprocess
+dsym = subprocess.check_output(
+["/usr/bin/mdfind",
+ "com_apple_xcode_dsym_uuids == %s"%uuid_str])[:-1]
+if dsym and os.path.exists(dsym):
+print('falling back to binary inside "%s"'%dsym)
+self.symfile = dsym
+dwarf_dir = os.path.join(dsym, 
'Contents/Resources/DWARF')
+for filename in os.listdir(dwarf_dir):
+self.path = os.path.join(dwarf_dir, filename)
+if not self.find_matching_slice():
+return False
+break
+except:
+pass
 if (self.resolved_path and os.path.exists(self.resolved_path)) or (
 self.path and os.path.exists(self.path)):
 print 'ok'


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


[Lldb-commits] [lldb] r349367 - Make crashlog.py work or binaries with spaces in their names

2018-12-17 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Dec 17 09:26:04 2018
New Revision: 349367

URL: http://llvm.org/viewvc/llvm-project?rev=349367&view=rev
Log:
Make crashlog.py work or binaries with spaces in their names

This is a little dangerous since the crashlog files aren't 100%
unambiguous, but the risk is mitigated by using a non-greedy +?
pattern.

rdar://problem/38478511

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

Added:
lldb/trunk/lit/Python/
lldb/trunk/lit/Python/crashlog.test
Modified:
lldb/trunk/examples/python/crashlog.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=349367&r1=349366&r2=349367&view=diff
==
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Mon Dec 17 09:26:04 2018
@@ -94,11 +94,9 @@ class CrashLog(symbolication.Symbolicato
 thread_regex = re.compile('^Thread ([0-9]+)([^:]*):(.*)')
 app_backtrace_regex = re.compile(
 '^Application Specific Backtrace ([0-9]+)([^:]*):(.*)')
-frame_regex = re.compile('^([0-9]+)\s+([^ ]+)\s+(0x[0-9a-fA-F]+) +(.*)')
+frame_regex = 
re.compile('^([0-9]+)\s+(.+?)\s+(0x[0-9a-fA-F]{7}[0-9a-fA-F]+) +(.*)')
 image_regex_uuid = re.compile(
-'(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) 
+([^<]+)<([-0-9a-fA-F]+)> (.*)')
-image_regex_no_uuid = re.compile(
-'(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^/]+)/(.*)')
+
'(0x[0-9a-fA-F]+)[-\s]+(0x[0-9a-fA-F]+)\s+[+]?(.+?)\s+(\(.+\))?\s?(<([-0-9a-fA-F]+)>)?
 (.*)')
 empty_line_regex = re.compile('^$')
 
 class Thread:
@@ -477,25 +475,16 @@ class CrashLog(symbolication.Symbolicato
 elif parse_mode == PARSE_MODE_IMAGES:
 image_match = self.image_regex_uuid.search(line)
 if image_match:
-image = CrashLog.DarwinImage(int(image_match.group(1), 0),
- int(image_match.group(2), 0),
- image_match.group(3).strip(),
- image_match.group(4).strip(),
- 
uuid.UUID(image_match.group(5)),
- image_match.group(6))
+(img_lo, img_hi, img_name, img_version,
+ _, img_uuid, img_path) = image_match.groups()
+image = CrashLog.DarwinImage(int(img_lo, 0), int(img_hi, 
0),
+ img_name.strip(),
+ img_version.strip()
+ if img_version else "",
+ uuid.UUID(img_uuid), img_path)
 self.images.append(image)
 else:
-image_match = self.image_regex_no_uuid.search(line)
-if image_match:
-image = CrashLog.DarwinImage(int(image_match.group(1), 
0),
- int(image_match.group(2), 
0),
- 
image_match.group(3).strip(),
- 
image_match.group(4).strip(),
- None,
- image_match.group(5))
-self.images.append(image)
-else:
-print "error: image regex failed for: %s" % line
+print "error: image regex failed for: %s" % line
 
 elif parse_mode == PARSE_MODE_THREGS:
 stripped_line = line.strip()

Added: lldb/trunk/lit/Python/crashlog.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Python/crashlog.test?rev=349367&view=auto
==
--- lldb/trunk/lit/Python/crashlog.test (added)
+++ lldb/trunk/lit/Python/crashlog.test Mon Dec 17 09:26:04 2018
@@ -0,0 +1,99 @@
+# -*- python 
-*-
+# RUN: cd %S/../../examples/python && %lldb -S %s | FileCheck %s
+# REQUIRES : system-darwin
+# CHECK-LABEL: {{S}}KIP BEYOND CHECKS
+script
+import crashlog
+cl = crashlog.CrashLog
+images = [
+"0x10b60b000 - 0x10f707fff com.apple.LLDB.framework (1.1000.11.38.2 - 
1000.11.38.2) <96E36F5C-1A83-39A1-8713-5FDD9701C3F1> 
/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/LLDB",
+# CHECK: 0x10b60b000
+# CHECK: 0x10f707fff
+# CHECK: com.apple.LLDB.framework
+# CHECK: 96E36F5C-1A83-39A1-8713-5FDD9701C3F1
+# CHECK: /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/LLDB
+
+"0x104591000 - 0x1055cfff7 +llvm-dwarfdump (0) 
 /Users/USER 
1/Doc

[Lldb-commits] [lldb] r349398 - Reflow readme

2018-12-17 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Dec 17 13:18:12 2018
New Revision: 349398

URL: http://llvm.org/viewvc/llvm-project?rev=349398&view=rev
Log:
Reflow readme

Modified:
lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite

Modified: lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite?rev=349398&r1=349397&r2=349398&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/README-TestSuite Mon Dec 17 
13:18:12 2018
@@ -1,7 +1,7 @@
-This README file describes the files and directories related to the Python test
-suite under the current 'test' directory.
+This README file describes the files and directories related   -*- rst -*-
+to the Python test suite under the current 'test' directory.
 
-o dotest.py
+- dotest.py
 
   Provides the test driver for the test suite.  To invoke it, cd to the 'test'
   directory and issue the './dotest.py' command or './dotest.py -v' for more
@@ -20,7 +20,7 @@ o dotest.py
  This runs the test suite, with logging turned on for the lldb as well as
  the process.gdb-remote channels and directs the run log to a file.
 
-o lldbtest.py
+- lldbtest.py
 
   Provides an abstract base class of lldb test case named 'TestBase', which in
   turn inherits from Python's unittest.TestCase.  The concrete subclass can
@@ -41,7 +41,7 @@ o lldbtest.py
   test case on its own.  To run the whole test suite, 'dotest.py' is all you
   need to do.
 
-o subdirectories of 'test'
+- subdirectories of 'test'
 
   Most of them predate the introduction of the python test suite and contain
   example C/C++/ObjC source files which get compiled into executables which are
@@ -58,7 +58,7 @@ o subdirectories of 'test'
   testcase that run a process to a breakpoint and check a local variable.  
These
   are convenient starting points for adding new tests.
 
-o make directory
+- make directory
 
   Contains Makefile.rules, which can be utilized by test cases to write 
Makefile
   based rules to build binaries for the inferiors.
@@ -95,12 +95,12 @@ o make directory
   The exe names for the two test methods are equal to the test method names and
   are therefore guaranteed different.
 
-o plugins directory
+- plugins directory
 
   Contains platform specific plugin to build binaries with dsym/dwarf debugging
   info.  Other platform specific functionalities may be added in the future.
 
-o unittest2 directory
+- unittest2 directory
 
   Many new features were added to unittest in Python 2.7, including test
   discovery. unittest2 allows you to use these features with earlier versions 
of
@@ -114,7 +114,7 @@ o unittest2 directory
   Later versions of unittest2 include changes in unittest made in Python 3.2 
and
   onwards after the release of Python 2.7.
 
-o dotest.pl
+- dotest.pl
 
   In case you wonder, there is also a 'dotest.pl' perl script file.  It was
   created to visit each Python test case under the specified directory and
@@ -127,47 +127,56 @@ o dotest.pl
 
   Note: dotest.pl has been moved to the attic directory.
 
-o Profiling dotest.py runs
+- Profiling dotest.py runs
 
   I used the following command line thingy to do the profiling on a SnowLeopard
   machine:
 
-$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test 
/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py
 -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log
+$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test 
/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py
 -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log
 
   After that, I used the pstats.py module to browse the statistics:
 
-$ python 
/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/pstats.py
 my.profile 
+$ python 
/System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/pstats.py
 my.profile 
 
-o Writing test cases:
+- Writing test cases:
 
- We strongly prefer writing test cases using the SB API's rather than the 
runCmd & expect.  
- Unless you are actually testing some feature of the command line, please 
don't write 
- command based tests.  For historical reasons there are plenty of examples of 
tests in the 
- test suite that use runCmd where they shouldn't, but don't copy them, copy 
the plenty that 
- do use the SB API's instead.  
-
- The reason for this is that our policy is that we will maintain compatibility 
with the 
- SB API's.  But we don't make any similar guarantee about the details of 
command result format.  
- If your test is using the command line, it is going to have to check against 
the command result
- text, and you either end up writing your check  pattern by checking as little 
as possible so 
- you won

[Lldb-commits] [lldb] r349397 - Remove sleep() synchronisation from teststcase and

2018-12-17 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Dec 17 13:18:11 2018
New Revision: 349397

URL: http://llvm.org/viewvc/llvm-project?rev=349397&view=rev
Log:
Remove sleep() synchronisation from teststcase and
make the executable name more unique.

This test is failing sporadically on some bots. By removing the sleep
synchronisation, I'm hoping to get it to fail more reproducibly so I
can investigate what is going on.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=349397&r1=349396&r2=349397&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Mon Dec 17 13:18:11 2018
@@ -35,7 +35,7 @@ class HelloWorldTestCase(TestBase):
 def test_with_process_launch_api(self):
 """Create target, breakpoint, launch a process, and then kill it."""
 # Get the full path to our executable to be attached/debugged.
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
 d = {'EXE': exe}
 self.build(dictionary=d)
 self.setTearDownCleanup(dictionary=d)
@@ -82,7 +82,7 @@ class HelloWorldTestCase(TestBase):
 @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession 
sometimes fails
 def test_with_attach_to_process_with_id_api(self):
 """Create target, spawn a process, and attach to it with process id."""
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
 d = {'EXE': exe}
 self.build(dictionary=d)
 self.setTearDownCleanup(dictionary=d)
@@ -92,9 +92,6 @@ class HelloWorldTestCase(TestBase):
 popen = self.spawnSubprocess(exe, ["abc", "xyz"])
 self.addTearDownHook(self.cleanupSubprocesses)
 
-# Give the subprocess time to start and wait for user input
-time.sleep(0.25)
-
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
 process = target.AttachToProcessWithID(listener, popen.pid, error)
@@ -114,7 +111,7 @@ class HelloWorldTestCase(TestBase):
 @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession 
sometimes fails
 def test_with_attach_to_process_with_name_api(self):
 """Create target, spawn a process, and attach to it with process 
name."""
-exe = self.getBuildArtifact(self.testMethodName)
+exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
 d = {'EXE': exe}
 self.build(dictionary=d)
 self.setTearDownCleanup(dictionary=d)
@@ -124,9 +121,6 @@ class HelloWorldTestCase(TestBase):
 popen = self.spawnSubprocess(exe, ["abc", "xyz"])
 self.addTearDownHook(self.cleanupSubprocesses)
 
-# Give the subprocess time to start and wait for user input
-time.sleep(0.25)
-
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
 # Pass 'False' since we don't want to wait for new instance of


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


Re: [Lldb-commits] [lldb] r349397 - Remove sleep() synchronisation from teststcase and

2018-12-18 Thread Adrian Prantl via lldb-commits


> On Dec 18, 2018, at 12:11 AM, Pavel Labath  wrote:
> 
> Not that I want to defend the use of sleep, but my expectation  is that this 
> will the test even more flaky.
> 
> The only thing that test does after attaching is verifying the process 
> backtrace to check that it contains the "main" function. If the test doesn't 
> sleep, it increases the likelyhood that you will attach before it even enters 
> the main function. This may be particularly true on linux, where the process 
> needs to invoke a special api (PR_SET_TRACER) before we can attach to it, and 
> so the even the attach will fail if it's done too early.
> 
> One of the patterns for synchronization we have in other tests is to have the 
> inferior create a file when it reaches the "safe to attach" point. The test 
> then waits for this file to appear (lldbutil.wait_for_file_on_target) before 
> proceeding. This still uses sleep() under the hood, but only because we don't 
> have/don't want to implement a wait_for_file blocking api. In the end it 
> still provides a more predictable state of the process we attach to.

That is an excellent idea. My first thought was to use piped IO to communicate 
that the process has launched but then immediately realized that this doesn't 
work on a remote platform. I'll try the file method!

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


[Lldb-commits] [lldb] r349533 - Fix REQUIRES line

2018-12-18 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Dec 18 12:28:54 2018
New Revision: 349533

URL: http://llvm.org/viewvc/llvm-project?rev=349533&view=rev
Log:
Fix REQUIRES line

Modified:
lldb/trunk/lit/Python/crashlog.test

Modified: lldb/trunk/lit/Python/crashlog.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Python/crashlog.test?rev=349533&r1=349532&r2=349533&view=diff
==
--- lldb/trunk/lit/Python/crashlog.test (original)
+++ lldb/trunk/lit/Python/crashlog.test Tue Dec 18 12:28:54 2018
@@ -1,6 +1,6 @@
 # -*- python 
-*-
+# REQUIRES: system-darwin
 # RUN: cd %S/../../examples/python && %lldb -S %s | FileCheck %s
-# REQUIRES : system-darwin
 # CHECK-LABEL: {{S}}KIP BEYOND CHECKS
 script
 import crashlog


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


[Lldb-commits] [lldb] r349550 - TestHelloWorld: Use a file on the target platform for synchronisation.

2018-12-18 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Dec 18 14:17:38 2018
New Revision: 349550

URL: http://llvm.org/viewvc/llvm-project?rev=349550&view=rev
Log:
TestHelloWorld: Use a file on the target platform for synchronisation.

Thanks to Pavel Labath for the idea!

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=349550&r1=349549&r2=349550&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Tue Dec 18 14:17:38 2018
@@ -10,8 +10,7 @@ import time
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
+import lldbsuite.test.lldbutil as lldbutil
 
 class HelloWorldTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
@@ -88,8 +87,12 @@ class HelloWorldTestCase(TestBase):
 target = self.dbg.CreateTarget(exe)
 
 # Spawn a new process
-popen = self.spawnSubprocess(exe, ["abc", "xyz"])
+token = exe+'.token'
+if os.path.exists(token):
+os.remove(token)
+popen = self.spawnSubprocess(exe, [token])
 self.addTearDownHook(self.cleanupSubprocesses)
+lldbutil.wait_for_file_on_target(self, token)
 
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
@@ -98,11 +101,10 @@ class HelloWorldTestCase(TestBase):
 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
 
 # Let's check the stack traces of the attached process.
-import lldbsuite.test.lldbutil as lldbutil
 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
 self.expect(stacktraces, exe=False,
 substrs=['main.c:%d' % self.line2,
- '(int)argc=3'])
+ '(int)argc=2'])
 
 @add_test_categories(['pyapi'])
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24600")
@@ -115,9 +117,13 @@ class HelloWorldTestCase(TestBase):
 self.setTearDownCleanup(dictionary=d)
 target = self.dbg.CreateTarget(exe)
 
-# Spawn a new process
-popen = self.spawnSubprocess(exe, ["abc", "xyz"])
+# Spawn a new process.
+token = exe+'.token'
+if os.path.exists(token):
+os.remove(token)
+popen = self.spawnSubprocess(exe, [token])
 self.addTearDownHook(self.cleanupSubprocesses)
+lldbutil.wait_for_file_on_target(self, token)
 
 listener = lldb.SBListener("my.attach.listener")
 error = lldb.SBError()
@@ -132,7 +138,6 @@ class HelloWorldTestCase(TestBase):
 target.ConnectRemote(listener, None, None, error)
 
 process = target.AttachToProcessWithName(listener, name, False, error)
-
 self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
 
 # Verify that after attach, our selected target indeed matches name.
@@ -142,8 +147,7 @@ class HelloWorldTestCase(TestBase):
 startstr=name)
 
 # Let's check the stack traces of the attached process.
-import lldbsuite.test.lldbutil as lldbutil
 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
 self.expect(stacktraces, exe=False,
 substrs=['main.c:%d' % self.line2,
- '(int)argc=3'])
+ '(int)argc=2'])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c?rev=349550&r1=349549&r2=349550&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/main.c Tue 
Dec 18 14:17:38 2018
@@ -8,16 +8,22 @@
 
 int main(int argc, char const *argv[])
 {
-lldb_enable_attach();
+  lldb_enable_attach();
 
-printf("Hello world.\n"); // Set break point at this line.
-if (argc == 1)
-return 0;
+  printf("Hello world.\n"); // Set break point at this line.
+  if (argc == 1)
+return 1;
 
-// Waiting to be attached by the debugger, otherwise.
-char line[100];
-while (1) 
-sleep (1); // Waiting to be attached...
+  // Create the synchronization token.
+  FILE *f;
+  if (f = fopen(argv[1], "wx")) {
+fputs("\n", f);
+fflush(f);
+fclose(f);
+  } else
+ 

[Lldb-commits] [lldb] r349700 - Simplify code for readability. (NFC)

2018-12-19 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Dec 19 15:48:40 2018
New Revision: 349700

URL: http://llvm.org/viewvc/llvm-project?rev=349700&view=rev
Log:
Simplify code for readability. (NFC)

Modified:
lldb/trunk/source/Core/ValueObjectChild.cpp

Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=349700&r1=349699&r2=349700&view=diff
==
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Wed Dec 19 15:48:40 2018
@@ -202,12 +202,9 @@ bool ValueObjectChild::UpdateValue() {
 ExecutionContext exe_ctx(
 GetExecutionContextRef().Lock(thread_and_frame_only_if_stopped));
 if (GetCompilerType().GetTypeInfo() & lldb::eTypeHasValue) {
-  if (!is_instance_ptr_base)
-m_error =
-m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
-  else
-m_error = m_parent->GetValue().GetValueAsData(&exe_ctx, m_data, 0,
-  GetModule().get());
+  Value &value = is_instance_ptr_base ? m_parent->GetValue() : m_value;
+  m_error =
+  value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
 } else {
   m_error.Clear(); // No value so nothing to read...
 }


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


[Lldb-commits] [lldb] r349851 - Disable a few tests on the green dragon sanitzier bot.

2018-12-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Dec 20 15:16:47 2018
New Revision: 349851

URL: http://llvm.org/viewvc/llvm-project?rev=349851&view=rev
Log:
Disable a few tests on the green dragon sanitzier bot.

These are tests that found actual, but hard to fix, bugs that are
tracked elsewhere. Leaving them red only distracts from new failures
this bot finds.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=349851&r1=349850&r2=349851&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Dec 20 15:16:47 
2018
@@ -806,3 +806,10 @@ def skipUnlessFeature(feature):
 except subprocess.CalledProcessError:
 return "%s is not supported on this system." % feature
 return skipTestIfFn(is_feature_enabled)
+
+def skipIfSanitized(func):
+"""Skip this test if the environment is set up to run LLDB itself under 
ASAN."""
+def is_sanitized():
+return (('DYLD_INSERT_LIBRARIES' in os.env) and
+'libclang_rt.asan' in os.env['DYLD_INSERT_LIBRARIES'])
+return skipTestIfFn(is_sanitized)(func)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=349851&r1=349850&r2=349851&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Thu Dec 20 15:16:47 2018
@@ -31,12 +31,14 @@ class ExecTestCase(TestBase):
 @skipUnlessDarwin
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@skipIfSanitized # rdar://problem/43756823
 def test_hitting_exec (self):
 self.do_test(False)
 
 @skipUnlessDarwin
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@skipIfSanitized # rdar://problem/43756823
 def test_skipping_exec (self):
 self.do_test(True)
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=349851&r1=349850&r2=349851&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Thu Dec 20 15:16:47 2018
@@ -107,6 +107,7 @@ class HelloWorldTestCase(TestBase):
 
 @add_test_categories(['pyapi'])
 @skipIfiOSSimulator
+@skipIfSanitized # FIXME: Hangs indefinitely.
 def test_with_attach_to_process_with_name_api(self):
 """Create target, spawn a process, and attach to it with process 
name."""
 exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())


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


[Lldb-commits] [lldb] r349861 - Fix typo

2018-12-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Dec 20 15:50:32 2018
New Revision: 349861

URL: http://llvm.org/viewvc/llvm-project?rev=349861&view=rev
Log:
Fix typo

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=349861&r1=349860&r2=349861&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Dec 20 15:50:32 
2018
@@ -810,6 +810,6 @@ def skipUnlessFeature(feature):
 def skipIfSanitized(func):
 """Skip this test if the environment is set up to run LLDB itself under 
ASAN."""
 def is_sanitized():
-return (('DYLD_INSERT_LIBRARIES' in os.env) and
-'libclang_rt.asan' in os.env['DYLD_INSERT_LIBRARIES'])
+return (('DYLD_INSERT_LIBRARIES' in os.environ) and
+'libclang_rt.asan' in os.environ['DYLD_INSERT_LIBRARIES'])
 return skipTestIfFn(is_sanitized)(func)


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


[Lldb-commits] [lldb] r349864 - Remove ineffective (misspelled) sanitizer option

2018-12-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Dec 20 17:09:14 2018
New Revision: 349864

URL: http://llvm.org/viewvc/llvm-project?rev=349864&view=rev
Log:
Remove ineffective (misspelled) sanitizer option

Modified:
lldb/trunk/lit/Suite/lit.cfg

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=349864&r1=349863&r2=349864&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Thu Dec 20 17:09:14 2018
@@ -29,7 +29,7 @@ if 'Address' in config.llvm_use_sanitize
   runtime = os.path.join(resource_dir, 'lib', 'darwin',
  'libclang_rt.asan_osx_dynamic.dylib')
   config.environment['ASAN_OPTIONS'] = \
-'detect_stack_use_after_return=1:container_overflow=0'
+'detect_stack_use_after_return=1'
   config.environment['DYLD_INSERT_LIBRARIES'] = runtime
 
 # Build dotest command.


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


[Lldb-commits] [lldb] r349865 - Add an assertion to aid in tracking down a bug

2018-12-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Dec 20 17:09:15 2018
New Revision: 349865

URL: http://llvm.org/viewvc/llvm-project?rev=349865&view=rev
Log:
Add an assertion to aid in tracking down a bug

Modified:
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/source/Target/Thread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=349865&r1=349864&r2=349865&view=diff
==
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Thu Dec 20 17:09:15 2018
@@ -1038,9 +1038,11 @@ void Thread::PushPlan(ThreadPlanSP &thre
   if (thread_plan_sp) {
 // If the thread plan doesn't already have a tracer, give it its parent's
 // tracer:
-if (!thread_plan_sp->GetThreadPlanTracer())
+if (!thread_plan_sp->GetThreadPlanTracer()) {
+  assert(!m_plan_stack.empty());
   thread_plan_sp->SetThreadPlanTracer(
   m_plan_stack.back()->GetThreadPlanTracer());
+}
 m_plan_stack.push_back(thread_plan_sp);
 
 thread_plan_sp->DidPush();


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


[Lldb-commits] [lldb] r350247 - Add file-based synchronization to flaky test

2019-01-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Jan  2 11:06:22 2019
New Revision: 350247

URL: http://llvm.org/viewvc/llvm-project?rev=350247&view=rev
Log:
Add file-based synchronization to flaky test

TestQueues is failing randomly on green dragon and I suspect it is
because the enqueued threads haven't executed by the time we expect
them. This patch adds file-based synchronization to the queues.

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

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=350247&r1=350246&r2=350247&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Wed 
Jan  2 11:06:22 2019
@@ -30,6 +30,16 @@ class TestQueues(TestBase):
 # Find the line numbers that we will step to in main:
 self.main_source = "main.c"
 
+def remove_token(self, name):
+for i in range(6):
+token = name+'.token.%d'%(i+1)
+if os.path.exists(token):
+os.remove(token)
+
+def await_token(self, name):
+for i in range(6):
+lldbutil.wait_for_file_on_target(self, name+'.token.%d'%(i+1))
+
 def check_queue_for_valid_queue_id(self, queue):
 self.assertTrue(
 queue.GetQueueID() != 0, "Check queue %s for valid QueueID (got 
0x%x)" %
@@ -112,12 +122,14 @@ class TestQueues(TestBase):
 self.main_source_spec = lldb.SBFileSpec(self.main_source)
 break1 = target.BreakpointCreateByName("stopper", 'a.out')
 self.assertTrue(break1, VALID_BREAKPOINT)
+self.remove_token(exe)
 process = target.LaunchSimple(
-None, None, self.get_process_working_directory())
+[exe+'.token.'], None, self.get_process_working_directory())
 self.assertTrue(process, PROCESS_IS_VALID)
 threads = lldbutil.get_threads_stopped_at_breakpoint(process, break1)
 if len(threads) != 1:
 self.fail("Failed to stop at breakpoint 1.")
+self.await_token(exe)
 
 queue_submittor_1 = lldb.SBQueue()
 queue_performer_1 = lldb.SBQueue()
@@ -271,8 +283,9 @@ class TestQueues(TestBase):
 if self.getArchitecture() in ['arm', 'arm64', 'arm64e', 'arm64_32', 
'armv7', 'armv7k']:
 libbtr_path = "/Developer/usr/lib/libBacktraceRecording.dylib"
 
+self.remove_token(exe)
 process = target.LaunchSimple(
-None,
+[exe+'.token.'],
 [
 'DYLD_INSERT_LIBRARIES=%s' % (libbtr_path),
 'DYLD_LIBRARY_PATH=/usr/lib/system/introspection'],
@@ -284,6 +297,7 @@ class TestQueues(TestBase):
 threads = lldbutil.get_threads_stopped_at_breakpoint(process, break1)
 if len(threads) != 1:
 self.fail("Failed to stop at breakpoint 1.")
+self.await_token(exe)
 
 libbtr_module_filespec = lldb.SBFileSpec("libBacktraceRecording.dylib")
 libbtr_module = target.FindModule(libbtr_module_filespec)

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350247&r1=350246&r2=350247&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Wed Jan  2 
11:06:22 2019
@@ -1,4 +1,6 @@
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -6,6 +8,19 @@
 int finished_enqueueing_work = 0;
 
 void
+touch (const char *name, unsigned n)
+{
+char token[2048];
+snprintf (token, 2048, "%s%d", name, n);
+FILE *f = fopen (token, "wx");
+if (!f)
+exit (1);
+fputs ("\n", f);
+fflush (f);
+fclose (f);
+}
+
+void
 doing_the_work_1(void *in)
 {
 while (1)
@@ -77,7 +92,7 @@ stopper ()
 }
 
 
-int main ()
+int main (int argc, const char **argv)
 {
 dispatch_queue_t work_submittor_1 = dispatch_queue_create 
("com.apple.work_submittor_1", DISPATCH_QUEUE_SERIAL);
 dispatch_queue_t work_submittor_2 = dispatch_queue_create 
("com.apple.work_submittor_and_quit_2", DISPATCH_QUEUE_SERIAL);
@@ -100,31 +115,37 @@ int main ()
 
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
 pthread_setname_np ("user initiated QoS");
+touch(argv[1], 1);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), 
^{

[Lldb-commits] [lldb] r350264 - Remove Range.* from Xcode project

2019-01-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Jan  2 14:23:51 2019
New Revision: 350264

URL: http://llvm.org/viewvc/llvm-project?rev=350264&view=rev
Log:
Remove Range.* from Xcode project

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=350264&r1=350263&r2=350264&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jan  2 14:23:51 2019
@@ -641,7 +641,6 @@
AF0C112818580CD800C4C45B /* QueueItem.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF0C112718580CD800C4C45B /* QueueItem.cpp */; };
AF26703B1852D01E00B6CC36 /* QueueList.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF2670391852D01E00B6CC36 /* QueueList.cpp */; };
4939EA8D1BD56B6D00084382 /* REPL.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 4939EA8C1BD56B6D00084382 /* REPL.cpp */; };
-   94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 94BA8B6C176F8C9B005A91B5 /* Range.cpp */; };
268900F113353E6F00698AC0 /* RegisterContext.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7F3710F1B90C00F91463 /* RegisterContext.cpp 
*/; };
26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* 
RegisterContextDarwin_arm.cpp */; };
AF9107EE168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
@@ -2523,8 +2522,6 @@
4939EA8C1BD56B6D00084382 /* REPL.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = REPL.cpp; path = source/Expression/REPL.cpp; sourceTree = ""; };
4939EA8B1BD56B3700084382 /* REPL.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = REPL.h; path = 
include/lldb/Expression/REPL.h; sourceTree = ""; };
9A2057451F3B905C00F6C293 /* RNBSocketTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = RNBSocketTest.cpp; path = debugserver/RNBSocketTest.cpp; sourceTree = 
""; };
-   94BA8B6C176F8C9B005A91B5 /* Range.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = Range.cpp; path = source/Utility/Range.cpp; sourceTree = ""; };
-   94BA8B6E176F8CA0005A91B5 /* Range.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Range.h; path = 
include/lldb/Utility/Range.h; sourceTree = ""; };
2626B6AD143E1BEA00EF935C /* RangeMap.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
RangeMap.h; path = include/lldb/Core/RangeMap.h; sourceTree = ""; };
26AB54111832DC3400EADFF3 /* RegisterCheckpoint.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
RegisterCheckpoint.h; path = include/lldb/Target/RegisterCheckpoint.h; 
sourceTree = ""; };
26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = RegisterContext.cpp; path = source/Target/RegisterContext.cpp; 
sourceTree = ""; };
@@ -4661,8 +4658,6 @@
9A35765F116E76B900E8ED2F /* StringList.cpp */,
26F2F8FD1B156678007857DE /* StructuredData.h */,
AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp 
*/,
-   94BA8B6E176F8CA0005A91B5 /* Range.h */,
-   94BA8B6C176F8C9B005A91B5 /* Range.cpp */,
AFF8FF0B1E779D4B003830EF /* 
TildeExpressionResolver.cpp */,
AFF8FF0D1E779D51003830EF /* 
TildeExpressionResolver.h */,
26BC7D7E10F1B77400F91463 /* Timer.h */,
@@ -8399,7 +8394,6 @@
6D55B2911A8A806200A70529 /* 
GDBRemoteCommunicationServerLLGS.cpp in Sources */,
260CC65315D0440D002BF2E0 /* 
OptionValueUInt64.cpp in Sources */,
260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp 
in Sources */,
-   94BA8B6D176F8C9B005A91B5 /* Range.cpp in 
Sources */,
267F684A1CC02DED0086832B /* ABISysV_s390x.cpp 
in Sources */,
AFDBC36E204663AF00B9C8F2 /* 
EmulateInstructionPPC64.cpp in Sources */,
26DAED6315D327C200E15819 /* 
OptionValuePathMappings.cpp in Sources */,


_

[Lldb-commits] [lldb] r350266 - Add file-based synching to places missed in r350247.

2019-01-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Jan  2 14:37:28 2019
New Revision: 350266

URL: http://llvm.org/viewvc/llvm-project?rev=350266&view=rev
Log:
Add file-based synching to places missed in r350247.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=350266&r1=350265&r2=350266&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Wed 
Jan  2 14:37:28 2019
@@ -31,14 +31,14 @@ class TestQueues(TestBase):
 self.main_source = "main.c"
 
 def remove_token(self, name):
-for i in range(6):
-token = name+'.token.%d'%(i+1)
+for i in range(7):
+token = name+'.token.%d'%i
 if os.path.exists(token):
 os.remove(token)
 
 def await_token(self, name):
-for i in range(6):
-lldbutil.wait_for_file_on_target(self, name+'.token.%d'%(i+1))
+for i in range(7):
+lldbutil.wait_for_file_on_target(self, name+'.token.%d'%i)
 
 def check_queue_for_valid_queue_id(self, queue):
 self.assertTrue(

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350266&r1=350265&r2=350266&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Wed Jan  2 
14:37:28 2019
@@ -6,6 +6,7 @@
 #include 
 
 int finished_enqueueing_work = 0;
+char *name = NULL;
 
 void
 touch (const char *name, unsigned n)
@@ -23,6 +24,7 @@ touch (const char *name, unsigned n)
 void
 doing_the_work_1(void *in)
 {
+touch (name, 0);
 while (1)
 sleep (1);
 }
@@ -94,6 +96,9 @@ stopper ()
 
 int main (int argc, const char **argv)
 {
+if (argc != 2)
+  return 2;
+name = argv[1];
 dispatch_queue_t work_submittor_1 = dispatch_queue_create 
("com.apple.work_submittor_1", DISPATCH_QUEUE_SERIAL);
 dispatch_queue_t work_submittor_2 = dispatch_queue_create 
("com.apple.work_submittor_and_quit_2", DISPATCH_QUEUE_SERIAL);
 dispatch_queue_t work_submittor_3 = dispatch_queue_create 
("com.apple.work_submittor_3", DISPATCH_QUEUE_SERIAL);
@@ -115,37 +120,37 @@ int main (int argc, const char **argv)
 
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
 pthread_setname_np ("user initiated QoS");
-touch(argv[1], 1);
+touch(name, 1);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), 
^{
 pthread_setname_np ("user interactive QoS");
-touch(argv[1], 2);
+touch(name, 2);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
 pthread_setname_np ("default QoS");
-touch(argv[1], 3);
+touch(name, 3);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
 pthread_setname_np ("utility QoS");
-touch(argv[1], 4);
+touch(name, 4);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{
 pthread_setname_np ("background QoS");
-touch(argv[1], 5);
+touch(name, 5);
 while (1)
 sleep (10);
 });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_UNSPECIFIED, 0), ^{
 pthread_setname_np ("unspecified QoS");
-touch(argv[1], 6);
+touch(name, 6);
 while (1)
 sleep (10);
 });


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


[Lldb-commits] [lldb] r350274 - Rearrange bitfield to allow for more space in file_idx.

2019-01-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Jan  2 15:37:54 2019
New Revision: 350274

URL: http://llvm.org/viewvc/llvm-project?rev=350274&view=rev
Log:
Rearrange bitfield to allow for more space in file_idx.

This is an alternate patch for the bug reported in
https://bugs.llvm.org/show_bug.cgi?id=39816 ("lldb doesn't show a file
of line entry for big project"). This limits the number of lines in a
source file to 32M, which I think is reasonable even for preprocessed
source inputs.

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

Modified:
lldb/trunk/include/lldb/Symbol/LineTable.h

Modified: lldb/trunk/include/lldb/Symbol/LineTable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/LineTable.h?rev=350274&r1=350273&r2=350274&view=diff
==
--- lldb/trunk/include/lldb/Symbol/LineTable.h (original)
+++ lldb/trunk/include/lldb/Symbol/LineTable.h Wed Jan  2 15:37:54 2019
@@ -306,26 +306,30 @@ protected:
 //--
 // Member variables.
 //--
-lldb::addr_t file_addr; ///< The file address for this line entry
-uint32_t line;   ///< The source line number, or zero if there is no line
- ///number information.
-uint16_t column; ///< The column number of the source line, or zero if 
there
- ///is no column information.
-uint16_t file_idx : 11, ///< The file index into CompileUnit's file table,
-///or zero if there is no file information.
-is_start_of_statement : 1, ///< Indicates this entry is the beginning 
of
-   ///a statement.
-is_start_of_basic_block : 1, ///< Indicates this entry is the beginning
- ///of a basic block.
-is_prologue_end : 1, ///< Indicates this entry is one (of possibly 
many)
- ///where execution should be suspended for an 
entry
- ///breakpoint of a function.
-is_epilogue_begin : 1, ///< Indicates this entry is one (of possibly
-   ///many) where execution should be suspended for
-   ///an exit breakpoint of a function.
-is_terminal_entry : 1; ///< Indicates this entry is that of the first
-   ///byte after the end of a sequence of target
-   ///machine instructions.
+/// The file address for this line entry.
+lldb::addr_t file_addr;
+/// The source line number, or zero if there is no line number
+/// information.
+uint32_t line : 27;
+/// Indicates this entry is the beginning of a statement.
+uint32_t is_start_of_statement : 1;
+/// Indicates this entry is the beginning of a basic block.
+uint32_t is_start_of_basic_block : 1;
+/// Indicates this entry is one (of possibly many) where execution
+/// should be suspended for an entry breakpoint of a function.
+uint32_t is_prologue_end : 1;
+/// Indicates this entry is one (of possibly many) where execution
+/// should be suspended for an exit breakpoint of a function.
+uint32_t is_epilogue_begin : 1;
+/// Indicates this entry is that of the first byte after the end
+/// of a sequence of target machine instructions.
+uint32_t is_terminal_entry : 1;
+/// The column number of the source line, or zero if there is no
+/// column information.
+uint16_t column;
+/// The file index into CompileUnit's file table, or zero if there
+/// is no file information.
+uint16_t file_idx;
   };
 
   struct EntrySearchInfo {


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


[Lldb-commits] [lldb] r350360 - TestQueues: Move the synchronisation code into the binary itself.

2019-01-03 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Jan  3 14:34:48 2019
New Revision: 350360

URL: http://llvm.org/viewvc/llvm-project?rev=350360&view=rev
Log:
TestQueues: Move the synchronisation code into the binary itself.

Thanks to Pavel Labath for the suggestion!

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=350360&r1=350359&r2=350360&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Thu 
Jan  3 14:34:48 2019
@@ -30,16 +30,6 @@ class TestQueues(TestBase):
 # Find the line numbers that we will step to in main:
 self.main_source = "main.c"
 
-def remove_token(self, name):
-for i in range(7):
-token = name+'.token.%d'%i
-if os.path.exists(token):
-os.remove(token)
-
-def await_token(self, name):
-for i in range(7):
-lldbutil.wait_for_file_on_target(self, name+'.token.%d'%i)
-
 def check_queue_for_valid_queue_id(self, queue):
 self.assertTrue(
 queue.GetQueueID() != 0, "Check queue %s for valid QueueID (got 
0x%x)" %
@@ -122,14 +112,12 @@ class TestQueues(TestBase):
 self.main_source_spec = lldb.SBFileSpec(self.main_source)
 break1 = target.BreakpointCreateByName("stopper", 'a.out')
 self.assertTrue(break1, VALID_BREAKPOINT)
-self.remove_token(exe)
 process = target.LaunchSimple(
-[exe+'.token.'], None, self.get_process_working_directory())
+[], None, self.get_process_working_directory())
 self.assertTrue(process, PROCESS_IS_VALID)
 threads = lldbutil.get_threads_stopped_at_breakpoint(process, break1)
 if len(threads) != 1:
 self.fail("Failed to stop at breakpoint 1.")
-self.await_token(exe)
 
 queue_submittor_1 = lldb.SBQueue()
 queue_performer_1 = lldb.SBQueue()
@@ -283,9 +271,8 @@ class TestQueues(TestBase):
 if self.getArchitecture() in ['arm', 'arm64', 'arm64e', 'arm64_32', 
'armv7', 'armv7k']:
 libbtr_path = "/Developer/usr/lib/libBacktraceRecording.dylib"
 
-self.remove_token(exe)
 process = target.LaunchSimple(
-[exe+'.token.'],
+[],
 [
 'DYLD_INSERT_LIBRARIES=%s' % (libbtr_path),
 'DYLD_LIBRARY_PATH=/usr/lib/system/introspection'],
@@ -297,7 +284,6 @@ class TestQueues(TestBase):
 threads = lldbutil.get_threads_stopped_at_breakpoint(process, break1)
 if len(threads) != 1:
 self.fail("Failed to stop at breakpoint 1.")
-self.await_token(exe)
 
 libbtr_module_filespec = lldb.SBFileSpec("libBacktraceRecording.dylib")
 libbtr_module = target.FindModule(libbtr_module_filespec)

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350360&r1=350359&r2=350360&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Thu Jan  3 
14:34:48 2019
@@ -1,30 +1,16 @@
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
 int finished_enqueueing_work = 0;
-char *name = NULL;
-
-void
-touch (const char *name, unsigned n)
-{
-char token[2048];
-snprintf (token, 2048, "%s%d", name, n);
-FILE *f = fopen (token, "wx");
-if (!f)
-exit (1);
-fputs ("\n", f);
-fflush (f);
-fclose (f);
-}
+atomic_int thread_count = 0;
 
 void
 doing_the_work_1(void *in)
 {
-touch (name, 0);
+atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (1);
 }
@@ -96,9 +82,6 @@ stopper ()
 
 int main (int argc, const char **argv)
 {
-if (argc != 2)
-  return 2;
-name = argv[1];
 dispatch_queue_t work_submittor_1 = dispatch_queue_create 
("com.apple.work_submittor_1", DISPATCH_QUEUE_SERIAL);
 dispatch_queue_t work_submittor_2 = dispatch_queue_create 
("com.apple.work_submittor_and_quit_2", DISPATCH_QUEUE_SERIAL);
 dispatch_queue_t work_submittor_3 = dispatch_queue_create 
("com.apple.work_submittor_3", DISPATCH_QUEUE_SERIAL);
@@ -117,44 +100,46 @@ int main (int argc, const char **argv)
 
 
 // Spin up threads with each of the different libdispatch QoS values.
-
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
 pthread_setname_np ("user initiated

[Lldb-commits] [lldb] r350537 - Simplify testcase by using lldbutil.run_to_source_breakpoint()

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 08:27:52 2019
New Revision: 350537

URL: http://llvm.org/viewvc/llvm-project?rev=350537&view=rev
Log:
Simplify testcase by using lldbutil.run_to_source_breakpoint()

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py?rev=350537&r1=350536&r2=350537&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
 Mon Jan  7 08:27:52 2019
@@ -23,8 +23,6 @@ class ModulesInlineFunctionsTestCase(Tes
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
-# Find the line number to break inside main().
-self.line = line_number('main.m', '// Set breakpoint here.')
 
 @skipUnlessDarwin
 @skipIf(macos_version=["<", "10.12"], debug_info=no_match(["gmodules"]))
@@ -34,19 +32,8 @@ class ModulesInlineFunctionsTestCase(Tes
 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
 # Break inside the foo function which takes a bar_ptr argument.
-lldbutil.run_break_set_by_file_and_line(
-self, "main.m", self.line, num_expected_locations=1, 
loc_exact=True)
-
-self.runCmd("run", RUN_SUCCEEDED)
-
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = breakpoint'])
-
-# The breakpoint should have a hit count of 1.
-self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
-substrs=[' resolved, hit count = 1'])
+lldbutil.run_to_source_breakpoint(
+self, '// Set breakpoint here.', lldb.SBFileSpec('main.m'))
 
 self.runCmd(
 "settings set target.clang-module-search-paths \"" +


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


[Lldb-commits] [lldb] r350543 - Fine-tune and document the barrier in TestQueues.

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 09:18:39 2019
New Revision: 350543

URL: http://llvm.org/viewvc/llvm-project?rev=350543&view=rev
Log:
Fine-tune and document the barrier in TestQueues.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350543&r1=350542&r2=350543&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Mon Jan  7 
09:18:39 2019
@@ -10,6 +10,8 @@ atomic_int thread_count = 0;
 void
 doing_the_work_1(void *in)
 {
+// This is only counted once because the first job in the queue
+// starves all the others.
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (1);
@@ -29,13 +31,15 @@ submit_work_1b(void *in)
 dispatch_queue_t *work_performer_1 = (dispatch_queue_t*) in;
 dispatch_async_f (*work_performer_1, NULL, doing_the_work_1);
 dispatch_async_f (*work_performer_1, NULL, doing_the_work_1);
+atomic_fetch_add(&thread_count, 1);
 while (1)
-  sleep (1);
+sleep (1);
 }
 
 void
 doing_the_work_2(void *in)
 {
+atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (1);
 }
@@ -45,7 +49,7 @@ submit_work_2(void *in)
 {
 dispatch_queue_t *work_performer_2 = (dispatch_queue_t*) in;
 int i = 0;
-while (i++ <  5000)
+while (i++ < 5000)
 {
 dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
 dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
@@ -57,8 +61,10 @@ submit_work_2(void *in)
 void
 doing_the_work_3(void *in)
 {
+// This counts four times, since the queue is marked as CONCURRENT.
+atomic_fetch_add(&thread_count, 1);
 while (1)
-sleep(1);
+sleep (1);
 }
 
 void
@@ -105,40 +111,40 @@ int main (int argc, const char **argv)
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), 
^{
 pthread_setname_np ("user interactive QoS");
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
 pthread_setname_np ("default QoS");
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
 pthread_setname_np ("utility QoS");
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{
 pthread_setname_np ("background QoS");
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 dispatch_async (dispatch_get_global_queue(QOS_CLASS_UNSPECIFIED, 0), ^{
 pthread_setname_np ("unspecified QoS");
 atomic_fetch_add(&thread_count, 1);
 while (1)
 sleep (10);
-});
+  });
 
 // Unfortunately there is no pthread_barrier on darwin.
-while (atomic_load(&thread_count) < 7)
+while (atomic_load(&thread_count) < 13)
 sleep(1);
 
 while (finished_enqueueing_work == 0)


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


[Lldb-commits] [lldb] r350557 - Refactor test, no changes expected.

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 11:19:34 2019
New Revision: 350557

URL: http://llvm.org/viewvc/llvm-project?rev=350557&view=rev
Log:
Refactor test, no changes expected.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c?rev=350557&r1=350556&r2=350557&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/main.c Mon Jan  7 
11:19:34 2019
@@ -4,7 +4,7 @@
 #include 
 #include 
 
-int finished_enqueueing_work = 0;
+atomic_int finished_enqueueing_work = 0;
 atomic_int thread_count = 0;
 
 void
@@ -54,7 +54,7 @@ submit_work_2(void *in)
 dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
 dispatch_async_f (*work_performer_2, NULL, doing_the_work_2);
 }
-finished_enqueueing_work = 1;
+atomic_fetch_add(&finished_enqueueing_work, 1);
 }
 
 
@@ -144,11 +144,8 @@ int main (int argc, const char **argv)
   });
 
 // Unfortunately there is no pthread_barrier on darwin.
-while (atomic_load(&thread_count) < 13)
-sleep(1);
-
-while (finished_enqueueing_work == 0)
+while ((atomic_load(&thread_count) < 13) || (finished_enqueueing_work == 
0))
 sleep (1);
-stopper ();
 
+stopper ();
 }


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


[Lldb-commits] [lldb] r350559 - Split two sub-tests into separate top-level methods.

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 11:24:04 2019
New Revision: 350559

URL: http://llvm.org/viewvc/llvm-project?rev=350559&view=rev
Log:
Split two sub-tests into separate top-level methods.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=350559&r1=350558&r2=350559&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Mon 
Jan  7 11:24:04 2019
@@ -18,10 +18,16 @@ class TestQueues(TestBase):
 
 @skipUnlessDarwin
 @add_test_categories(['pyapi'])
-def test_with_python_api(self):
+def test_with_python_api_queues(self):
 """Test queues inspection SB APIs."""
 self.build()
 self.queues()
+
+@skipUnlessDarwin
+@add_test_categories(['pyapi'])
+def test_with_python_api_queues_with_backtrace(self):
+"""Test queues inspection SB APIs."""
+self.build()
 self.queues_with_libBacktraceRecording()
 
 def setUp(self):


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


[Lldb-commits] [lldb] r350575 - Rename DWARFDIE::GetDWOContext() -> GetDeclContext() (NFC)

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 14:47:17 2019
New Revision: 350575

URL: http://llvm.org/viewvc/llvm-project?rev=350575&view=rev
Log:
Rename DWARFDIE::GetDWOContext() -> GetDeclContext() (NFC)

Despite the name, this function has nothing to do with the DWO format.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=350575&r1=350574&r2=350575&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan  
7 14:47:17 2019
@@ -144,7 +144,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 
   // This type comes from an external DWO module.
   std::vector dwo_context;
-  die.GetDWOContext(dwo_context);
+  die.GetDeclContext(dwo_context);
   TypeMap dwo_types;
 
   if (!dwo_module_sp->GetSymbolVendor()->FindTypes(dwo_context, true,

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp?rev=350575&r1=350574&r2=350575&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp Mon Jan  7 14:47:17 
2019
@@ -166,13 +166,13 @@ void DWARFDIE::GetDWARFDeclContext(DWARF
   }
 }
 
-void DWARFDIE::GetDWOContext(std::vector &context) const {
+void DWARFDIE::GetDeclContext(std::vector &context) const {
   const dw_tag_t tag = Tag();
   if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
 return;
   DWARFDIE parent = GetParent();
   if (parent)
-parent.GetDWOContext(context);
+parent.GetDeclContext(context);
   switch (tag) {
   case DW_TAG_module:
 context.push_back(

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h?rev=350575&r1=350574&r2=350575&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h Mon Jan  7 14:47:17 
2019
@@ -90,7 +90,10 @@ public:
 
   void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const;
 
-  void GetDWOContext(std::vector &context) 
const;
+  /// Return this DIE's decl context as it is needed to look up types
+  /// in Clang's -gmodules debug info format.
+  void
+  GetDeclContext(std::vector &context) const;
 
   //--
   // Getting attribute values from the DIE.

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=350575&r1=350574&r2=350575&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jan  7 
14:47:17 2019
@@ -2573,7 +2573,7 @@ size_t SymbolFileDWARF::FindTypes(const
 
   if (die) {
 std::vector die_context;
-die.GetDWOContext(die_context);
+die.GetDeclContext(die_context);
 if (die_context != context)
   continue;
 


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


[Lldb-commits] [lldb] r350576 - Clarify comment and variable names. (NFC)

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 15:02:28 2019
New Revision: 350576

URL: http://llvm.org/viewvc/llvm-project?rev=350576&view=rev
Log:
Clarify comment and variable names. (NFC)

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=350576&r1=350575&r2=350576&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan  
7 15:02:28 2019
@@ -142,12 +142,14 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   if (!dwo_module_sp)
 return TypeSP();
 
-  // This type comes from an external DWO module.
-  std::vector dwo_context;
-  die.GetDeclContext(dwo_context);
+  // If this type comes from a Clang module, look in the DWARF section
+  // of the pcm file in the module cache. Clang generates DWO skeleton
+  // units as breadcrumbs to find them.
+  std::vector decl_context;
+  die.GetDeclContext(decl_context);
   TypeMap dwo_types;
 
-  if (!dwo_module_sp->GetSymbolVendor()->FindTypes(dwo_context, true,
+  if (!dwo_module_sp->GetSymbolVendor()->FindTypes(decl_context, true,
dwo_types)) {
 if (!isClangModuleFwdDecl(die))
   return TypeSP();
@@ -159,7 +161,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   if (!NameModule.second)
 continue;
   SymbolVendor *SymVendor = NameModule.second->GetSymbolVendor();
-  if (SymVendor->FindTypes(dwo_context, true, dwo_types))
+  if (SymVendor->FindTypes(decl_context, true, dwo_types))
 break;
 }
   }


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


[Lldb-commits] [lldb] r350577 - Simplify code.

2019-01-07 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Jan  7 15:08:16 2019
New Revision: 350577

URL: http://llvm.org/viewvc/llvm-project?rev=350577&view=rev
Log:
Simplify code.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=350577&r1=350576&r2=350577&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Jan  
7 15:08:16 2019
@@ -166,8 +166,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 }
   }
 
-  const size_t num_dwo_types = dwo_types.GetSize();
-  if (num_dwo_types != 1)
+  if (dwo_types.GetSize() != 1)
 return TypeSP();
 
   // We found a real definition for this type in the Clang module, so lets use


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


[Lldb-commits] [lldb] r350651 - Convert to LLDB coding style (NFC)

2019-01-08 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Jan  8 12:48:40 2019
New Revision: 350651

URL: http://llvm.org/viewvc/llvm-project?rev=350651&view=rev
Log:
Convert to LLDB coding style (NFC)

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=350651&r1=350650&r2=350651&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Tue Jan  
8 12:48:40 2019
@@ -125,7 +125,7 @@ ClangASTImporter &DWARFASTParserClang::G
 }
 
 /// Detect a forward declaration that is nested in a DW_TAG_module.
-static bool isClangModuleFwdDecl(const DWARFDIE &Die) {
+static bool IsClangModuleFwdDecl(const DWARFDIE &Die) {
   if (!Die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
 return false;
   auto Parent = Die.GetParent();
@@ -151,17 +151,17 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 
   if (!dwo_module_sp->GetSymbolVendor()->FindTypes(decl_context, true,
dwo_types)) {
-if (!isClangModuleFwdDecl(die))
+if (!IsClangModuleFwdDecl(die))
   return TypeSP();
 
 // Since this this type is defined in one of the Clang modules imported by
 // this symbol file, search all of them.
-auto *SymFile = die.GetCU()->GetSymbolFileDWARF();
-for (const auto &NameModule : SymFile->getExternalTypeModules()) {
-  if (!NameModule.second)
+auto *sym_file = die.GetCU()->GetSymbolFileDWARF();
+for (const auto &name_module : sym_file->getExternalTypeModules()) {
+  if (!name_module.second)
 continue;
-  SymbolVendor *SymVendor = NameModule.second->GetSymbolVendor();
-  if (SymVendor->FindTypes(decl_context, true, dwo_types))
+  SymbolVendor *sym_vendor = name_module.second->GetSymbolVendor();
+  if (sym_vendor->FindTypes(decl_context, true, dwo_types))
 break;
 }
   }


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


[Lldb-commits] [lldb] r332067 - Retrieve the deployment target when retrieving an object file's triple.

2018-05-10 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu May 10 17:41:20 2018
New Revision: 332067

URL: http://llvm.org/viewvc/llvm-project?rev=332067&view=rev
Log:
Retrieve the deployment target when retrieving an object file's triple.

Getting the deployment target can be significant information when
rebuilding clang modules since availability information could depend
on it.

rdar://problem/40039633

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

Added:
lldb/trunk/lit/Modules/lc_version_min.yaml
Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Added: lldb/trunk/lit/Modules/lc_version_min.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lc_version_min.yaml?rev=332067&view=auto
==
--- lldb/trunk/lit/Modules/lc_version_min.yaml (added)
+++ lldb/trunk/lit/Modules/lc_version_min.yaml Thu May 10 17:41:20 2018
@@ -0,0 +1,205 @@
+# RUN: yaml2obj %s > %t.out
+# RUN: lldb-test symbols %t.out | FileCheck %s
+# REQUIRES: darwin
+# Test that the deployment target is parsed from the load commands.
+# CHECK: x86_64-apple-macosx10.9.0
+--- !mach-o
+FileHeader:  
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x8003
+  filetype:0x0002
+  ncmds:   14
+  sizeofcmds:  728
+  flags:   0x00200085
+  reserved:0x
+LoadCommands:
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __PAGEZERO
+vmaddr:  0
+vmsize:  4294967296
+fileoff: 0
+filesize:0
+maxprot: 0
+initprot:0
+nsects:  0
+flags:   0
+  - cmd: LC_SEGMENT_64
+cmdsize: 232
+segname: __TEXT
+vmaddr:  4294967296
+vmsize:  4096
+fileoff: 0
+filesize:4096
+maxprot: 7
+initprot:5
+nsects:  2
+flags:   0
+Sections:
+  - sectname:__text
+segname: __TEXT
+addr:0x00010FB0
+size:8
+offset:  0x0FB0
+align:   0
+reloff:  0x
+nreloc:  0
+flags:   0x8400
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__unwind_info
+segname: __TEXT
+addr:0x00010FB8
+size:72
+offset:  0x0FB8
+align:   2
+reloff:  0x
+nreloc:  0
+flags:   0x
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __LINKEDIT
+vmaddr:  4294971392
+vmsize:  4096
+fileoff: 4096
+filesize:152
+maxprot: 7
+initprot:1
+nsects:  0
+flags:   0
+  - cmd: LC_DYLD_INFO_ONLY
+cmdsize: 48
+rebase_off:  0
+rebase_size: 0
+bind_off:0
+bind_size:   0
+weak_bind_off:   0
+weak_bind_size:  0
+lazy_bind_off:   0
+lazy_bind_size:  0
+export_off:  4096
+export_size: 48
+  - cmd: LC_SYMTAB
+cmdsize: 24
+symoff:  4152
+nsyms:   3
+stroff:  4200
+strsize: 48
+  - cmd: LC_DYSYMTAB
+cmdsize: 80
+ilocalsym:   0
+nlocalsym:   0
+iextdefsym:  0
+nextdefsym:  2
+iundefsym:   2
+nundefsym:   1
+tocoff:  0
+ntoc:0
+modtaboff:   0
+nmodtab: 0
+extrefsymoff:0
+nextrefsyms: 0
+indirectsymoff:  0
+nindirectsyms:   0
+extreloff:   0
+nextrel: 0
+locreloff:   0
+nlocrel: 0
+  - cmd: LC_LOAD_DYLINKER
+cmdsize: 32
+name:12
+PayloadString:   /usr/lib/dyld
+ZeroPadBytes:7
+  - cmd: LC_UUID
+cmdsize: 24
+uuid:E75E737C-4FB3-312D-9B17-10987F48F957
+  - cmd: LC_VERSION_MIN_MACOSX
+cmdsize: 16
+version: 657664
+sdk: 658944
+  - cmd: LC_SOURCE_VERSION
+cmdsize: 16
+version: 0
+  - cmd: LC_MAIN
+cmdsize: 24
+entryoff:4016
+stacksize:   0
+  - cmd: LC_LOAD_DYLIB
+cmdsize: 56
+dylib:   
+  name:24
+  timestamp:   2
+  current_version: 82102276
+  compatibility_version: 65536
+PayloadString:   /usr/lib/libSystem.B.dylib
+Zer

[Lldb-commits] [lldb] r332111 - HostInfoMacOSX: Share the clang resource directory with Swift.

2018-05-11 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri May 11 10:54:09 2018
New Revision: 332111

URL: http://llvm.org/viewvc/llvm-project?rev=332111&view=rev
Log:
HostInfoMacOSX: Share the clang resource directory with Swift.

Inside Xcode and in Xcode toolchains LLDB is always in lockstep
with the Swift compiler, so it can reuse its Clang resource
directory. This allows LLDB and the Swift compiler to share the
same Clang module cache.

rdar://problem/40039633

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

Modified:
lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/unittests/Host/CMakeLists.txt
lldb/trunk/unittests/Host/HostInfoTest.cpp

Modified: lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h?rev=332111&r1=332110&r2=332111&view=diff
==
--- lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h (original)
+++ lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h Fri May 11 10:54:09 
2018
@@ -38,6 +38,8 @@ protected:
   static bool ComputeHeaderDirectory(FileSpec &file_spec);
   static bool ComputePythonDirectory(FileSpec &file_spec);
   static bool ComputeClangDirectory(FileSpec &file_spec);
+  static bool ComputeClangDirectory(FileSpec &lldb_shlib_spec,
+FileSpec &file_spec, bool verify);
   static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
   static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
 };

Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=332111&r1=332110&r2=332111&view=diff
==
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Fri May 11 10:54:09 2018
@@ -19,6 +19,7 @@
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 
 // C++ Includes
@@ -226,21 +227,67 @@ bool HostInfoMacOSX::ComputePythonDirect
 #endif
 }
 
+static bool VerifyClangPath(const llvm::Twine &clang_path) {
+  if (llvm::sys::fs::is_directory(clang_path))
+return true;
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+  if (log)
+log->Printf("HostInfoMacOSX::ComputeClangDirectory(): "
+"failed to stat clang resource directory at \"%s\"",
+clang_path.str().c_str());
+  return false;
+}
+
 bool HostInfoMacOSX::ComputeClangDirectory(FileSpec &file_spec) {
   FileSpec lldb_file_spec;
   if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
 return false;
+  return ComputeClangDirectory(lldb_file_spec, file_spec, true);
+}
 
-  std::string raw_path = lldb_file_spec.GetPath();
+bool HostInfoMacOSX::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
+   FileSpec &file_spec, bool verify) {
+  std::string raw_path = lldb_shlib_spec.GetPath();
 
-  size_t framework_pos = raw_path.find("LLDB.framework");
-  if (framework_pos == std::string::npos)
+  auto rev_it = llvm::sys::path::rbegin(raw_path);
+  auto r_end = llvm::sys::path::rend(raw_path);
+
+  // Check for a Posix-style build of LLDB.
+  if (rev_it == r_end || *rev_it != "LLDB.framework")
 return HostInfoPosix::ComputeClangDirectory(file_spec);
-  
-  framework_pos += strlen("LLDB.framework");
-  raw_path.resize(framework_pos);
+
+  // Inside Xcode and in Xcode toolchains LLDB is always in lockstep
+  // with the Swift compiler, so it can reuse its Clang resource
+  // directory. This allows LLDB and the Swift compiler to share the
+  // same Clang module cache.
+  llvm::SmallString<256> clang_path;
+  const char *swift_clang_resource_dir = "usr/lib/swift/clang";
+  ++rev_it;
+  if (rev_it != r_end && *rev_it == "SharedFrameworks") {
+// This is the top-level LLDB in the Xcode.app bundle.
+raw_path.resize(rev_it - r_end);
+llvm::sys::path::append(clang_path, raw_path,
+"Developer/Toolchains/XcodeDefault.xctoolchain",
+swift_clang_resource_dir);
+if (!verify || VerifyClangPath(clang_path)) {
+  file_spec.SetFile(clang_path.c_str(), true);
+  return true;
+}
+  } else if (rev_it != r_end && *rev_it == "PrivateFrameworks" &&
+ ++rev_it != r_end && ++rev_it != r_end) {
+// This is LLDB inside an Xcode toolchain.
+raw_path.resize(rev_it - r_end);
+llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
+if (!verify || VerifyClangPath(clang_path)) {
+  file_spec.SetFile(clang_path.c_str(), true);
+  return true;
+}
+  } else {
+raw_path.resize(rev_it - r_end);
+  }
+
+  // Fall back to the Clang resource directory

[Lldb-commits] [lldb] r332120 - Fix a regression in r332111. The LLDB.framework path component is not

2018-05-11 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri May 11 12:00:58 2018
New Revision: 332120

URL: http://llvm.org/viewvc/llvm-project?rev=332120&view=rev
Log:
Fix a regression in r332111. The LLDB.framework path component is not
usually the last component.

Modified:
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/unittests/Host/HostInfoTest.cpp

Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=332120&r1=332119&r2=332120&view=diff
==
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Fri May 11 12:00:58 2018
@@ -253,7 +253,13 @@ bool HostInfoMacOSX::ComputeClangDirecto
   auto r_end = llvm::sys::path::rend(raw_path);
 
   // Check for a Posix-style build of LLDB.
-  if (rev_it == r_end || *rev_it != "LLDB.framework")
+  while (rev_it != r_end) {
+if (*rev_it == "LLDB.framework")
+  break;
+++rev_it;
+  }
+
+  if (rev_it == r_end)
 return HostInfoPosix::ComputeClangDirectory(file_spec);
 
   // Inside Xcode and in Xcode toolchains LLDB is always in lockstep

Modified: lldb/trunk/unittests/Host/HostInfoTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/HostInfoTest.cpp?rev=332120&r1=332119&r2=332120&view=diff
==
--- lldb/trunk/unittests/Host/HostInfoTest.cpp (original)
+++ lldb/trunk/unittests/Host/HostInfoTest.cpp Fri May 11 12:00:58 2018
@@ -63,8 +63,14 @@ TEST_F(HostInfoTest, MacOSX) {
   std::string posix = "/usr/lib/liblldb.dylib";
   EXPECT_FALSE(HostInfoMacOSXTest::ComputeClangDir(posix).empty());
 
+  std::string framework =
+"/SharedFrameworks/LLDB.framework";
+  std::string framework_clang =
+"/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang";
+  EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(framework), framework_clang);
+
   std::string xcode =
-"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework";
+
"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A";
   std::string xcode_clang =
 "/Applications/Xcode.app/Contents/Developer/Toolchains/"
 "XcodeDefault.xctoolchain/usr/lib/swift/clang";


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


[Lldb-commits] [lldb] r332126 - Yet another follow-up to r332111. This also handles the case where an

2018-05-11 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri May 11 12:29:25 2018
New Revision: 332126

URL: http://llvm.org/viewvc/llvm-project?rev=332126&view=rev
Log:
Yet another follow-up to r332111. This also handles the case where an
LLDB.framework is built inside the LLDB build directory (but not
inside an Xcode installation).

Modified:
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/unittests/Host/HostInfoTest.cpp

Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=332126&r1=332125&r2=332126&view=diff
==
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Fri May 11 12:29:25 2018
@@ -268,10 +268,11 @@ bool HostInfoMacOSX::ComputeClangDirecto
   // same Clang module cache.
   llvm::SmallString<256> clang_path;
   const char *swift_clang_resource_dir = "usr/lib/swift/clang";
-  ++rev_it;
-  if (rev_it != r_end && *rev_it == "SharedFrameworks") {
+  auto parent = std::next(rev_it);
+  if (parent != r_end && *parent == "SharedFrameworks") {
 // This is the top-level LLDB in the Xcode.app bundle.
-raw_path.resize(rev_it - r_end);
+// e.g., "Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A"
+raw_path.resize(parent - r_end);
 llvm::sys::path::append(clang_path, raw_path,
 "Developer/Toolchains/XcodeDefault.xctoolchain",
 swift_clang_resource_dir);
@@ -279,10 +280,14 @@ bool HostInfoMacOSX::ComputeClangDirecto
   file_spec.SetFile(clang_path.c_str(), true);
   return true;
 }
-  } else if (rev_it != r_end && *rev_it == "PrivateFrameworks" &&
- ++rev_it != r_end && ++rev_it != r_end) {
+  } else if (parent != r_end && *parent == "PrivateFrameworks" &&
+ std::distance(parent, r_end) > 2) {
 // This is LLDB inside an Xcode toolchain.
-raw_path.resize(rev_it - r_end);
+// e.g., "Xcode.app/Contents/Developer/Toolchains/" \
+//   "My.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework"
+++parent;
+++parent;
+raw_path.resize(parent - r_end);
 llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
 if (!verify || VerifyClangPath(clang_path)) {
   file_spec.SetFile(clang_path.c_str(), true);
@@ -293,7 +298,7 @@ bool HostInfoMacOSX::ComputeClangDirecto
   }
 
   // Fall back to the Clang resource directory inside the framework.
-  raw_path.append("/Resources/Clang");
+  raw_path.append("LLDB.framework/Resources/Clang");
   file_spec.SetFile(raw_path.c_str(), true);
   return true;
 }

Modified: lldb/trunk/unittests/Host/HostInfoTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/HostInfoTest.cpp?rev=332126&r1=332125&r2=332126&view=diff
==
--- lldb/trunk/unittests/Host/HostInfoTest.cpp (original)
+++ lldb/trunk/unittests/Host/HostInfoTest.cpp Fri May 11 12:29:25 2018
@@ -63,11 +63,11 @@ TEST_F(HostInfoTest, MacOSX) {
   std::string posix = "/usr/lib/liblldb.dylib";
   EXPECT_FALSE(HostInfoMacOSXTest::ComputeClangDir(posix).empty());
 
-  std::string framework =
-"/SharedFrameworks/LLDB.framework";
-  std::string framework_clang =
-"/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang";
-  EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(framework), framework_clang);
+  std::string build =
+"/lldb-macosx-x86_64/Library/Frameworks/LLDB.framework/Versions/A";
+  std::string build_clang =
+"/lldb-macosx-x86_64/Library/Frameworks/LLDB.framework/Resources/Clang";
+  EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(build), build_clang);
 
   std::string xcode =
 
"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A";


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


[Lldb-commits] [lldb] r332140 - Conditionally compile a Darwin-only test.

2018-05-11 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri May 11 14:05:32 2018
New Revision: 332140

URL: http://llvm.org/viewvc/llvm-project?rev=332140&view=rev
Log:
Conditionally compile a Darwin-only test.

Modified:
lldb/trunk/unittests/Host/HostInfoTest.cpp

Modified: lldb/trunk/unittests/Host/HostInfoTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/HostInfoTest.cpp?rev=332140&r1=332139&r2=332140&view=diff
==
--- lldb/trunk/unittests/Host/HostInfoTest.cpp (original)
+++ lldb/trunk/unittests/Host/HostInfoTest.cpp Fri May 11 14:05:32 2018
@@ -58,6 +58,7 @@ struct HostInfoMacOSXTest : public HostI
 };
 
 
+#ifdef __APPLE__
 TEST_F(HostInfoTest, MacOSX) {
   // This returns whatever the POSIX fallback returns.
   std::string posix = "/usr/lib/liblldb.dylib";
@@ -89,3 +90,4 @@ TEST_F(HostInfoTest, MacOSX) {
   EXPECT_NE(HostInfoMacOSXTest::ComputeClangDir(GetInputFilePath(xcode), true),
 HostInfoMacOSXTest::ComputeClangDir(GetInputFilePath(xcode)));
 }
+#endif


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


Re: [Lldb-commits] [PATCH] D46889: [DWARF] Extract indexing code into a separate class hierarchy

2018-05-18 Thread Adrian Prantl via lldb-commits
Thanks for jumping on this Amara — I just wanted to point out that we ususally 
don't revert lldb changes that only break the lldb-xcode bot if they pass on 
the lldb-cmake bot at the same time. When this happens it usually means that 
the lldb Xcode project must be updated and it's too much to ask from all open 
source contributors to get access to a machine running Xcode to do this. 
Instead one of the Apple LLDB developers usually goes in and updates the Xcode 
project for them.

-- adrian

> On May 18, 2018, at 9:04 AM, Amara Emerson via Phabricator 
>  wrote:
> 
> aemerson reopened this revision.
> aemerson added a comment.
> This revision is now accepted and ready to land.
> 
> Hi Pavel,
> 
> I reverted this in r332730 due to the bot breaking. Please have a look and 
> commit again when ready.
> 
> Thanks,
> Amara
> 
> 
> Repository:
>  rL LLVM
> 
> https://reviews.llvm.org/D46889
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D46889: [DWARF] Extract indexing code into a separate class hierarchy

2018-05-18 Thread Adrian Prantl via lldb-commits


> On May 18, 2018, at 11:25 AM, Amara Emerson via Phabricator 
>  wrote:
> 
> aemerson added a comment.
> 
> In https://reviews.llvm.org/D46889#1104823, @aprantl wrote:
> 
>> Thanks for jumping on this Amara — I just wanted to point out that we 
>> ususally don't revert lldb changes that only break the lldb-xcode bot if 
>> they pass on the lldb-cmake bot at the same time. When this happens it 
>> usually means that the lldb Xcode project must be updated and it's too much 
>> to ask from all open source contributors to get access to a machine running 
>> Xcode to do this. Instead one of the Apple LLDB developers usually goes in 
>> and updates the Xcode project for them.
>> 
>> - adrian
> 
> 
> Ah ok. Does that include cases like this one with the link error:

Possibly not.. I just realized that the lldb-cmake bot was stuck. I changed the 
configuration to have a timeout and forced a clean rebuild.
-- adrian

> 
>  Undefined symbols for architecture x86_64:
>"lldb_private::AppleDWARFIndex::Create(lldb_private::Module&, 
> lldb_private::DWARFDataExtractor, lldb_private::DWARFDataExtractor, 
> lldb_private::DWARFDataExtractor, lldb_private::DWARFDataExtractor, 
> lldb_private::DWARFDataExtractor)", referenced from:
>SymbolFileDWARF::InitializeObject() in 
> liblldb-core.a(SymbolFileDWARF.o)
>"vtable for lldb_private::ManualDWARFIndex", referenced from:
>SymbolFileDWARF::InitializeObject() in 
> liblldb-core.a(SymbolFileDWARF.o)
>NOTE: a missing vtable usually means the first non-inline virtual member 
> function has no definition.
> 
> 
> Repository:
>  rL LLVM
> 
> https://reviews.llvm.org/D46889
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D43984: Make the clang module cache setting available without a target

2018-05-22 Thread Adrian Prantl via lldb-commits
Can you help me understand why this dependency poses a problem? It's not clear 
to me how to resolve this otherwise. The point of the patch is to ask the clang 
driver for the clang module cache path. If the problem is that we otherwise 
don't use the driver and now pull it in, would moving the Clang API into a 
different clang library work? Which one?

-- adrian

> On May 22, 2018, at 11:28 AM, Zachary Turner  wrote:
> 
> This change has introduced a dependency from Core -> clang Driver (due to 
> #include "clang/Driver/Driver.h" in ModuleList.cpp).  Can you please try to 
> find a way to remove this dependency?
> 
> On Fri, Mar 2, 2018 at 2:45 PM Phabricator via Phabricator via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> This revision was not accepted when it landed; it landed in state "Needs 
> Review".
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL326628: Make the clang module cache setting available 
> without a target (authored by adrian, committed by ).
> Herald added a subscriber: llvm-commits.
> 
> Changed prior to commit:
>   https://reviews.llvm.org/D43984?vs=136803&id=136858#toc 
> 
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D43984 
> 
> Files:
>   lldb/trunk/include/lldb/Core/ModuleList.h
>   lldb/trunk/include/lldb/Target/Target.h
>   lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile
>   
> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
>   lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h
>   lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m
>   
> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap
>   lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
>   lldb/trunk/source/Core/Debugger.cpp
>   lldb/trunk/source/Core/ModuleList.cpp
>   lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
>   lldb/trunk/source/Target/Target.cpp
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 

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


Re: [Lldb-commits] [PATCH] D47235: Move ModuleList's dependency on clangDriver into Host

2018-05-23 Thread Adrian Prantl via lldb-commits


> On May 22, 2018, at 6:57 PM, Zachary Turner  wrote:
> 
> Yea I don’t think this addresses the problem. We should be able to link 
> against parts of lldb without a dependency on clang. Since this is about 
> configuring something related to clang, it seems like it should be isolated 
> to some part of lldb that interfaces with clang 

And this is the point where I need some help :-)
The intended layering of LLDB is not at all clear to me. Which LLDB libraries 
are allowed to link against clang? Do we have a diagram somewhere?

-- adrian

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


Re: [Lldb-commits] [PATCH] D47235: Move ModuleList's dependency on clangDriver into Host

2018-05-23 Thread Adrian Prantl via lldb-commits


> On May 23, 2018, at 8:51 AM, Zachary Turner  wrote:
> 
> There's not really a diagram, because we don't have an exact vision of what 
> the final layering is going to look like (some things will need to be split 
> up, entirely new targets will need to be introduced, etc).  Mostly it's just 
> built from experience based on what the primary logical function of a target 
> is, and then asking whether or not someone who wishes to use that 
> functionality should be required to link in all of that target's current 
> dependencies.  And hoping that a layering emerges from this process, at which 
> point we can then make a diagram as well as enforce it through CMake / 
> LLVMBuild / etc.
> 
> Core is the fundamental target that contains the basic data structures 
> representing a generic debugger.  A generic debugger shouldn't need to depend 
> on clang.  Someone should be able to (in theory) link against Core (and 
> perhaps a few other targets) and build a Java debugger.  Or a debugger for an 
> embedded platform.  So a dependency on clang doesn't belong there.
> 
> LLDB is a specific debugger which is built on top of Core and other 
> libraries, and so that is why I think it makes sense to expose a static 
> function in Module which allows you to set the clang modules path, and then 
> we do that during LLDB initialization.

Could you point me at a specific source file? It's not obvious to me what "LLDB 
initialization" means to you.

-- adrian

>   For the record, that still isn't correct from a purity standpoint, because 
> there is a method in Core which claims to have something to do with clang 
> modules.  But at least it's relatively benign.
> 
> In any case, what do you think about that approach?  
> 
> On Wed, May 23, 2018 at 8:42 AM Adrian Prantl  > wrote:
> 
> 
> > On May 22, 2018, at 6:57 PM, Zachary Turner  > > wrote:
> > 
> > Yea I don’t think this addresses the problem. We should be able to link 
> > against parts of lldb without a dependency on clang. Since this is about 
> > configuring something related to clang, it seems like it should be isolated 
> > to some part of lldb that interfaces with clang 
> 
> And this is the point where I need some help :-)
> The intended layering of LLDB is not at all clear to me. Which LLDB libraries 
> are allowed to link against clang? Do we have a diagram somewhere?
> 
> -- adrian
> 

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


Re: [Lldb-commits] [PATCH] D47235: Move ModuleList's dependency on clangDriver into Host

2018-05-23 Thread Adrian Prantl via lldb-commits


> On May 23, 2018, at 1:33 PM, Zachary Turner  wrote:
> 
> Actually, now I’m starting to wonder why can’t ClangModulesDeclVendor.cpp 
> just call this function in clangDriver to get the default if the accessor 
> returns an empty string? That sidesteps all of this initialization funny 
> business and lets the client just handle it.

Since it is surfaced as a property, users expect that "settings list" returns a 
proper value. ClangModulesDeclVendor is only initialized once a Target exists. 
Xcode may also use this property to set the module cache path and initializing 
the property later than at LLDB initialization time could create a race 
condition.
ClangModulesDeclVendor also isn't the only user of the property. The Swift 
Plugin also needs to know it and I'd like to avoid duplicating the code.


-- adrian


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


[Lldb-commits] [lldb] r333140 - Add a --synchronous option to lldb-mi to facilitate reliable testing.

2018-05-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed May 23 16:33:50 2018
New Revision: 333140

URL: http://llvm.org/viewvc/llvm-project?rev=333140&view=rev
Log:
Add a --synchronous option to lldb-mi to facilitate reliable testing.

Patch by Alexander Polyakov!

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

Modified:
lldb/trunk/tools/lldb-mi/MICmnResources.cpp
lldb/trunk/tools/lldb-mi/MICmnResources.h
lldb/trunk/tools/lldb-mi/MIDriver.cpp
lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp

Modified: lldb/trunk/tools/lldb-mi/MICmnResources.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnResources.cpp?rev=333140&r1=333139&r2=333140&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmnResources.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnResources.cpp Wed May 23 16:33:50 2018
@@ -110,6 +110,8 @@ const CMICmnResources::SRsrcTextData
 {IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file "
 "path to the executable i.e. '\"C:\\My "
 "Dev\\foo.exe\"'."},
+{IDE_MI_APP_ARG_SYNCHRONOUS, "--synchronous\n\tBlock until each 
command "
+ "has finished executing.\n\tUsed for 
testing only."},
 {IDS_STDIN_ERR_INVALID_PROMPT,
  "Stdin. Invalid prompt description '%s'"},
 {IDS_STDIN_ERR_THREAD_CREATION_FAILED,

Modified: lldb/trunk/tools/lldb-mi/MICmnResources.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnResources.h?rev=333140&r1=333139&r2=333140&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmnResources.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnResources.h Wed May 23 16:33:50 2018
@@ -77,6 +77,7 @@ enum {
   IDE_MI_APP_ARG_APP_LOG_DIR,
   IDE_MI_APP_ARG_EXAMPLE,
   IDE_MI_APP_ARG_EXECUTABLE,
+  IDE_MI_APP_ARG_SYNCHRONOUS,
 
   IDS_STDIN_ERR_INVALID_PROMPT,
   IDS_STDIN_ERR_THREAD_CREATION_FAILED,

Modified: lldb/trunk/tools/lldb-mi/MIDriver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIDriver.cpp?rev=333140&r1=333139&r2=333140&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIDriver.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MIDriver.cpp Wed May 23 16:33:50 2018
@@ -382,6 +382,7 @@ lldb::SBError CMIDriver::DoParseArgs(con
 //  that are only handled by *this driver:
 //  --executable 
 //  --source  or -s 
+//  --synchronous
 //  The application's options --interpreter and --executable in code 
act
 //  very similar.
 //  The --executable is necessary to differentiate whether the MI 
Driver
@@ -397,6 +398,7 @@ lldb::SBError CMIDriver::DoParseArgs(con
 //  argument for a debug session. Using --interpreter on the command
 //  line does not
 //  issue additional commands to initialise a debug session.
+//  Option --synchronous disables an asynchronous mode in the lldb-mi 
driver.
 // Type:Overridden.
 // Args:argc- (R)   An integer that contains the count of arguments
 // that follow in
@@ -469,6 +471,8 @@ lldb::SBError CMIDriver::ParseArgs(const
 // command line
   { // See fn description.
 bHaveExecutableLongOption = true;
+  } else if (strArg.compare("--synchronous") == 0) {
+CMICmnLLDBDebugSessionInfo::Instance().GetDebugger().SetAsync(false);
   }
 }
   }

Modified: lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp?rev=333140&r1=333139&r2=333140&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp Wed May 23 16:33:50 2018
@@ -640,6 +640,7 @@ CMIUtilString CMIDriverMgr::GetHelpOnCmd
   MIRSRC(IDE_MI_APP_ARG_VERSION), MIRSRC(IDE_MI_APP_ARG_VERSION_LONG),
   MIRSRC(IDE_MI_APP_ARG_INTERPRETER), MIRSRC(IDE_MI_APP_ARG_SOURCE),
   MIRSRC(IDE_MI_APP_ARG_EXECUTEABLE),
+  MIRSRC(IDE_MI_APP_ARG_SYNCHRONOUS),
   CMIUtilString::Format(
   MIRSRC(IDE_MI_APP_ARG_APP_LOG),
   CMICmnLogMediumFile::Instance().GetFileName().c_str()),


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


[Lldb-commits] [lldb] r333205 - [lldb-mi] Add possibility to set breakpoints without selecting a target.

2018-05-24 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu May 24 09:45:59 2018
New Revision: 333205

URL: http://llvm.org/viewvc/llvm-project?rev=333205&view=rev
Log:
[lldb-mi] Add possibility to set breakpoints without selecting a target.

Now it's possible to set breakpoints before selecting a target, they
will be set to the dummy target and then copied to an each added one.

Patch by Alexander Polyakov!

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

Added:
lldb/trunk/lit/tools/
lldb/trunk/lit/tools/lldb-mi/
lldb/trunk/lit/tools/lldb-mi/breakpoint/
lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/
lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c
lldb/trunk/lit/tools/lldb-mi/breakpoint/lit.local.cfg
Modified:
lldb/trunk/lit/lit.cfg
lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=333205&r1=333204&r2=333205&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Thu May 24 09:45:59 2018
@@ -58,6 +58,8 @@ debugserver = lit.util.which('debugserve
 lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
config.test_source_root)
 
+lldbmi = lit.util.which('lldb-mi', lldb_tools_dir)
+
 if not os.path.exists(config.cc):
 config.cc = lit.util.which(config.cc, config.environment['PATH'])
 
@@ -79,6 +81,7 @@ if platform.system() in ['Darwin']:
 config.substitutions.append(('%cc', config.cc))
 config.substitutions.append(('%cxx', config.cxx))
 
+config.substitutions.append(('%lldbmi', lldbmi + " --synchronous"))
 config.substitutions.append(('%lldb', lldb))
 
 if debugserver is not None:

Added: lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test?rev=333205&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test (added)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test Thu May 24 
09:45:59 2018
@@ -0,0 +1,15 @@
+# RUN: %cc %p/inputs/break-insert.c -g
+# RUN: %lldbmi < %s | FileCheck %s
+
+# Test that a breakpoint can be inserted before creating a target.
+
+-break-insert breakpoint
+# CHECK: ^done,bkpt={number="1"
+
+-file-exec-and-symbols a.out
+# CHECK: ^done
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+

Added: lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c?rev=333205&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c (added)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c Thu May 24 
09:45:59 2018
@@ -0,0 +1,7 @@
+int breakpoint() { // Breakpoint will be set here.
+  return 0;
+}
+
+int main() {
+  return breakpoint();
+}

Added: lldb/trunk/lit/tools/lldb-mi/breakpoint/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/lit.local.cfg?rev=333205&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/lit.local.cfg (added)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/lit.local.cfg Thu May 24 09:45:59 
2018
@@ -0,0 +1 @@
+config.suffixes = ['.test']

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp?rev=333205&r1=333204&r2=333205&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Thu May 24 09:45:59 2018
@@ -148,6 +148,11 @@ bool CMICmdCmdBreakInsert::Execute() {
   CMICMDBASE_GETOPTION(pArgRestrictBrkPtToThreadId, OptionShort,
m_constStrArgNamedRestrictBrkPtToThreadId);
 
+  // Ask LLDB for the target to check if we have valid or dummy one.
+  CMICmnLLDBDebugSessionInfo &rSessionInfo(
+  CMICmnLLDBDebugSessionInfo::Instance());
+  lldb::SBTarget sbTarget = rSessionInfo.GetTarget();
+
   m_bBrkPtEnabled = !pArgDisableBrkPt->GetFound();
   m_bBrkPtIsTemp = pArgTempBrkPt->GetFound();
   m_bHaveArgOptionThreadGrp = pArgThreadGroup->GetFound();
@@ -157,7 +162,12 @@ bool CMICmdCmdBreakInsert::Execute() {
 nThreadGrp);
 m_strArgOptionThreadGrp = CMIUtilString::Format("i%d", nThreadGrp);
   }
-  m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
+
+  if (sbTarget == rSessionInfo.GetDebugger().GetDummyTarget())
+m_bBrkPtIsPending = true;
+  else
+m_bBrkPtIsPending = pArgPen

[Lldb-commits] [lldb] r333248 - HostInfoMacOSX: Support finding the clang resource directory within CLTools.

2018-05-24 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu May 24 17:29:01 2018
New Revision: 333248

URL: http://llvm.org/viewvc/llvm-project?rev=333248&view=rev
Log:
HostInfoMacOSX: Support finding the clang resource directory within CLTools.

rdar://problem/40537961

Modified:
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/unittests/Host/HostInfoTest.cpp

Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=333248&r1=333247&r2=333248&view=diff
==
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Thu May 24 17:29:01 2018
@@ -271,7 +271,7 @@ bool HostInfoMacOSX::ComputeClangDirecto
   auto parent = std::next(rev_it);
   if (parent != r_end && *parent == "SharedFrameworks") {
 // This is the top-level LLDB in the Xcode.app bundle.
-// e.g., "Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A"
+// E.g., "Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A"
 raw_path.resize(parent - r_end);
 llvm::sys::path::append(clang_path, raw_path,
 "Developer/Toolchains/XcodeDefault.xctoolchain",
@@ -282,17 +282,21 @@ bool HostInfoMacOSX::ComputeClangDirecto
 }
   } else if (parent != r_end && *parent == "PrivateFrameworks" &&
  std::distance(parent, r_end) > 2) {
-// This is LLDB inside an Xcode toolchain.
-// e.g., "Xcode.app/Contents/Developer/Toolchains/" \
-//   "My.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework"
 ++parent;
 ++parent;
-raw_path.resize(parent - r_end);
-llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
-if (!verify || VerifyClangPath(clang_path)) {
-  file_spec.SetFile(clang_path.c_str(), true);
-  return true;
+if (*parent == "System") {
+  // This is LLDB inside an Xcode toolchain.
+  // E.g., "Xcode.app/Contents/Developer/Toolchains/"   \
+  //   "My.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework"
+  raw_path.resize(parent - r_end);
+  llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
+  if (!verify || VerifyClangPath(clang_path)) {
+file_spec.SetFile(clang_path.c_str(), true);
+return true;
+  }
+  raw_path = lldb_shlib_spec.GetPath();
 }
+raw_path.resize(rev_it - r_end);
   } else {
 raw_path.resize(rev_it - r_end);
   }

Modified: lldb/trunk/unittests/Host/HostInfoTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/HostInfoTest.cpp?rev=333248&r1=333247&r2=333248&view=diff
==
--- lldb/trunk/unittests/Host/HostInfoTest.cpp (original)
+++ lldb/trunk/unittests/Host/HostInfoTest.cpp Thu May 24 17:29:01 2018
@@ -90,6 +90,14 @@ TEST_F(HostInfoTest, MacOSX) {
   "Swift-4.1-development-snapshot.xctoolchain/usr/lib/swift/clang";
   EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(toolchain), toolchain_clang);
 
+  std::string cltools = "/Library/Developer/CommandLineTools/Library/"
+"PrivateFrameworks/LLDB.framework";
+  std::string cltools_clang =
+  "/Library/Developer/CommandLineTools/Library/PrivateFrameworks/"
+  "LLDB.framework/Resources/Clang";
+  EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(cltools), cltools_clang);
+
+
   // Test that a bogus path is detected.
   EXPECT_NE(HostInfoMacOSXTest::ComputeClangDir(GetInputFilePath(xcode), true),
 HostInfoMacOSXTest::ComputeClangDir(GetInputFilePath(xcode)));


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


Re: [Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Adrian Prantl via lldb-commits


> On Jun 12, 2018, at 9:08 AM, Adrian Prantl via Phabricator 
>  wrote:
> 
> aprantl added a comment.
> 
> Hmm.. @lemo 's reasoning

What I was going to say here: Just from looking at the API documentation, it 
looks like default arguments are mapped into Python by SWIG, so there doesn't 
seem to be an additional cost to having default arguments. But maybe I'm 
missing something.

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


[Lldb-commits] [lldb] r334614 - Fix/unify the spelling of Objective-C.

2018-06-13 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Jun 13 09:21:24 2018
New Revision: 334614

URL: http://llvm.org/viewvc/llvm-project?rev=334614&view=rev
Log:
Fix/unify the spelling of Objective-C.

Modified:
lldb/trunk/CODE_OWNERS.txt
lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp
lldb/trunk/include/lldb/lldb-enumerations.h

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Host/macosx/objcxx/HostInfoMacOSX.mm
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/www/index.html
lldb/trunk/www/lldb-gdb.html
lldb/trunk/www/status.html
lldb/trunk/www/tutorial.html

Modified: lldb/trunk/CODE_OWNERS.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CODE_OWNERS.txt?rev=334614&r1=334613&r2=334614&view=diff
==
--- lldb/trunk/CODE_OWNERS.txt (original)
+++ lldb/trunk/CODE_OWNERS.txt Wed Jun 13 09:21:24 2018
@@ -17,7 +17,7 @@ D: Build scripts, Test suite, Platform,
 N: Jim Ingham
 E: jing...@apple.com
 D: Overall LLDB architecture, Thread plans, Expression parser, ValueObject, 
Breakpoints, ABI
-D: Watchpoints, Trampolines, Target, Command Interpreter, C++ / Objective C 
Language runtime
+D: Watchpoints, Trampolines, Target, Command Interpreter, C++ / Objective-C 
Language runtime
 D: Expression evaluator, IR interpreter, Clang integration
 D: Data Formatters
 

Modified: lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp?rev=334614&r1=334613&r2=334614&view=diff
==
--- lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp (original)
+++ lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp Wed Jun 13 09:21:24 
2018
@@ -410,7 +410,7 @@ public:
   m_sort_type = eSortTypeBytes;
 }
 if (print && m_size > 0) {
-  puts("Objective C objects by total bytes:");
+  puts("Objective-C objects by total bytes:");
   puts("Total Bytes Class Name");
   puts("--- "

"-");
@@ -427,7 +427,7 @@ public:
   m_sort_type = eSortTypeCount;
 }
 if (print && m_size > 0) {
-  puts("Objective C objects by total count:");
+  puts("Objective-C objects by total count:");
   puts("CountClass Name");
   puts(" "

"-");

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=334614&r1=334613&r2=334614&view=diff
==
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Wed Jun 13 09:21:24 2018
@@ -626,7 +626,7 @@ enum SectionType {
   eSectionTypeDebug,
   eSectionTypeZeroFill,
   eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector
-  eSectionTypeDataObjCCFStrings, // Objective C const CFString/NSString objects
+  eSectionTypeDataObjCCFStrings, // Objective-C const CFString/NSString objects
   eSectionTypeDWARFDebugAbbrev,
   eSectionTypeDWARFDebugAddr,
   eSectionTypeDWARFDebugAranges,

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py?rev=334614&r1=334613&r2=334614&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
 Wed Jun 13 09:21:24 2018
@@ -22,7 +22,7 @@ class TestObjCBreakpoints(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 def test_break(self):
-"""Test setting Objective C specific breakpoints (DWARF in .o 
files)."""
+"""Test setting Objective-C specific breakpoints (DWARF in .o 
files)."""
 self.build()
 self

[Lldb-commits] [lldb] r335386 - Mark this test as no debuginfo

2018-06-22 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri Jun 22 13:26:53 2018
New Revision: 335386

URL: http://llvm.org/viewvc/llvm-project?rev=335386&view=rev
Log:
Mark this test as no debuginfo

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=335386&r1=335385&r2=335386&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Fri Jun 22 13:26:53 2018
@@ -14,7 +14,7 @@ from lldbsuite.test import lldbutil
 
 
 class HelloWorldTestCase(TestBase):
-
+NO_DEBUG_INFO_TESTCASE = True
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):


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


Re: [Lldb-commits] Adding a test for split-dwarf

2018-06-26 Thread Adrian Prantl via lldb-commits
We just use reviews.llvm.org  and CC lldb-commits.

-- adrian

> On Jun 25, 2018, at 9:09 PM, Puyan Lotfi via lldb-commits 
>  wrote:
> 
> This is a first draft. Just trying to do some basic breakpoint and line 
> number checks on a split dwarf compiled binary for now.
> 
> 
> Also, is there an LLDB phabricator? I didn't notice it in the project listing 
> in reviews.llvm.org .
> 
> PL
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r339828 - Add libc++ data formatters for std::optional.

2018-08-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Aug 15 15:48:48 2018
New Revision: 339828

URL: http://llvm.org/viewvc/llvm-project?rev=339828&view=rev
Log:
Add libc++ data formatters for std::optional.

Patch by Shafik Yaghmour!

This reapplies an earlier version after addressing some post-commit feedback.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/optional/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/optional/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/optional/TestDataFormatterLibcxxOptional.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/optional/main.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=339828&r1=339827&r2=339828&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Aug 15 15:48:48 2018
@@ -390,6 +390,7 @@
945261C11B9A11FC00BF138D /* LibCxxInitializerList.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 945261B71B9A11E800BF138D /* 
LibCxxInitializerList.cpp */; };
945261C21B9A11FC00BF138D /* LibCxxList.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 945261B81B9A11E800BF138D /* LibCxxList.cpp */; };
945261C31B9A11FC00BF138D /* LibCxxMap.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 945261B91B9A11E800BF138D /* LibCxxMap.cpp */; };
+   E4A63A9120F55D28000D9548 /* LibCxxOptional.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = E4A63A9020F55D27000D9548 /* LibCxxOptional.cpp 
*/; };
AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */; 
};
AF9FF1F51FAA79A400474976 /* LibCxxTuple.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */; 
};
945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 945261BA1B9A11E800BF138D /* 
LibCxxUnorderedMap.cpp */; };
@@ -2010,6 +2011,7 @@
945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
LibCxxInitializerList.cpp; path = Language/CPlusPlus/LibCxxInitializerList.cpp; 
sourceTree = ""; };
945261B81B9A11E800BF138D /* LibCxxList.cpp */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
LibCxxList.cpp; path = Language/CPlusPlus/LibCxxList.cpp; sourceTree = 
""; };
945261B91B9A11E800BF138D /* LibCxxMap.cpp */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxMap.cpp; 
path = Language/CPlusPlus/LibCxxMap.cpp; sourceTree = ""; };
+   E4A63A9020F55D27000D9548 /* LibCxxOptional.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxOptional.cpp; path = Language/CPlusPlus/LibCxxOptional.cpp; 
sourceTree = ""; };
AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxQueue.cpp; path = Language/CPlusPlus/LibCxxQueue.cpp; sourceTree = 
""; };
AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxTuple.cpp; path = Language/CPlusPlus/LibCxxTuple.cpp; sourceTree = 
""; };
945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
LibCxxUnorderedMap.cpp; path = Language/CPlusPlus/LibCxxUnorderedMap.cpp; 
sourceTree = ""; };
@@ -6374,6 +6376,7 @@
945261B71B9A11E800BF138D /* 
LibCxxInitializerList.cpp */,
945261B81B9A11E800BF138D /* LibCxxList.cpp */,
945261B91B9A11E800BF138D /* LibCxxMap.cpp */,
+   E4A63A9020F55D27000D9548 /* LibCxxOptional.cpp 
*/,
AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */,
AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */,
 

Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits
After reading through the code in TestVSCode_attach.py I see that there are 
lots of commands with a 1s timeout. I would not be surprised if that is too 
small for running on a bot, which is by definition under extreme load. Do you 
think increasing the timeouts would help?

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits


> On Aug 17, 2018, at 10:35 AM, Greg Clayton  wrote:
> 
> I can expectedFail this test if needed?

I'm afraid it looks like that won't be good enough. I just had to manually log 
into the build node and kill TestVSCode_variables.py, too, because it was 
hanging indefinitely. We either need to figure out what is going with these 
tests or skip them on Darwin entirely. 

-- adrian

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits
Here's the output from attach:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9017/testReport/lldb-Suite/tools_lldb-vscode_attach/TestVSCode_attach_py

> On Aug 17, 2018, at 11:32 AM, Adrian Prantl via lldb-commits 
>  wrote:
> 
> 
> 
>> On Aug 17, 2018, at 10:35 AM, Greg Clayton  wrote:
>> 
>> I can expectedFail this test if needed?
> 
> I'm afraid it looks like that won't be good enough. I just had to manually 
> log into the build node and kill TestVSCode_variables.py, too, because it was 
> hanging indefinitely. We either need to figure out what is going with these 
> tests or skip them on Darwin entirely. 
> 
> -- adrian
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits
Here's a third failure:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9021/console

==
FAIL: test_commands (TestVSCode_launch.TestVSCode_launch)
--
Traceback (most recent call last):
  File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/decorators.py",
 line 341, in wrapper
return func(self, *args, **kwargs)
  File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py",
 line 317, in test_commands
self.verify_commands('stopCommands', output, stopCommands)
  File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py",
 line 115, in verify_commands
cmd, flavor))
AssertionError: False is not True : verify 'frame variable' found in console 
output for 'stopCommands'
Config=x86_64-/Users/buildslave/jenkins/workspace/lldb-cmake/build/bin/clang-8
--
Ran 11 tests in 13.143s

RESULT: FAILED (10 passes, 1 failures, 0 errors, 0 skipped, 0 expected 
failures, 0 unexpected successes)

Do you have access to a Mac to reproduce these failures?

-- adrian

> On Aug 17, 2018, at 11:33 AM, Adrian Prantl  wrote:
> 
> Here's the output from attach:
> 
> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9017/testReport/lldb-Suite/tools_lldb-vscode_attach/TestVSCode_attach_py
> 
>> On Aug 17, 2018, at 11:32 AM, Adrian Prantl via lldb-commits 
>>  wrote:
>> 
>> 
>> 
>>> On Aug 17, 2018, at 10:35 AM, Greg Clayton  wrote:
>>> 
>>> I can expectedFail this test if needed?
>> 
>> I'm afraid it looks like that won't be good enough. I just had to manually 
>> log into the build node and kill TestVSCode_variables.py, too, because it 
>> was hanging indefinitely. We either need to figure out what is going with 
>> these tests or skip them on Darwin entirely. 
>> 
>> -- adrian
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits

On Aug 17, 2018, at 1:44 PM, Greg Clayton  wrote:

> I run everything on a mac and there are no failures on my machine. 
> Can you find out exactly how the test suite is invoked so I can try to 
> reproduce?

You can find the exact invocation in the build logs:

cmake /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm 
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON 
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON 
-DCMAKE_INSTALL_PREFIX=/Users/buildslave/jenkins/workspace/lldb-cmake/results/lldb
 
'-DLLDB_TEST_USER_ARGS=--arch;x86_64;--build-dir;/Users/buildslave/jenkins/workspace/lldb-cmake/build/lldb-test-build.noindex;--session-file-format;fm;-s=/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs;--rerun-all-issues;--env;TERM=vt100'
 
'-DLLVM_LIT_ARGS=--xunit-xml-output=/Users/buildslave/jenkins/workspace/lldb-cmake/test/results.xml
 -v' -G Ninja

ninja

env TERM=vt100 ninja -v check-lldb

This is running on a 2013 Mac Pro with 24 threads on 10.13.5 with Xcode 9.2.

-- adrian


> 
>> On Aug 17, 2018, at 1:39 PM, Adrian Prantl  wrote:
>> 
>> Here's a third failure:
>> 
>> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9021/console
>> 
>> ==
>> FAIL: test_commands (TestVSCode_launch.TestVSCode_launch)
>> --
>> Traceback (most recent call last):
>> File 
>> "/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/decorators.py",
>>  line 341, in wrapper
>>   return func(self, *args, **kwargs)
>> File 
>> "/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py",
>>  line 317, in test_commands
>>   self.verify_commands('stopCommands', output, stopCommands)
>> File 
>> "/Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py",
>>  line 115, in verify_commands
>>   cmd, flavor))
>> AssertionError: False is not True : verify 'frame variable' found in console 
>> output for 'stopCommands'
>> Config=x86_64-/Users/buildslave/jenkins/workspace/lldb-cmake/build/bin/clang-8
>> --
>> Ran 11 tests in 13.143s
>> 
>> RESULT: FAILED (10 passes, 1 failures, 0 errors, 0 skipped, 0 expected 
>> failures, 0 unexpected successes)
>> 
>> Do you have access to a Mac to reproduce these failures?
>> 
>> -- adrian
>> 
>>> On Aug 17, 2018, at 11:33 AM, Adrian Prantl  wrote:
>>> 
>>> Here's the output from attach:
>>> 
>>> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9017/testReport/lldb-Suite/tools_lldb-vscode_attach/TestVSCode_attach_py
>>> 
>>>> On Aug 17, 2018, at 11:32 AM, Adrian Prantl via lldb-commits 
>>>>  wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Aug 17, 2018, at 10:35 AM, Greg Clayton  wrote:
>>>>> 
>>>>> I can expectedFail this test if needed?
>>>> 
>>>> I'm afraid it looks like that won't be good enough. I just had to manually 
>>>> log into the build node and kill TestVSCode_variables.py, too, because it 
>>>> was hanging indefinitely. We either need to figure out what is going with 
>>>> these tests or skip them on Darwin entirely. 
>>>> 
>>>> -- adrian
>>>> 
>>>> ___
>>>> lldb-commits mailing list
>>>> lldb-commits@lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>> 
>> 
> 

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits


> On Aug 17, 2018, at 1:49 PM, Adrian Prantl  wrote:
> 
> 
> On Aug 17, 2018, at 1:44 PM, Greg Clayton  wrote:
> 
>> I run everything on a mac and there are no failures on my machine. 
>> Can you find out exactly how the test suite is invoked so I can try to 
>> reproduce?
> 
> You can find the exact invocation in the build logs:
> 
> cmake /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm 
> -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON 
> -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 
> -DCMAKE_INSTALL_PREFIX=/Users/buildslave/jenkins/workspace/lldb-cmake/results/lldb
>  
> '-DLLDB_TEST_USER_ARGS=--arch;x86_64;--build-dir;/Users/buildslave/jenkins/workspace/lldb-cmake/build/lldb-test-build.noindex;--session-file-format;fm;-s=/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs;--rerun-all-issues;--env;TERM=vt100'
>  
> '-DLLVM_LIT_ARGS=--xunit-xml-output=/Users/buildslave/jenkins/workspace/lldb-cmake/test/results.xml
>  -v' -G Ninja
> 
> ninja
> 
> env TERM=vt100 ninja -v check-lldb
> 
> This is running on a 2013 Mac Pro with 24 threads on 10.13.5 with Xcode 9.2.

I would not be surprised if the fact that lit launches 24 jobs simultaneously 
is significant for reproducing the issue; it does look like some sort of 
synchronization bug that may need a really loaded machine to trigger.

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits
We really need to do *something*. Normally our lldb-cmake bot churns out a 
fresh run every 10 minutes, now it is timing out after 1.5 hours:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9021/consoleFull#console-section-10
Build timed out (after 90 minutes). Marking the build as aborted.
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/buildTimeTrend

Until we figured this out, would you mind setting all tests that use the 
vs_code shim to skipIfDarwin?

I'm happy to help you with collecting additional diagnostics, also feel free to 
enable them again if you want to test a fix. I can also run commands for you 
directly on the bot if that helps.

-- adrian


> On Aug 17, 2018, at 1:52 PM, Adrian Prantl  wrote:
> 
> 
> 
>> On Aug 17, 2018, at 1:49 PM, Adrian Prantl  wrote:
>> 
>> 
>> On Aug 17, 2018, at 1:44 PM, Greg Clayton  wrote:
>> 
>>> I run everything on a mac and there are no failures on my machine. 
>>> Can you find out exactly how the test suite is invoked so I can try to 
>>> reproduce?
>> 
>> You can find the exact invocation in the build logs:
>> 
>> cmake /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm 
>> -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON 
>> -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 
>> -DCMAKE_INSTALL_PREFIX=/Users/buildslave/jenkins/workspace/lldb-cmake/results/lldb
>>  
>> '-DLLDB_TEST_USER_ARGS=--arch;x86_64;--build-dir;/Users/buildslave/jenkins/workspace/lldb-cmake/build/lldb-test-build.noindex;--session-file-format;fm;-s=/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs;--rerun-all-issues;--env;TERM=vt100'
>>  
>> '-DLLVM_LIT_ARGS=--xunit-xml-output=/Users/buildslave/jenkins/workspace/lldb-cmake/test/results.xml
>>  -v' -G Ninja
>> 
>> ninja
>> 
>> env TERM=vt100 ninja -v check-lldb
>> 
>> This is running on a 2013 Mac Pro with 24 threads on 10.13.5 with Xcode 9.2.
> 
> I would not be surprised if the fact that lit launches 24 jobs simultaneously 
> is significant for reproducing the issue; it does look like some sort of 
> synchronization bug that may need a really loaded machine to trigger.
> 
> -- adrian

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


Re: [Lldb-commits] [lldb] r339911 - Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

2018-08-17 Thread Adrian Prantl via lldb-commits
Thanks! Do let me know if I can help you with figuring this out.

-- adrian

> On Aug 17, 2018, at 5:34 PM, Greg Clayton  wrote:
> 
> $ svn commit
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/attach/TestVSCode_attach.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/TestVSCode_setFunctionBreakpoints.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/stackTrace/TestVSCode_stackTrace.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py
> Sending
> packages/Python/lldbsuite/test/tools/lldb-vscode/variables/TestVSCode_variables.py
> Transmitting file data done
> Committing transaction...
> Committed revision 340112.
> 
> 
>> On Aug 17, 2018, at 3:43 PM, Adrian Prantl > > wrote:
>> 
>> We really need to do *something*. Normally our lldb-cmake bot churns out a 
>> fresh run every 10 minutes, now it is timing out after 1.5 hours:
>> 
>> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/9021/consoleFull#console-section-10
>>  
>> 
>> Build timed out (after 90 minutes). Marking the build as aborted.
>> http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/buildTimeTrend
>> 
>> Until we figured this out, would you mind setting all tests that use the 
>> vs_code shim to skipIfDarwin?
>> 
>> I'm happy to help you with collecting additional diagnostics, also feel free 
>> to enable them again if you want to test a fix. I can also run commands for 
>> you directly on the bot if that helps.
>> 
>> -- adrian
>> 
>> 
>>> On Aug 17, 2018, at 1:52 PM, Adrian Prantl  wrote:
>>> 
>>> 
>>> 
 On Aug 17, 2018, at 1:49 PM, Adrian Prantl  wrote:
 
 
 On Aug 17, 2018, at 1:44 PM, Greg Clayton  wrote:
 
> I run everything on a mac and there are no failures on my machine. 
> Can you find out exactly how the test suite is invoked so I can try to 
> reproduce?
 
 You can find the exact invocation in the build logs:
 
 cmake /Users/buildslave/jenkins/workspace/lldb-cmake/src/llvm 
 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON 
 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 
 -DCMAKE_INSTALL_PREFIX=/Users/buildslave/jenkins/workspace/lldb-cmake/results/lldb
  
 '-DLLDB_TEST_USER_ARGS=--arch;x86_64;--build-dir;/Users/buildslave/jenkins/workspace/lldb-cmake/build/lldb-test-build.noindex;--session-file-format;fm;-s=/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs;--rerun-all-issues;--env;TERM=vt100'
  
 '-DLLVM_LIT_ARGS=--xunit-xml-output=/Users/buildslave/jenkins/workspace/lldb-cmake/test/results.xml
  -v' -G Ninja
 
 ninja
 
 env TERM=vt100 ninja -v check-lldb
 
 This is running on a 2013 Mac Pro with 24 threads on 10.13.5 with Xcode 
 9.2.
>>> 
>>> I would not be surprised if the fact that lit launches 24 jobs 
>>> simultaneously is significant for reproducing the issue; it does look like 
>>> some sort of synchronization bug that may need a really loaded machine to 
>>> trigger.
>>> 
>>> -- adrian
>> 
> 

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


[Lldb-commits] [lldb] r340218 - Set path to sanitizer runtime when running tests through LIT on macOS.

2018-08-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Aug 20 15:00:31 2018
New Revision: 340218

URL: http://llvm.org/viewvc/llvm-project?rev=340218&view=rev
Log:
Set path to sanitizer runtime when running tests through LIT on macOS.

rdar://problem/42984739

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

Modified:
lldb/trunk/lit/Suite/lit.cfg
lldb/trunk/lit/Suite/lit.site.cfg.in

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=340218&r1=340217&r2=340218&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Mon Aug 20 15:00:31 2018
@@ -19,6 +19,19 @@ config.test_source_root = os.path.join(c
'Python', 'lldbsuite', 'test')
 config.test_exec_root = config.test_source_root
 
+# macOS flags needed for LLDB built with address sanitizer.
+if 'Address' in config.llvm_use_sanitizer and \
+   'Darwin' in config.host_os and \
+   'x86' in config.host_triple:
+  import subprocess
+  resource_dir = subprocess.check_output(
+config.cmake_cxx_compiler +' -print-resource-dir', shell=True).strip()
+  runtime = os.path.join(resource_dir, 'lib', 'darwin',
+ 'libclang_rt.asan_osx_dynamic.dylib')
+  config.environment['ASAN_OPTIONS'] = \
+'detect_stack_use_after_return=1:container_overflow=0'
+  config.environment['DYLD_INSERT_LIBRARIES'] = runtime
+
 # Build dotest command.
 dotest_cmd = [config.dotest_path, '-q']
 dotest_cmd.extend(config.dotest_args_str.split(';'))

Modified: lldb/trunk/lit/Suite/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.site.cfg.in?rev=340218&r1=340217&r2=340218&view=diff
==
--- lldb/trunk/lit/Suite/lit.site.cfg.in (original)
+++ lldb/trunk/lit/Suite/lit.site.cfg.in Mon Aug 20 15:00:31 2018
@@ -9,6 +9,10 @@ config.llvm_build_mode = "@LLVM_BUILD_MO
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
+config.cmake_cxx_compiler = "@CMAKE_CXX_COMPILER@"
+config.host_os = "@HOST_OS@"
+config.host_triple = "@LLVM_HOST_TRIPLE@"
+config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"


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


[Lldb-commits] [lldb] r340219 - Reflow comments

2018-08-20 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Aug 20 15:00:32 2018
New Revision: 340219

URL: http://llvm.org/viewvc/llvm-project?rev=340219&view=rev
Log:
Reflow comments

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340219&r1=340218&r2=340219&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Mon Aug 20 15:00:32 2018
@@ -44,9 +44,9 @@ class LLDBTest(TestFormat):
 return (lit.Test.UNSUPPORTED, 'Test is unsupported')
 
 testPath, testFile = os.path.split(test.getSourcePath())
-# On Windows, the system does not always correctly interpret shebang 
lines.
-# To make sure we can execute the tests, add python exe as the first 
parameter
-# of the command.
+# On Windows, the system does not always correctly interpret
+# shebang lines.  To make sure we can execute the tests, add
+# python exe as the first parameter of the command.
 cmd = [sys.executable] + self.dotest_cmd + [testPath, '-p', testFile]
 
 try:


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


[Lldb-commits] [lldb] r340286 - Makefile.rules: Use an absolute path to the module cache directory.

2018-08-21 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Aug 21 08:46:15 2018
New Revision: 340286

URL: http://llvm.org/viewvc/llvm-project?rev=340286&view=rev
Log:
Makefile.rules: Use an absolute path to the module cache directory.

This change is NFC, but it makes it more obvious in log files what happened.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=340286&r1=340285&r2=340286&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Aug 21 
08:46:15 2018
@@ -29,6 +29,7 @@
 # SHELL = /bin/sh -x
 
 SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST)))/
+BUILDDIR := $(shell pwd)
 THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/
 LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
 
@@ -239,7 +240,7 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
 endif
 
-CLANG_MODULE_CACHE_DIR := module-cache
+CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
 
 MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules 
-fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
 


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


[Lldb-commits] [lldb] r340293 - lldbtest.py: Unconditionally set the clang module cache path.

2018-08-21 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Tue Aug 21 09:13:37 2018
New Revision: 340293

URL: http://llvm.org/viewvc/llvm-project?rev=340293&view=rev
Log:
lldbtest.py: Unconditionally set the clang module cache path.

This should fix the errors observable on the new lldb-cmake bot.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=340293&r1=340292&r2=340293&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Tue Aug 21 09:13:37 
2018
@@ -1880,18 +1880,15 @@ class TestBase(Base):
 # decorators.
 Base.setUp(self)
 
-if self.child:
-# Set the clang modules cache path.
-assert(self.getDebugInfo() == 'default')
-mod_cache = os.path.join(self.getBuildDir(), "module-cache")
-self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
-% mod_cache)
-
-# Disable Spotlight lookup. The testsuite creates
-# different binaries with the same UUID, because they only
-# differ in the debug info, which is not being hashed.
-self.runCmd('settings set symbols.enable-external-lookup false')
+# Set the clang modules cache path.
+mod_cache = os.path.join(self.getBuildDir(), "module-cache-lldb")
+self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
+% mod_cache)
 
+# Disable Spotlight lookup. The testsuite creates
+# different binaries with the same UUID, because they only
+# differ in the debug info, which is not being hashed.
+self.runCmd('settings set symbols.enable-external-lookup false')
 
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py?rev=340293&r1=340292&r2=340293&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py 
Tue Aug 21 09:13:37 2018
@@ -95,7 +95,8 @@ class DarwinNSLogOutputTestCase(TestBase
 self.expect(re.compile(r"stop reason = breakpoint"))
 
 def runCmd(self, cmd):
-self.child.sendline(cmd)
+if self.child:
+self.child.sendline(cmd)
 
 def expect_prompt(self, exactly=True):
 self.expect(self.child_prompt, exactly=exactly)


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


[Lldb-commits] [lldb] r340543 - Add libc++ data formatter for std::function

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 10:02:39 2018
New Revision: 340543

URL: http://llvm.org/viewvc/llvm-project?rev=340543&view=rev
Log:
Add libc++ data formatter for std::function

- Added LibcxxFunctionSummaryProvider
- Removed LibcxxFunctionFrontEnd
- Modified data formatter tests to test new summary functionality

Patch by Shafik Yaghmour!

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py?rev=340543&r1=340542&r2=340543&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
 Thu Aug 23 10:02:39 2018
@@ -40,13 +40,17 @@ class LibCxxFunctionTestCase(TestBase):
 substrs=['stopped',
  'stop reason = breakpoint'])
 
-f1 = self.get_variable('f1')
-f2 = self.get_variable('f2')
+self.expect("frame variable f1",
+substrs=['f1 =  Function = foo(int, int)'])
 
-if self.TraceOn():
-print(f1)
-if self.TraceOn():
-print(f2)
+self.expect("frame variable f2",
+substrs=['f2 =  Lambda in File main.cpp at Line 27'])
 
-self.assertTrue(f1.GetValueAsUnsigned(0) != 0, 'f1 has a valid value')
-self.assertTrue(f2.GetValueAsUnsigned(0) != 0, 'f2 has a valid value')
+self.expect("frame variable f3",
+substrs=['f3 =  Lambda in File main.cpp at Line 31'])
+
+self.expect("frame variable f4",
+substrs=['f4 =  Function in File main.cpp at Line 17'])
+
+self.expect("frame variable f5",
+substrs=['f5 =  Function = Bar::add_num(int) const'])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp?rev=340543&r1=340542&r2=340543&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/main.cpp
 Thu Aug 23 10:02:39 2018
@@ -13,13 +13,28 @@ int foo(int x, int y) {
   return x + y - 1;
 }
 
-int main ()
+struct Bar {
+   int operator()() {
+   return 66 ;
+   }
+   int add_num(int i) const { return i + 3 ; }
+} ;
+
+int main (int argc, char *argv[])
 {
   int acc = 42;
   std::function f1 = foo;
   std::function f2 = [acc,f1] (int x) -> int {
 return x+f1(acc,x);
   };
-return f1(acc,acc) + f2(acc); // Set break point at this line.
-}
 
+  auto f = [](int x, int y) { return x + y; };
+  auto g = [](int x, int y) { return x * y; } ;
+  std::function f3 =  argc %2 ? f : g ;
+
+  Bar bar1 ;
+  std::function f4( bar1 ) ;
+  std::function f5 = &Bar::add_num;
+
+  return f1(acc,acc) + f2(acc) + f3(acc+1,acc+2) + f4() + f5(bar1, 10); // Set 
break point at this line.
+}

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=340543&r1=340542&r2=340543&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Thu Aug 
23 10:02:39 2018
@@ -542,6 +542,11 @@ static void LoadLibCxxFormatters(lldb::T
   ConstString("^(std::__(ndk)?1::)weak_ptr<.+>(( )?&)?$"), stl_synth_flags,
   true);
 
+  AddCXXSummary(
+  cpp_category_sp, lldb_private::formatters::LibcxxFunctionSummaryProvider,
+  "libc++ std::function summary provider",
+  ConstString("^std::__(ndk)?1::function<.+>$"), stl_summary

[Lldb-commits] [lldb] r340548 - lldbtest.py: Work around macOS SIP when testing ASANified builds.

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 10:19:08 2018
New Revision: 340548

URL: http://llvm.org/viewvc/llvm-project?rev=340548&view=rev
Log:
lldbtest.py: Work around macOS SIP when testing ASANified builds.

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340548&r1=340547&r2=340548&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Thu Aug 23 10:19:08 2018
@@ -9,6 +9,14 @@ import lit.TestRunner
 import lit.util
 from lit.formats.base import TestFormat
 
+def getBuildDir(cmd):
+found = False
+for arg in cmd:
+if found:
+return arg
+if arg == '--build-dir':
+found = True
+return None
 
 class LLDBTest(TestFormat):
 def __init__(self, dotest_cmd):
@@ -49,6 +57,18 @@ class LLDBTest(TestFormat):
 # python exe as the first parameter of the command.
 cmd = [sys.executable] + self.dotest_cmd + [testPath, '-p', testFile]
 
+# The macOS system integrity protection (SIP) doesn't allow injecting
+# libraries into system binaries, but this can be worked around by
+# copying the binary into a different location.
+if test.config.environment['DYLD_INSERT_LIBRARIES'] and \
+sys.executable.startswith('/System/'):
+builddir = getBuildDir(cmd)
+assert(builddir)
+copied_python = os.path.join(builddir, 'copied-system-python')
+import shutil
+shutil.copy(sys.executable, os.path.join(builddir, copied_python))
+cmd[0] = copied_python
+
 try:
 out, err, exitCode = lit.util.executeCommand(
 cmd,


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


[Lldb-commits] [lldb] r340550 - XFAIL test for older versions of dsymutil

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 10:30:56 2018
New Revision: 340550

URL: http://llvm.org/viewvc/llvm-project?rev=340550&view=rev
Log:
XFAIL test for older versions of dsymutil

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py?rev=340550&r1=340549&r2=340550&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
Thu Aug 23 10:30:56 2018
@@ -9,6 +9,7 @@ class TestUnicodeSymbols(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'], 
debug_info="dsym")
 def test_union_members(self):
 self.build()
 spec = lldb.SBModuleSpec()


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


[Lldb-commits] [lldb] r340557 - Fix check for dictionary entry

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 10:51:14 2018
New Revision: 340557

URL: http://llvm.org/viewvc/llvm-project?rev=340557&view=rev
Log:
Fix check for dictionary entry

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340557&r1=340556&r2=340557&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Thu Aug 23 10:51:14 2018
@@ -60,7 +60,7 @@ class LLDBTest(TestFormat):
 # The macOS system integrity protection (SIP) doesn't allow injecting
 # libraries into system binaries, but this can be worked around by
 # copying the binary into a different location.
-if test.config.environment['DYLD_INSERT_LIBRARIES'] and \
+if 'DYLD_INSERT_LIBRARIES' in test.config.environment and \
 sys.executable.startswith('/System/'):
 builddir = getBuildDir(cmd)
 assert(builddir)


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


[Lldb-commits] [lldb] r340573 - XFAIL test for older versions of clang

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 14:00:37 2018
New Revision: 340573

URL: http://llvm.org/viewvc/llvm-project?rev=340573&view=rev
Log:
XFAIL test for older versions of clang

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py?rev=340573&r1=340572&r2=340573&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
Thu Aug 23 14:00:37 2018
@@ -9,7 +9,7 @@ class TestUnicodeSymbols(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'], 
debug_info="dsym")
+@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'])
 def test_union_members(self):
 self.build()
 spec = lldb.SBModuleSpec()


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


[Lldb-commits] [lldb] r340574 - Change xfail to skipIf. The exact condition is really difficult to get

2018-08-23 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 23 14:08:30 2018
New Revision: 340574

URL: http://llvm.org/viewvc/llvm-project?rev=340574&view=rev
Log:
Change xfail to skipIf. The exact condition is really difficult to get
right and doesn't add much signal.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py?rev=340574&r1=340573&r2=340574&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py 
Thu Aug 23 14:08:30 2018
@@ -9,7 +9,7 @@ class TestUnicodeSymbols(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'])
+@skipIf(compiler="clang", compiler_version=['<', '7.0'])
 def test_union_members(self):
 self.build()
 spec = lldb.SBModuleSpec()


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


[Lldb-commits] [lldb] r340779 - Fix typo

2018-08-27 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Aug 27 14:46:18 2018
New Revision: 340779

URL: http://llvm.org/viewvc/llvm-project?rev=340779&view=rev
Log:
Fix typo

Modified:
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=340779&r1=340778&r2=340779&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Mon Aug 27 14:46:18 2018
@@ -30,7 +30,7 @@ set(LLDB_TEST_USER_ARGS
   ""
   CACHE STRING "Specify additional arguments to pass to test runner. For 
example: '-C gcc -C clang -A i386 -A x86_64'")
 
-# The .nodindex suffix is a marker for Spotlight to never index the
+# The .noindex suffix is a marker for Spotlight to never index the
 # build directory.  LLDB queries Spotlight to locate .dSYM bundles
 # based on the UUID embedded in a binary, and because the UUID is a
 # hash of filename and .text section, there *will* be conflicts inside


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


[Lldb-commits] [lldb] r340791 - Add a mkdir -p to builddir into lldbtest.py

2018-08-27 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Aug 27 16:06:37 2018
New Revision: 340791

URL: http://llvm.org/viewvc/llvm-project?rev=340791&view=rev
Log:
Add a mkdir -p to builddir into lldbtest.py

Based on how it is executed, it may not have been yet created.

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340791&r1=340790&r2=340791&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Mon Aug 27 16:06:37 2018
@@ -18,6 +18,16 @@ def getBuildDir(cmd):
 found = True
 return None
 
+def mkdir_p(path):
+import errno
+try:
+os.makedirs(path)
+except OSError as e:
+if e.errno != errno.EEXIST:
+raise
+if not os.path.isdir(path):
+raise OSError(errno.ENOTDIR, "%s is not a directory"%path)
+
 class LLDBTest(TestFormat):
 def __init__(self, dotest_cmd):
 self.dotest_cmd = dotest_cmd
@@ -64,6 +74,7 @@ class LLDBTest(TestFormat):
 sys.executable.startswith('/System/'):
 builddir = getBuildDir(cmd)
 assert(builddir)
+mkdir_p(builddir)
 copied_python = os.path.join(builddir, 'copied-system-python')
 import shutil
 shutil.copy(sys.executable, os.path.join(builddir, copied_python))


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


[Lldb-commits] [lldb] r340792 - Make the DYLD_INSERT_LIBRARIES workaround for SIP more robut for the various configurations that bots are running

2018-08-27 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Aug 27 16:06:38 2018
New Revision: 340792

URL: http://llvm.org/viewvc/llvm-project?rev=340792&view=rev
Log:
Make the DYLD_INSERT_LIBRARIES workaround for SIP more robut for the various 
configurations that bots are running

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340792&r1=340791&r2=340792&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Mon Aug 27 16:06:38 2018
@@ -71,13 +71,17 @@ class LLDBTest(TestFormat):
 # libraries into system binaries, but this can be worked around by
 # copying the binary into a different location.
 if 'DYLD_INSERT_LIBRARIES' in test.config.environment and \
-sys.executable.startswith('/System/'):
+sys.executable.startswith('/System/') or \
+sys.executable.startswith('/usr/'):
 builddir = getBuildDir(cmd)
-assert(builddir)
 mkdir_p(builddir)
 copied_python = os.path.join(builddir, 'copied-system-python')
-import shutil
-shutil.copy(sys.executable, os.path.join(builddir, copied_python))
+if not os.path.isfile(copied_python):
+import shutil, subprocess
+python = subprocess.check_output([
+'/usr/bin/python2.7', '-c',
+'import sys; print sys.executable']).strip()
+shutil.copy(python, copied_python)
 cmd[0] = copied_python
 
 try:


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


[Lldb-commits] [lldb] r340994 - Refactor BreakpointResolver::SetSCMatchesByLine() to make it easier to

2018-08-29 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Aug 29 16:16:42 2018
New Revision: 340994

URL: http://llvm.org/viewvc/llvm-project?rev=340994&view=rev
Log:
Refactor BreakpointResolver::SetSCMatchesByLine() to make it easier to
read/understand/maintain.

As a side-effect, this should also improve the performance by avoiding
costly vector element removals and switching from a std::map to a
SmallDenseSet.

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

Modified:
lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
lldb/trunk/source/Breakpoint/BreakpointResolver.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h?rev=340994&r1=340993&r2=340994&view=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h Wed Aug 29 16:16:42 
2018
@@ -237,6 +237,10 @@ protected:
 // breakpoints we set.
 
 private:
+  /// Helper for \p SetSCMatchesByLine.
+  void AddLocation(SearchFilter &filter, const SymbolContext &sc,
+   bool skip_prologue, llvm::StringRef log_ident);
+
   // Subclass identifier (for llvm isa/dyn_cast)
   const unsigned char SubclassID;
   DISALLOW_COPY_AND_ASSIGN(BreakpointResolver);

Modified: lldb/trunk/source/Breakpoint/BreakpointResolver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolver.cpp?rev=340994&r1=340993&r2=340994&view=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointResolver.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolver.cpp Wed Aug 29 16:16:42 2018
@@ -180,128 +180,109 @@ void BreakpointResolver::SetSCMatchesByL
 SymbolContextList &sc_list,
 bool skip_prologue,
 llvm::StringRef log_ident) {
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
-
-  while (sc_list.GetSize() > 0) {
-SymbolContextList tmp_sc_list;
-unsigned current_idx = 0;
-SymbolContext sc;
-bool first_entry = true;
-
-FileSpec match_file_spec;
-FileSpec match_original_file_spec;
-uint32_t closest_line_number = UINT32_MAX;
-
-// Pull out the first entry, and all the others that match its file spec,
-// and stuff them in the tmp list.
-while (current_idx < sc_list.GetSize()) {
-  bool matches;
-
-  sc_list.GetContextAtIndex(current_idx, sc);
-  if (first_entry) {
-match_file_spec = sc.line_entry.file;
-match_original_file_spec = sc.line_entry.original_file;
-matches = true;
-first_entry = false;
-  } else
-matches = ((sc.line_entry.file == match_file_spec) ||
-   (sc.line_entry.original_file == match_original_file_spec));
-
-  if (matches) {
-tmp_sc_list.Append(sc);
-sc_list.RemoveContextAtIndex(current_idx);
-
-// ResolveSymbolContext will always return a number that is >= the line
-// number you pass in. So the smaller line number is always better.
-if (sc.line_entry.line < closest_line_number)
-  closest_line_number = sc.line_entry.line;
-  } else
-current_idx++;
+  llvm::SmallVector all_scs;
+  for (uint32_t i = 0; i < sc_list.GetSize(); ++i)
+all_scs.push_back(sc_list[i]);
+
+  while (all_scs.size()) {
+// ResolveSymbolContext will always return a number that is >= the
+// line number you pass in. So the smaller line number is always
+// better.
+uint32_t closest_line = UINT32_MAX;
+
+// Move all the elements with a matching file spec to the end.
+auto &match = all_scs[0];
+auto worklist_begin = std::partition(
+all_scs.begin(), all_scs.end(), [&](const SymbolContext &sc) {
+  if (sc.line_entry.file == match.line_entry.file ||
+  sc.line_entry.original_file == match.line_entry.original_file) {
+// When a match is found, keep track of the smallest line number.
+closest_line = std::min(closest_line, sc.line_entry.line);
+return false;
+  }
+  return true;
+});
+
+// Within, remove all entries with a larger line number.
+auto worklist_end = std::remove_if(
+worklist_begin, all_scs.end(), [&](const SymbolContext &sc) {
+  return closest_line != sc.line_entry.line;
+});
+
+// Sort by file address.
+std::sort(worklist_begin, worklist_end,
+  [](const SymbolContext &a, const SymbolContext &b) {
+return a.line_entry.range.GetBaseAddress().GetFileAddress() <
+   b.line_entry.range.GetBaseAddress().GetFileAddress();
+  });
+
+// Go thr

[Lldb-commits] [lldb] r341078 - Support setting a breakpoint by FileSpec+Line+Column in the SBAPI.

2018-08-30 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu Aug 30 08:11:00 2018
New Revision: 341078

URL: http://llvm.org/viewvc/llvm-project?rev=341078&view=rev
Log:
Support setting a breakpoint by FileSpec+Line+Column in the SBAPI.

This patch extends the SBAPI to allow for setting a breakpoint not
only at a specific line, but also at a specific (minimum) column. When
a column is specified, it will try to find an exact match or the
closest match on the same line that comes after the specified
location.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_by_line_and_column/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_by_line_and_column/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_by_line_and_column/main.c
Modified:
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h
lldb/trunk/include/lldb/Target/Target.h

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
lldb/trunk/scripts/interface/SBTarget.i
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Breakpoint/BreakpointResolver.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Core/IOHandler.cpp
lldb/trunk/source/Symbol/LineEntry.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=341078&r1=341077&r2=341078&view=diff
==
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Thu Aug 30 08:11:00 2018
@@ -580,6 +580,11 @@ public:
   BreakpointCreateByLocation(const lldb::SBFileSpec &file_spec, uint32_t line,
  lldb::addr_t offset, SBFileSpecList &module_list);
 
+  lldb::SBBreakpoint
+  BreakpointCreateByLocation(const lldb::SBFileSpec &file_spec, uint32_t line,
+ uint32_t column, lldb::addr_t offset,
+ SBFileSpecList &module_list);
+
   lldb::SBBreakpoint BreakpointCreateByName(const char *symbol_name,
 const char *module_name = nullptr);
 

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h?rev=341078&r1=341077&r2=341078&view=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h Thu Aug 30 08:11:00 
2018
@@ -200,6 +200,7 @@ protected:
 Inlines,
 LanguageName,
 LineNumber,
+Column,
 ModuleName,
 NameMaskArray,
 Offset,
@@ -224,8 +225,11 @@ protected:
   /// number that matches, and then filter down the matching addresses to
   /// unique entries, and skip the prologue if asked to do so, and then set
   /// breakpoint locations in this breakpoint for all the resultant addresses.
+  /// When \p column is nonzero the \p line and \p column args are used to
+  /// filter the results to find the first breakpoint >= (line, column).
   void SetSCMatchesByLine(SearchFilter &filter, SymbolContextList &sc_list,
-  bool skip_prologue, llvm::StringRef log_ident);
+  bool skip_prologue, llvm::StringRef log_ident,
+  uint32_t line = 0, uint32_t column = 0);
   void SetSCMatchesByLine(SearchFilter &, SymbolContextList &, bool,
   const char *) = delete;
 

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h?rev=341078&r1=341077&r2=341078&view=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h Thu Aug 30 
08:11:00 2018
@@ -28,9 +28,9 @@ namespace lldb_private {
 class BreakpointResolverFileLine : public BreakpointResolver {
 public:
   BreakpointResolverFileLine(Breakpoint *bkpt, const FileSpec &resolver,
- uint32_t line_no, lldb::addr_

  1   2   3   4   5   6   7   8   9   10   >