[Lldb-commits] [PATCH] D65208: SymbolVendor: Move Symtab construction into the SymbolFile

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D65208#1599648 , @clayborg wrote:

> So the original idea behind the symbol vendor was that if you have more than 
> one binary: stripped installed binary, and unstripped debug info binary with 
> symbols, that the symbol table could be generated by using one or more object 
> files. It would be nice to ensure we can still do this somehow.


This functionality still exists/works (we even have tests for it :P), and I 
have no intention of removing it. The merging of sections from the split 
binaries happens in SymbolVendorELF::CreateInstance and 
ObjectFileMachO::CreateSections. This patch merely changes where the Symtab 
created from these merged sections ends up being stored.


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

https://reviews.llvm.org/D65208



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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D65185#1599423 , @JDevlieghere 
wrote:

> In D65185#1599262 , @labath wrote:
>
> > .def files can omit fields too: `#define BOOL_PROPERTY(name, global, 
> > default, desc) PROPERTY(name, OptionValue::eTypeBoolean, global, default, 
> > nullptr, {}, desc)`. Some sanity checking sounds like it could be useful, 
> > but I'm not exactly sure what kind of checks you have in mind. Being able 
> > to change the representation is nice, but I expect most of those changes 
> > would also be achievable with the def files. More radical changes (like the 
> > variable thing I mentioned) would probably require changes regardless of 
> > how the properties are generated...
>
>
> I agree with you and I'm not opposed to def-files at all. I think tablegen 
> and `.def` files have different trade-offs and while the latter could 
> probably work for properties, I have the feeling that tablegen is a better 
> fit. The things are mentioned before are just a few things that came to mind.
>
> To give an example of sanity checking: this isn't in the patch (yet) but with 
> tablegen we can ensure that every option has either a default unsigned or 
> string value. In the table you can't differentiate between a default `0` and 
> an explicit default value of `0`.


If you used something like the BOOL_PROPERTY macro from my previous comment, 
then there would be no way to explicitly specify a default string value for a 
boolean property (and similarly for other property types too).

Overall, I'm not strongly opposed to this, but I am not convinced that the 
added complexity of tablegen ("#including a .def file" vs. "running a 
functional program which generates a def file, which is then #included") is 
worth the benefits. I suggest getting someone else to review this to break the 
stalemate. :)


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

https://reviews.llvm.org/D65185



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


[Lldb-commits] [lldb] r366994 - SymbolVendor: Remove the type list member

2019-07-25 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Jul 25 01:22:05 2019
New Revision: 366994

URL: http://llvm.org/viewvc/llvm-project?rev=366994&view=rev
Log:
SymbolVendor: Remove the type list member

Summary:
Similarly to the compile unit lists, the list of types can also be
managed by the symbol file itself.

Since the only purpose of this list seems to be to maintain an owning
reference to all the types a symbol file has created (items are only
ever added to the list, never retrieved), I remove the passthrough
functions in SymbolVendor and Module. I also tighten the interface of
the function (return a reference instead of a pointer, make it protected
instead of public).

Reviewers: clayborg, JDevlieghere, jingham

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/source/API/SBCompileUnit.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp
lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/Core/Module.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=366994&r1=366993&r2=366994&view=diff
==
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Thu Jul 25 01:22:05 2019
@@ -653,13 +653,6 @@ public:
   GetSymbolVendor(bool can_create = true,
   lldb_private::Stream *feedback_strm = nullptr);
 
-  /// Get accessor the type list for this module.
-  ///
-  /// \return
-  /// A valid type list pointer, or nullptr if there is no valid
-  /// symbol vendor for this module.
-  TypeList *GetTypeList();
-
   /// Get a reference to the UUID value contained in this object.
   ///
   /// If the executable image file doesn't not have a UUID value built into

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=366994&r1=366993&r2=366994&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Thu Jul 25 01:22:05 2019
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/Function.h"
 #include "lldb/Symbol/SourceModule.h"
 #include "lldb/Symbol/Type.h"
+#include "lldb/Symbol/TypeList.h"
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/DenseSet.h"
@@ -191,10 +192,7 @@ public:
   virtual void
   GetMangledNamesForFunction(const std::string &scope_qualified_name,
  std::vector &mangled_names);
-  //  virtual uint32_tFindTypes (const SymbolContext& sc, const
-  //  RegularExpression& regex, bool append, uint32_t max_matches, TypeList&
-  //  types) = 0;
-  virtual TypeList *GetTypeList();
+
   virtual size_t GetTypes(lldb_private::SymbolContextScope *sc_scope,
   lldb::TypeClass type_mask,
   lldb_private::TypeList &type_list) = 0;
@@ -241,11 +239,13 @@ protected:
   void AssertModuleLock();
   virtual uint32_t CalculateNumCompileUnits() = 0;
   virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx) = 0;
+  virtual TypeList &GetTypeList() { return m_type_list; }
 
   void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp);
 
   ObjectFile *m_obj_file; // The object file that symbols can be extracted 
from.
   llvm::Optional> m_compile_units;
+  TypeList m_type_list;
   uint32_t m_abilities;
   bool m_calculated_abilities;
 

Modified: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolVendor.h?rev=366994&r1=366993&r2=366994&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h Thu Jul 25 01:22:05 2019
@@ -14,7 +14,6 @@
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Symbol/SourceModule.h"
-#include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/lldb-private.h"
 #include "llvm/ADT/DenseSet.h"
@@ -112,10 +111,6 @@ public:
 
   virtual lldb::CompUnitSP GetCompileUnitAtIndex(size_t idx);
 
-  TypeList &GetTypeList() { return m_type_list; }
-

[Lldb-commits] [PATCH] D65135: SymbolVendor: Remove the type list member

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366994: SymbolVendor: Remove the type list member (authored 
by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65135?vs=211268&id=211688#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65135

Files:
  lldb/trunk/include/lldb/Core/Module.h
  lldb/trunk/include/lldb/Symbol/SymbolFile.h
  lldb/trunk/include/lldb/Symbol/SymbolVendor.h
  lldb/trunk/include/lldb/Symbol/Type.h
  lldb/trunk/source/API/SBCompileUnit.cpp
  lldb/trunk/source/Core/Module.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/trunk/source/Symbol/SymbolFile.cpp
  lldb/trunk/source/Symbol/SymbolVendor.cpp
  lldb/trunk/source/Symbol/Type.cpp

Index: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
===
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h
@@ -14,7 +14,6 @@
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Symbol/SourceModule.h"
-#include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/lldb-private.h"
 #include "llvm/ADT/DenseSet.h"
@@ -112,10 +111,6 @@
 
   virtual lldb::CompUnitSP GetCompileUnitAtIndex(size_t idx);
 
-  TypeList &GetTypeList() { return m_type_list; }
-
-  const TypeList &GetTypeList() const { return m_type_list; }
-
   virtual size_t GetTypes(SymbolContextScope *sc_scope,
   lldb::TypeClass type_mask, TypeList &type_list);
 
@@ -139,7 +134,6 @@
   uint32_t GetPluginVersion() override;
 
 protected:
-  TypeList m_type_list; // Uniqued types for all parsers owned by this module
   lldb::ObjectFileSP m_objfile_sp; // Keep a reference to the object file in
// case it isn't the same as the module
// object file (debug symbols in a separate
Index: lldb/trunk/include/lldb/Symbol/Type.h
===
--- lldb/trunk/include/lldb/Symbol/Type.h
+++ lldb/trunk/include/lldb/Symbol/Type.h
@@ -117,8 +117,6 @@
   SymbolFile *GetSymbolFile() { return m_symbol_file; }
   const SymbolFile *GetSymbolFile() const { return m_symbol_file; }
 
-  TypeList *GetTypeList();
-
   ConstString GetName();
 
   llvm::Optional GetByteSize();
Index: lldb/trunk/include/lldb/Symbol/SymbolFile.h
===
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/Function.h"
 #include "lldb/Symbol/SourceModule.h"
 #include "lldb/Symbol/Type.h"
+#include "lldb/Symbol/TypeList.h"
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/DenseSet.h"
@@ -191,10 +192,7 @@
   virtual void
   GetMangledNamesForFunction(const std::string &scope_qualified_name,
  std::vector &mangled_names);
-  //  virtual uint32_tFindTypes (const SymbolContext& sc, const
-  //  RegularExpression& regex, bool append, uint32_t max_matches, TypeList&
-  //  types) = 0;
-  virtual TypeList *GetTypeList();
+
   virtual size_t GetTypes(lldb_private::SymbolContextScope *sc_scope,
   lldb::TypeClass type_mask,
   lldb_private::TypeList &type_list) = 0;
@@ -241,11 +239,13 @@
   void AssertModuleLock();
   virtual uint32_t CalculateNumCompileUnits() = 0;
   virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx) = 0;
+  virtual TypeList &GetTypeList() { return m_type_list; }
 
   void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp);
 
   ObjectFile *m_obj_file; // The object file that symbols can be extracted from.
   llvm::Optional> m_compile_units;
+  TypeList m_type_list;
   uint32_t m_abilities;
   bool m_calculated_abilities;
 
Index: lldb/trunk/include/lldb/Core/Module.h
===
--- lldb/trunk/include/lldb/Core/Module.h
+++ lldb/trunk/include/lldb/Core/Module.h
@@ -653,13 +653,6 @@
   GetSymbolVendor(bool can_create = true,
   lldb_private::Stream *feedback_strm = nullptr);
 
-  /// Get accessor the type list for this module.
-  ///
-  /// \return
-  /// A valid type list pointer, or nullptr if there is no valid
-  /// symbol vendor for this module.
-  TypeList *GetTypeList();
-
   /// Get a reference to the UUID value contained 

[Lldb-commits] [PATCH] D65266: SymbolVendor: Make SectionAddressesChanged a passthrough

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: clayborg, jingham, JDevlieghere.

This moves the implementation of the function into the SymbolFile class,
making it possible to excise the SymbolVendor passthrough functions in
follow-up patches.


https://reviews.llvm.org/D65266

Files:
  include/lldb/Symbol/SymbolFile.h
  source/Symbol/SymbolFile.cpp
  source/Symbol/SymbolVendor.cpp


Index: source/Symbol/SymbolVendor.cpp
===
--- source/Symbol/SymbolVendor.cpp
+++ source/Symbol/SymbolVendor.cpp
@@ -390,19 +390,8 @@
 }
 
 void SymbolVendor::SectionFileAddressesChanged() {
-  ModuleSP module_sp(GetModule());
-  if (module_sp) {
-ObjectFile *module_objfile = module_sp->GetObjectFile();
-if (m_sym_file_up) {
-  ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
-  if (symfile_objfile != module_objfile)
-symfile_objfile->SectionFileAddressesChanged();
-}
-Symtab *symtab = GetSymtab();
-if (symtab) {
-  symtab->SectionFileAddressesChanged();
-}
-  }
+  if (m_sym_file_up)
+m_sym_file_up->SectionFileAddressesChanged();
 }
 
 // PluginInterface protocol
Index: source/Symbol/SymbolFile.cpp
===
--- source/Symbol/SymbolFile.cpp
+++ source/Symbol/SymbolFile.cpp
@@ -31,6 +31,9 @@
 std::recursive_mutex &SymbolFile::GetModuleMutex() const {
   return GetObjectFile()->GetModule()->GetMutex();
 }
+ObjectFile *SymbolFile::GetMainObjectFile() {
+  return m_obj_file->GetModule()->GetObjectFile();
+}
 
 SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
   std::unique_ptr best_symfile_up;
@@ -205,7 +208,7 @@
 return m_symtab;
 
   // Fetch the symtab from the main object file.
-  m_symtab = m_obj_file->GetModule()->GetObjectFile()->GetSymtab();
+  m_symtab = GetMainObjectFile()->GetSymtab();
 
   // Then add our symbols to it.
   if (m_symtab)
@@ -214,6 +217,15 @@
   return m_symtab;
 }
 
+void SymbolFile::SectionFileAddressesChanged() {
+  ObjectFile *module_objfile = GetMainObjectFile();
+  ObjectFile *symfile_objfile = GetObjectFile();
+  if (symfile_objfile != module_objfile)
+symfile_objfile->SectionFileAddressesChanged();
+  if (m_symtab)
+m_symtab->SectionFileAddressesChanged();
+}
+
 void SymbolFile::Dump(Stream &s) {
   s.PutCString("Types:\n");
   m_type_list.Dump(&s, /*show_context*/ false);
Index: include/lldb/Symbol/SymbolFile.h
===
--- include/lldb/Symbol/SymbolFile.h
+++ include/lldb/Symbol/SymbolFile.h
@@ -212,6 +212,7 @@
 
   ObjectFile *GetObjectFile() { return m_obj_file; }
   const ObjectFile *GetObjectFile() const { return m_obj_file; }
+  ObjectFile *GetMainObjectFile();
 
   virtual std::vector ParseCallEdgesInFunction(UserID func_id) {
 return {};
@@ -221,7 +222,7 @@
 
   /// Notify the SymbolFile that the file addresses in the Sections
   /// for this module have been changed.
-  virtual void SectionFileAddressesChanged() {}
+  virtual void SectionFileAddressesChanged();
 
   struct RegisterInfoResolver {
 virtual ~RegisterInfoResolver(); // anchor


Index: source/Symbol/SymbolVendor.cpp
===
--- source/Symbol/SymbolVendor.cpp
+++ source/Symbol/SymbolVendor.cpp
@@ -390,19 +390,8 @@
 }
 
 void SymbolVendor::SectionFileAddressesChanged() {
-  ModuleSP module_sp(GetModule());
-  if (module_sp) {
-ObjectFile *module_objfile = module_sp->GetObjectFile();
-if (m_sym_file_up) {
-  ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
-  if (symfile_objfile != module_objfile)
-symfile_objfile->SectionFileAddressesChanged();
-}
-Symtab *symtab = GetSymtab();
-if (symtab) {
-  symtab->SectionFileAddressesChanged();
-}
-  }
+  if (m_sym_file_up)
+m_sym_file_up->SectionFileAddressesChanged();
 }
 
 // PluginInterface protocol
Index: source/Symbol/SymbolFile.cpp
===
--- source/Symbol/SymbolFile.cpp
+++ source/Symbol/SymbolFile.cpp
@@ -31,6 +31,9 @@
 std::recursive_mutex &SymbolFile::GetModuleMutex() const {
   return GetObjectFile()->GetModule()->GetMutex();
 }
+ObjectFile *SymbolFile::GetMainObjectFile() {
+  return m_obj_file->GetModule()->GetObjectFile();
+}
 
 SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
   std::unique_ptr best_symfile_up;
@@ -205,7 +208,7 @@
 return m_symtab;
 
   // Fetch the symtab from the main object file.
-  m_symtab = m_obj_file->GetModule()->GetObjectFile()->GetSymtab();
+  m_symtab = GetMainObjectFile()->GetSymtab();
 
   // Then add our symbols to it.
   if (m_symtab)
@@ -214,6 +217,15 @@
   return m_symtab;
 }
 
+void SymbolFile::SectionFileAddressesChanged() {
+  ObjectFile *module_objfile = GetMainObjectFile();
+  ObjectFile *symfile_objfile = GetObjectFile();
+  if (symfile_objfile != module_objfile)
+   

[Lldb-commits] [lldb] r367001 - SymbolFile: Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D65089/r366791

2019-07-25 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Thu Jul 25 02:56:45 2019
New Revision: 367001

URL: http://llvm.org/viewvc/llvm-project?rev=367001&view=rev
Log:
SymbolFile: Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after 
D65089/r366791

Modified:
lldb/trunk/source/Symbol/SymbolFile.cpp

Modified: lldb/trunk/source/Symbol/SymbolFile.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolFile.cpp?rev=367001&r1=367000&r2=367001&view=diff
==
--- lldb/trunk/source/Symbol/SymbolFile.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolFile.cpp Thu Jul 25 02:56:45 2019
@@ -189,6 +189,7 @@ void SymbolFile::SetCompileUnitAtIndex(u
   std::lock_guard guard(GetModuleMutex());
   const size_t num_compile_units = GetNumCompileUnits();
   assert(idx < num_compile_units);
+  (void)num_compile_units;
 
   // Fire off an assertion if this compile unit already exists for now. The
   // partial parsing should take care of only setting the compile unit


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


[Lldb-commits] [lldb] r367005 - [lldb][CMake] Fix framework-enabled build detail for Xcode

2019-07-25 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Thu Jul 25 03:47:49 2019
New Revision: 367005

URL: http://llvm.org/viewvc/llvm-project?rev=367005&view=rev
Log:
[lldb][CMake] Fix framework-enabled build detail for Xcode

If debugserver or any other framework tool gets built first, its post-build 
copy operation was using 'Resources' as the file name instead of the 
destination directory. It was not a problem with Ninja, because here the 
framework structure was alreaady created at configuration time. With this fix, 
both generators are happy.

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

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=367005&r1=367004&r2=367005&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Jul 25 03:47:49 2019
@@ -204,7 +204,7 @@ function(lldb_add_to_buildtree_lldb_fram
   # Destination for the copy in the build-tree. While the framework target may
   # not exist yet, it will exist when the generator expression gets expanded.
   get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
-  set(copy_dest "${framework_build_dir}/${subdir}")
+  set(copy_dest "${framework_build_dir}/${subdir}/$")
 
   # Copy into the given subdirectory for testing.
   add_custom_command(TARGET ${name} POST_BUILD


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


[Lldb-commits] [lldb] r367009 - [lldb] Tablegenify expr/frame/log/register/memory

2019-07-25 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Jul 25 04:22:46 2019
New Revision: 367009

URL: http://llvm.org/viewvc/llvm-project?rev=367009&view=rev
Log:
[lldb] Tablegenify expr/frame/log/register/memory

Modified:
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectLog.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectRegister.cpp
lldb/trunk/source/Commands/Options.td

Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=367009&r1=367008&r2=367009&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Thu Jul 25 04:22:46 
2019
@@ -48,23 +48,8 @@ static constexpr OptionEnumValues Descri
 }
 
 static constexpr OptionDefinition g_expression_options[] = {
-// clang-format off
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "all-threads",   'a', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeBoolean,  "Should we run all threads if the execution 
doesn't complete on one thread."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "ignore-breakpoints",'i', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeBoolean,  "Ignore breakpoint hits while running 
expressions"},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "timeout",   't', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeUnsignedInteger,  "Timeout value (in microseconds) for running the 
expression."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "unwind-on-error",   'u', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeBoolean,  "Clean up program state if the expression causes 
a crash, or raises a signal.  "
-   

   "Note, unlike gdb hitting a breakpoint is controlled by 
another option (-i)."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "debug", 'g', 
OptionParser::eNoArgument,   nullptr, {},  0, 
eArgTypeNone, "When specified, debug the JIT code by setting a 
breakpoint on the first instruction "
-   

   "and forcing breakpoints to not be ignored (-i0) and no 
unwinding to happen on error (-u0)."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "language",  'l', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeLanguage, "Specifies the Language to use when parsing the 
expression.  If not set the target.language "
-   

   "setting is used." },
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "apply-fixits",  'X', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeLanguage, "If true, simple fix-it hints will be 
automatically applied to the expression." },
-  {LLDB_OPT_SET_1,  false, "description-verbosity", 'v', 
OptionParser::eOptionalArgument, nullptr, DescriptionVerbosityTypes(), 0, 
eArgTypeDescriptionVerbosity, "How verbose should the output of this expression 
be, if the object description is asked for."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "top-level", 'p', 
OptionParser::eNoArgument,   nullptr, {},  0, 
eArgTypeNone, "Interpret the expression as a complete 
translation unit, without injecting it into the local "
-   

   "context.  Allows declaration of persistent, top-level 
entities without a $ prefix."},
-  {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "allow-jit", 'j', 
OptionParser::eRequiredArgument, nullptr, {},  0, 
eArgTypeBoolean,  "Controls whether the expression can fall back to 
being JITted if it's not supported by "
-   

   "the interpreter (defaults to true)."}
-// clang-format on
+#d

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: aprantl, labath, clayborg.
jankratochvil added a project: LLDB.
Herald added subscribers: lldb-commits, abidh.

rL357954  did increase `packet-timeout` 1sec 
-> 5secs. Which is IMO about the maximum timeout reasonable for regular use. 
But for testsuite I think the timeout should be higher as the testsuite runs in 
parallel and it can be run even on slow hosts and with other load (moreover if 
it runs on some slow arch).
I have chosen 300 secs, I do not mind lower but it should be >=60 I think.
I agree these testsuite settings together with `symbols.enable-external-lookup` 
should be unified to a single place but that can be some other patch.
This patch was based on this testsuite timeout:
http://lab.llvm.org:8014/builders/lldb-x86_64-fedora/builds/546/steps/test/logs/stdio

  FAIL: test_connect (TestGDBRemoteClient.TestGDBRemoteClient)
 Test connecting to a remote gdb server
  --
  Traceback (most recent call last):
File 
"/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py",
 line 13, in test_connect
  process = self.connect(target)
File 
"/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py",
 line 480, in connect
  self.assertTrue(error.Success(), error.description)
  AssertionError: False is not True : failed to get reply to handshake packet


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65271

Files:
  lldb/lit/lit-lldb-init.in
  lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -976,6 +976,12 @@
 
   auto Dbg = lldb_private::Debugger::CreateInstance();
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  // Unable to get:
+  // GetGlobalPluginProperties()->SetPacketTimeout(std::chrono::seconds(300));
+  CommandReturnObject Result;
+  Dbg->GetCommandInterpreter().HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 300",
+  /*add_to_history*/ eLazyBoolNo, Result);
 
   if (!opts::Log.empty())
 Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -211,6 +211,7 @@
 // may take a little longer than normal to receive a reply.  Wait at least
 // 6 seconds for a reply to this packet.
 
+// 6 secs are still not sufficient; this line is not to be checked-in.
 ScopedTimeout timeout(*this, std::max(GetPacketTimeout(), seconds(6)));
 
 StringExtractorGDBRemote response;
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -448,7 +448,8 @@
 if trace:
 args_dict['trace'] = trace
 args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+'settings set symbols.enable-external-lookup false',
+'settings set plugin.process.gdb-remote.packet-timeout 300']
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
@@ -579,7 +580,8 @@
 if trace:
 args_dict['trace'] = trace
 args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+'settings set symbols.enable-external-lookup false',
+'settings set plugin.process.gdb-remote.packet-timeout 300']
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -716,7 +716,9 @@
 else:
 self.lldbVSCodeExec = N

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 211712.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271

Files:
  lldb/lit/lit-lldb-init.in
  lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -976,6 +976,12 @@
 
   auto Dbg = lldb_private::Debugger::CreateInstance();
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  // Unable to get:
+  // GetGlobalPluginProperties()->SetPacketTimeout(std::chrono::seconds(300));
+  CommandReturnObject Result;
+  Dbg->GetCommandInterpreter().HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 300",
+  /*add_to_history*/ eLazyBoolNo, Result);
 
   if (!opts::Log.empty())
 Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -211,6 +211,7 @@
 // may take a little longer than normal to receive a reply.  Wait at least
 // 6 seconds for a reply to this packet.
 
+// 6 secs are still not sufficient; this line is not to be checked-in.
 ScopedTimeout timeout(*this, std::max(GetPacketTimeout(), seconds(6)));
 
 StringExtractorGDBRemote response;
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -448,7 +448,8 @@
 if trace:
 args_dict['trace'] = trace
 args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+'settings set symbols.enable-external-lookup false',
+'settings set plugin.process.gdb-remote.packet-timeout 300']
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
@@ -579,7 +580,8 @@
 if trace:
 args_dict['trace'] = trace
 args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+'settings set symbols.enable-external-lookup false',
+'settings set plugin.process.gdb-remote.packet-timeout 300']
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -716,7 +716,9 @@
 else:
 self.lldbVSCodeExec = None
 
-self.lldbOption = "-o 'settings set symbols.enable-external-lookup false'"
+self.lldbOption = (
+"-o 'settings set symbols.enable-external-lookup false'"
+" -o 'settings set plugin.process.gdb-remote.packet-timeout 300'")
 
 # If we spawn an lldb process for test (via pexpect), do not load the
 # init file unless told otherwise.
@@ -1864,6 +1866,9 @@
 # differ in the debug info, which is not being hashed.
 self.runCmd('settings set symbols.enable-external-lookup false')
 
+# Testsuite runs in parallel and the host can have also other load.
+self.runCmd('settings set plugin.process.gdb-remote.packet-timeout 300')
+
 # Disable color.
 self.runCmd("settings set use-color false")
 
Index: lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
@@ -21,6 +21,7 @@
 def threadStopInfo(self, threadnum):
 if threadnum == 0x1ff0d:
 return "T02thread:1ff0d;thread-pcs:10001bc00;"
+return ""
 
 def setBreakpoint(self, packet):
 if packet.startswith("Z2,"):
Index: lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.te

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked 3 inline comments as done.
jankratochvil added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py:24
 return "T02thread:1ff0d;thread-pcs:10001bc00;"
+return ""
 

Here it was always timing out (and still reporting `PASS`) which was not a 
problem for 5 seconds timeout but with 5 minutes timeout it was hanging during 
the testsuite run.



Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:214
 
+// 6 secs are still not sufficient; this line is not to be checked-in.
 ScopedTimeout timeout(*this, std::max(GetPacketTimeout(), seconds(6)));

The failed `TestGDBRemoteClient` testcases did timeout despite this increase to 
6 seconds (which made more sense before rL357954 when the default timeout was 
just 1 second and not the current 5 seconds).
If this patch is not welcome maybe we could try running the testsuite just 
increasing this `seconds(6)` to some `seconds(60)`.



Comment at: lldb/tools/lldb-test/lldb-test.cpp:984
+  "settings set plugin.process.gdb-remote.packet-timeout 300",
+  /*add_to_history*/ eLazyBoolNo, Result);
 

I somehow failed to find how to access the timeout by API, I can try again.



Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Why not unify now? It shouldn't be too hard to at least unify all the instances 
in dotest python code to a single place. That would already cut the number of 
places that need to be kept synced in half...




Comment at: lldb/tools/lldb-test/lldb-test.cpp:984
+  "settings set plugin.process.gdb-remote.packet-timeout 300",
+  /*add_to_history*/ eLazyBoolNo, Result);
 

jankratochvil wrote:
> I somehow failed to find how to access the timeout by API, I can try again.
> 
I wouldn't be surprised if there is no api for that.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [PATCH] D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4

2019-07-25 Thread António Afonso via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367020: Correctly use GetLoadedModuleList to take advantage 
of libraries-svr4 (authored by aadsm, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64013?vs=211661&id=211745#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64013

Files:
  lldb/trunk/include/lldb/Target/Process.h
  lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
  lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
  lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
  
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -200,9 +200,9 @@
 
   llvm::VersionTuple GetHostOSVersion() override;
 
-  size_t LoadModules(LoadedModuleInfoList &module_list) override;
+  llvm::Error LoadModules() override;
 
-  size_t LoadModules() override;
+  llvm::Expected GetLoadedModuleList() override;
 
   Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded,
 lldb::addr_t &load_addr) override;
@@ -391,9 +391,6 @@
   // Query remote GDBServer for register information
   bool GetGDBServerRegisterInfo(ArchSpec &arch);
 
-  // Query remote GDBServer for a detailed loaded library list
-  Status GetLoadedModuleList(LoadedModuleInfoList &);
-
   lldb::ModuleSP LoadModuleAtAddress(const FileSpec &file,
  lldb::addr_t link_map,
  lldb::addr_t base_addr,
Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2390,7 +2390,12 @@
 ostr.Printf("%" PRIu64 " %" PRIu32, wp_addr, wp_index);
 description = ostr.GetString();
   } else if (key.compare("library") == 0) {
-LoadModules();
+auto error = LoadModules();
+if (error) {
+  Log *log(
+  ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+  LLDB_LOG_ERROR(log, std::move(error), "Failed to load modules: {0}");
+}
   } else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1])) {
 uint32_t reg = UINT32_MAX;
 if (!key.getAsInteger(16, reg))
@@ -2742,9 +2747,13 @@
 
   // the loaded module list can also provides a link map address
   if (addr == LLDB_INVALID_ADDRESS) {
-LoadedModuleInfoList list;
-if (GetLoadedModuleList(list).Success())
-  addr = list.m_link_map;
+llvm::Expected list = GetLoadedModuleList();
+if (!list) {
+  Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+  LLDB_LOG_ERROR(log, list.takeError(), "Failed to read module list: {0}");
+} else {
+  addr = list->m_link_map;
+}
   }
 
   return addr;
@@ -4682,39 +4691,43 @@
   return m_register_info.GetNumRegisters() > 0;
 }
 
-Status ProcessGDBRemote::GetLoadedModuleList(LoadedModuleInfoList &list) {
+llvm::Expected ProcessGDBRemote::GetLoadedModuleList() {
   // Make sure LLDB has an XML parser it can use first
   if (!XMLDocument::XMLEnabled())
-return Status(0, ErrorType::eErrorTypeGeneric);
+return llvm::createStringError(llvm::inconvertibleErrorCode(),
+   "XML parsing not available");
 
   Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS);
   LLDB_LOGF(log, "ProcessGDBRemote::%s", __FUNCTION__);
 
+  LoadedModuleInfoList list;
   GDBRemoteCommunicationClient &comm = m_gdb_comm;
   bool can_use_svr4 = GetGlobalPluginProperties()->GetUseSVR4();
 
   // check that we have extended feature read support
   if (can_use_svr4 && comm.GetQXferLibrariesSVR4ReadSupported()) {
-list.clear();
-
 // request the loaded library list
 std::string raw;
 lldb_private::Status lldberr;
 
 if (!comm.ReadExtFeature(ConstString("libraries-svr4"), ConstString(""),
  raw, lldberr))
-  return Status(0, ErrorType::eErrorTypeGeneric);
+  return llvm::createStringError(llvm::inconvertibleErrorCode(),
+ "Error in libraries-svr4 packet");
 
 // parse the xml file in memory
 LLDB_LOGF(log, "parsing: %s", raw.c_str());
 XMLDocument doc;
 
 if (!doc.ParseMemory(raw.c_str()

[Lldb-commits] [PATCH] D65282: ObjectFileELF: permit thread-local sections with overlapping file addresses

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: clayborg, jingham.
Herald added subscribers: MaskRay, arichardson, aprantl, emaste.
Herald added a reviewer: espindola.

In an attempt to make file-address-based lookups more predictable, in D55998 

we started ignoring sections which would result in file address
overlaps. It turns out this was too aggressive because thread-local
sections typically will have file addresses which apear to overlap
regular data/code. This does not cause a problem at runtime because
thread-local sections are loaded into memory using special logic, but it
can cause problems for lldb when trying to lookup objects by their file
address.

This patch changes ObjectFileELF to permit thread-local sections to
overlap regular ones by essentially giving them a separate address
space. It also makes them more symmetrical to regular sections by
creating container sections from PT_TLS segments.

Simultaneously, the patch changes the regular file address lookup logic
to ignore sections with the thread-specific bit set. I believe this is
what the users looking up file addresses would typically expect, as
looking up thread-local data generally requires more complex logic (e.g.
DWARF has a special opcode for that).


https://reviews.llvm.org/D65282

Files:
  lit/Modules/ELF/PT_LOAD-overlap-PT_TLS.yaml
  source/Core/Section.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1772,6 +1772,8 @@
   VMMap Segments = VMMap(Alloc);
   VMMap Sections = VMMap(Alloc);
   lldb_private::Log *Log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_MODULES);
+  size_t SegmentCount = 0;
+  std::string SegmentName;
 
   VMRange GetVMRange(const ELFSectionHeader &H) {
 addr_t Address = H.sh_addr;
@@ -1786,18 +1788,22 @@
   }
 
 public:
-  VMAddressProvider(ObjectFile::Type Type) : ObjectType(Type) {}
+  VMAddressProvider(ObjectFile::Type Type, llvm::StringRef SegmentName)
+  : ObjectType(Type), SegmentName(SegmentName) {}
+
+  size_t GetSegmentCount() const { return SegmentCount; }
+  llvm::StringRef GetSegmentName() const { return SegmentName; }
 
   llvm::Optional GetAddressInfo(const ELFProgramHeader &H) {
 if (H.p_memsz == 0) {
-  LLDB_LOG(Log,
-   "Ignoring zero-sized PT_LOAD segment. Corrupt object file?");
+  LLDB_LOG(Log, "Ignoring zero-sized {0} segment. Corrupt object file?",
+   SegmentName);
   return llvm::None;
 }
 
 if (Segments.overlaps(H.p_vaddr, H.p_vaddr + H.p_memsz)) {
-  LLDB_LOG(Log,
-   "Ignoring overlapping PT_LOAD segment. Corrupt object file?");
+  LLDB_LOG(Log, "Ignoring overlapping {0} segment. Corrupt object file?",
+   SegmentName);
   return llvm::None;
 }
 return VMRange(H.p_vaddr, H.p_memsz);
@@ -1832,6 +1838,7 @@
 
   void AddSegment(const VMRange &Range, SectionSP Seg) {
 Segments.insert(Range.GetRangeBase(), Range.GetRangeEnd(), std::move(Seg));
+++SegmentCount;
   }
 
   void AddSection(SectionAddressInfo Info, SectionSP Sect) {
@@ -1850,28 +1857,33 @@
 return;
 
   m_sections_up = llvm::make_unique();
-  VMAddressProvider address_provider(GetType());
+  VMAddressProvider regular_provider(GetType(), "PT_LOAD");
+  VMAddressProvider tls_provider(GetType(), "PT_TLS");
 
-  size_t LoadID = 0;
   for (const auto &EnumPHdr : llvm::enumerate(ProgramHeaders())) {
 const ELFProgramHeader &PHdr = EnumPHdr.value();
-if (PHdr.p_type != PT_LOAD)
+if (PHdr.p_type != PT_LOAD && PHdr.p_type != PT_TLS)
   continue;
 
-auto InfoOr = address_provider.GetAddressInfo(PHdr);
+VMAddressProvider &provider =
+PHdr.p_type == PT_TLS ? tls_provider : regular_provider;
+auto InfoOr = provider.GetAddressInfo(PHdr);
 if (!InfoOr)
   continue;
 
-ConstString Name(("PT_LOAD[" + llvm::Twine(LoadID++) + "]").str());
+ConstString Name(llvm::formatv("{0}[{1}]", provider.GetSegmentName(),
+   provider.GetSegmentCount())
+ .str());
 uint32_t Log2Align = llvm::Log2_64(std::max(PHdr.p_align, 1));
 SectionSP Segment = std::make_shared(
 GetModule(), this, SegmentID(EnumPHdr.index()), Name,
 eSectionTypeContainer, InfoOr->GetRangeBase(), InfoOr->GetByteSize(),
 PHdr.p_offset, PHdr.p_filesz, Log2Align, /*flags*/ 0);
 Segment->SetPermissions(GetPermissions(PHdr));
+Segment->SetIsThreadSpecific(PHdr.p_type == PT_TLS);
 m_sections_up->AddSection(Segment);
 
-address_provider.AddSegment(*InfoOr, std::move(Segment));
+provider.AddSegment(*InfoOr, std::move(Segment));
   }
 
   ParseSectionHeaders();
@@ -1886,7 +1898,9 @@
 const uint64_t file_size =
 header.sh_type == SHT_NOBITS ? 0 : header.

[Lldb-commits] [PATCH] D65289: [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, krytarowski.
Herald added a project: LLDB.

Mark the process as stopped when SIGSTOP arrives.  This is necessary
for lldb-server to generate correct response to 'process interrupt',
and therefore to prevent the whole stack crashing when process
is stopped.

Thanks to Pavel Labath for the tip.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65289

Files:
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(StateType::eStateStopped, true);
   }
 }
 


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(StateType::eStateStopped, true);
   }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65230: [CMake] Loosen Python version check and ignore patch version

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:203-204
+  if (NOT CMAKE_CROSSCOMPILING)
+# Manually split PYTHON_VERSION_STRING because find_python_libs_windows
+# doesn't set PYTHON_VERSION_MAJOR or PYTHON_VERSION_MINOR.
+string(REPLACE "." ";" python_version_list ${PYTHON_VERSION_STRING})

labath wrote:
> If this is the only reason, then maybe we could fix find_python_libs_windows 
> to set the relevant variables instead (?)
FindPythonLibs only sets `PYTHONLIBS_VERSION_STRING`, so we'd still have that 
to parse the major and minor version of that manually. It was a coin flip 
between keeping the parsing together and updating `find_python_libs_windows`. 
I'm happy to do either. 


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

https://reviews.llvm.org/D65230



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


[Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

2019-07-25 Thread Guilherme Andrade via Phabricator via lldb-commits
guiandrade updated this revision to Diff 211781.
guiandrade marked an inline comment as done.
guiandrade added a comment.

Adds a test to make sure the client is using 'g'  by default.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62931

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -128,6 +128,12 @@
   ASSERT_EQ(0,
 memcmp(buffer_sp->GetBytes(), one_register, sizeof one_register));
 
+  async_result = std::async(std::launch::async,
+[&] { return client.GetgPacketSupported(tid); });
+  Handle_QThreadSuffixSupported(server, true);
+  HandlePacket(server, "g;thread:0047;", all_registers_hex);
+  ASSERT_TRUE(async_result.get());
+
   read_result = std::async(std::launch::async,
[&] { return client.ReadAllRegisters(tid); });
   HandlePacket(server, "g;thread:0047;", all_registers_hex);
Index: lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -303,10 +303,13 @@
 if (process_sp) {
   ProcessGDBRemote *gdb_process =
   static_cast(process_sp.get());
-  // read_all_registers_at_once will be true if 'p' packet is not
-  // supported.
+  // read_all_registers_at_once will be true if the server supports 'g'
+  // packet and either the flag gdb_process->m_use_g_packet is true or 'p'
+  // packet is not supported.
   bool read_all_registers_at_once =
-  !gdb_process->GetGDBRemote().GetpPacketSupported(GetID());
+  gdb_process->GetGDBRemote().GetgPacketSupported(GetID()) &&
+  (gdb_process->m_use_g_packet ||
+   !gdb_process->GetGDBRemote().GetpPacketSupported(GetID()));
   reg_ctx_sp = std::make_shared(
   *this, concrete_frame_idx, gdb_process->m_register_info,
   read_all_registers_at_once);
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -283,6 +283,7 @@
   lldb::CommandObjectSP m_command_sp;
   int64_t m_breakpoint_pc_offset;
   lldb::tid_t m_initial_tid; // The initial thread ID, given by stub on attach
+  bool m_use_g_packet;
 
   bool m_replay_mode;
   bool m_allow_flash_writes;
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
@@ -138,12 +138,20 @@
  nullptr,
  {},
  "If true, the libraries-svr4 feature will be used to get a hold of the "
- "process's loaded modules."}};
+ "process's loaded modules."},
+{"use-g-packet",
+ OptionValue::eTypeBoolean,
+ true,
+ 1,
+ nullptr,
+ {},
+ "Specify if the server should use 'g' packets."}};
 
 enum {
   ePropertyPacketTimeout,
   ePropertyTargetDefinitionFile,
-  ePropertyUseSVR4
+  ePropertyUseSVR4,
+  ePropertyUseGPacket,
 };
 
 class PluginProperties : public Properties {
@@ -180,6 +188,11 @@
 return m_collection_sp->GetPropertyAtIndexAsBoolean(
 nullptr, idx, g_properties[idx].default_uint_value != 0);
   }
+
+  bool GetUseGPacket() const {
+const uint32_t idx = ePropertyUseGPacket;
+return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, true);
+  }
 };
 
 typedef std::shared_ptr ProcessKDPPropertiesSP;
@@ -374,6 +387,8 @@
   GetGlobalPluginProperties()->GetPacketTimeout();
   if (timeout_seconds > 0)
 m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds));
+
+  m_use_g_packet = GetGlobalPluginProperties()->GetUseGPacket();
 }
 
 // Destructor
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ lld

[Lldb-commits] [PATCH] D65289: [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 211787.
mgorny added a comment.
Herald added a reviewer: jfb.

Un-XFAIL some tests fixed by this.


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

https://reviews.llvm.org/D65289

Files:
  
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
  
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
  lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(StateType::eStateStopped, true);
   }
 }
 
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -194,7 +194,6 @@
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -26,7 +26,6 @@
 oslist=['freebsd'],
 bugnumber="llvm.org/pr23318: does not report running state")
 @skipIfWindows  # Windows does not support signals
-@expectedFailureNetBSD
 def test_with_run_command(self):
 """Test that lldb command 'process signal SIGUSR1' sends a signal to 
the inferior process."""
 self.build()
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
===
--- 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
@@ -27,7 +27,6 @@
 oslist=[
 "windows"],
 bugnumber="llvm.org/pr21765")
-@expectedFailureNetBSD
 def test(self):
 """Test calling std::String member function."""
 self.build()
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
===
--- 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -26,7 +26,6 @@
 @skipIfFreeBSD  # llvm.org/pr19246: intermittent failure
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
-@expectedFailureNetBSD
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
 def test(self):
 """Test calling function that hits a signal and restarts."""


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(StateType::eStateStopped, true);
   }
 }
 
Index: lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -194,7 +194,6 @@
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 
-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""
Index: lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
===
--- lldb/packa

[Lldb-commits] [PATCH] D65289: [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 211789.
mgorny added a comment.
Herald added a subscriber: dexonsmith.

Two more apparent XPASS-es.


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

https://reviews.llvm.org/D65289

Files:
  
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
  
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
  lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
  
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(StateType::eStateStopped, true);
   }
 }
 
Index: 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
===
--- 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
+++ 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
@@ -61,7 +61,6 @@
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
-@expectedFailureNetBSD
 @no_debug_info_test
 def test_cwd(self):
 '''
@@ -90,7 +89,6 @@
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
-@expectedFailureNetBSD
 @no_debug_info_test
 def test_debuggerRoot(self):
 '''
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -194,7 +194,6 @@
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -26,7 +26,6 @@
 oslist=['freebsd'],
 bugnumber="llvm.org/pr23318: does not report running state")
 @skipIfWindows  # Windows does not support signals
-@expectedFailureNetBSD
 def test_with_run_command(self):
 """Test that lldb command 'process signal SIGUSR1' sends a signal to 
the inferior process."""
 self.build()
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
===
--- 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
@@ -27,7 +27,6 @@
 oslist=[
 "windows"],
 bugnumber="llvm.org/pr21765")
-@expectedFailureNetBSD
 def test(self):
 """Test calling std::String member function."""
 self.build()
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
===
--- 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -26,7 +26,6 @@
 @skipIfFreeBSD  # llvm.org/pr19246: intermittent failure
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
-@expectedFailureNetBSD
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
 def test(self):
 """Test calling function that hits a signal and restarts."""


Index: lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -203,6 +203,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+   

[Lldb-commits] [PATCH] D65293: Document the fact that LLDB_LOG uses llvm::format_providers

2019-07-25 Thread Jim Ingham via Phabricator via lldb-commits
jingham created this revision.
jingham added a reviewer: labath.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This is a handy and powerful addition to the logging system, but not at all 
discoverable.

This is a trivial patch, but since I don't actually know much about these 
formatters I put it up for review in case there's more useful detail to add or 
people can think of a better place to put this.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65293

Files:
  lldb/include/lldb/Utility/Log.h


Index: lldb/include/lldb/Utility/Log.h
===
--- lldb/include/lldb/Utility/Log.h
+++ lldb/include/lldb/Utility/Log.h
@@ -206,6 +206,11 @@
 
 } // namespace lldb_private
 
+/// The LLDB_LOG macro uses the llvm::formatv system (see the 
ProgrammersManual page in the
+/// llvm docs for more details).  This allows the use of "format_providers" to 
auto-format some of the
+/// llvm and lldb datatypes.  If you need to do non-trivial formatting of one 
of these types,
+/// be sure to grep the lldb and llvm sources for format_provider to see if 
there is already a formatter
+/// before doing in situ formatting, and feel free to add a provider if one 
does not exist.
 #define LLDB_LOG(log, ...) 
\
   do { 
\
 ::lldb_private::Log *log_private = (log);  
\


Index: lldb/include/lldb/Utility/Log.h
===
--- lldb/include/lldb/Utility/Log.h
+++ lldb/include/lldb/Utility/Log.h
@@ -206,6 +206,11 @@
 
 } // namespace lldb_private
 
+/// The LLDB_LOG macro uses the llvm::formatv system (see the ProgrammersManual page in the
+/// llvm docs for more details).  This allows the use of "format_providers" to auto-format some of the
+/// llvm and lldb datatypes.  If you need to do non-trivial formatting of one of these types,
+/// be sure to grep the lldb and llvm sources for format_provider to see if there is already a formatter
+/// before doing in situ formatting, and feel free to add a provider if one does not exist.
 #define LLDB_LOG(log, ...) \
   do { \
 ::lldb_private::Log *log_private = (log);  \
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65128: [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)

2019-07-25 Thread Jim Ingham via Phabricator via lldb-commits
jingham added inline comments.



Comment at: lldb/source/Expression/IRExecutionUnit.cpp:601
 
   if (log) {
+LLDB_LOGF(log,

labath wrote:
> jingham wrote:
> > labath wrote:
> > > looks like there are some `if(log)`s still remaining. Maybe the `{}` 
> > > around the printf confused your vim macro?
> > There will always be some "if (log)" statements.  Whenever consing up the 
> > log message involves work, you should always say:
> > 
> > if (log) {
> >/// Do expensive work
> >LLDB_LOG...
> > }
> > 
> > Not saying that all the remaining "if (logs)" are for that reason, but then 
> > intent is NOT to remove all such statements as they serve a useful purpose.
> I'm fine with `if(log)`s staying if they serve a purpose (or even if they're 
> hard to remove in this patch). However, I would expect that with LLDB_LOG, 
> they become much less frequently needed, because the formatter is much more 
> powerful (e.g., there is no need to write a for loop just to print an array, 
> etc.)
Yes, it's also not entirely obvious (YAY for macros!!!) that code in the 
LLDB_LOG* arguments doesn't get evaluated if log == nullptr, but that also 
reduces the need for standalone if (logs).

BTW, we were going to document somewhere that LLDB_LOG actually used 
format_providers but I didn't see that anywhere.  I submitted:

https://reviews.llvm.org/D65293

to put this somewhere in the lldb sources.  Not sure if this is the best place, 
or if there is more that it would be useful to add.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65128



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


[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

There isn't an SB API for "settings set" yet.  I've put off doing that because 
the "settings" subsystem is currently unfinished.  In the original design you 
would be specify qualifiers in the setting hierarchy, like:

settings set target[arch=x86_64].whatever

That would be pretty handy in a lot of cases - for instance there are some 
settings that you have to set when doing KEXT development on macOS that are not 
appropriate for user-space debugging and  this trips up the kernel developers 
all the time.

But we've never gotten around to designing this fully, and I've don't want to 
design the SB API's for settings till we know how this is going to work.  
Apparently I didn't put this on the Projects page, I'll go rectify that in a 
bit.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 211800.
JDevlieghere added a comment.

Add sanity check that I mentioned. This actually caught a few properties that 
didn't have defaults.


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

https://reviews.llvm.org/D65185

Files:
  lldb/CMakeLists.txt
  lldb/include/lldb/Core/CMakeLists.txt
  lldb/include/lldb/Core/Properties.td
  lldb/include/lldb/Core/PropertiesBase.td
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
  lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/source/Plugins/JITLoader/GDB/Properties.td
  lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Platform/MacOSX/Properties.td
  lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td
  lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
  lldb/source/Plugins/StructuredData/DarwinLog/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/Properties.td
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/Thread.cpp
  lldb/utils/TableGen/CMakeLists.txt
  lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
  lldb/utils/TableGen/LLDBTableGen.cpp
  lldb/utils/TableGen/LLDBTableGenBackends.h

Index: lldb/utils/TableGen/LLDBTableGenBackends.h
===
--- lldb/utils/TableGen/LLDBTableGenBackends.h
+++ lldb/utils/TableGen/LLDBTableGenBackends.h
@@ -29,6 +29,8 @@
 namespace lldb_private {
 
 void EmitOptionDefs(RecordKeeper &RK, raw_ostream &OS);
+void EmitPropertyDefs(RecordKeeper &RK, raw_ostream &OS);
+void EmitPropertyEnumDefs(RecordKeeper &RK, raw_ostream &OS);
 
 } // namespace lldb_private
 
Index: lldb/utils/TableGen/LLDBTableGen.cpp
===
--- lldb/utils/TableGen/LLDBTableGen.cpp
+++ lldb/utils/TableGen/LLDBTableGen.cpp
@@ -25,6 +25,8 @@
   PrintRecords,
   DumpJSON,
   GenOptionDefs,
+  GenPropertyDefs,
+  GenPropertyEnumDefs,
 };
 
 static cl::opt
@@ -34,7 +36,11 @@
   clEnumValN(DumpJSON, "dump-json",
  "Dump all records as machine-readable JSON"),
   clEnumValN(GenOptionDefs, "gen-lldb-option-defs",
- "Generate lldb option definitions")));
+ "Generate lldb option definitions"),
+  clEnumValN(GenPropertyDefs, "gen-lldb-property-defs",
+ "Generate lldb property definitions"),
+  clEnumValN(GenPropertyEnumDefs, "gen-lldb-property-enum-defs",
+ "Generate lldb property enum definitions")));
 
 static bool LLDBTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
   switch (Action) {
@@ -47,6 +53,12 @@
   case GenOptionDefs:
 EmitOptionDefs(Records, OS);
 break;
+  case GenPropertyDefs:
+EmitPropertyDefs(Records, OS);
+break;
+  case GenPropertyEnumDefs:
+EmitPropertyEnumDefs(Records, OS);
+break;
   }
   return false;
 }
Index: lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
@@ -0,0 +1,173 @@
+//===- LLDBPropertyDefEmitter.cpp -===//
+//
+// 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
+//
+//===--===//
+//
+// These tablegen backends emits LLDB's PropertyDefinition values.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/TableGen/Record.h"
+#include "llvm/TableGen/StringMatcher.h"
+#include "llvm/TableGen/TableGenBackend.h"
+#include 
+#include 
+
+using namespace llvm;
+
+///

[Lldb-commits] [PATCH] D65289: [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

cool


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

https://reviews.llvm.org/D65289



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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-25 Thread Alex Langford via Phabricator via lldb-commits
xiaobai accepted this revision.
xiaobai added a comment.
This revision is now accepted and ready to land.

I think this is fine. Using `.def` files would be okay too, but I like the 
sanity checks that Jonas introduced in the LLDBPropertyDefEmitter


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

https://reviews.llvm.org/D65185



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


[Lldb-commits] [PATCH] D65230: [CMake] Loosen Python version check and ignore patch version

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:203-204
+  if (NOT CMAKE_CROSSCOMPILING)
+# Manually split PYTHON_VERSION_STRING because find_python_libs_windows
+# doesn't set PYTHON_VERSION_MAJOR or PYTHON_VERSION_MINOR.
+string(REPLACE "." ";" python_version_list ${PYTHON_VERSION_STRING})

JDevlieghere wrote:
> labath wrote:
> > If this is the only reason, then maybe we could fix 
> > find_python_libs_windows to set the relevant variables instead (?)
> FindPythonLibs only sets `PYTHONLIBS_VERSION_STRING`, so we'd still have that 
> to parse the major and minor version of that manually. It was a coin flip 
> between keeping the parsing together and updating `find_python_libs_windows`. 
> I'm happy to do either. 
Yea, I see what you mean. I think I'd go with changing 
`find_python_libs_windows` just to minimize the difference between the windows 
and non-windows branches of the python-finding code (and possible side-effects 
of those differences), but it's not a big deal either way...


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

https://reviews.llvm.org/D65230



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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-25 Thread Frederic Riss via Phabricator via lldb-commits
friss added a comment.

When we hit that merge conflict issue 2 days ago (which mismatched a property 
and its enum), the first thing that came to my mind was that a tablegen 
approach would have prevented it. For some reason it seemed more natural to me, 
and it still does.

I might have liked a .def file approach as much if Jonas did it that way. Now 
that this is implemented however, I'm not sure I see the appeal of redoing it 
as a .def file.


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

https://reviews.llvm.org/D65185



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


[Lldb-commits] [lldb] r367047 - [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Jul 25 13:27:40 2019
New Revision: 367047

URL: http://llvm.org/viewvc/llvm-project?rev=367047&view=rev
Log:
[lldb] [Process/NetBSD] Report stopped process on SIGSTOP

Mark the process as stopped when SIGSTOP arrives.  This is necessary
for lldb-server to generate correct response to 'process interrupt',
and therefore to prevent the whole stack crashing when process
is stopped.

Thanks to Pavel Labath for the tip.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
 Thu Jul 25 13:27:40 2019
@@ -26,7 +26,6 @@ class ExprCommandThatRestartsTestCase(Te
 @skipIfFreeBSD  # llvm.org/pr19246: intermittent failure
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
-@expectedFailureNetBSD
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
 def test(self):
 """Test calling function that hits a signal and restarts."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
 Thu Jul 25 13:27:40 2019
@@ -27,7 +27,6 @@ class ExprCommandWithTimeoutsTestCase(Te
 oslist=[
 "windows"],
 bugnumber="llvm.org/pr21765")
-@expectedFailureNetBSD
 def test(self):
 """Test calling std::String member function."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
 Thu Jul 25 13:27:40 2019
@@ -26,7 +26,6 @@ class SendSignalTestCase(TestBase):
 oslist=['freebsd'],
 bugnumber="llvm.org/pr23318: does not report running state")
 @skipIfWindows  # Windows does not support signals
-@expectedFailureNetBSD
 def test_with_run_command(self):
 """Test that lldb command 'process signal SIGUSR1' sends a signal to 
the inferior process."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=367047&r1=367046&r2=367047&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
 Thu Jul 25 13:27:40 2019
@@ -194,7 +194,6 @@ class ThreadStateTestCase(TestBase):
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
ht

[Lldb-commits] [PATCH] D65289: [lldb] [Process/NetBSD] Report stopped process on SIGSTOP

2019-07-25 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367047: [lldb] [Process/NetBSD] Report stopped process on 
SIGSTOP (authored by mgorny, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65289?vs=211789&id=211809#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65289

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
  lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp


Index: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
@@ -61,7 +61,6 @@
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
-@expectedFailureNetBSD
 @no_debug_info_test
 def test_cwd(self):
 '''
@@ -90,7 +89,6 @@
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
-@expectedFailureNetBSD
 @no_debug_info_test
 def test_debuggerRoot(self):
 '''
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -26,7 +26,6 @@
 oslist=['freebsd'],
 bugnumber="llvm.org/pr23318: does not report running state")
 @skipIfWindows  # Windows does not support signals
-@expectedFailureNetBSD
 def test_with_run_command(self):
 """Test that lldb command 'process signal SIGUSR1' sends a signal to 
the inferior process."""
 self.build()
Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -194,7 +194,6 @@
 oslist=["windows"],
 bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
 @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and 

-@expectedFailureNetBSD
 @no_debug_info_test
 def test_process_interrupt(self):
 """Test process interrupt and continue."""
Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
@@ -27,7 +27,6 @@
 oslist=[
 "windows"],
 bugnumber="llvm.org/pr21765")
-@expectedFailureNetBSD
 def test(self):
 """Test calling std::String member function."""
 self.build()
Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -26,7 +26,6 @@
 @skipIfFreeBSD  # llvm.org/pr19246: intermittent failure
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
-@expectedFailureNetBSD
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
 def test(self):
 """Test calling function that hits a signal and restarts."""
Index: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
===
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -195,6 +195,7 @@
 SIGSTOP, &info.psi_siginfo);
   }
 }
+SetState(Sta

[Lldb-commits] [PATCH] D65230: [CMake] Loosen Python version check and ignore patch version

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 211811.
JDevlieghere marked an inline comment as done.
JDevlieghere added a comment.

Export the same variables in `find_python_libs_windows` as `FindPythonInterp` 
and `FindPythonLibs`.


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

https://reviews.llvm.org/D65230

Files:
  lldb/cmake/modules/LLDBConfig.cmake


Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -140,7 +140,6 @@
  PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message(STATUS "Found Python library version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" 
PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
-set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" PARENT_SCOPE)
 unset(python_version_str)
   else()
 message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python 
installation is corrupt.")
@@ -175,13 +174,31 @@
 return()
   endif()
 
-  set (PYTHON_EXECUTABLE ${PYTHON_EXE} PARENT_SCOPE)
-  set (PYTHON_LIBRARY ${PYTHON_LIB} PARENT_SCOPE)
-  set (PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
-  set (PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} PARENT_SCOPE)
+  # Find the version of the Python interpreter.
+  execute_process(COMMAND "${PYTHON_EXE}" -c
+  "import sys; sys.stdout.write(';'.join([str(x) for x in 
sys.version_info[:3]]))"
+  OUTPUT_VARIABLE PYTHON_VERSION_OUTPUT
+  RESULT_VARIABLE PYTHON_VERSION_RESULT
+  ERROR_QUIET)
+  if(NOT PYTHON_VERSION_RESULT)
+string(REPLACE ";" "." PYTHON_VERSION_STRING "${PYTHON_VERSION_OUTPUT}")
+list(GET PYTHON_VERSION_OUTPUT 0 PYTHON_VERSION_MAJOR)
+list(GET PYTHON_VERSION_OUTPUT 1 PYTHON_VERSION_MINOR)
+list(GET PYTHON_VERSION_OUTPUT 2 PYTHON_VERSION_PATCH)
+  endif()
 
-  message(STATUS "LLDB Found PythonExecutable: ${PYTHON_EXE}")
-  message(STATUS "LLDB Found PythonLibs: ${PYTHON_LIB}")
+  # Set the same variables as FindPythonInterp and FindPythonLibs.
+  set(PYTHON_EXECUTABLE ${PYTHON_EXE} PARENT_SCOPE)
+  set(PYTHON_LIBRARY ${PYTHON_LIB} PARENT_SCOPE)
+  set(PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
+  set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" PARENT_SCOPE)
+  set(PYTHON_VERSION_STRING ${PYTHON_VERSION_STRING} PARENT_SCOPE)
+  set(PYTHON_VERSION_MAJOR ${PYTHON_VERSION_MAJOR} PARENT_SCOPE)
+  set(PYTHON_VERSION_MINOR ${PYTHON_VERSION_MINOR} PARENT_SCOPE)
+  set(PYTHON_VERSION_PATCH ${PYTHON_VERSION_PATCH} PARENT_SCOPE)
+
+  message(STATUS "LLDB Found PythonExecutable: ${PYTHON_EXECUTABLE}")
+  message(STATUS "LLDB Found PythonLibs: ${PYTHON_LIBRARY}")
   message(STATUS "LLDB Found PythonDLL: ${PYTHON_DLL}")
   message(STATUS "LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")
 endfunction(find_python_libs_windows)
@@ -199,9 +216,18 @@
 find_package(PythonLibs REQUIRED)
   endif()
 
-  if (NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING AND
-  NOT CMAKE_CROSSCOMPILING)
-message(FATAL_ERROR "Found incompatible Python interpreter 
(${PYTHON_VERSION_STRING}) and Python libraries (${PYTHONLIBS_VERSION_STRING})")
+  if (NOT CMAKE_CROSSCOMPILING)
+string(REPLACE "." ";" pythonlibs_version_list 
${PYTHONLIBS_VERSION_STRING})
+list(GET pythonlibs_version_list 0 pythonlibs_major)
+list(GET pythonlibs_version_list 1 pythonlibs_minor)
+
+# Ignore the patch version. Some versions of macOS report a different patch
+# version for the system provided interpreter and libraries.
+if (NOT PYTHON_VERSION_MAJOR VERSION_EQUAL pythonlibs_major OR
+NOT PYTHON_VERSION_MINOR VERSION_EQUAL pythonlibs_minor)
+  message(FATAL_ERROR "Found incompatible Python interpreter 
(${python_major}.${python_minor})"
+  " and Python libraries 
(${pythonlibs_major}.${pythonlibs_minor})")
+endif()
   endif()
 
   if (PYTHON_INCLUDE_DIR)


Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -140,7 +140,6 @@
  PYTHONLIBS_VERSION_STRING "${python_version_str}")
 message(STATUS "Found Python library version ${PYTHONLIBS_VERSION_STRING}")
 string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
-set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}" PARENT_SCOPE)
 unset(python_version_str)
   else()
 message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python installation is corrupt.")
@@ -175,13 +174,31 @@
 return()
   endif()
 
-  set (PYTHON_EXECUTABLE ${PYTHON_EXE} PARENT_SCOPE)
-  set (PYTHON_LIBRARY ${PYTHON_LIB} PARENT_SCOPE)
-  set (PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
-  set (PYTHO

[Lldb-commits] [PATCH] D65230: [CMake] Loosen Python version check and ignore patch version

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

@amccarth I think this might explain the issues you were having last week. 
Without this patch, `find_python_libs_windows` is not setting the expected 
version variables. As a result, my check was complaining about a mismatch 
between the Python interpreter that LLVM found, and the libs that LLDB found, 
while LLDB was actually using a different Python interpreter, found by 
`find_python_libs_windows`.




Comment at: lldb/cmake/modules/LLDBConfig.cmake:203-204
+  if (NOT CMAKE_CROSSCOMPILING)
+# Manually split PYTHON_VERSION_STRING because find_python_libs_windows
+# doesn't set PYTHON_VERSION_MAJOR or PYTHON_VERSION_MINOR.
+string(REPLACE "." ";" python_version_list ${PYTHON_VERSION_STRING})

labath wrote:
> JDevlieghere wrote:
> > labath wrote:
> > > If this is the only reason, then maybe we could fix 
> > > find_python_libs_windows to set the relevant variables instead (?)
> > FindPythonLibs only sets `PYTHONLIBS_VERSION_STRING`, so we'd still have 
> > that to parse the major and minor version of that manually. It was a coin 
> > flip between keeping the parsing together and updating 
> > `find_python_libs_windows`. I'm happy to do either. 
> Yea, I see what you mean. I think I'd go with changing 
> `find_python_libs_windows` just to minimize the difference between the 
> windows and non-windows branches of the python-finding code (and possible 
> side-effects of those differences), but it's not a big deal either way...
Sure, sounds good!


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

https://reviews.llvm.org/D65230



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


[Lldb-commits] [PATCH] D65171: [LLDB] Find debugserver in Command Line Tools as well

2019-07-25 Thread António Afonso via Phabricator via lldb-commits
aadsm added a comment.

@clayborg, yes, I made sure of that, we always first check the Xcode path.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65171



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


[Lldb-commits] [lldb] r367054 - [dotest] Set environment variables after potentialy clearing others.

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 13:54:41 2019
New Revision: 367054

URL: http://llvm.org/viewvc/llvm-project?rev=367054&view=rev
Log:
[dotest] Set environment variables after potentialy clearing others.

Dotest contains code to clear DYLD_LIBRARY_PATH for the inferior to not
propagate sanitized builds. However, it's possible that we want to
inject a different library path with `--inferior-env`. To make that work
correctly, we need to do that *after* clearing DYLD_LIBRARY_PATH.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.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=367054&r1=367053&r2=367054&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Jul 25 13:54:41 
2019
@@ -1851,9 +1851,6 @@ class TestBase(Base):
 # decorators.
 Base.setUp(self)
 
-if lldbtest_config.inferior_env:
-self.runCmd('settings set target.env-vars 
{}'.format(lldbtest_config.inferior_env))
-
 # Set the clang modules cache path used by LLDB.
 mod_cache = os.path.join(os.environ["LLDB_BUILD"], "module-cache-lldb")
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
@@ -1871,6 +1868,10 @@ class TestBase(Base):
 if 'DYLD_LIBRARY_PATH' in os.environ:
 self.runCmd('settings set target.env-vars DYLD_LIBRARY_PATH=')
 
+# Set environment variables for the inferior.
+if lldbtest_config.inferior_env:
+self.runCmd('settings set target.env-vars 
{}'.format(lldbtest_config.inferior_env))
+
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])
 


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


[Lldb-commits] [PATCH] D65171: [LLDB] Find debugserver in Command Line Tools as well

2019-07-25 Thread António Afonso via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367052: [LLDB] Find debugserver in Command Line Tools as 
well (authored by aadsm, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65171?vs=211372&id=211815#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65171

Files:
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
===
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -1102,6 +1102,34 @@
   return false;
 }
 
+static FileSpec GetXcodeSelectPath() {
+  static FileSpec g_xcode_select_filespec;
+
+  if (!g_xcode_select_filespec) {
+FileSpec xcode_select_cmd("/usr/bin/xcode-select");
+if (FileSystem::Instance().Exists(xcode_select_cmd)) {
+  int exit_status = -1;
+  int signo = -1;
+  std::string command_output;
+  Status status =
+  Host::RunShellCommand("/usr/bin/xcode-select --print-path",
+nullptr, // current working directory
+&exit_status, &signo, &command_output,
+std::chrono::seconds(2), // short timeout
+false);  // don't run in a shell
+  if (status.Success() && exit_status == 0 && !command_output.empty()) {
+size_t first_non_newline = command_output.find_last_not_of("\r\n");
+if (first_non_newline != std::string::npos) {
+  command_output.erase(first_non_newline + 1);
+}
+g_xcode_select_filespec = FileSpec(command_output);
+  }
+}
+  }
+
+  return g_xcode_select_filespec;
+}
+
 // Return a directory path like /Applications/Xcode.app/Contents/Developer
 const char *PlatformDarwin::GetDeveloperDirectory() {
   std::lock_guard guard(m_mutex);
@@ -1159,34 +1187,10 @@
 }
 
 if (!developer_dir_path_valid) {
-  FileSpec xcode_select_cmd("/usr/bin/xcode-select");
-  if (FileSystem::Instance().Exists(xcode_select_cmd)) {
-int exit_status = -1;
-int signo = -1;
-std::string command_output;
-Status error =
-Host::RunShellCommand("/usr/bin/xcode-select --print-path",
-  nullptr, // current working directory
-  &exit_status, &signo, &command_output,
-  std::chrono::seconds(2), // short timeout
-  false); // don't run in a shell
-if (error.Success() && exit_status == 0 && !command_output.empty()) {
-  const char *cmd_output_ptr = command_output.c_str();
-  developer_dir_path[sizeof(developer_dir_path) - 1] = '\0';
-  size_t i;
-  for (i = 0; i < sizeof(developer_dir_path) - 1; i++) {
-if (cmd_output_ptr[i] == '\r' || cmd_output_ptr[i] == '\n' ||
-cmd_output_ptr[i] == '\0')
-  break;
-developer_dir_path[i] = cmd_output_ptr[i];
-  }
-  developer_dir_path[i] = '\0';
-
-  FileSpec devel_dir(developer_dir_path);
-  if (FileSystem::Instance().IsDirectory(devel_dir)) {
-developer_dir_path_valid = true;
-  }
-}
+  FileSpec devel_dir = GetXcodeSelectPath();
+  if (FileSystem::Instance().IsDirectory(devel_dir)) {
+devel_dir.GetPath(&developer_dir_path[0], sizeof(developer_dir_path));
+developer_dir_path_valid = true;
   }
 }
 
@@ -1328,29 +1332,11 @@
 g_xcode_filespec = CheckPathForXcode(developer_dir_spec);
   }
 
-  // Fall back to using "xcrun" to find the selected Xcode
+  // Fall back to using "xcode-select" to find the selected Xcode
   if (!g_xcode_filespec) {
-int status = 0;
-int signo = 0;
-std::string output;
-const char *command = "/usr/bin/xcode-select -p";
-lldb_private::Status error = Host::RunShellCommand(
-command, // shell command to run
-nullptr, // current working directory
-&status, // Put the exit status of the process in here
-&signo,  // Put the signal that caused the process to exit in here
-&output, // Get the output from the command and place it in this
- // string
-std::chrono::seconds(3));
-if (status == 0 && !output.empty()) {
-  size_t first_non_newline = output.find_last_not_of("\r\n");
-  if (first_non_newline != std::string::npos) {
-output.erase(first_non_newline + 1);
-  }
-  output.append("/..");
-
-  g_xcode_filespec = CheckPathForXcode(FileSpec(output));

[Lldb-commits] [lldb] r367057 - Remove a project that was completed.

2019-07-25 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Jul 25 14:29:29 2019
New Revision: 367057

URL: http://llvm.org/viewvc/llvm-project?rev=367057&view=rev
Log:
Remove a project that was completed.

Modified:
lldb/trunk/docs/status/projects.rst

Modified: lldb/trunk/docs/status/projects.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/status/projects.rst?rev=367057&r1=367056&r2=367057&view=diff
==
--- lldb/trunk/docs/status/projects.rst (original)
+++ lldb/trunk/docs/status/projects.rst Thu Jul 25 14:29:29 2019
@@ -185,12 +185,6 @@ threads lazily but keep "unseen" threads
 them when we know we've fetched the whole thread list and ensured they are no
 longer alive.
 
-Add an extension point in the breakpoint search machinery
--
-
-This would allow highly customizable, algorithmic breakpoint types, like "break
-on every use of some particular instruction, or instruction pattern, etc."
-
 Make Python-backed commands first class citizens
 
 


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


[Lldb-commits] [lldb] r367058 - Let tablegen generate property definitions

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 14:36:37 2019
New Revision: 367058

URL: http://llvm.org/viewvc/llvm-project?rev=367058&view=rev
Log:
Let tablegen generate property definitions

Property definitions are currently defined in a PropertyDefinition array
and have a corresponding enum to index in this array. Unfortunately this
is quite error prone. Indeed, just today we found an incorrect merge
where a discrepancy between the order of the enum values and their
definition caused the test suite to fail spectacularly.

Tablegen can streamline the process of generating the property
definition table while at the same time guaranteeing that the enums stay
in sync. That's exactly what this patch does. It adds a new tablegen
file for the properties, building on top of the infrastructure that
Raphael added recently for the command options. It also introduces two
new tablegen backends: one for the property definitions and one for
their corresponding enums.

It might be worth mentioning that I generated most of the tablegen
definitions from the existing property definitions, by adding a dump
method to the struct. This seems both more efficient and less error
prone that copying everything over by hand. Only Enum properties needed
manual fixup for the EnumValues and DefaultEnumValue fields.

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

Added:
lldb/trunk/include/lldb/Core/CMakeLists.txt
lldb/trunk/include/lldb/Core/Properties.td
lldb/trunk/include/lldb/Core/PropertiesBase.td
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
lldb/trunk/source/Plugins/JITLoader/GDB/Properties.td
lldb/trunk/source/Plugins/Platform/MacOSX/Properties.td
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Properties.td
lldb/trunk/source/Plugins/Process/gdb-remote/Properties.td
lldb/trunk/source/Plugins/StructuredData/DarwinLog/Properties.td
lldb/trunk/source/Plugins/SymbolFile/DWARF/Properties.td
lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/source/Core/CMakeLists.txt
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/JITLoader/GDB/CMakeLists.txt
lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Target/CMakeLists.txt
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/utils/TableGen/CMakeLists.txt
lldb/trunk/utils/TableGen/LLDBTableGen.cpp
lldb/trunk/utils/TableGen/LLDBTableGenBackends.h

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=367058&r1=367057&r2=367058&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Thu Jul 25 14:36:37 2019
@@ -57,6 +57,9 @@ add_subdirectory(source)
 add_subdirectory(tools)
 add_subdirectory(docs)
 
+# Needed by tablegen.
+add_subdirectory(include/lldb/Core)
+
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." 
${LLVM_INCLUDE_TESTS})
 option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via 
LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built 
compiler). Defaults to OFF." OFF)
 option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via 
LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built 
compiler). Defaults to OFF." OFF)

Added: lldb/trunk/include/lldb/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/CMakeLists.txt?rev=367058&view=auto
==
--- lldb/trunk/include/lldb/Core/CMakeLists.txt (added)
+++ lldb/trunk/include/lldb/Core/CMakeLists.txt Thu Jul 25 14:36:37 2019
@@ -0,0 +1,7 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPropertiesGen)
+

[Lldb-commits] [lldb] r367059 - Mention adding predicates to settings in the projects page.

2019-07-25 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Jul 25 14:37:57 2019
New Revision: 367059

URL: http://llvm.org/viewvc/llvm-project?rev=367059&view=rev
Log:
Mention adding predicates to settings in the projects page.

Modified:
lldb/trunk/docs/status/projects.rst

Modified: lldb/trunk/docs/status/projects.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/status/projects.rst?rev=367059&r1=367058&r2=367059&view=diff
==
--- lldb/trunk/docs/status/projects.rst (original)
+++ lldb/trunk/docs/status/projects.rst Thu Jul 25 14:37:57 2019
@@ -409,3 +409,17 @@ If we could predict the catching frame,
 
 And of course, this would be a useful piece of information to display when 
stopped 
 at a throw point.
+
+Add predicates to the nodes of settings
+---
+
+It would be very useful to be able to give values to settings that are 
dependent
+on the triple, or executable name, for targets, or on whether a process is 
local
+or remote, or on the name of a thread, etc.  The original intent (and there is
+a sketch of this in the settings parsing code) was to be able to say:
+
+::
+
+  (lldb) settings set target{arch=x86_64}.process.thread{name=foo}...
+
+The exact details are still to be worked out, however.


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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367058: Let tablegen generate property definitions (authored 
by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65185?vs=211800&id=211824#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65185

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/include/lldb/Core/CMakeLists.txt
  lldb/trunk/include/lldb/Core/Properties.td
  lldb/trunk/include/lldb/Core/PropertiesBase.td
  lldb/trunk/source/Core/CMakeLists.txt
  lldb/trunk/source/Core/Debugger.cpp
  lldb/trunk/source/Core/ModuleList.cpp
  lldb/trunk/source/Interpreter/CommandInterpreter.cpp
  lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
  lldb/trunk/source/Plugins/JITLoader/GDB/CMakeLists.txt
  lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/trunk/source/Plugins/JITLoader/GDB/Properties.td
  lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/Properties.td
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Properties.td
  lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/Properties.td
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/Properties.td
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/trunk/source/Plugins/SymbolFile/DWARF/Properties.td
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Target/CMakeLists.txt
  lldb/trunk/source/Target/Platform.cpp
  lldb/trunk/source/Target/Process.cpp
  lldb/trunk/source/Target/Target.cpp
  lldb/trunk/source/Target/Thread.cpp
  lldb/trunk/utils/TableGen/CMakeLists.txt
  lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
  lldb/trunk/utils/TableGen/LLDBTableGen.cpp
  lldb/trunk/utils/TableGen/LLDBTableGenBackends.h

Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -57,6 +57,9 @@
 add_subdirectory(tools)
 add_subdirectory(docs)
 
+# Needed by tablegen.
+add_subdirectory(include/lldb/Core)
+
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS})
 option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
 option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
Index: lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
===
--- lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
+++ lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
@@ -0,0 +1,173 @@
+//===- LLDBPropertyDefEmitter.cpp -===//
+//
+// 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
+//
+//===--===//
+//
+// These tablegen backends emits LLDB's PropertyDefinition values.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/TableGen/Record.h"
+#include "llvm/TableGen/StringMatcher.h"
+#include "llvm/TableGen/TableGenBackend.h"
+#include 
+#include 
+
+using namespace llvm;
+
+/// Map of properties definitions to their associated records. Also makes sure
+/// our property definitions are sorted in a deterministic way.
+typedef std::map> RecordsByDefinition;
+
+/// Groups all properties by their definition.
+static RecordsByDefinition getPropertyList(std::vector Properties) {
+  RecordsByDefinition result;
+  for (Record *Property : Properties)
+result[Property->getValueAsString("Definition").str()].push_back(Property);
+  return result;
+}
+
+static void emitPropertyEnum(Record *Property, raw_ostream &OS) {
+  OS << "eProperty";
+  OS << Property->getName();
+  OS << ",\n";
+}
+
+s

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 211825.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271

Files:
  lldb/lit/lit-lldb-init.in
  lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -976,6 +976,12 @@
 
   auto Dbg = lldb_private::Debugger::CreateInstance();
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  // There is no SB API for settings in general like:
+  // GetGlobalPluginProperties()->SetPacketTimeout(std::chrono::seconds(300));
+  CommandReturnObject Result;
+  Dbg->GetCommandInterpreter().HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 300",
+  /*add_to_history*/ eLazyBoolNo, Result);
 
   if (!opts::Log.empty())
 Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -10,6 +10,7 @@
 import subprocess
 import sys
 import threading
+from lldbsuite.test.lldbtest import Base
 
 
 def dump_memory(base_addr, data, num_per_line, outfile):
@@ -447,8 +448,7 @@
 args_dict['waitFor'] = waitFor
 if trace:
 args_dict['trace'] = trace
-args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+args_dict['initCommands'] = Base.setUpCommands()
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
@@ -578,8 +578,7 @@
 args_dict['shellExpandArguments'] = shellExpandArguments
 if trace:
 args_dict['trace'] = trace
-args_dict['initCommands'] = [
-'settings set symbols.enable-external-lookup false']
+args_dict['initCommands'] = Base.setUpCommands()
 if initCommands:
 args_dict['initCommands'].extend(initCommands)
 if preRunCommands:
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -698,6 +698,17 @@
 """Return absolute path to a file in the test's source directory."""
 return os.path.join(self.getSourceDir(), name)
 
+@staticmethod
+def setUpCommands():
+return [
+# 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.
+"settings set symbols.enable-external-lookup false",
+
+# Testsuite runs in parallel and the host can have also other load.
+"settings set plugin.process.gdb-remote.packet-timeout 300"]
+
 def setUp(self):
 """Fixture for unittest test case setup.
 
@@ -716,7 +727,7 @@
 else:
 self.lldbVSCodeExec = None
 
-self.lldbOption = "-o 'settings set symbols.enable-external-lookup false'"
+self.lldbOption = " ".join("-o '" + s + "'" for s in self.setUpCommands())
 
 # If we spawn an lldb process for test (via pexpect), do not load the
 # init file unless told otherwise.
@@ -1856,10 +1867,8 @@
 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')
+for s in self.setUpCommands():
+self.runCmd(s)
 
 # Disable color.
 self.runCmd("settings set use-color false")
Index: lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
@@ -21,6 +21,7 @@
 def threadStopInfo(self, threadnum):
 if threadnum == 0x1ff0d:
 return "T02thread:1ff0d;thread-pc

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 5mins

2019-07-25 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked an inline comment as done.
jankratochvil added a comment.

In D65271#1600829 , @labath wrote:

> Why not unify now? It shouldn't be too hard to at least unify all the 
> instances in dotest python code to a single place. That would already cut the 
> number of places that need to be kept synced in half...


Done; but I do not like much that `from lldbsuite.test.lldbtest import Base` in 
`vscode.py` but then other choices (passing `Base.setUpCommands()` from 
callers) looks even more messy to me.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [PATCH] D65282: ObjectFileELF: permit thread-local sections with overlapping file addresses

2019-07-25 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:1874-1875
 
-ConstString Name(("PT_LOAD[" + llvm::Twine(LoadID++) + "]").str());
+ConstString Name(llvm::formatv("{0}[{1}]", provider.GetSegmentName(),
+   provider.GetSegmentCount())
+ .str());

Maybe ask segment provider to get the next segment name?

```
ConstString Name(provider.GetNextSegmentName());
```

And have the llvm::formatv call be in a the 
VMAddressProvider::GetNextSegmentName()?



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

https://reviews.llvm.org/D65282



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


[Lldb-commits] [lldb] r367065 - [Tablegen] Fix issues caused by incorrect escaping.

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 15:17:08 2019
New Revision: 367065

URL: http://llvm.org/viewvc/llvm-project?rev=367065&view=rev
Log:
[Tablegen] Fix issues caused by incorrect escaping.

The printEscapedString would escape newlines by their ASCII values
instead of prefixing them with a `\`. Remove the escaping logic and
escape the strings in the definition file.

Modified:
lldb/trunk/include/lldb/Core/Properties.td
lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp

Modified: lldb/trunk/include/lldb/Core/Properties.td
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Properties.td?rev=367065&r1=367064&r2=367065&view=diff
==
--- lldb/trunk/include/lldb/Core/Properties.td (original)
+++ lldb/trunk/include/lldb/Core/Properties.td Thu Jul 25 15:17:08 2019
@@ -162,7 +162,7 @@ let Definition = "process" in {
 Desc<"Disable reading and caching of memory in fixed-size units.">;
   def ExtraStartCommand: Property<"extra-startup-command", "Array">,
 DefaultUnsignedValue<16>,
-Desc<"A list containing extra commands understood by the particular 
process plugin used.  For instance, to turn on debugserver logging set this to 
\"QSetLogging:bitmask=LOG_DEFAULT;\"">;
+Desc<"A list containing extra commands understood by the particular 
process plugin used.  For instance, to turn on debugserver logging set this to 
'QSetLogging:bitmask=LOG_DEFAULT;">;
   def IgnoreBreakpointsInExpressions: 
Property<"ignore-breakpoints-in-expressions", "Boolean">,
 Global,
 DefaultTrue,
@@ -251,11 +251,11 @@ let Definition = "debugger" in {
 Desc<"If true all confirmation prompts will receive their default reply.">;
   def DisassemblyFormat: Property<"disassembly-format", "FormatEntity">,
 Global,
-
DefaultStringValue<"{${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow}
 }${addr-file-or-load}{ <${function.concrete-only-addr-offset-no-padding}>}: ">,
+
DefaultStringValue<"{${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:n}{${function.changed}n{${module.file.basename}`}{${function.name-without-args}}:n}{${current-pc-arrow}
 }${addr-file-or-load}{ <${function.concrete-only-addr-offset-no-padding}>}: ">,
 Desc<"The default disassembly format string to use when disassembling 
instruction sequences.">;
   def FrameFormat: Property<"frame-format", "FormatEntity">,
 Global,
-DefaultStringValue<"frame #${frame.index}: 
${ansi.fg.yellow}${frame.pc}${ansi.normal}{ 
${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset{
 at 
${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized}
 [opt]}{${frame.is-artificial} [artificial]}\n">,
+DefaultStringValue<"frame #${frame.index}: 
${ansi.fg.yellow}${frame.pc}${ansi.normal}{ 
${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset{
 at 
${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized}
 [opt]}{${frame.is-artificial} [artificial]}n">,
 Desc<"The default frame format string to use when displaying stack frame 
information for threads.">;
   def NotiftVoid: Property<"notify-void", "Boolean">,
 Global,
@@ -310,11 +310,11 @@ let Definition = "debugger" in {
 Desc<"The maximum number of columns to use for displaying text.">;
   def ThreadFormat: Property<"thread-format", "FormatEntity">,
 Global,
-DefaultStringValue<"thread #${thread.index}: tid = ${thread.id%tid}{, 
${frame.pc}}{ 
${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset{
 at 
${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{,
 name = ${ansi.fg.green}'${thread.name}'${ansi.normal}}{, queue = 
${ansi.fg.green}'${thread.queue}'${ansi.normal}}{, activity = 
${ansi.fg.green}'${thread.info.activity.name}'${ansi.normal}}{, 
${thread.info.trace_messages} messages}{, stop reason = 
${ansi.fg.red}${thread.stop-reason}${ansi.normal}}{\nReturn value: 
${thread.return-value}}{\nCompleted expression: 
${thread.completed-expression}}\n">,
+DefaultStringValue<"thread #${thread.index}: tid = ${thread.id%tid}{, 
${frame.pc}}{ 
${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset{
 at 
${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{,
 name = ${ansi.fg.green}'${thread.name}'${ansi.normal}}{, queue = 
${ansi.fg.

[Lldb-commits] [lldb] r367066 - [Docs] Remove reproducers from the project page.

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 15:22:43 2019
New Revision: 367066

URL: http://llvm.org/viewvc/llvm-project?rev=367066&view=rev
Log:
[Docs] Remove reproducers from the project page.

Jim pointed out that this was still open on the website.

Modified:
lldb/trunk/docs/status/projects.rst

Modified: lldb/trunk/docs/status/projects.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/status/projects.rst?rev=367066&r1=367065&r2=367066&view=diff
==
--- lldb/trunk/docs/status/projects.rst (original)
+++ lldb/trunk/docs/status/projects.rst Thu Jul 25 15:22:43 2019
@@ -291,21 +291,6 @@ state at StopPoint 0, StopPoint 1, etc.
 reactions to complex threading problems & the like, and also for simulating
 hard-to-test environments (like bare board debugging).
 
-A Bug-Trapper infrastructure
-
-
-We very often have bugs that can't be reproduced locally. So having a
-bug-report-trapper that can gather enough information from the surroundings of
-a bug so that we can replay the session locally would be a big help tracking
-down issues in this situation. This is tricky because you can't necessarily
-require folks to leak information about their code in order to file bug
-reports. So not only will you have to figure out what state to gather, you're
-also going to have to anonymize it somehow. But we very often have bugs from
-people that can't reduce the problem to a simple test case and can't give us
-our code, and we often just can't help them as things stand now. Note that
-adding the ProcessMock would be a good first stage towards this, since you
-could make a ProcessMock creator/serializer from the current lldb state.
-
 Expression parser needs syntax for "{symbol,type} A in CU B.cpp"
 
 
@@ -393,21 +378,21 @@ Teach lldb to predict exception propagat
 -
 
 There are a bunch of places in lldb where we need to know at the point where an
-exception is thrown, what frame will catch the exception.  
+exception is thrown, what frame will catch the exception.
 
-For instance, if an expression throws an exception, we need to know whether 
the 
-exception will be caught in the course of the expression evaluation.  If so it 
-would be safe to let the expression continue.  But since we would destroy the 
-state of the thread if we let the exception escape the expression, we 
currently 
+For instance, if an expression throws an exception, we need to know whether the
+exception will be caught in the course of the expression evaluation.  If so it
+would be safe to let the expression continue.  But since we would destroy the
+state of the thread if we let the exception escape the expression, we currently
 stop the expression evaluation if we see a throw.  If we knew where it would be
 caught we could distinguish these two cases.
 
-Similarly, when you step over a call that throws, you want to stop at the 
throw 
+Similarly, when you step over a call that throws, you want to stop at the throw
 point if you know the exception will unwind past the frame you were stepping 
in,
 but it would annoying to have the step abort every time an exception was 
thrown.
 If we could predict the catching frame, we could do this right.
 
-And of course, this would be a useful piece of information to display when 
stopped 
+And of course, this would be a useful piece of information to display when 
stopped
 at a throw point.
 
 Add predicates to the nodes of settings


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


[Lldb-commits] [lldb] r367073 - [CMake] Add TableGen dependency to lldbInterpreter.

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 15:56:59 2019
New Revision: 367073

URL: http://llvm.org/viewvc/llvm-project?rev=367073&view=rev
Log:
[CMake] Add TableGen dependency to lldbInterpreter.

lldbInterpreter depends on LLDBPropertiesGen and LLDBPropertiesEnumGen.

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

Modified: lldb/trunk/source/Interpreter/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CMakeLists.txt?rev=367073&r1=367072&r2=367073&view=diff
==
--- lldb/trunk/source/Interpreter/CMakeLists.txt (original)
+++ lldb/trunk/source/Interpreter/CMakeLists.txt Thu Jul 25 15:56:59 2019
@@ -56,6 +56,8 @@ add_lldb_library(lldbInterpreter
 Support
   )
 
+add_dependencies(lldbInterpreter LLDBPropertiesGen LLDBPropertiesEnumGen)
+
 if (NOT LLDB_DISABLE_LIBEDIT)
   target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS})
 endif()
\ No newline at end of file


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


[Lldb-commits] [PATCH] D65311: [dotest] Remove multiprocessing

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
JDevlieghere updated this revision to Diff 211861.
JDevlieghere added a comment.

Add context


Now that the Xcode project is removed, I want to focus on `dotest` as a test 
framework, and remove its driver capabilities for which we can rely on lit. 
Removing multiprocessing is the first step in that direction.


https://reviews.llvm.org/D65311

Files:
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dosep.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py

Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -4,7 +4,6 @@
 # System modules
 import argparse
 import sys
-import multiprocessing
 import os
 import textwrap
 
@@ -225,22 +224,6 @@
 group.set_defaults(disable_crash_dialog=True)
 
 group = parser.add_argument_group('Parallel execution options')
-group.add_argument(
-'--inferior',
-action='store_true',
-help=('specify this invocation is a multiprocess inferior, '
-  'used internally'))
-group.add_argument(
-'--no-multiprocess',
-action='store_true',
-help='skip running the multiprocess test runner')
-group.add_argument(
-'--threads',
-type=int,
-dest='num_threads',
-default=default_thread_count(),
-help=('The number of threads/processes to use when running tests '
-  'separately, defaults to the number of CPU cores available'))
 group.add_argument(
 '--test-subdir',
 action='store',
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -170,9 +170,6 @@
 
 Writing logs into different files per test case::
 
-This option is particularly useful when multiple dotest instances are created
-by dosep.py
-
 $ ./dotest.py --channel "lldb all"
 
 $ ./dotest.py --channel "lldb all" --channel "gdb-remote packets"
@@ -450,23 +447,11 @@
 if do_help:
 usage(parser)
 
-if args.no_multiprocess:
-configuration.no_multiprocess_test_runner = True
-
-if args.inferior:
-configuration.is_inferior_test_runner = True
-
-if args.num_threads:
-configuration.num_threads = args.num_threads
-
 if args.test_subdir:
 configuration.exclusive_test_subdir = args.test_subdir
 
-if args.test_runner_name:
-configuration.test_runner_name = args.test_runner_name
-
 # Capture test results-related args.
-if args.curses and not args.inferior:
+if args.curses:
 # Act as if the following args were set.
 args.results_formatter = "lldbsuite.test_event.formatter.curses.Curses"
 args.results_file = "stdout"
@@ -488,9 +473,8 @@
 if args.results_formatter_options:
 configuration.results_formatter_options = args.results_formatter_options
 
-# Default to using the BasicResultsFormatter if no formatter is specified
-# and we're not a test inferior.
-if not args.inferior and configuration.results_formatter_name is None:
+# Default to using the BasicResultsFormatter if no formatter is specified.
+if configuration.results_formatter_name is None:
 configuration.results_formatter_name = (
 "lldbsuite.test_event.formatter.results_formatter.ResultsFormatter")
 
@@ -587,17 +571,7 @@
 
 # Send an initialize message to the formatter.
 initialize_event = EventBuilder.bare_event("initialize")
-if isMultiprocessTestRunner():
-if (configuration.test_runner_name is not None and
-configuration.test_runner_name == "serial"):
-# Only one worker queue here.
-worker_count = 1
-else:
-# Workers will be the number of threads specified.
-worker_count = configuration.num_threads
-else:
-worker_count = 1
-initialize_event["worker_count"] = worker_count
+initialize_event["worker_count"] = 1
 
 formatter_spec.formatter.handle_event(initialize_event)
 
@@ -639,7 +613,7 @@
 def get_llvm_bin_dirs():
 """
 Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.  
+in them, relative to this current file.
 Returns an empty array if none are found.
 """
 result = []
@@ -1071,15 +1045,6 @@
 sys.exit(exitCode)
 
 
-def isMultiprocessTestRunner():
-# We're not multiprocess when we're either explicitly
-# the inferior (as specifi

[Lldb-commits] [PATCH] D65311: [dotest] Remove multiprocessing

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 211861.
JDevlieghere added a comment.

Add context


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

https://reviews.llvm.org/D65311

Files:
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dosep.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py

Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -4,7 +4,6 @@
 # System modules
 import argparse
 import sys
-import multiprocessing
 import os
 import textwrap
 
@@ -225,22 +224,6 @@
 group.set_defaults(disable_crash_dialog=True)
 
 group = parser.add_argument_group('Parallel execution options')
-group.add_argument(
-'--inferior',
-action='store_true',
-help=('specify this invocation is a multiprocess inferior, '
-  'used internally'))
-group.add_argument(
-'--no-multiprocess',
-action='store_true',
-help='skip running the multiprocess test runner')
-group.add_argument(
-'--threads',
-type=int,
-dest='num_threads',
-default=default_thread_count(),
-help=('The number of threads/processes to use when running tests '
-  'separately, defaults to the number of CPU cores available'))
 group.add_argument(
 '--test-subdir',
 action='store',
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -170,9 +170,6 @@
 
 Writing logs into different files per test case::
 
-This option is particularly useful when multiple dotest instances are created
-by dosep.py
-
 $ ./dotest.py --channel "lldb all"
 
 $ ./dotest.py --channel "lldb all" --channel "gdb-remote packets"
@@ -450,23 +447,11 @@
 if do_help:
 usage(parser)
 
-if args.no_multiprocess:
-configuration.no_multiprocess_test_runner = True
-
-if args.inferior:
-configuration.is_inferior_test_runner = True
-
-if args.num_threads:
-configuration.num_threads = args.num_threads
-
 if args.test_subdir:
 configuration.exclusive_test_subdir = args.test_subdir
 
-if args.test_runner_name:
-configuration.test_runner_name = args.test_runner_name
-
 # Capture test results-related args.
-if args.curses and not args.inferior:
+if args.curses:
 # Act as if the following args were set.
 args.results_formatter = "lldbsuite.test_event.formatter.curses.Curses"
 args.results_file = "stdout"
@@ -488,9 +473,8 @@
 if args.results_formatter_options:
 configuration.results_formatter_options = args.results_formatter_options
 
-# Default to using the BasicResultsFormatter if no formatter is specified
-# and we're not a test inferior.
-if not args.inferior and configuration.results_formatter_name is None:
+# Default to using the BasicResultsFormatter if no formatter is specified.
+if configuration.results_formatter_name is None:
 configuration.results_formatter_name = (
 "lldbsuite.test_event.formatter.results_formatter.ResultsFormatter")
 
@@ -587,17 +571,7 @@
 
 # Send an initialize message to the formatter.
 initialize_event = EventBuilder.bare_event("initialize")
-if isMultiprocessTestRunner():
-if (configuration.test_runner_name is not None and
-configuration.test_runner_name == "serial"):
-# Only one worker queue here.
-worker_count = 1
-else:
-# Workers will be the number of threads specified.
-worker_count = configuration.num_threads
-else:
-worker_count = 1
-initialize_event["worker_count"] = worker_count
+initialize_event["worker_count"] = 1
 
 formatter_spec.formatter.handle_event(initialize_event)
 
@@ -639,7 +613,7 @@
 def get_llvm_bin_dirs():
 """
 Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.  
+in them, relative to this current file.
 Returns an empty array if none are found.
 """
 result = []
@@ -1071,15 +1045,6 @@
 sys.exit(exitCode)
 
 
-def isMultiprocessTestRunner():
-# We're not multiprocess when we're either explicitly
-# the inferior (as specified by the multiprocess test
-# runner) OR we've been told to skip using the multiprocess
-# test runner
-return not (
-configuration.is_inferior_test_runner or configuration.no_multiprocess_test_runner)
-
-
 def getVersionForSDK(sdk):
 sdk = str.lower(sdk)
 full_path =

[Lldb-commits] [lldb] r367077 - [Tests] Split inferior crashing tests

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 18:00:40 2019
New Revision: 367077

URL: http://llvm.org/viewvc/llvm-project?rev=367077&view=rev
Log:
[Tests] Split inferior crashing tests

We noticed that TestInferiorCrashing.py and TestRecursiveInferior.py are
the second and third slowest tests in the test suite. Splitting them up
allows lit to schedule them more effectively.

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashingStep.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=367077&r1=367076&r2=367077&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
 Thu Jul 25 18:00:40 2019
@@ -40,29 +40,6 @@ class CrashingInferiorTestCase(TestBase)
 self.build()
 self.inferior_crashing_expr()
 
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-def test_inferior_crashing_step(self):
-"""Test that stepping after a crash behaves correctly."""
-self.build()
-self.inferior_crashing_step()
-
-@skipIfTargetAndroid()  # debuggerd interferes with this test on Android
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-def test_inferior_crashing_step_after_break(self):
-"""Test that lldb functions correctly after stepping through a 
crash."""
-self.build()
-self.inferior_crashing_step_after_break()
-
-# Inferior exits after stepping after a segfault. This is working as
-# intended IMHO.
-@skipIfLinux
-@skipIfFreeBSD
-@expectedFailureNetBSD
-def test_inferior_crashing_expr_step_and_expr(self):
-"""Test that lldb expressions work before and after stepping after a 
crash."""
-self.build()
-self.inferior_crashing_expr_step_expr()
-
 def set_breakpoint(self, line):
 lldbutil.run_break_set_by_file_and_line(
 self, "main.c", line, num_expected_locations=1, loc_exact=True)
@@ -158,79 +135,3 @@ class CrashingInferiorTestCase(TestBase)
 
 self.expect("p hello_world",
 substrs=['Hello'])
-
-def inferior_crashing_step(self):
-"""Test that lldb functions correctly after stepping through a 
crash."""
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-self.set_breakpoint(self.line)
-self.runCmd("run", RUN_SUCCEEDED)
-
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['main.c:%d' % self.line,
- 'stop reason = breakpoint'])
-
-self.runCmd("next")
-self.check_stop_reason()
-
-# The lldb expression interpreter should be able to read from addresses
-# of the inferior after a crash.
-self.expect("p argv[0]",
-substrs=['a.out'])
-self.expect("p null_ptr",
-substrs=['= 0x0'])
-
-# lldb should be able to read from registers from the inferior after
-# crashing.
-lldbplatformutil.check_first_register_readable(self)
-
-# And it should report the correct line number.
-self.expect("thread backtrace all",
-substrs=['main.c:%d' % self.line])
-
-def inferior_crashing_step_after_break(self):
-"""Test that lldb behaves correctly when stepping after a crash."""
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-self.runCmd("run", RUN_SUCCEEDED)
-self.check_stop_reason()
-
-expected_state = 'exited'  # Provide the exit code.
-if self.platformIsDarwin():
-# TODO: Determine why 'next' and 'continue' have no effect after a
-# crash.
-expected_state = 'stopped'
-
-self.expect("next",
-substrs=['Process', expected_state])
-
-if expected_state == 'exited':
-self.expect(
-"thread list",
-error=True,
-substrs=['Process must be launched'])
-else:
-self.check_stop_reason()
-
-def inferior_crashing_expr_step_expr(self):
-   

[Lldb-commits] [PATCH] D65311: [dotest] Remove multiprocessing

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 211862.
JDevlieghere added a comment.
Herald added a subscriber: mgorny.

Remove more options and external references.


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

https://reviews.llvm.org/D65311

Files:
  lldb/docs/resources/test.rst
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dosep.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/test/CMakeLists.txt

Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -119,13 +119,6 @@
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
 
-add_python_test_target(check-lldb-single
-  ${LLDB_SOURCE_DIR}/test/dotest.py
-  "--no-multiprocess;${LLDB_DOTEST_ARGS}"
-  "Testing LLDB with args: ${LLDB_DOTEST_ARGS}"
-  )
-set_target_properties(check-lldb-single PROPERTIES FOLDER "lldb misc")
-
 # If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable
 # output is desired (i.e. in continuous integration contexts) check-lldb-single is a better target.
 add_custom_target(check-lldb)
Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -4,7 +4,6 @@
 # System modules
 import argparse
 import sys
-import multiprocessing
 import os
 import textwrap
 
@@ -34,15 +33,6 @@
 return parser.parse_args(args=argv, namespace=args)
 
 
-def default_thread_count():
-# Check if specified in the environment
-num_threads_str = os.environ.get("LLDB_TEST_THREADS")
-if num_threads_str:
-return int(num_threads_str)
-else:
-return multiprocessing.cpu_count()
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',
@@ -224,35 +214,6 @@
 help='(Windows only) When LLDB crashes, display the Windows crash dialog.')
 group.set_defaults(disable_crash_dialog=True)
 
-group = parser.add_argument_group('Parallel execution options')
-group.add_argument(
-'--inferior',
-action='store_true',
-help=('specify this invocation is a multiprocess inferior, '
-  'used internally'))
-group.add_argument(
-'--no-multiprocess',
-action='store_true',
-help='skip running the multiprocess test runner')
-group.add_argument(
-'--threads',
-type=int,
-dest='num_threads',
-default=default_thread_count(),
-help=('The number of threads/processes to use when running tests '
-  'separately, defaults to the number of CPU cores available'))
-group.add_argument(
-'--test-subdir',
-action='store',
-help='Specify a test subdirectory to use relative to the test root dir'
-)
-group.add_argument(
-'--test-runner-name',
-action='store',
-help=('Specify a test runner strategy.  Valid values: multiprocessing,'
-  ' multiprocessing-pool, serial, threading, threading-pool')
-)
-
 # Test results support.
 group = parser.add_argument_group('Test results options')
 group.add_argument(
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -170,9 +170,6 @@
 
 Writing logs into different files per test case::
 
-This option is particularly useful when multiple dotest instances are created
-by dosep.py
-
 $ ./dotest.py --channel "lldb all"
 
 $ ./dotest.py --channel "lldb all" --channel "gdb-remote packets"
@@ -382,17 +379,6 @@
 if any([x.startswith('-') for x in args.f]):
 usage(parser)
 configuration.filters.extend(args.f)
-# Shut off multiprocessing mode when additional filters are specified.
-# The rational is that the user is probably going after a very specific
-# test and doesn't need a bunch of parallel test runners all looking for
-# it in a frenzy.  Also, '-v' now spits out all test run output even
-# on success, so the standard recipe for redoing a failing test (with -v
-# and a -f to filter to the specific test) now causes all test scanning
-# (in parallel) to print results for do-nothing runs in a very distracting
-# manner.  If we really need filtered parallel runs in the future, consider
-# adding a --no-output-on-success that prevents -v from setting
-# output-on-success.
-configuration.no_multiprocess_test_runner = True
 
 if args.l:
 configuration.skip_lo

[Lldb-commits] [lldb] r367079 - [dotest] Remove dead code

2019-07-25 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Jul 25 18:58:18 2019
New Revision: 367079

URL: http://llvm.org/viewvc/llvm-project?rev=367079&view=rev
Log:
[dotest] Remove dead code

Remove some dead code that I ran into when preparing D65311.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py
lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.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=367079&r1=367078&r2=367079&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Jul 25 18:58:18 
2019
@@ -2,9 +2,8 @@ from __future__ import absolute_import
 from __future__ import print_function
 
 # System modules
-from distutils.version import LooseVersion, StrictVersion
+from distutils.version import LooseVersion
 from functools import wraps
-import inspect
 import os
 import platform
 import re
@@ -17,8 +16,6 @@ import six
 import unittest2
 
 # LLDB modules
-import use_lldb_suite
-
 import lldb
 from . import configuration
 from . import test_categories

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=367079&r1=367078&r2=367079&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Jul 25 18:58:18 2019
@@ -29,7 +29,6 @@ import logging
 import platform
 import re
 import signal
-import socket
 import subprocess
 import sys
 
@@ -58,7 +57,7 @@ def is_exe(fpath):
 
 def which(program):
 """Returns the full path to a program; None otherwise."""
-fpath, fname = os.path.split(program)
+fpath, _ = os.path.split(program)
 if fpath:
 if is_exe(program):
 return program
@@ -70,27 +69,6 @@ def which(program):
 return None
 
 
-class _WritelnDecorator(object):
-"""Used to decorate file-like objects with a handy 'writeln' method"""
-
-def __init__(self, stream):
-self.stream = stream
-
-def __getattr__(self, attr):
-if attr in ('stream', '__getstate__'):
-raise AttributeError(attr)
-return getattr(self.stream, attr)
-
-def writeln(self, arg=None):
-if arg:
-self.write(arg)
-self.write('\n')  # text-mode streams translate to \r\n if needed
-
-#
-# Global variables:
-#
-
-
 def usage(parser):
 parser.print_help()
 if configuration.verbose > 0:
@@ -558,17 +536,6 @@ def getXcodeOutputPaths(lldbRootDirector
 return result
 
 
-def createSocketToLocalPort(port):
-def socket_closer(s):
-"""Close down an opened socket properly."""
-s.shutdown(socket.SHUT_RDWR)
-s.close()
-
-sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-sock.connect(("localhost", port))
-return (sock, lambda: socket_closer(sock))
-
-
 def setupTestResults():
 """Sets up test results-related objects based on arg settings."""
 # Setup the results formatter configuration.
@@ -639,7 +606,7 @@ def getOutputPaths(lldbRootDirectory):
 def get_llvm_bin_dirs():
 """
 Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.  
+in them, relative to this current file.
 Returns an empty array if none are found.
 """
 result = []
@@ -1090,14 +1057,6 @@ def getVersionForSDK(sdk):
 return ver
 
 
-def getPathForSDK(sdk):
-sdk = str.lower(sdk)
-full_path = seven.get_command_output('xcrun -sdk %s --show-sdk-path' % sdk)
-if os.path.exists(full_path):
-return full_path
-return None
-
-
 def setDefaultTripleForPlatform():
 if configuration.lldb_platform_name == 'ios-simulator':
 triple_str = 'x86_64-apple-ios%s' % (

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py?rev=367079&r1=367078&r2=367079&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py Thu Jul 25 
18:58:18 2019
@@ -9,7 +9,6 @@ import itertools
 import six
 
 # LLDB modules
-import use_lldb_suite
 import lldb
 
 windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, 
darwin_embedded, freebsd, netbsd, bsd_all, android = range(

Modified: lldb/trunk/packages/Python/lldbsuite/

[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-25 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

After going through this and modifying this patch, I can't help but wonder if 
`llvm::Optional` would be more appropriate. There are plenty of 
instances where it's not a hard error if you can't get a TypeSystem and the 
appropriate action is probably just to log and move on. I am conflicted because 
I like how Expected forces you to be more rigorous with error handling but I 
can't help but feel it is the wrong abstraction. Thoughts?


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-25 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65122#1602025 , @xiaobai wrote:

> After going through this and modifying this patch, I can't help but wonder if 
> `llvm::Optional` would be more appropriate. There are plenty of 
> instances where it's not a hard error if you can't get a TypeSystem and the 
> appropriate action is probably just to log and move on. I am conflicted 
> because I like how Expected forces you to be more rigorous with error 
> handling but I can't help but feel it is the wrong abstraction. Thoughts?


I think an `Optional` would be fine. We can always create an `Error` when 
necessary, with the trade-off of being a little less precision about the root 
cause, which honestly doesn't seem that informative anyway.


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65282: ObjectFileELF: permit thread-local sections with overlapping file addresses

2019-07-25 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added a comment.

> It turns out this was too aggressive because thread-local

sections typically will have file addresses which apear to overlap
regular data/code. This does not cause a problem at runtime because
thread-local sections are loaded into memory using special logic, but it
can cause problems for lldb when trying to lookup objects by their file
address.

Yes :) This can happen with .tbss (SHT_NOBITS) overlapping another section 
(usually .fini_array, but .got and .data are also possible).




Comment at: lit/Modules/ELF/PT_LOAD-overlap-PT_TLS.yaml:68
+Flags:   [ SHF_ALLOC, SHF_WRITE, SHF_TLS ]
+Address: 0x1010
+AddressAlign:0x4

> .tbss 0x1000 NOBITS
>
> .tdata 0x1010 PROGBITS

Move .tdata before .tbss (0xff0) to make the example more realistic?

.tdata has a larger address than .tbss. I think this is impossible in ld.bfd, 
but you can make .tbss go before .tdata with a broken lld linker script.


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

https://reviews.llvm.org/D65282



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


[Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

2019-07-25 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62931



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