[Lldb-commits] [lldb] r364890 - [DWARF] Add one more type unit test

2019-07-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jul  2 00:57:08 2019
New Revision: 364890

URL: http://llvm.org/viewvc/llvm-project?rev=364890&view=rev
Log:
[DWARF] Add one more type unit test

This test passes already, but it seems interesting to test that we can
jump between type units in different dwo files nonetheless.

Added:
lldb/trunk/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp

Added: lldb/trunk/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp?rev=364890&view=auto
==
--- lldb/trunk/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp (added)
+++ lldb/trunk/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp Tue Jul 
 2 00:57:08 2019
@@ -0,0 +1,37 @@
+// Test that we can jump from a type unit in one dwo file into a type unit in a
+// different dwo file.
+
+// REQUIRES: lld
+
+// RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -g \
+// RUN:   -fdebug-types-section -gsplit-dwarf -c -o %t1.o -DONE
+// RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -g \
+// RUN:   -fdebug-types-section -gsplit-dwarf -c -o %t2.o -DTWO
+// RUN: llvm-dwarfdump %t1.dwo -debug-types | FileCheck --check-prefix=ONEUNIT 
%s
+// RUN: llvm-dwarfdump %t2.dwo -debug-types | FileCheck --check-prefix=ONEUNIT 
%s
+// RUN: ld.lld %t1.o %t2.o -o %t
+// RUN: %lldb %t -o "target var a b **b.a" -b | FileCheck %s
+
+// ONEUNIT-COUNT-1: DW_TAG_type_unit
+
+// CHECK:  (const A) a = (a = 42)
+// CHECK:  (const B) b = {
+// CHECK-NEXT:   a = 0x{{.*}}
+// CHECK-NEXT: }
+// CHECK:  (const A) **b.a = (a = 42)
+
+struct A;
+
+extern const A *a_ptr;
+#ifdef ONE
+struct A {
+  int a = 42;
+};
+constexpr A a{};
+const A *a_ptr = &a;
+#else
+struct B {
+  const A **a;
+};
+extern constexpr B b{&a_ptr};
+#endif


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


[Lldb-commits] [lldb] r364946 - [swig] Define attribute(ref) instead of accessing swig internals.

2019-07-02 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Jul  2 10:25:20 2019
New Revision: 364946

URL: http://llvm.org/viewvc/llvm-project?rev=364946&view=rev
Log:
[swig] Define attribute(ref) instead of accessing swig internals.

As of SWIG 4.0, __swig_getmethods__ and __swig_setmethods__ are no
longer defined. The solution is to stop using these internal swig
dictionaries and use %attribute and %attributeref instead. I plan on
doing this incrementally, with this differential serving as an example.

Differential revision: https://reviews.llvm.org/D63530

Modified:
lldb/trunk/scripts/interface/SBAddress.i
lldb/trunk/scripts/interface/SBBlock.i
lldb/trunk/scripts/interface/SBBreakpoint.i
lldb/trunk/scripts/interface/SBCompileUnit.i
lldb/trunk/scripts/interface/SBData.i
lldb/trunk/scripts/interface/SBDeclaration.i
lldb/trunk/scripts/interface/SBError.i
lldb/trunk/scripts/interface/SBExecutionContext.i
lldb/trunk/scripts/interface/SBFileSpec.i
lldb/trunk/scripts/interface/SBFrame.i

Modified: lldb/trunk/scripts/interface/SBAddress.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBAddress.i?rev=364946&r1=364945&r2=364946&view=diff
==
--- lldb/trunk/scripts/interface/SBAddress.i (original)
+++ lldb/trunk/scripts/interface/SBAddress.i Tue Jul  2 10:25:20 2019
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+%include 
+
 namespace lldb {
 
 %feature("docstring",
@@ -162,39 +164,20 @@ public:
 '''Convert the address to an hex string'''
 return '0x%x' % int(self)
 
-__swig_getmethods__["module"] = GetModule
-if _newclass: module = property(GetModule, None, doc='''A read only 
property that returns an lldb object that represents the module (lldb.SBModule) 
that this address resides within.''')
-
-__swig_getmethods__["compile_unit"] = GetCompileUnit
-if _newclass: compile_unit = property(GetCompileUnit, None, doc='''A 
read only property that returns an lldb object that represents the compile unit 
(lldb.SBCompileUnit) that this address resides within.''')
-
-__swig_getmethods__["line_entry"] = GetLineEntry
-if _newclass: line_entry = property(GetLineEntry, None, doc='''A read 
only property that returns an lldb object that represents the line entry 
(lldb.SBLineEntry) that this address resides within.''')
-
-__swig_getmethods__["function"] = GetFunction
-if _newclass: function = property(GetFunction, None, doc='''A read 
only property that returns an lldb object that represents the function 
(lldb.SBFunction) that this address resides within.''')
-
-__swig_getmethods__["block"] = GetBlock
-if _newclass: block = property(GetBlock, None, doc='''A read only 
property that returns an lldb object that represents the block (lldb.SBBlock) 
that this address resides within.''')
-
-__swig_getmethods__["symbol"] = GetSymbol
-if _newclass: symbol = property(GetSymbol, None, doc='''A read only 
property that returns an lldb object that represents the symbol (lldb.SBSymbol) 
that this address resides within.''')
-
-__swig_getmethods__["offset"] = GetOffset
-if _newclass: offset = property(GetOffset, None, doc='''A read only 
property that returns the section offset in bytes as an integer.''')
-
-__swig_getmethods__["section"] = GetSection
-if _newclass: section = property(GetSection, None, doc='''A read only 
property that returns an lldb object that represents the section 
(lldb.SBSection) that this address resides within.''')
-
-__swig_getmethods__["file_addr"] = GetFileAddress
-if _newclass: file_addr = property(GetFileAddress, None, doc='''A read 
only property that returns file address for the section as an integer. This is 
the address that represents the address as it is found in the object file that 
defines it.''')
-
-__swig_getmethods__["load_addr"] = __get_load_addr_property__
-__swig_setmethods__["load_addr"] = __set_load_addr_property__
-if _newclass: load_addr = property(__get_load_addr_property__, 
__set_load_addr_property__, doc='''A read/write property that gets/sets the 
SBAddress using load address. The setter resolves SBAddress using the SBTarget 
from lldb.target so this property can ONLY be used in the interactive script 
interpreter (i.e. under the lldb script command) and not in Python based 
commands, or breakpoint commands.''')
+load_addr = property(__get_load_addr_property__, 
__set_load_addr_property__, doc='''A read/write property that gets/sets the 
SBAddress using load address. The setter resolves SBAddress using the SBTarget 
from lldb.target so this property can ONLY be used in the interactive script 
interpreter (i.e. under the lldb script command) and not in Python based 
commands, or breakpoint commands.''')
 
 %}
 
 };
 

[Lldb-commits] [PATCH] D63530: [swig] Define attribute(ref) instead of accessing swig internals.

2019-07-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL364946: [swig] Define attribute(ref) instead of accessing 
swig internals. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63530?vs=205483&id=207588#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63530

Files:
  lldb/trunk/scripts/interface/SBAddress.i
  lldb/trunk/scripts/interface/SBBlock.i
  lldb/trunk/scripts/interface/SBBreakpoint.i
  lldb/trunk/scripts/interface/SBCompileUnit.i
  lldb/trunk/scripts/interface/SBData.i
  lldb/trunk/scripts/interface/SBDeclaration.i
  lldb/trunk/scripts/interface/SBError.i
  lldb/trunk/scripts/interface/SBExecutionContext.i
  lldb/trunk/scripts/interface/SBFileSpec.i
  lldb/trunk/scripts/interface/SBFrame.i

Index: lldb/trunk/scripts/interface/SBCompileUnit.i
===
--- lldb/trunk/scripts/interface/SBCompileUnit.i
+++ lldb/trunk/scripts/interface/SBCompileUnit.i
@@ -6,6 +6,8 @@
 //
 //===--===//
 
+%include 
+
 namespace lldb {
 
 %feature("docstring",
@@ -125,13 +127,10 @@
 '''Return the number of line entries in a lldb.SBCompileUnit
 object.'''
 return self.GetNumLineEntries()
-
-__swig_getmethods__["file"] = GetFileSpec
-if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''')
-
-__swig_getmethods__["num_line_entries"] = GetNumLineEntries
-if _newclass: num_line_entries = property(GetNumLineEntries, None, doc='''A read only property that returns the number of line entries in a compile unit as an integer.''')
 %}
 };
 
+%attributeref(lldb::SBCompileUnit, lldb::SBFileSpec, file, GetFileSpec);
+%attribute(lldb::SBCompileUnit, uint32_t, num_line_entries, GetNumLineEntries);
+
 } // namespace lldb
Index: lldb/trunk/scripts/interface/SBData.i
===
--- lldb/trunk/scripts/interface/SBData.i
+++ lldb/trunk/scripts/interface/SBData.i
@@ -6,6 +6,7 @@
 //
 //===--===//
 
+%include 
 
 namespace lldb {
 
@@ -264,78 +265,31 @@
 def _read_all_double(self):
 return self._make_helper_double().all()
 
-__swig_getmethods__["uint8"] = _make_helper_uint8
-if _newclass: uint8 = property(_make_helper_uint8, None, doc='''A read only property that returns an array-like object out of which you can read uint8 values.''')
-
-__swig_getmethods__["uint16"] = _make_helper_uint16
-if _newclass: uint16 = property(_make_helper_uint16, None, doc='''A read only property that returns an array-like object out of which you can read uint16 values.''')
-
-__swig_getmethods__["uint32"] = _make_helper_uint32
-if _newclass: uint32 = property(_make_helper_uint32, None, doc='''A read only property that returns an array-like object out of which you can read uint32 values.''')
-
-__swig_getmethods__["uint64"] = _make_helper_uint64
-if _newclass: uint64 = property(_make_helper_uint64, None, doc='''A read only property that returns an array-like object out of which you can read uint64 values.''')
-
-__swig_getmethods__["sint8"] = _make_helper_sint8
-if _newclass: sint8 = property(_make_helper_sint8, None, doc='''A read only property that returns an array-like object out of which you can read sint8 values.''')
-
-__swig_getmethods__["sint16"] = _make_helper_sint16
-if _newclass: sint16 = property(_make_helper_sint16, None, doc='''A read only property that returns an array-like object out of which you can read sint16 values.''')
-
-__swig_getmethods__["sint32"] = _make_helper_sint32
-if _newclass: sint32 = property(_make_helper_sint32, None, doc='''A read only property that returns an array-like object out of which you can read sint32 values.''')
-
-__swig_getmethods__["sint64"] = _make_helper_sint64
-if _newclass: sint64 = property(_make_helper_sint64, None, doc='''A read only property that returns an array-like object out of which you can read sint64 values.''')
-
-__swig_getmethods__["float"] = _make_helper_float
-if _newclass: float = property(_make_helper_float, None, doc='''A read only property that returns an array-like object out of which you can read float values.''')
-
-__swig_getmethods__["double"] = _make_helper_double
-if _newclass: double = property(_make_helper_double, None, doc='''A read only property that returns an array-like object out of which you can read double values.''')
-
-

[Lldb-commits] [lldb] r364951 - Revert "[swig] Define attribute(ref) instead of accessing swig internals."

2019-07-02 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Tue Jul  2 11:04:55 2019
New Revision: 364951

URL: http://llvm.org/viewvc/llvm-project?rev=364951&view=rev
Log:
Revert "[swig] Define attribute(ref) instead of accessing swig internals."

This reverts commit f9b91a52797325ccaaee229e414beae7c03f1948.

Modified:
lldb/trunk/scripts/interface/SBAddress.i
lldb/trunk/scripts/interface/SBBlock.i
lldb/trunk/scripts/interface/SBBreakpoint.i
lldb/trunk/scripts/interface/SBCompileUnit.i
lldb/trunk/scripts/interface/SBData.i
lldb/trunk/scripts/interface/SBDeclaration.i
lldb/trunk/scripts/interface/SBError.i
lldb/trunk/scripts/interface/SBExecutionContext.i
lldb/trunk/scripts/interface/SBFileSpec.i
lldb/trunk/scripts/interface/SBFrame.i

Modified: lldb/trunk/scripts/interface/SBAddress.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBAddress.i?rev=364951&r1=364950&r2=364951&view=diff
==
--- lldb/trunk/scripts/interface/SBAddress.i (original)
+++ lldb/trunk/scripts/interface/SBAddress.i Tue Jul  2 11:04:55 2019
@@ -6,8 +6,6 @@
 //
 
//===--===//
 
-%include 
-
 namespace lldb {
 
 %feature("docstring",
@@ -164,20 +162,39 @@ public:
 '''Convert the address to an hex string'''
 return '0x%x' % int(self)
 
-load_addr = property(__get_load_addr_property__, 
__set_load_addr_property__, doc='''A read/write property that gets/sets the 
SBAddress using load address. The setter resolves SBAddress using the SBTarget 
from lldb.target so this property can ONLY be used in the interactive script 
interpreter (i.e. under the lldb script command) and not in Python based 
commands, or breakpoint commands.''')
+__swig_getmethods__["module"] = GetModule
+if _newclass: module = property(GetModule, None, doc='''A read only 
property that returns an lldb object that represents the module (lldb.SBModule) 
that this address resides within.''')
+
+__swig_getmethods__["compile_unit"] = GetCompileUnit
+if _newclass: compile_unit = property(GetCompileUnit, None, doc='''A 
read only property that returns an lldb object that represents the compile unit 
(lldb.SBCompileUnit) that this address resides within.''')
+
+__swig_getmethods__["line_entry"] = GetLineEntry
+if _newclass: line_entry = property(GetLineEntry, None, doc='''A read 
only property that returns an lldb object that represents the line entry 
(lldb.SBLineEntry) that this address resides within.''')
+
+__swig_getmethods__["function"] = GetFunction
+if _newclass: function = property(GetFunction, None, doc='''A read 
only property that returns an lldb object that represents the function 
(lldb.SBFunction) that this address resides within.''')
+
+__swig_getmethods__["block"] = GetBlock
+if _newclass: block = property(GetBlock, None, doc='''A read only 
property that returns an lldb object that represents the block (lldb.SBBlock) 
that this address resides within.''')
+
+__swig_getmethods__["symbol"] = GetSymbol
+if _newclass: symbol = property(GetSymbol, None, doc='''A read only 
property that returns an lldb object that represents the symbol (lldb.SBSymbol) 
that this address resides within.''')
+
+__swig_getmethods__["offset"] = GetOffset
+if _newclass: offset = property(GetOffset, None, doc='''A read only 
property that returns the section offset in bytes as an integer.''')
+
+__swig_getmethods__["section"] = GetSection
+if _newclass: section = property(GetSection, None, doc='''A read only 
property that returns an lldb object that represents the section 
(lldb.SBSection) that this address resides within.''')
+
+__swig_getmethods__["file_addr"] = GetFileAddress
+if _newclass: file_addr = property(GetFileAddress, None, doc='''A read 
only property that returns file address for the section as an integer. This is 
the address that represents the address as it is found in the object file that 
defines it.''')
+
+__swig_getmethods__["load_addr"] = __get_load_addr_property__
+__swig_setmethods__["load_addr"] = __set_load_addr_property__
+if _newclass: load_addr = property(__get_load_addr_property__, 
__set_load_addr_property__, doc='''A read/write property that gets/sets the 
SBAddress using load address. The setter resolves SBAddress using the SBTarget 
from lldb.target so this property can ONLY be used in the interactive script 
interpreter (i.e. under the lldb script command) and not in Python based 
commands, or breakpoint commands.''')
 
 %}
 
 };
 
-%attributeref(lldb::SBAddress, lldb::SBModule, module, GetModule);
-%attributeref(lldb::SBAddress, lldb::SBCompileUnit, compile_unit, 
GetCompileUnit);
-%attributeref(lldb::SBAddress, lldb::SBLineEntry, line_entry, GetLineEntry);
-%attributeref(lldb::SBAddre

[Lldb-commits] [lldb] r364962 - [Symbol] Add DeclVendor::FindTypes

2019-07-02 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Tue Jul  2 12:53:07 2019
New Revision: 364962

URL: http://llvm.org/viewvc/llvm-project?rev=364962&view=rev
Log:
[Symbol] Add DeclVendor::FindTypes

Summary:
Following up on the plan I outlined in D63622, we can remove the
dependence on clang in all the places where we only want to find the
types from the DeclVendor. This means that currently DeclVendor depends
on clang, but centralizing the dependency makes it easier to refactor
cleanly.

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

Added:
lldb/trunk/source/Symbol/DeclVendor.cpp
Modified:
lldb/trunk/include/lldb/Symbol/DeclVendor.h
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

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

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
lldb/trunk/source/Symbol/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Symbol/DeclVendor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/DeclVendor.h?rev=364962&r1=364961&r2=364962&view=diff
==
--- lldb/trunk/include/lldb/Symbol/DeclVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/DeclVendor.h Tue Jul  2 12:53:07 2019
@@ -47,6 +47,19 @@ public:
  uint32_t max_matches,
  std::vector &decls) = 0;
 
+  /// Look up the types that the DeclVendor currently knows about matching a
+  /// given name.
+  ///
+  /// \param[in] name
+  /// The name to look for.
+  ///
+  /// \param[in] max_matches
+  //  The maximum number of matches. UINT32_MAX means "as many as 
possible".
+  ///
+  /// \return
+  /// The vector of CompilerTypes that was found.
+  std::vector FindTypes(ConstString name, uint32_t max_matches);
+
   /// Interface for ExternalASTMerger.  Returns an ImporterSource 
   /// allowing type completion.
   ///

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=364962&r1=364961&r2=364962&view=diff
==
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Tue Jul  2 12:53:07 2019
@@ -1847,18 +1847,12 @@ lldb::SBType SBTarget::FindFirstType(con
 }
 
 // Didn't find the type in the symbols; Try the loaded language runtimes
-// FIXME: This depends on clang, but should be able to support any
-// TypeSystem/compiler.
 if (auto process_sp = target_sp->GetProcessSP()) {
   for (auto *runtime : process_sp->GetLanguageRuntimes()) {
 if (auto vendor = runtime->GetDeclVendor()) {
-  std::vector decls;
-  if (vendor->FindDecls(const_typename, /*append*/ true,
-/*max_matches*/ 1, decls) > 0) {
-if (CompilerType type =
-ClangASTContext::GetTypeForDecl(decls.front()))
-  return LLDB_RECORD_RESULT(SBType(type));
-  }
+  auto types = vendor->FindTypes(const_typename, /*max_matches*/ 1);
+  if (!types.empty())
+return LLDB_RECORD_RESULT(SBType(types.front()));
 }
   }
 }
@@ -1911,19 +1905,13 @@ lldb::SBTypeList SBTarget::FindTypes(con
 }
 
 // Try the loaded language runtimes
-// FIXME: This depends on clang, but should be able to support any
-// TypeSystem/compiler.
 if (auto process_sp = target_sp->GetProcessSP()) {
   for (auto *runtime : process_sp->GetLanguageRuntimes()) {
 if (auto *vendor = runtime->GetDeclVendor()) {
-  std::vector decls;
-  if (vendor->FindDecls(const_typename, /*append*/ true,
-/*max_matches*/ 1, decls) > 0) {
-for (auto *decl : decls) {
-  if (CompilerType type = ClangASTContext::GetTypeForDecl(decl))
-sb_type_list.Append(SBType(type));
-}
-  }
+  auto types =
+  vendor->FindTypes(const_typename, /*max_matches*/ UINT32_MAX);
+  for (auto type : types)
+sb_type_list.Append(SBType(type));
 }
   }
 }

Modified: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp?rev=364962&r1=364961&r2=364962&view=diff
==
--- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp Tue Jul  2 
12:53:07 2019
@@ -932,25 +932,16 @@ std::unique_ptr
ResultSet &results) override {
   bool result = false;
 
-  Process *process = exe_scope->CalculateProcess().get();
-  if (process) {
-auto objc_runtime = Obj

[Lldb-commits] [PATCH] D63853: [Symbol] Add DeclVendor::FindTypes

2019-07-02 Thread Alex Langford via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL364962: [Symbol] Add DeclVendor::FindTypes (authored by 
xiaobai, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63853

Files:
  lldb/trunk/include/lldb/Symbol/DeclVendor.h
  lldb/trunk/source/API/SBTarget.cpp
  lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
  lldb/trunk/source/Symbol/CMakeLists.txt
  lldb/trunk/source/Symbol/DeclVendor.cpp

Index: lldb/trunk/source/Symbol/CMakeLists.txt
===
--- lldb/trunk/source/Symbol/CMakeLists.txt
+++ lldb/trunk/source/Symbol/CMakeLists.txt
@@ -21,6 +21,7 @@
   DWARFCallFrameInfo.cpp
   DebugMacros.cpp
   Declaration.cpp
+  DeclVendor.cpp
   FuncUnwinders.cpp
   Function.cpp
   LineEntry.cpp
Index: lldb/trunk/source/Symbol/DeclVendor.cpp
===
--- lldb/trunk/source/Symbol/DeclVendor.cpp
+++ lldb/trunk/source/Symbol/DeclVendor.cpp
@@ -0,0 +1,29 @@
+//===-- DeclVendor.cpp --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/Symbol/DeclVendor.h"
+
+#include "lldb/Symbol/ClangASTContext.h"
+
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+
+std::vector DeclVendor::FindTypes(ConstString name,
+uint32_t max_matches) {
+  // FIXME: This depends on clang, but should be able to support any
+  // TypeSystem.
+  std::vector ret;
+  std::vector decls;
+  if (FindDecls(name, /*append*/ true, max_matches, decls))
+for (auto *decl : decls)
+  if (auto type = ClangASTContext::GetTypeForDecl(decl))
+ret.push_back(type);
+  return ret;
+}
Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
===
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -245,25 +245,19 @@
 if (!decl_vendor)
   return clang::QualType();
 
-const bool append = false;
-const uint32_t max_matches = 1;
-std::vector decls;
-
-uint32_t num_types =
-decl_vendor->FindDecls(ConstString(name), append, max_matches, decls);
+auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);
 
 // The user can forward-declare something that has no definition.  The runtime
 // doesn't prohibit this at all. This is a rare and very weird case.  We keep
 // this assert in debug builds so we catch other weird cases.
 #ifdef LLDB_CONFIGURATION_DEBUG
-assert(num_types);
+assert(!types.empty());
 #else
-if (!num_types)
+if (types.empty())
   return ast_ctx.getObjCIdType();
 #endif
 
-return ClangUtil::GetQualType(
-ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType());
+return ClangUtil::GetQualType(types.front().GetPointerType());
   } else {
 // We're going to resolve this dynamically anyway, so just smile and wave.
 return ast_ctx.getObjCIdType();
Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -474,12 +474,10 @@
   class_type_or_name.SetTypeSP(type_sp);
 } else {
   // try to go for a CompilerType at least
-  DeclVendor *vendor = GetDeclVendor();
-  if (vendor) {
-std::vector decls;
-if (vendor->FindDecls(class_name, false, 1, decls) && decls.size())
-  class_type_or_name.SetCompilerType(
-  ClangASTContext::GetTypeForDecl(decls[0]));
+  if (auto *vendor = GetDeclVendor()) {
+auto types = vendor->FindTypes(class_name, /*max_matches*/ 1);
+if (!types.empty())
+  class_type_or_name.SetCompilerType(types.front());
   }
 }
   }
Index: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
===
--- lldb/trunk/source

[Lldb-commits] [lldb] r364967 - [lldb] Mention automatic codesign setup script [NFC]

2019-07-02 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Tue Jul  2 14:07:25 2019
New Revision: 364967

URL: http://llvm.org/viewvc/llvm-project?rev=364967&view=rev
Log:
[lldb] Mention automatic codesign setup script [NFC]

The script is the modern way of getting the certificate, so we should mention 
it in
the documentation.

Patch idea by Davidino Italiano!

Modified:
lldb/trunk/docs/code-signing.txt

Modified: lldb/trunk/docs/code-signing.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/code-signing.txt?rev=364967&r1=364966&r2=364967&view=diff
==
--- lldb/trunk/docs/code-signing.txt (original)
+++ lldb/trunk/docs/code-signing.txt Tue Jul  2 14:07:25 2019
@@ -14,7 +14,10 @@ build folders that contained old signed
 code signing using the executable's file system node, so you will need to
 delete the file so the kernel clears its cache.
 
-If you don't have one yet you will need to:
+Automatic setup:
+- Run scripts/macos-setup-codesign.sh
+
+Manual setup steps:
 - Launch /Applications/Utilities/Keychain Access.app
 
 - In Keychain Access select the "login" keychain in the "Keychains"


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


Re: [Lldb-commits] [lldb] r364967 - [lldb] Mention automatic codesign setup script [NFC]

2019-07-02 Thread Jonas Devlieghere via lldb-commits
Should we convert this to RST file and make it a proper part of the website?

On Tue, Jul 2, 2019 at 2:07 PM Raphael Isemann via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: teemperor
> Date: Tue Jul  2 14:07:25 2019
> New Revision: 364967
>
> URL: http://llvm.org/viewvc/llvm-project?rev=364967&view=rev
> Log:
> [lldb] Mention automatic codesign setup script [NFC]
>
> The script is the modern way of getting the certificate, so we should
> mention it in
> the documentation.
>
> Patch idea by Davidino Italiano!
>
> Modified:
> lldb/trunk/docs/code-signing.txt
>
> Modified: lldb/trunk/docs/code-signing.txt
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/code-signing.txt?rev=364967&r1=364966&r2=364967&view=diff
>
> ==
> --- lldb/trunk/docs/code-signing.txt (original)
> +++ lldb/trunk/docs/code-signing.txt Tue Jul  2 14:07:25 2019
> @@ -14,7 +14,10 @@ build folders that contained old signed
>  code signing using the executable's file system node, so you will need to
>  delete the file so the kernel clears its cache.
>
> -If you don't have one yet you will need to:
> +Automatic setup:
> +- Run scripts/macos-setup-codesign.sh
> +
> +Manual setup steps:
>  - Launch /Applications/Utilities/Keychain Access.app
>
>  - In Keychain Access select the "login" keychain in the "Keychains"
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r364967 - [lldb] Mention automatic codesign setup script [NFC]

2019-07-02 Thread Raphael “Teemperor” Isemann via lldb-commits
Yeah that whole document should probably be part of the build section for 
macOS. I can move the guide there because I anyway have to learn how the new 
website works :)

- Raphael

> On Jul 2, 2019, at 3:27 PM, Jonas Devlieghere  wrote:
> 
> Should we convert this to RST file and make it a proper part of the website?
> 
> On Tue, Jul 2, 2019 at 2:07 PM Raphael Isemann via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: teemperor
> Date: Tue Jul  2 14:07:25 2019
> New Revision: 364967
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=364967&view=rev 
> 
> Log:
> [lldb] Mention automatic codesign setup script [NFC]
> 
> The script is the modern way of getting the certificate, so we should mention 
> it in
> the documentation.
> 
> Patch idea by Davidino Italiano!
> 
> Modified:
> lldb/trunk/docs/code-signing.txt
> 
> Modified: lldb/trunk/docs/code-signing.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/code-signing.txt?rev=364967&r1=364966&r2=364967&view=diff
>  
> 
> ==
> --- lldb/trunk/docs/code-signing.txt (original)
> +++ lldb/trunk/docs/code-signing.txt Tue Jul  2 14:07:25 2019
> @@ -14,7 +14,10 @@ build folders that contained old signed
>  code signing using the executable's file system node, so you will need to
>  delete the file so the kernel clears its cache.
> 
> -If you don't have one yet you will need to:
> +Automatic setup:
> +- Run scripts/macos-setup-codesign.sh
> +
> +Manual setup steps:
>  - Launch /Applications/Utilities/Keychain Access.app
> 
>  - In Keychain Access select the "login" keychain in the "Keychains"
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 

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


[Lldb-commits] [lldb] r364976 - add symbols/declvendor.cpp.

2019-07-02 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jul  2 16:06:13 2019
New Revision: 364976

URL: http://llvm.org/viewvc/llvm-project?rev=364976&view=rev
Log:
add symbols/declvendor.cpp.

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=364976&r1=364975&r2=364976&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jul  2 16:06:13 2019
@@ -283,6 +283,7 @@
23D4007E1C210201000C3885 /* DebugMacros.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */; 
};
AF116BEF20CF234B0071093F /* DebugNamesDWARFIndex.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF116BED20CF234B0071093F /* 
DebugNamesDWARFIndex.cpp */; };
2689003913353E0400698AC0 /* Debugger.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 263664921140A4930075843B /* Debugger.cpp */; };
+   AF1675A922CC1A3C00DC40ED /* DeclVendor.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF1675A822CC1A3C00DC40ED /* DeclVendor.cpp */; };
268900D613353E6F00698AC0 /* Declaration.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */; 
};
49E4F66B1C9CAD16008487EA /* DiagnosticManager.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 49E4F6681C9CAD12008487EA /* 
DiagnosticManager.cpp */; };
2689003A13353E0400698AC0 /* Disassembler.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7E7610F1B85900F91463 /* Disassembler.cpp */; 
};
@@ -1826,6 +1827,7 @@
AF116BEE20CF234B0071093F /* DebugNamesDWARFIndex.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
DebugNamesDWARFIndex.h; sourceTree = ""; };
263664921140A4930075843B /* Debugger.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
lineEnding = 0; name = Debugger.cpp; path = source/Core/Debugger.cpp; 
sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
263664941140A4C10075843B /* Debugger.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
lineEnding = 0; name = Debugger.h; path = include/lldb/Core/Debugger.h; 
sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; 
};
+   AF1675A822CC1A3C00DC40ED /* DeclVendor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DeclVendor.cpp; path = source/Symbol/DeclVendor.cpp; sourceTree = 
""; };
49B01A2D15F67B1700666829 /* DeclVendor.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DeclVendor.h; path 
= include/lldb/Symbol/DeclVendor.h; sourceTree = ""; };
26BC7F1610F1B8EC00F91463 /* Declaration.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = Declaration.cpp; path = source/Symbol/Declaration.cpp; sourceTree = 
""; };
26BC7C5810F1B6E900F91463 /* Declaration.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
Declaration.h; path = include/lldb/Symbol/Declaration.h; sourceTree = 
""; };
@@ -5322,6 +5324,7 @@
26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */,
23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */,
26BC7C5810F1B6E900F91463 /* Declaration.h */,
+   AF1675A822CC1A3C00DC40ED /* DeclVendor.cpp */,
DDB5829B2278C8D600491B41 /* 
CxxModuleHandler.cpp */,
26BC7F1610F1B8EC00F91463 /* Declaration.cpp */,
49B01A2D15F67B1700666829 /* DeclVendor.h */,
@@ -8267,6 +8270,7 @@
268900B013353E5000698AC0 /* 
RegisterContextLLDB.cpp in Sources */,
23E2E5451D904913006F38BB /* MinidumpTypes.cpp 
in Sources */,
AF33B4BE1C1FA441001B28D9 /* NetBSDSignals.cpp 
in Sources */,
+   AF1675A922CC1A3C00DC40ED /* DeclVendor.cpp in 
Sources */,
949EEDA31BA76577008C63CF /* Cocoa.cpp in 
Sources */,
AFD966BB217140B6006714AC /* 
SymbolFileNativePDB.cpp in Sources */,
AFCB1D59219CD4FD00730AD5 /* 
GDBRemoteCommunicationReplayServer.cpp in Sources */,


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


[Lldb-commits] [PATCH] D64112: Add plugin.process.gdb-remote.use-libraries-svr4 option

2019-07-02 Thread António Afonso via Phabricator via lldb-commits
aadsm created this revision.
aadsm added reviewers: labath, jankratochvil.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This option allow the toggling of the libraries-svr4 usage in ProcessGDBRemote. 
It's a follow up of https://reviews.llvm.org/D62503#1564296 and it's meant to 
test / tweak this new packet with, hopefully, minimum impact and in a faster 
way.

Enable it with `settings set plugin.process.gdb-remote.use-libraries-svr4 
true`. For now, by default it's false.

I didn't put tests up for this but I did test it manually.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64112

Files:
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -111,18 +111,40 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-{"packet-timeout", OptionValue::eTypeUInt64, true, 5
+{"packet-timeout",
+ OptionValue::eTypeUInt64,
+ true,
+ 5
 #if defined(__has_feature)
 #if __has_feature(address_sanitizer)
  * 2
 #endif
 #endif
- , nullptr, {},
+ ,
+ nullptr,
+ {},
  "Specify the default packet timeout in seconds."},
-{"target-definition-file", OptionValue::eTypeFileSpec, true, 0, nullptr, 
{},
- "The file that provides the description for remote target registers."}};
-
-enum { ePropertyPacketTimeout, ePropertyTargetDefinitionFile };
+{"target-definition-file",
+ OptionValue::eTypeFileSpec,
+ true,
+ 0,
+ nullptr,
+ {},
+ "The file that provides the description for remote target registers."},
+{"use-libraries-svr4",
+ OptionValue::eTypeBoolean,
+ true,
+ false,
+ nullptr,
+ {},
+ "If true, the libraries-svr4 feature will be used to get a hold of the "
+ "process's loaded modules."}};
+
+enum {
+  ePropertyPacketTimeout,
+  ePropertyTargetDefinitionFile,
+  ePropertyUseSVR4
+};
 
 class PluginProperties : public Properties {
 public:
@@ -152,6 +174,12 @@
 const uint32_t idx = ePropertyTargetDefinitionFile;
 return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx);
   }
+
+  bool GetUseSVR4() const {
+const uint32_t idx = ePropertyUseSVR4;
+return m_collection_sp->GetPropertyAtIndexAsBoolean(
+nullptr, idx, g_properties[idx].default_uint_value != 0);
+  }
 };
 
 typedef std::shared_ptr ProcessKDPPropertiesSP;
@@ -4681,9 +4709,10 @@
 log->Printf("ProcessGDBRemote::%s", __FUNCTION__);
 
   GDBRemoteCommunicationClient &comm = m_gdb_comm;
+  bool can_use_svr4 = GetGlobalPluginProperties()->GetUseSVR4();
 
   // check that we have extended feature read support
-  if (comm.GetQXferLibrariesSVR4ReadSupported()) {
+  if (can_use_svr4 && comm.GetQXferLibrariesSVR4ReadSupported()) {
 list.clear();
 
 // request the loaded library list


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -111,18 +111,40 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-{"packet-timeout", OptionValue::eTypeUInt64, true, 5
+{"packet-timeout",
+ OptionValue::eTypeUInt64,
+ true,
+ 5
 #if defined(__has_feature)
 #if __has_feature(address_sanitizer)
  * 2
 #endif
 #endif
- , nullptr, {},
+ ,
+ nullptr,
+ {},
  "Specify the default packet timeout in seconds."},
-{"target-definition-file", OptionValue::eTypeFileSpec, true, 0, nullptr, {},
- "The file that provides the description for remote target registers."}};
-
-enum { ePropertyPacketTimeout, ePropertyTargetDefinitionFile };
+{"target-definition-file",
+ OptionValue::eTypeFileSpec,
+ true,
+ 0,
+ nullptr,
+ {},
+ "The file that provides the description for remote target registers."},
+{"use-libraries-svr4",
+ OptionValue::eTypeBoolean,
+ true,
+ false,
+ nullptr,
+ {},
+ "If true, the libraries-svr4 feature will be used to get a hold of the "
+ "process's loaded modules."}};
+
+enum {
+  ePropertyPacketTimeout,
+  ePropertyTargetDefinitionFile,
+  ePropertyUseSVR4
+};
 
 class PluginProperties : public Properties {
 public:
@@ -152,6 +174,12 @@
 const uint32_t idx = ePropertyTargetDefinitionFile;
 return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx);
   }
+
+  bool GetUseSVR4() const {
+const uint32_t idx = ePropertyUseSVR4;
+return m_collection_sp->GetPropertyAtIndexAsBoolean(
+nullptr, idx, g_properties[idx].default_uint_value != 0);
+  }
 };
 
 typedef std::shared_ptr ProcessKDPPropertiesSP;
@@ -4681,9 +4709,10 @@
 l

[Lldb-commits] [lldb] r364979 - Update cmake build setup so lldb doesn't link against the DebugSymbols

2019-07-02 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jul  2 16:36:39 2019
New Revision: 364979

URL: http://llvm.org/viewvc/llvm-project?rev=364979&view=rev
Log:
Update cmake build setup so lldb doesn't link against the DebugSymbols
framework on macOS, in line with the source/xcode project changes in
r364243.
 

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=364979&r1=364978&r2=364979&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Jul  2 16:36:39 2019
@@ -335,7 +335,6 @@ if (APPLE)
   if(NOT IOS)
 find_library(CARBON_LIBRARY Carbon)
 find_library(CORE_SERVICES_LIBRARY CoreServices)
-find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS 
"/System/Library/PrivateFrameworks")
   endif()
   find_library(FOUNDATION_LIBRARY Foundation)
   find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)


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


[Lldb-commits] [lldb] r364980 - Fix for r364686 - actually set symbol_is_missing_weak...

2019-07-02 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Tue Jul  2 16:38:07 2019
New Revision: 364980

URL: http://llvm.org/viewvc/llvm-project?rev=364980&view=rev
Log:
Fix for r364686 - actually set symbol_is_missing_weak...

This was set in a std::function, but I was shadowing a
variable that I thought I was capturing.  Even with this bug
we were correctly not raising an error and returning an address
of 0x0.  We were not marking the symbol as weak, but apparently
the JIT didn't need that, so the test still passed.

Modified:
lldb/trunk/source/Expression/IRExecutionUnit.cpp

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=364980&r1=364979&r2=364980&view=diff
==
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Tue Jul  2 16:38:07 2019
@@ -791,7 +791,8 @@ lldb::addr_t IRExecutionUnit::FindInSymb
 
 std::function
-get_external_load_address = [&best_internal_load_address, target](
+get_external_load_address = [&best_internal_load_address, target,
+ &symbol_was_missing_weak](
 lldb::addr_t &load_address, SymbolContextList &sc_list,
 const lldb_private::SymbolContext &sc) -> lldb::addr_t {
   load_address = LLDB_INVALID_ADDRESS;
@@ -801,7 +802,7 @@ lldb::addr_t IRExecutionUnit::FindInSymb
 
   // missing_weak_symbol will be true only if we found only weak undefined 
   // references to this symbol.
-  bool symbol_was_missing_weak = true;  
+  symbol_was_missing_weak = true;  
   for (auto candidate_sc : sc_list.SymbolContexts()) {
 // Only symbols can be weak undefined:
 if (!candidate_sc.symbol)


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


[Lldb-commits] [PATCH] D64118: [lldb_test_suite] Fix lldb test suite targeting remote Android

2019-07-02 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour created this revision.
kusmour added a reviewer: xiaobai.
Herald added subscribers: lldb-commits, srhines.
Herald added a project: LLDB.

Fixed `Android.rules` for running test suite on remote android

- the build configuration is not compatible with ndk structure, change it to 
link to static libc++
- generally clang should be able to use libc++ and will link against the right 
library, but some libc++ installations require the user manually link libc++abi.
- add flag `-lc++abi` to fix the test binary build failure

Added `skipIfTargetAndroid` for better test support

- the `skipIfPlatform` method will ask `lldbplatformutil.getPlatform()` for 
platform info which is actually the os type, and *Android* is not os type but 
environment
- create this function to handle the android target condition


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64118

Files:
  
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/make/Android.rules


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -90,5 +90,6 @@
 
ARCH_LDFLAGS += \
-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+   -lc++abi
 endif
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -606,6 +606,10 @@
 """Decorate the item to skip tests that should be skipped on any non 
Darwin platform."""
 return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
 
+def skipUnlessTargetAndroid(func):
+return unittest2.skipUnless(lldbplatformutil.target_is_android(),
+"requires target to be Android")(func)
+
 
 def skipIfHostIncompatibleWithRemote(func):
 """Decorate the item to skip tests if binaries built on this host are 
incompatible."""
Index: 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
===
--- 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -16,7 +16,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipUnlessPlatform(['android'])
+@skipUnlessTargetAndroid
 def test_cache_line_size(self):
 self.build(dictionary=self.getBuildFlags())
 exe = self.getBuildArtifact("a.out")


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -90,5 +90,6 @@
 
 	ARCH_LDFLAGS += \
 		-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-		$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+		$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+		-lc++abi
 endif
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -606,6 +606,10 @@
 """Decorate the item to skip tests that should be skipped on any non Darwin platform."""
 return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
 
+def skipUnlessTargetAndroid(func):
+return unittest2.skipUnless(lldbplatformutil.target_is_android(),
+"requires target to be Android")(func)
+
 
 def skipIfHostIncompatibleWithRemote(func):
 """Decorate the item to skip tests if binaries built on this host are incompatible."""
Index: lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
===
--- lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -16,7 +16,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipUnlessPlatform(['android'])
+@skipUnlessTargetAndroid
 def test_cache_line_size(self):
 self.build(dictionary=self.getBuildFlags())
 exe = self.getBuildArtifact("a.out")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi