[Lldb-commits] [PATCH] D42955: Make Module::GetSectionList output consistent

2018-02-14 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/Core/Module.cpp:1286
+if (SymbolVendor *vendor = GetSymbolVendor())
+  vendor->CreateSections(*GetUnifiedSectionList());
   }

clayborg wrote:
> should we pass "obj_file" down into the SymbolVendor::CreateSections(...) 
> call for the case where the symbol vendor is using the same ObjectFile that 
> it can just return?
I don't think an extra parameter is needed to achieve this, as this is 
something that the symbol vendor should already know about based on how it was 
constructed.

And after looking up the implementation, it seems this is already how it works 
right now: SymbolVendorELF (the only non-trivial implementation of this 
function) is only constructed if it manages to find debug info in an 
alternative symbol file (there's an `if 
(llvm::sys::fs::equivalent(candidate_file_spec.GetPath(), 
module_file_spec.GetPath()))` check in `Symbols::LocateExecutableSymbolFile`). 
If we fail to construct a SymbolVendorELF then a default SymbolVendor instance 
is created in `SymbolVendor::FindPlugin` (and that one has a no-op 
implementation of this function).



https://reviews.llvm.org/D42955



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


[Lldb-commits] [PATCH] D43292: [dotest] Add ability to skip tests based on build configuration

2018-02-14 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: zturner, jingham, davide.
Herald added a subscriber: mgorny.

Some lldb features depend on xml support. Tests exercising that
functionality can only succeed if lldb was built with xml support. Right
now we have one such test, and another waiting in a patch that's blocked
on this.

This patch implements that functionality by exporting the build
configuration from cmake via configure_file (for the XCode build, I add
a hard-coded configuration file). Then, in dotest we parse this file and
use it to initialize a "feature" configuration variable. I chose a
fairly generic name as other as I anticipate adding other things here,
for example, the list of configured llvm targets. Lastly, I add a
new "features" option to the skipIf decorator enable skipping based on
configured features

The TestTargetXMLArch is updated to match on the xml feature instead of
incorrectly matching on the host platform.


https://reviews.llvm.org/D43292

Files:
  lldb.xcodeproj/lldb_build_config.py
  packages/Python/lldbsuite/test/configuration.py
  packages/Python/lldbsuite/test/decorators.py
  packages/Python/lldbsuite/test/dotest.py
  
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
  test/CMakeLists.txt
  test/lldb_build_config.py.in

Index: test/lldb_build_config.py.in
===
--- /dev/null
+++ test/lldb_build_config.py.in
@@ -0,0 +1 @@
+have_libxml2 = @LIBXML2_FOUND@
Index: test/CMakeLists.txt
===
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -148,3 +148,6 @@
 # This will add LLDB's test dependencies to the depenednecies for check-all and
 # include them in the test-depends target.
 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
+
+llvm_canonicalize_cmake_booleans(LIBXML2_FOUND)
+configure_file(lldb_build_config.py.in lldb_build_config.py @ONLY)
Index: packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
===
--- packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
+++ packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
@@ -6,7 +6,7 @@
 
 class TestTargetXMLArch(GDBRemoteTestBase):
 
-@skipIf(hostoslist=no_match(lldbplatformutil.getDarwinOSTriples()))
+@skipIf(features=no_match(["xml"]))
 @expectedFailureAll(archs=["i386"])
 def test(self):
 """
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -816,6 +816,28 @@
 # sys.path[0].
 sys.path[1:1] = [lldbPythonDir]
 
+# Import our build configuration
+build_config_file = None
+candidates = [
+os.path.join(lldbLibDir, '..'), # Standalone build
+os.path.join(lldbLibDir, '..', 'tools', 'lldb'), # Built as a part of llvm
+]
+for c in candidates:
+c = os.path.join(c, 'test', 'lldb_build_config.py')
+if os.path.exists(c):
+build_config_file = c
+break
+
+if build_config_file is None:
+print("Could not find lldb_build_config.py")
+print("Assuming an XCode build and loading defaults")
+build_config_file = os.path.join(lldbRootDirectory, 'lldb.xcodeproj',
+'lldb_build_config.py')
+
+sys.path.append(os.path.dirname(build_config_file))
+configuration.import_build_config(__import__("lldb_build_config"))
+sys.path.pop()
+
 
 def visit_file(dir, name):
 # Try to match the regexp pattern, if specified.
Index: packages/Python/lldbsuite/test/decorators.py
===
--- packages/Python/lldbsuite/test/decorators.py
+++ packages/Python/lldbsuite/test/decorators.py
@@ -86,6 +86,15 @@
 else:
 return expected == actual
 
+def _match_features(features):
+if features is None:
+return True
+
+if isinstance(features, no_match):
+return not _match_features(features.item)
+
+return any([f in configuration.features for f in features])
+
 
 def expectedFailure(expected_fn, bugnumber=None):
 def expectedFailure_impl(func):
@@ -159,7 +168,7 @@
   debug_info=None,
   swig_version=None, py_version=None,
   macos_version=None,
-  remote=None):
+  remote=None, features=None):
 def fn(self):
 skip_for_os = _match_decorator_property(
 lldbplatform.translate(oslist), self.getPlatform())
@@ -176,6 +185,7 @@
 triple, lldb.DBG.GetSelectedPlatform().GetTriple())
 skip_for_remote = _match_decorator_property(
 remote, lldb.remote_platform is not None)
+   

[Lldb-commits] [lldb] r325137 - Remove vestigial remnants of the test crash info hook

2018-02-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Feb 14 08:08:26 2018
New Revision: 325137

URL: http://llvm.org/viewvc/llvm-project?rev=325137&view=rev
Log:
Remove vestigial remnants of the test crash info hook

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=325137&r1=325136&r2=325137&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Feb 14 
08:08:26 2018
@@ -133,10 +133,6 @@ rerun_max_file_threhold = 0
 # same base name.
 all_tests = set()
 
-# safe default
-setCrashInfoHook = lambda x: None
-
-
 def shouldSkipBecauseOfCategories(test_categories):
 if useCategories:
 if len(test_categories) == 0 or len(

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_result.py?rev=325137&r1=325136&r2=325137&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py Wed Feb 14 
08:08:26 2018
@@ -166,10 +166,6 @@ class LLDBTestResult(unittest2.TextTestR
 configuration.skip_tests, test.id()):
 self.hardMarkAsSkipped(test)
 
-configuration.setCrashInfoHook(
-"%s at %s" %
-(str(test), inspect.getfile(
-test.__class__)))
 self.counter += 1
 test.test_number = self.counter
 if self.showAll:


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


[Lldb-commits] [PATCH] D43292: [dotest] Add ability to skip tests based on build configuration

2018-02-14 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

After all the work he did on the testsuite I think Adrian is in a good position 
to review this one.


https://reviews.llvm.org/D43292



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


[Lldb-commits] [PATCH] D43215: Supply missing break in case statement.

2018-02-14 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth updated this revision to Diff 134252.
amccarth added a comment.

Per Aaron's suggestion, I ran the tests with an unconditional return (and an 
assertion).  There was no change in the test results, so I'm making this return 
unconditionally.


https://reviews.llvm.org/D43215

Files:
  lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp


Index: lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===
--- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -107,9 +107,7 @@
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-// FIXME: where is non-zero size of `void` from?
-if (width == 0)
-  return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast->GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
 return clang_ast->GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:


Index: lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===
--- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -107,9 +107,7 @@
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-// FIXME: where is non-zero size of `void` from?
-if (width == 0)
-  return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast->GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
 return clang_ast->GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43215: Supply missing break in case statement.

2018-02-14 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth added a comment.

Any remaining concerns?


https://reviews.llvm.org/D43215



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


Re: [Lldb-commits] [PATCH] D43215: Supply missing break in case statement.

2018-02-14 Thread Zachary Turner via lldb-commits
No
On Wed, Feb 14, 2018 at 2:46 PM Adrian McCarthy via Phabricator <
revi...@reviews.llvm.org> wrote:

> amccarth added a comment.
>
> Any remaining concerns?
>
>
> https://reviews.llvm.org/D43215
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r325188 - Supply missing break in case statement.

2018-02-14 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Wed Feb 14 15:16:36 2018
New Revision: 325188

URL: http://llvm.org/viewvc/llvm-project?rev=325188&view=rev
Log:
Supply missing break in case statement.

Summary:
All the tests pass without hitting the situation mentioned in the FIXME, so,
per Aaron Smith's suggestion, this case will now return unconditionally.

Subscribers: sanjoy, mgorny, JDevlieghere

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=325188&r1=325187&r2=325188&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Wed Feb 14 
15:16:36 2018
@@ -107,9 +107,7 @@ CompilerType GetBuiltinTypeForPDBEncodin
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-// FIXME: where is non-zero size of `void` from?
-if (width == 0)
-  return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast->GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
 return clang_ast->GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:


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


[Lldb-commits] [PATCH] D43215: Supply missing break in case statement.

2018-02-14 Thread Adrian McCarthy via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325188: Supply missing break in case statement. (authored by 
amccarth, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D43215?vs=134252&id=134330#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43215

Files:
  lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp


Index: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -107,9 +107,7 @@
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-// FIXME: where is non-zero size of `void` from?
-if (width == 0)
-  return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast->GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
 return clang_ast->GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:


Index: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -107,9 +107,7 @@
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-// FIXME: where is non-zero size of `void` from?
-if (width == 0)
-  return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast->GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
 return clang_ast->GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D43215: Supply missing break in case statement.

2018-02-14 Thread Aaron Smith via Phabricator via lldb-commits
asmith added a comment.

Lgtm


Repository:
  rL LLVM

https://reviews.llvm.org/D43215



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