[Lldb-commits] [PATCH] D49018: Convert a location information from PDB to a DWARF expression

2018-07-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

The test here can be expanded to include https://reviews.llvm.org/D48960 case.


https://reviews.llvm.org/D49018



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


[Lldb-commits] [PATCH] D48960: Use an unwinder to get register contexts of frames other than zeroth under Windows

2018-07-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

This can be tested after applying https://reviews.llvm.org/D49018 patch.


https://reviews.llvm.org/D48960



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


[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Add LLDB_API to SBAddress's operator== to fix lldb-mi build on Windows.


https://reviews.llvm.org/D49006



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


[Lldb-commits] [PATCH] D49018: Convert a location information from PDB to a DWARF expression

2018-07-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Excuse me, I have forgot to add lldb-commits as a subscriber, so I'll repeat 
initial message.

The current version of SymbolFilePDB::ParseVariableForPDBData function always 
initializes variables with an empty location. This patch adds the converter of 
a location information from PDB to a DWARF expression, so it becomes possible 
to watch values of variables of primitive data types. At the moment the 
converter supports only Static, TLS, RegRel, Enregistered and Constant PDB 
location types, but it seems that it's enough for most cases. There are still 
some problems with retrieving values of variables (e.g. we can't watch 
variables of composite types), but they look not relevant to the conversion to 
DWARF.


https://reviews.llvm.org/D49018



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


[Lldb-commits] [PATCH] D48960: Use an unwinder to get register contexts of frames other than zeroth under Windows

2018-07-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Excuse me, I have forgot to add lldb-commits as a subscriber, so I'll repeat 
initial message.

The current version of TargetThreadWindows::CreateRegisterContextForFrame 
function always returns the register context of the zeroth frame. This patch 
uses an unwinder to get register contexts of frames other than zeroth.


https://reviews.llvm.org/D48960



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


[Lldb-commits] [PATCH] D48993: [CMake] Give Python module install command a component name

2018-07-06 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added a comment.

The `install-` target is created by `add_llvm_install_targets`, not by the 
component.  The component is part of CMake itself, and is controlled by the 
`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME`.


https://reviews.llvm.org/D48993



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


[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-06 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov accepted this revision.
apolyakov added a comment.
This revision is now accepted and ready to land.

LGTM!


https://reviews.llvm.org/D49006



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


[Lldb-commits] [lldb] r318664 - [Expression parser] Remove logging of field that is no longer in clang's TargetOptions struct.

2018-07-06 Thread Craig Topper via lldb-commits
Author: ctopper
Date: Mon Nov 20 09:24:47 2017
New Revision: 318664

URL: http://llvm.org/viewvc/llvm-project?rev=318664&view=rev
Log:
[Expression parser] Remove logging of field that is no longer in clang's 
TargetOptions struct.

The Reciprocals field was moved to CodeGenOptions. I don't think lldb was 
really using this field so I'm just removing the mention.

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=318664&r1=318663&r2=318664&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Mon Nov 20 09:24:47 2017
@@ -350,7 +350,6 @@ ClangExpressionParser::ClangExpressionPa
   LLDB_LOGV(log, "LinkerVersion: '{0}'", opts.LinkerVersion);
   StringList::LogDump(log, opts.FeaturesAsWritten, "FeaturesAsWritten");
   StringList::LogDump(log, opts.Features, "Features");
-  StringList::LogDump(log, opts.Reciprocals, "Reciprocals");
 }
 
   // 4. Create and install the target on the compiler.


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


[Lldb-commits] [lldb] r323064 - [modules] Fix missing includes/typo in LLDB's includes. [NFC]

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Sun Jan 21 01:54:19 2018
New Revision: 323064

URL: http://llvm.org/viewvc/llvm-project?rev=323064&view=rev
Log:
[modules] Fix missing includes/typo in LLDB's includes. [NFC]

Summary:
This patch adds missing includes to the LLDB headers inside `include/` as a 
first step of building LLDB's source with C++ modules. It also fixes this 
single `stds::` typo.

Some quick map why some non-obvious includes were necessary:
* lldb/lldb-defines.h for LLDB_INVALID_ADDRESS
* lldb/lldb-types.h for addr_t
* lldb/lldb-defines.h for DISALLOW_COPY_AND_ASSIG
* lldb/DataFormatters/TypeSynthetic.h for SyntheticChildrenFrontEnd

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: zturner, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h
lldb/trunk/include/lldb/Core/ThreadSafeValue.h
lldb/trunk/include/lldb/DataFormatters/VectorIterator.h
lldb/trunk/include/lldb/Target/ProcessStructReader.h
lldb/trunk/include/lldb/Utility/AnsiTerminal.h
lldb/trunk/include/lldb/Utility/SharedCluster.h

Modified: lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h (original)
+++ lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h Sun Jan 21 01:54:19 2018
@@ -13,10 +13,13 @@
 // C Includes
 
 // C++ Includes
+#include 
 #include 
 
 // Other libraries and framework includes
+#include "lldb/lldb-defines.h"
 #include "lldb/lldb-private-forward.h"
+#include "lldb/lldb-types.h"
 
 namespace lldb_private {
 class LoadedModuleInfoList {

Modified: lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h (original)
+++ lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h Sun Jan 21 01:54:19 2018
@@ -46,7 +46,7 @@ public:
   }
 
   void Clear() {
-stds::lock_guard<_MutexType> guard(m_mutex);
+std::lock_guard<_MutexType> guard(m_mutex);
 m_set.clear();
   }
 

Modified: lldb/trunk/include/lldb/Core/ThreadSafeValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeValue.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/Core/ThreadSafeValue.h (original)
+++ lldb/trunk/include/lldb/Core/ThreadSafeValue.h Sun Jan 21 01:54:19 2018
@@ -17,6 +17,7 @@
 
 // Other libraries and framework includes
 // Project includes
+#include "lldb/lldb-defines.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/DataFormatters/VectorIterator.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/VectorIterator.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/VectorIterator.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/VectorIterator.h Sun Jan 21 01:54:19 
2018
@@ -13,6 +13,7 @@
 
 #include "lldb/lldb-forward.h"
 
+#include "lldb/DataFormatters/TypeSynthetic.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Utility/ConstString.h"
 

Modified: lldb/trunk/include/lldb/Target/ProcessStructReader.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ProcessStructReader.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/Target/ProcessStructReader.h (original)
+++ lldb/trunk/include/lldb/Target/ProcessStructReader.h Sun Jan 21 01:54:19 
2018
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Status.h"
 

Modified: lldb/trunk/include/lldb/Utility/AnsiTerminal.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/AnsiTerminal.h?rev=323064&r1=323063&r2=323064&view=diff
==
--- lldb/trunk/include/lldb/Utility/AnsiTerminal.h (original)
+++ lldb/trunk/include/lldb/Utility/AnsiTerminal.h Sun Jan 21 01:54:19 2018
@@ -50,6 +50,7 @@
 #define ANSI_1_CTRL(ctrl1) "\033["##ctrl1 ANSI_ESC_END
 #define ANSI_2_CTRL(ctrl1, ctrl2) "\033["##ctrl1 ";"##ctrl2 ANSI_ESC_END
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 

Modified: lldb/tru

[Lldb-commits] [lldb] r321344 - [lldb] Stop searching for a symbol in a pdb by regex

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Dec 21 21:26:50 2017
New Revision: 321344

URL: http://llvm.org/viewvc/llvm-project?rev=321344&view=rev
Log:
[lldb] Stop searching for a symbol in a pdb by regex

Summary:
It was possible when searching for a symbol by regex in a pdb that an invalid 
regex would cause an exception on Windows. This updates the code to avoid 
throwing an exception.

When fixing the exception it was decided there is no reason to search for a 
symbol in a pdb by regex. To support this, SymbolFilePDB::FindTypes() now only 
searches for types by name and no longer calls FindTypesByRegEx().

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: clayborg

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=321344&r1=321343&r2=321344&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Thu Dec 21 
21:26:50 2017
@@ -124,6 +124,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
   } else if (auto type_def = llvm::dyn_cast(&type)) {
 lldb_private::Type *target_type =
 m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId());
+if (!target_type)
+  return nullptr;
 std::string name = type_def->getName();
 uint64_t bytes = type_def->getLength();
 if (!target_type)
@@ -179,6 +181,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 
 lldb_private::Type *element_type =
 m_ast.GetSymbolFile()->ResolveTypeUID(element_uid);
+if (!element_type)
+  return nullptr;
 CompilerType element_ast_type = element_type->GetFullCompilerType();
 CompilerType array_ast_type =
 m_ast.CreateArrayType(element_ast_type, num_elements, false);

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=321344&r1=321343&r2=321344&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Thu Dec 21 
21:26:50 2017
@@ -19,6 +19,7 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/TypeMap.h"
+#include "lldb/Utility/RegularExpression.h"
 
 #include "llvm/DebugInfo/PDB/GenericError.h"
 #include "llvm/DebugInfo/PDB/IPDBDataStream.h"
@@ -293,7 +294,8 @@ lldb_private::Type *SymbolFilePDB::Resol
 return nullptr;
 
   lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type);
-  m_types.insert(std::make_pair(type_uid, result));
+  if (result.get())
+m_types.insert(std::make_pair(type_uid, result));
   return result.get();
 }
 
@@ -428,19 +430,16 @@ uint32_t SymbolFilePDB::FindTypes(
 
   std::string name_str = name.AsCString();
 
-  // If this might be a regex, we have to return EVERY symbol and process them
-  // one by one, which is going to destroy performance on large PDB files.  So
-  // try really hard not to use a regex match.
-  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos)
-FindTypesByRegex(name_str, max_matches, types);
-  else
-FindTypesByName(name_str, max_matches, types);
+  // There is an assumption 'name' is not a regex
+  FindTypesByName(name_str, max_matches, types);
+   
   return types.GetSize();
 }
 
-void SymbolFilePDB::FindTypesByRegex(const std::string ®ex,
- uint32_t max_matches,
- lldb_private::TypeMap &types) {
+void
+SymbolFilePDB::FindTypesByRegex(const lldb_private::RegularExpression ®ex,
+uint32_t max_matches,
+lldb_private::TypeMap &types) {
   // When searching by regex, we need to go out of our way to limit the search
   // space as much as possible since this searches EVERYTHING in the PDB,
   // manually doing regex comparisons.  PDB library isn't optimized for regex
@@ -452,8 +451,6 @@ void SymbolFilePDB::FindTypesByRegex(con
   auto global = m_session_up->getGlobalScope();
   std::unique_ptr results;
 
-  std::regex re(regex);
-
   uint32_t matches = 0;
 
   for (auto tag : tags_to_search) {
@@ -476,7 +473,7 @@ void SymbolFilePDB::FindTypesByRegex(con
 continue;
   }
 
-  if (!std::regex_match(type_name, re))
+  if (!regex.Execute(type_name))
 continue;
 
   // This should cause the type to get cached and stored i

[Lldb-commits] [lldb] r321511 - Update failing PDB unit tests that are searching for symbols by regex

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Wed Dec 27 22:29:59 2017
New Revision: 321511

URL: http://llvm.org/viewvc/llvm-project?rev=321511&view=rev
Log:
Update failing PDB unit tests that are searching for symbols by regex

Summary: D41086 fixed an exception in FindTypes()/FindTypesByRegex() and caused 
two lldb unit test to fail. This change updates the unit tests to pass again.

Reviewers: zturner, lldb-commits, labath, clayborg, asmith

Reviewed By: asmith

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h?rev=321511&r1=321510&r2=321511&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Wed Dec 27 
22:29:59 2017
@@ -140,6 +140,10 @@ public:
   size_t FindTypes(const std::vector &context,
bool append, lldb_private::TypeMap &types) override;
 
+  void FindTypesByRegex(const lldb_private::RegularExpression ®ex,
+uint32_t max_matches,
+lldb_private::TypeMap &types);
+
   lldb_private::TypeList *GetTypeList() override;
 
   size_t GetTypes(lldb_private::SymbolContextScope *sc_scope,

Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=321511&r1=321510&r2=321511&view=diff
==
--- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Wed Dec 27 
22:29:59 2017
@@ -512,20 +512,15 @@ TEST_F(SymbolFilePDBTests, TestRegexName
   SymbolVendor *plugin = module->GetSymbolVendor();
   SymbolFilePDB *symfile =
   static_cast(plugin->GetSymbolFile());
-  SymbolContext sc;
-  llvm::DenseSet searched_files;
   TypeMap results;
-  uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr,
-false, 0, searched_files, results);
-  EXPECT_GT(num_results, 1u);
-  EXPECT_EQ(num_results, results.GetSize());
+   
+  symfile->FindTypesByRegex(RegularExpression(".*"), 0, results);
+  EXPECT_GT(results.GetSize(), 1u);
 
   // We expect no exception thrown if the given regex can't be compiled
   results.Clear();
-  num_results = symfile->FindTypes(sc, ConstString("**"), nullptr,
-   false, 0, searched_files, results);
-  EXPECT_EQ(num_results, 0u);
-  EXPECT_EQ(num_results, results.GetSize());
+  symfile->FindTypesByRegex(RegularExpression("**"), 0, results);
+  EXPECT_EQ(0u, results.GetSize());
 }
 
 TEST_F(SymbolFilePDBTests, TestMaxMatches) {
@@ -539,7 +534,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatche
   SymbolContext sc;
   llvm::DenseSet searched_files;
   TypeMap results;
-  uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr,
+  const ConstString name("ClassTypedef");
+  uint32_t num_results = symfile->FindTypes(sc, name, nullptr,
 false, 0, searched_files, results);
   // Try to limit ourselves from 1 to 10 results, otherwise we could be doing
   // this thousands of times.
@@ -549,7 +545,7 @@ TEST_F(SymbolFilePDBTests, TestMaxMatche
   uint32_t iterations = std::min(num_results, 10u);
   for (uint32_t i = 1; i <= iterations; ++i) {
 uint32_t num_limited_results = symfile->FindTypes(
-sc, ConstString(".*"), nullptr, false, i, searched_files, results);
+sc, name, nullptr, false, i, searched_files, results);
 EXPECT_EQ(i, num_limited_results);
 EXPECT_EQ(num_limited_results, results.GetSize());
   }


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


[Lldb-commits] [lldb] r320537 - [lldb] Set component when invoking add_llvm_install_targets

2018-07-06 Thread Petr Hosek via lldb-commits
Author: phosek
Date: Tue Dec 12 17:14:27 2017
New Revision: 320537

URL: http://llvm.org/viewvc/llvm-project?rev=320537&view=rev
Log:
[lldb] Set component when invoking add_llvm_install_targets

This is needed to ensure that the distribution and install-distribution
targets work properly.

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

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=320537&r1=320536&r2=320537&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Tue Dec 12 17:14:27 2017
@@ -67,7 +67,8 @@ function(add_lldb_library name)
   endif()
   if (NOT CMAKE_CONFIGURATION_TYPES)
 add_llvm_install_targets(install-${name}
- DEPENDS ${name})
+ DEPENDS ${name}
+ COMPONENT ${name})
   endif()
 endif()
   endif()
@@ -134,7 +135,8 @@ function(add_lldb_executable name)
   RUNTIME DESTINATION bin)
 if (NOT CMAKE_CONFIGURATION_TYPES)
   add_llvm_install_targets(install-${name}
-   DEPENDS ${name})
+   DEPENDS ${name}
+   COMPONENT ${name})
 endif()
   endif()
 


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


[Lldb-commits] [lldb] r319869 - Do not use default arguments of DataLayout::getPointer*. NFC

2018-07-06 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Tue Dec  5 17:32:06 2017
New Revision: 319869

URL: http://llvm.org/viewvc/llvm-project?rev=319869&view=rev
Log:
Do not use default arguments of DataLayout::getPointer*. NFC

Summary: There are "FIXME"s in include/llvm/IR/DataLayout.h to remove the 
default arguments.

Reviewers: zturner, clayborg

Reviewed By: zturner

Subscribers: bjope

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

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

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=319869&r1=319868&r2=319869&view=diff
==
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Tue Dec  5 17:32:06 2017
@@ -385,11 +385,6 @@ public:
 return ret;
   }
 
-  lldb::addr_t MallocPointer() {
-return Malloc(m_target_data.getPointerSize(),
-  m_target_data.getPointerPrefAlignment());
-  }
-
   lldb::addr_t Malloc(llvm::Type *type) {
 lldb_private::Status alloc_error;
 


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


[Lldb-commits] [lldb] r322995 - [SymbolFilePDB] Fix null array access when parsing the type of a function without any arguments, i.e. 'int main()' and add support to test it

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Fri Jan 19 13:55:44 2018
New Revision: 322995

URL: http://llvm.org/viewvc/llvm-project?rev=322995&view=rev
Log:
[SymbolFilePDB] Fix null array access when parsing the type of a function 
without any arguments, i.e. 'int main()' and add support to test it

Summary:
- Fix a null array access bug. This happens when creating the lldb type for a 
function that has no argument.
- Implement SymbolFilePDB::ParseTypes method. Using `lldb-test symbols` will 
show all supported types in the target.
- Create lldb types for variadic function, PDBSymbolTypePointer, 
PDBSymbolTypeBuiltin
- The underlying builtin type for PDBSymbolTypeEnum is always `Int`, correct it 
with the very first enumerator's encoding if any. This is more accurate when 
the underlying type is not signed or another integer type.
- Fix a bug when the compiler type is not created based on PDB_BuiltinType. For 
example, basic type `long` is of same width as `int` in a 32-bit target, and 
the compiler type of former one will be represented by the one generated for 
latter if using the default method. Introduce a static function 
GetBuiltinTypeForPDBEncodingAndBitSize to correct this issue.
- Basic type `long double` and `double` have the same bit size in MSVC and 
there is no information in a PDB to distinguish them. The compiler type of the 
former one is represented by the latter's.
- There is no line informaton about typedef, enum etc in a PDB and the source 
and line information for them are not shown.
- There is no information about scoped enumeration. The compiler type is 
represented as an unscoped one.

Reviewers: zturner, lldb-commits, davide, asmith

Reviewed By: zturner, asmith

Subscribers: llvm-commits, davide

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
lldb/trunk/lit/SymbolFile/PDB/typedefs.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp?rev=322995&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp Fri Jan 19 
13:55:44 2018
@@ -0,0 +1,40 @@
+// typedef
+typedef unsigned long ULongArrayTypedef[10];
+ULongArrayTypedef ULongArrayVar;
+
+typedef long double*& RefTypedef;
+long double* LongDoublePtrVar = 0;
+RefTypedef RefVar = LongDoublePtrVar;
+
+typedef long long (*FuncPtrTypedef)(int&, unsigned char**, short[], const 
double, volatile bool);
+FuncPtrTypedef FuncVar;
+
+typedef char (*VarArgsFuncTypedef)(void*, long, unsigned short, unsigned int, 
...);
+VarArgsFuncTypedef VarArgsFuncVar;
+
+typedef float (*VarArgsFuncTypedefA)(...);
+VarArgsFuncTypedefA VarArgsFuncVarA;
+
+// unscoped enum
+enum Enum { RED, GREEN, BLUE };
+Enum EnumVar;
+
+enum EnumConst { LOW, NORMAL = 10, HIGH };
+EnumConst EnumConstVar;
+
+enum EnumEmpty {};
+EnumEmpty EnumEmptyVar;
+
+enum EnumUChar : unsigned char { ON, OFF, AUTO };
+EnumUChar EnumCharVar;
+
+// scoped enum
+enum class EnumClass { YES, NO, DEFAULT };
+EnumClass EnumClassVar;
+
+enum struct EnumStruct { red, blue, black };
+EnumStruct EnumStructVar;
+  
+int main() {
+  return 0;
+}

Added: lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/enums-layout.test?rev=322995&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/enums-layout.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/enums-layout.test Fri Jan 19 13:55:44 2018
@@ -0,0 +1,45 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/SimpleTypesTest.cpp /o 
%T/SimpleTypesTest.cpp.enums.obj
+RUN: link %T/SimpleTypesTest.cpp.enums.obj /DEBUG /nodefaultlib /ENTRY:main 
/OUT:%T/SimpleTypesTest.cpp.enums.exe
+RUN: lldb-test symbols %T/SimpleTypesTest.cpp.enums.exe | FileCheck %s
+
+; FIXME: PDB does not have information about scoped enumeration (Enum class) 
so the  
+; compiler type used is the same as the one for unscoped enumeration.
+
+CHECK: Module [[CU:.*]]
+CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
+CHECK:  Type{{.*}} , name = "Enum", size = 4, compiler_type = {{.*}} enum 
Enum {
+CHECK-NEXT:RED,
+CHECK-NEXT:GREEN,
+CHECK-NEXT:BLUE
+CHECK-NEXT:}
+
+CHECK:  Type{{.*}} , name = "EnumConst", size = 4, compiler_type = {{.*}} 
enum EnumConst {
+CHECK-NEXT:LOW,
+CHECK-NEXT:NORMAL,
+CHECK-NEXT:HIGH
+CHECK-NEXT:}
+
+CHECK:  Type{{.*}} , name = "EnumEmpty", size = 4, 

[Lldb-commits] [lldb] r321327 - Enable more abilities in SymbolFilePDB

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Dec 21 16:04:36 2017
New Revision: 321327

URL: http://llvm.org/viewvc/llvm-project?rev=321327&view=rev
Log:
Enable more abilities in SymbolFilePDB

Summary:
1) Finding symbols through --symfile
2) More abilities: Functions, Blocks, GlobalVariables, LocalVariables, 
VariableTypes

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: clayborg

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=321327&r1=321326&r2=321327&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Thu Dec 21 
16:04:36 2017
@@ -21,12 +21,15 @@
 #include "lldb/Symbol/TypeMap.h"
 
 #include "llvm/DebugInfo/PDB/GenericError.h"
+#include "llvm/DebugInfo/PDB/IPDBDataStream.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
+#include "llvm/DebugInfo/PDB/IPDBTable.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
@@ -93,6 +96,10 @@ SymbolFilePDB::SymbolFilePDB(lldb_privat
 SymbolFilePDB::~SymbolFilePDB() {}
 
 uint32_t SymbolFilePDB::CalculateAbilities() {
+  uint32_t abilities = 0;
+  if (!m_obj_file)
+return 0;
+
   if (!m_session_up) {
 // Lazily load and match the PDB file, but only do this once.
 std::string exePath = m_obj_file->GetFileSpec().GetPath();
@@ -100,10 +107,46 @@ uint32_t SymbolFilePDB::CalculateAbiliti
 m_session_up);
 if (error) {
   llvm::consumeError(std::move(error));
-  return 0;
+  auto module_sp = m_obj_file->GetModule();
+  if (!module_sp)
+return 0;
+  // See if any symbol file is specified through `--symfile` option.
+  FileSpec symfile = module_sp->GetSymbolFileFileSpec();
+  if (!symfile)
+return 0;
+  error = loadDataForPDB(PDB_ReaderType::DIA,
+ llvm::StringRef(symfile.GetPath()),
+ m_session_up);
+  if (error) {
+llvm::consumeError(std::move(error));
+return 0;
+  }
+}
+  }
+  if (!m_session_up.get())
+return 0;
+
+  auto enum_tables_up = m_session_up->getEnumTables();
+  if (!enum_tables_up)
+return 0;
+  while (auto table_up = enum_tables_up->getNext()) {
+if (table_up->getItemCount() == 0)
+  continue;
+auto type = table_up->getTableType();
+switch (type) {
+case PDB_TableType::Symbols:
+  // This table represents a store of symbols with types listed in
+  // PDBSym_Type
+  abilities |= (CompileUnits | Functions | Blocks |
+GlobalVariables | LocalVariables | VariableTypes);
+  break;
+case PDB_TableType::LineNumbers:
+  abilities |= LineTables;
+  break;
+default: break;
 }
   }
-  return CompileUnits | LineTables;
+  return abilities;
 }
 
 void SymbolFilePDB::InitializeObject() {

Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=321327&r1=321326&r2=321327&view=diff
==
--- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Thu Dec 21 
16:04:36 2017
@@ -154,8 +154,7 @@ TEST_F(SymbolFilePDBTests, TestAbilities
   EXPECT_NE(nullptr, symfile);
   EXPECT_EQ(symfile->GetPluginName(), SymbolFilePDB::GetPluginNameStatic());
 
-  uint32_t expected_abilities =
-  SymbolFile::CompileUnits | SymbolFile::LineTables;
+  uint32_t expected_abilities = SymbolFile::kAllAbilities;
   EXPECT_EQ(expected_abilities, symfile->CalculateAbilities());
 }
 


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


[Lldb-commits] [lldb] r321514 - Remove duplicate declaration from D41550; NFC

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Wed Dec 27 23:48:10 2017
New Revision: 321514

URL: http://llvm.org/viewvc/llvm-project?rev=321514&view=rev
Log:
Remove duplicate declaration from D41550; NFC 

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h?rev=321514&r1=321513&r2=321514&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h Wed Dec 27 
23:48:10 2017
@@ -176,10 +176,6 @@ private:
   const llvm::pdb::PDBSymbolCompiland &cu,
   llvm::DenseMap &index_map) const;
 
-  void FindTypesByRegex(const lldb_private::RegularExpression ®ex,
-uint32_t max_matches,
-lldb_private::TypeMap &types);
-
   void FindTypesByName(const std::string &name, uint32_t max_matches,
lldb_private::TypeMap &types);
 


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


[Lldb-commits] [lldb] r323255 - [SymbolFilePDB] Fix null array access when parsing the type of a function without any arguments, i.e. 'int main()' and add support to test it

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Jan 23 12:35:19 2018
New Revision: 323255

URL: http://llvm.org/viewvc/llvm-project?rev=323255&view=rev
Log:
[SymbolFilePDB] Fix null array access when parsing the type of a function 
without any arguments, i.e. 'int main()' and add support to test it

Summary:
- Fix a null array access bug. This happens when creating the lldb type for a 
function that has no argument.
- Implement SymbolFilePDB::ParseTypes method. Using `lldb-test symbols` will 
show all supported types in the target.
- Create lldb types for variadic function, PDBSymbolTypePointer, 
PDBSymbolTypeBuiltin
- The underlying builtin type for PDBSymbolTypeEnum is always `Int`, correct it 
with the very first enumerator's encoding if any. This is more accurate when 
the underlying type is not signed or another integer type.
- Fix a bug when the compiler type is not created based on PDB_BuiltinType. For 
example, basic type `long` is of same width as `int` in a 32-bit target, and 
the compiler type of former one will be represented by the one generated for 
latter if using the default method. Introduce a static function 
GetBuiltinTypeForPDBEncodingAndBitSize to correct this issue.
- Basic type `long double` and `double` have the same bit size in MSVC and 
there is no information in a PDB to distinguish them. The compiler type of the 
former one is represented by the latter's.
- There is no line information about typedef, enum etc in a PDB and the source 
and line information for them are not shown.
- There is no information about scoped enumeration. The compiler type is 
represented as an unscoped one.

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: majnemer, llvm-commits

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
lldb/trunk/lit/SymbolFile/PDB/typedefs.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp?rev=323255&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp Tue Jan 23 
12:35:19 2018
@@ -0,0 +1,40 @@
+// typedef
+typedef unsigned long ULongArrayTypedef[10];
+ULongArrayTypedef ULongArrayVar;
+
+typedef long double*& RefTypedef;
+long double* LongDoublePtrVar = 0;
+RefTypedef RefVar = LongDoublePtrVar;
+
+typedef long long (*FuncPtrTypedef)(int&, unsigned char**, short[], const 
double, volatile bool);
+FuncPtrTypedef FuncVar;
+
+typedef char (*VarArgsFuncTypedef)(void*, long, unsigned short, unsigned int, 
...);
+VarArgsFuncTypedef VarArgsFuncVar;
+
+typedef float (*VarArgsFuncTypedefA)(...);
+VarArgsFuncTypedefA VarArgsFuncVarA;
+
+// unscoped enum
+enum Enum { RED, GREEN, BLUE };
+Enum EnumVar;
+
+enum EnumConst { LOW, NORMAL = 10, HIGH };
+EnumConst EnumConstVar;
+
+enum EnumEmpty {};
+EnumEmpty EnumEmptyVar;
+
+enum EnumUChar : unsigned char { ON, OFF, AUTO };
+EnumUChar EnumCharVar;
+
+// scoped enum
+enum class EnumClass { YES, NO, DEFAULT };
+EnumClass EnumClassVar;
+
+enum struct EnumStruct { red, blue, black };
+EnumStruct EnumStructVar;
+  
+int main() {
+  return 0;
+}

Added: lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/enums-layout.test?rev=323255&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/enums-layout.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/enums-layout.test Tue Jan 23 12:35:19 2018
@@ -0,0 +1,45 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/SimpleTypesTest.cpp /o 
%T/SimpleTypesTest.cpp.enums.obj
+RUN: link %T/SimpleTypesTest.cpp.enums.obj /DEBUG /nodefaultlib /ENTRY:main 
/OUT:%T/SimpleTypesTest.cpp.enums.exe
+RUN: lldb-test symbols %T/SimpleTypesTest.cpp.enums.exe | FileCheck %s
+
+; FIXME: PDB does not have information about scoped enumeration (Enum class) 
so the  
+; compiler type used is the same as the one for unscoped enumeration.
+
+CHECK: Module [[CU:.*]]
+CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
+CHECK:  Type{{.*}} , name = "Enum", size = 4, compiler_type = {{.*}} enum 
Enum {
+CHECK-NEXT:RED,
+CHECK-NEXT:GREEN,
+CHECK-NEXT:BLUE
+CHECK-NEXT:}
+
+CHECK:  Type{{.*}} , name = "EnumConst", size = 4, compiler_type = {{.*}} 
enum EnumConst {
+CHECK-NEXT:LOW,
+CHECK-NEXT:NORMAL,
+CHECK-NEXT:HIGH
+CHECK-NEXT:}
+
+CHECK:  Type{{.*}} , name = "EnumEmpty", size = 4, compiler_type = {{.*}} 
enum EnumEmpty {
+CHECK-NEXT:}
+
+CHECK:  Type{{.*}} , name = "EnumUChar", size = 1, compiler_type = {{.*}} 
enum EnumUCha

[Lldb-commits] [lldb] r322433 - [lldb] Add support to cache a PDB's global scope and fix a bug in getting the source file name for a compiland

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Fri Jan 12 22:58:18 2018
New Revision: 322433

URL: http://llvm.org/viewvc/llvm-project?rev=322433&view=rev
Log:
[lldb] Add support to cache a PDB's global scope and fix a bug in getting the 
source file name for a compiland

Summary:
This commit is a combination of the following changes:

- Cache PDB's global scope (executable) in SymbolFilePDB  

- Change naming of `cu` to `compiland` which is PDB specific   

- Change ParseCompileUnitForSymIndex to ParseCompileUnitForUID.
   Prefer using a common name `UID` instead of PDB's `System Index`
   Adding one more argument `index` to this method, which is used to
   specify the index of the compile unit in a cached compile unit array

- Add GetPDBCompilandByUID method to simply code

- Fix a bug in getting the source file name for a PDB compiland.
   For some reason, PDBSymbolCompiland::getSourceFileName() could
   return an empty name, so if that is true, we have to walk through all
   source files of this compiland and determine the right source file
   used to generate this compiland based on language indicated.

   The previous implementation called PDBSession::findOneSourceFile 
   method to get its name for the compiland. This is not accurate since
   the `one source file` found could be a header other than source file.

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

Added:
lldb/trunk/lit/SymbolFile/
lldb/trunk/lit/SymbolFile/PDB/
lldb/trunk/lit/SymbolFile/PDB/Inputs/
lldb/trunk/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp
lldb/trunk/lit/SymbolFile/PDB/compilands.test
lldb/trunk/lit/SymbolFile/PDB/lit.local.cfg
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp?rev=322433&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp Fri Jan 12 22:58:18 
2018
@@ -0,0 +1,3 @@
+int main() {
+  return 0;
+}

Added: lldb/trunk/lit/SymbolFile/PDB/compilands.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/compilands.test?rev=322433&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/compilands.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/compilands.test Fri Jan 12 22:58:18 2018
@@ -0,0 +1,9 @@
+REQUIRES: windows
+RUN: clang-cl /Z7 %S/Inputs/CompilandsTest.cpp /o %T/CompilandsTest.cpp.exe
+RUN: lldb-test symbols %T/CompilandsTest.cpp.exe | FileCheck %s
+
+; Link default libraries
+
+CHECK: Module [[CU:.*]]
+CHECK: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
+CHECK: {{^[0-9A-F]+}}:   CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", 
file = '{{.*}}\CompilandsTest.cpp'

Added: lldb/trunk/lit/SymbolFile/PDB/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/lit.local.cfg?rev=322433&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/lit.local.cfg (added)
+++ lldb/trunk/lit/SymbolFile/PDB/lit.local.cfg Fri Jan 12 22:58:18 2018
@@ -0,0 +1 @@
+config.suffixes = ['.test']

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=322433&r1=322432&r2=322433&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Fri Jan 12 
22:58:18 2018
@@ -128,8 +128,6 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
   return nullptr;
 std::string name = type_def->getName();
 uint64_t bytes = type_def->getLength();
-if (!target_type)
-  return nullptr;
 CompilerType target_ast_type = target_type->GetFullCompilerType();
 CompilerDeclContext target_decl_ctx =
 m_ast.GetSymbolFile()->GetDeclContextForUID(target_type->GetID());

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=322433&r1=322432&r2=322433&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Fri Jan 12 
22:58:18 2018
@@ -18,6 +18,7 @@
 #include "lldb/Symbol/LineTable.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb

[Lldb-commits] [lldb] r322270 - Check existence of each required component during construction of LLVMCDisassembler.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Thu Jan 11 04:06:22 2018
New Revision: 322270

URL: http://llvm.org/viewvc/llvm-project?rev=322270&view=rev
Log:
Check existence of each required component during construction of 
LLVMCDisassembler.

Summary:
Actually, fix two issues:

  # remove repeat creation of reg_info, use m_reg_info_ap  for createMCAsmInfo 
instead;

  # remove possibility to dereference nullptr during createMCAsmInfo 
invocation, that could lead to undefined behavior.

Placed checking of a component right after its creation to simplify the code 
and avoid same issues later.

Reviewers: zturner, clayborg, jingham, jasonmolenda, labath

Reviewed By: clayborg, labath

Subscribers: labath, lldb-commits

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

Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=322270&r1=322269&r2=322270&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu Jan 
11 04:06:22 2018
@@ -10,6 +10,9 @@
 // C Includes
 // C++ Includes
 // Project includes
+#include "DisassemblerLLVMC.h"
+
+// Other libraries and framework includes
 #include "llvm-c/Disassembler.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/MC/MCAsmInfo.h"
@@ -27,9 +30,6 @@
 #include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetSelect.h"
 
-// Other libraries and framework includes
-#include "DisassemblerLLVMC.h"
-
 #include "lldb/Core/Address.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Symbol/SymbolContext.h"
@@ -41,13 +41,47 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/Stream.h"
-
 #include "lldb/Utility/RegularExpression.h"
+#include "lldb/Utility/Stream.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+class DisassemblerLLVMC::MCDisasmInstance {
+public:
+  static std::unique_ptr
+  Create(const char *triple, const char *cpu, const char *features_str,
+ unsigned flavor, DisassemblerLLVMC &owner);
+
+  ~MCDisasmInstance() = default;
+
+  uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len,
+ lldb::addr_t pc, llvm::MCInst &mc_inst) const;
+  void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string,
+   std::string &comments_string);
+  void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style);
+  bool CanBranch(llvm::MCInst &mc_inst) const;
+  bool HasDelaySlot(llvm::MCInst &mc_inst) const;
+  bool IsCall(llvm::MCInst &mc_inst) const;
+
+private:
+  MCDisasmInstance(std::unique_ptr &&instr_info_up,
+   std::unique_ptr &®_info_up,
+   std::unique_ptr &&subtarget_info_up,
+   std::unique_ptr &&asm_info_up,
+   std::unique_ptr &&context_up,
+   std::unique_ptr &&disasm_up,
+   std::unique_ptr &&instr_printer_up);
+
+  std::unique_ptr m_instr_info_up;
+  std::unique_ptr m_reg_info_up;
+  std::unique_ptr m_subtarget_info_up;
+  std::unique_ptr m_asm_info_up;
+  std::unique_ptr m_context_up;
+  std::unique_ptr m_disasm_up;
+  std::unique_ptr m_instr_printer_up;
+};
+
 class InstructionLLVMC : public lldb_private::Instruction {
 public:
   InstructionLLVMC(DisassemblerLLVMC &disasm,
@@ -72,7 +106,7 @@ public:
   bool is_alternate_isa;
   lldb::addr_t pc = m_address.GetFileAddress();
 
-  DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+  DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
   GetDisasmToUse(is_alternate_isa);
   const uint8_t *opcode_data = data.GetDataStart();
   const size_t opcode_data_len = data.GetByteSize();
@@ -107,7 +141,7 @@ public:
   bool is_alternate_isa;
   lldb::addr_t pc = m_address.GetFileAddress();
 
-  DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+  DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
   GetDisasmToUse(is_alternate_isa);
   const uint8_t *opcode_data = data.GetDataStart();
   const size_t opcode_data_len = data.GetByteSize();
@@ -132,19 +166,19 @@ public:
 return m_has_delay_slot == eLazyBoolYes;
   }
 
-  DisassemblerLLVMC::LLVMCDisassembler *GetDisasmToUse(bool &is_alternate_isa) 
{
+  DisassemblerLLVMC::MCDisasmInstance *GetDisasmToUse(bool &is_alternate_isa) {
 is_alternate_isa = false;
 std::shared_ptr disasm_sp(GetDisassembler());
 if (disasm_sp) {
-  if (disasm_sp->m_alternate_disasm_ap.get() != NULL) {
+  if (disasm_sp->m_alternate_disasm_up) {
 

[Lldb-commits] [lldb] r324227 - [test] Un-XFAIL TestRaise.RaiseTestCase.test_restart_bug

2018-07-06 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Feb  5 03:39:04 2018
New Revision: 324227

URL: http://llvm.org/viewvc/llvm-project?rev=324227&view=rev
Log:
[test] Un-XFAIL TestRaise.RaiseTestCase.test_restart_bug

This test was marked as an expected failure because of PR20231 but it
seems to consistently result in an unexpected success across the bots.
Let's try to re-enable this test again.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py?rev=324227&r1=324226&r2=324227&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
 Mon Feb  5 03:39:04 2018
@@ -189,10 +189,6 @@ class RaiseTestCase(TestBase):
 # reset signal handling to default
 self.set_handle(signal, default_pass, default_stop, default_notify)
 
-@expectedFailureAll(
-oslist=["linux"] +
-getDarwinOSTriples(),
-bugnumber="llvm.org/pr20231")
 def test_restart_bug(self):
 """Test that we catch a signal in the edge case where the process 
receives it while we are
 about to interrupt it"""


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


[Lldb-commits] [lldb] r324555 - Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler.

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Wed Feb  7 18:13:48 2018
New Revision: 324555

URL: http://llvm.org/viewvc/llvm-project?rev=324555&view=rev
Log:
Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler. 

Summary:
This is a small change towards running the LLDB unit tests on Windows (still 
WIP).

Builds that use make do not point to specific configurations. However, builds 
with multiple configurations such as Visual Studio on Windows need the 
configuration (release/debug/etc) as part of the path so the binaries produced 
by clang are placed in the correct directory for the configuration.

Reviewers: zturner, lldb-commits, labath

Reviewed By: labath

Subscribers: labath, mgorny, hintonda, llvm-commits

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

Modified:
lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=324555&r1=324554&r2=324555&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Wed Feb  7 18:13:48 2018
@@ -63,8 +63,8 @@ option(LLDB_INCLUDE_TESTS "Generate buil
   ${LLVM_INCLUDE_TESTS})
 if(LLDB_INCLUDE_TESTS)
   if (TARGET clang)
-set(LLDB_DEFAULT_TEST_C_COMPILER 
"${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
-set(LLDB_DEFAULT_TEST_CXX_COMPILER 
"${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
+set(LLDB_DEFAULT_TEST_C_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
+set(LLDB_DEFAULT_TEST_CXX_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
   else()
 set(LLDB_DEFAULT_TEST_C_COMPILER "")
 set(LLDB_DEFAULT_TEST_CXX_COMPILER "")


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


[Lldb-commits] [lldb] r318833 - Remove unused variable.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Nov 22 05:35:04 2017
New Revision: 318833

URL: http://llvm.org/viewvc/llvm-project?rev=318833&view=rev
Log:
Remove unused variable.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=318833&r1=318832&r2=318833&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp 
Wed Nov 22 05:35:04 2017
@@ -178,7 +178,7 @@ bool GDBRemoteRegisterContext::GetPrimor
 const RegisterInfo *reg_info, GDBRemoteCommunicationClient &gdb_comm) {
   const uint32_t lldb_reg = reg_info->kinds[eRegisterKindLLDB];
   const uint32_t remote_reg = reg_info->kinds[eRegisterKindProcessPlugin];
-  StringExtractorGDBRemote response;
+
   if (DataBufferSP buffer_sp =
   gdb_comm.ReadRegister(m_thread.GetProtocolID(), remote_reg))
 return PrivateSetRegisterValue(


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


[Lldb-commits] [lldb] r318832 - Test commit. Fix typo in comment.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Nov 22 05:03:02 2017
New Revision: 318832

URL: http://llvm.org/viewvc/llvm-project?rev=318832&view=rev
Log:
Test commit. Fix typo in comment.

Modified:
lldb/trunk/include/lldb/Core/Architecture.h

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=318832&r1=318831&r2=318832&view=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Wed Nov 22 05:03:02 2017
@@ -22,7 +22,7 @@ public:
   //--
   /// This is currently intended to handle cases where a
   /// program stops at an instruction that won't get executed and it
-  /// allows the stop reasonm, like "breakpoint hit", to be replaced
+  /// allows the stop reason, like "breakpoint hit", to be replaced
   /// with a different stop reason like "no stop reason".
   ///
   /// This is specifically used for ARM in Thumb code when we stop in


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


[Lldb-commits] [lldb] r318846 - Remove extra minuses from command option

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Nov 22 09:07:43 2017
New Revision: 318846

URL: http://llvm.org/viewvc/llvm-project?rev=318846&view=rev
Log:
Remove extra minuses from command option

Reviewers: labath, abidh, clayborg, ki.stfu

Reviewed By: labath, abidh, clayborg, ki.stfu

Subscribers: clayborg, ki.stfu, lldb-commits

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

Modified:
lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=318846&r1=318845&r2=318846&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Wed Nov 22 09:07:43 2017
@@ -2586,7 +2586,7 @@ public:
   "Fullpath or basename for module to load.", ""),
 m_load_option(LLDB_OPT_SET_1, false, "load", 'l',
   "Write file contents to the memory.", false, true),
-m_pc_option(LLDB_OPT_SET_1, false, "--set-pc-to-entry", 'p',
+m_pc_option(LLDB_OPT_SET_1, false, "set-pc-to-entry", 'p',
 "Set PC to the entry point."
 " Only applicable with '--load' option.",
 false, true),


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


[Lldb-commits] [lldb] r325652 - [lit] Update how clang and other binaries are found in per-configuration directories

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Feb 20 16:05:51 2018
New Revision: 325652

URL: http://llvm.org/viewvc/llvm-project?rev=325652&view=rev
Log:
[lit] Update how clang and other binaries are found in per-configuration 
directories

Summary:
This is modeled after the clang and llvm lit tests.

Several properties have CMAKE_CFG_INTDIR as part of the path - this works 
correctly when the cmake generator only supports one configuration which is 
known at configuration time, but it does not work correctly when the cmake 
generator supports multiple configurations (for example, VS). 

For VS, CMAKE_CFG_INTDIR ends up set as $Configuration and then it is never 
updated correctly. Instead, the lit configuration can use a property that can 
be overwritten at run time. AddLLVM does that for several properties (such as 
LLVM_TOOLS_DIR). 

This change is also removing properties from the lit/CMakeLists.txt that are 
actually set during the call to configure_lit_site_cfg

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits, labath, stella.stamenova, mgorny, hintonda

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

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/lit.site.cfg.in

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=325652&r1=325651&r2=325652&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Tue Feb 20 16:05:51 2018
@@ -62,12 +62,18 @@ add_subdirectory(tools)
 
 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)
 if(LLDB_INCLUDE_TESTS)
-  if (TARGET clang)
+  if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER AND TARGET clang)
 set(LLDB_DEFAULT_TEST_C_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
-set(LLDB_DEFAULT_TEST_CXX_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
   else()
 set(LLDB_DEFAULT_TEST_C_COMPILER "")
+  endif()
+
+  if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER AND TARGET clang)
+set(LLDB_DEFAULT_TEST_CXX_COMPILER 
"${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
+  else()
 set(LLDB_DEFAULT_TEST_CXX_COMPILER "")
   endif()
 

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=325652&r1=325651&r2=325652&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Tue Feb 20 16:05:51 2018
@@ -1,10 +1,23 @@
-set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
-set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
-set(LLVM_BUILD_MODE "%(build_mode)s")
-set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
-set(LLVM_LIBS_DIR 
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+# Test runner infrastructure for LLDB. This configures the LLDB test trees
+# for use by Lit, and delegates to LLVM's lit test handlers.
+
+if (CMAKE_CFG_INTDIR STREQUAL ".")
+  set(LLVM_BUILD_MODE ".")
+else ()
+  set(LLVM_BUILD_MODE "%(build_mode)s")
+endif ()
+
+if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER)
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER 
${LLDB_TEST_C_COMPILER})
+endif ()
+
+if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER)
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER 
${LLDB_TEST_CXX_COMPILER})
+endif ()
+
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR 
${LLVM_LIBRARY_OUTPUT_INTDIR})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR 
${LLVM_RUNTIME_OUTPUT_INTDIR})
+
 if(BUILD_SHARED_LIBS)
   set(ENABLE_SHARED 1)
 else()

Modified: lldb/trunk/lit/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.in?rev=325652&r1=325651&r2=325652&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.in (original)
+++ lldb/trunk/lit/lit.site.cfg.in Tue Feb 20 16:05:51 2018
@@ -6,8 +6,8 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"
-config.lldb_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
-config.lldb_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+conf

[Lldb-commits] [lldb] r326858 - [SymbolFilePDB] Get line number for PDBSymbolTypeEnum

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Mar  6 16:35:27 2018
New Revision: 326858

URL: http://llvm.org/viewvc/llvm-project?rev=326858&view=rev
Log:
[SymbolFilePDB] Get line number for PDBSymbolTypeEnum

Reviewers: zturner, lldb-commits, rnk

Reviewed By: zturner

Subscribers: llvm-commits

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

Modified:
lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp

Modified: lldb/trunk/lit/SymbolFile/PDB/enums-layout.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/enums-layout.test?rev=326858&r1=326857&r2=326858&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/enums-layout.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/enums-layout.test Tue Mar  6 16:35:27 2018
@@ -8,35 +8,35 @@ RUN: lldb-test symbols %T/SimpleTypesTes
 
 CHECK: Module [[CU:.*]]
 CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
-CHECK:  Type{{.*}} , name = "Enum", size = 4, compiler_type = {{.*}} enum 
Enum {
+CHECK:  Type{{.*}} , name = "Enum", size = 4, decl = 
SimpleTypesTest.cpp:19, compiler_type = {{.*}} enum Enum {
 CHECK-NEXT:RED,
 CHECK-NEXT:GREEN,
 CHECK-NEXT:BLUE
 CHECK-NEXT:}
 
-CHECK:  Type{{.*}} , name = "EnumConst", size = 4, compiler_type = {{.*}} 
enum EnumConst {
+CHECK:  Type{{.*}} , name = "EnumConst", size = 4,  decl = 
SimpleTypesTest.cpp:22, compiler_type = {{.*}} enum EnumConst {
 CHECK-NEXT:LOW,
 CHECK-NEXT:NORMAL,
 CHECK-NEXT:HIGH
 CHECK-NEXT:}
 
-CHECK:  Type{{.*}} , name = "EnumEmpty", size = 4, compiler_type = {{.*}} 
enum EnumEmpty {
+CHECK:  Type{{.*}} , name = "EnumEmpty", size = 4,  decl = 
SimpleTypesTest.cpp:25, compiler_type = {{.*}} enum EnumEmpty {
 CHECK-NEXT:}
 
-CHECK:  Type{{.*}} , name = "EnumUChar", size = 1, compiler_type = {{.*}} 
enum EnumUChar {
+CHECK:  Type{{.*}} , name = "EnumUChar", size = 1,  decl = 
SimpleTypesTest.cpp:28, compiler_type = {{.*}} enum EnumUChar {
 CHECK-NEXT:ON,
 CHECK-NEXT:OFF,
 CHECK-NEXT:AUTO
 CHECK-NEXT:}
 
 ; Note that `enum EnumClass` is tested instead of `enum class EnumClass`
-CHECK:  Type{{.*}} , name = "EnumClass", size = 4, compiler_type = {{.*}} 
enum EnumClass {
+CHECK:  Type{{.*}} , name = "EnumClass", size = 4,  decl = 
SimpleTypesTest.cpp:32, compiler_type = {{.*}} enum EnumClass {
 CHECK-NEXT:YES,
 CHECK-NEXT:NO,
 CHECK-NEXT:DEFAULT
 CHECK-NEXT:}
 
-CHECK:  Type{{.*}} , name = "EnumStruct", size = 4, compiler_type = {{.*}} 
enum EnumStruct {
+CHECK:  Type{{.*}} , name = "EnumStruct", size = 4,  decl = 
SimpleTypesTest.cpp:35, compiler_type = {{.*}} enum EnumStruct {
 CHECK-NEXT:red,
 CHECK-NEXT:blue,
 CHECK-NEXT:black

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=326858&r1=326857&r2=326858&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Tue Mar  6 
16:35:27 2018
@@ -170,14 +170,17 @@ ConstString GetPDBBuiltinTypeName(const
 
 bool GetDeclarationForSymbol(const PDBSymbol &symbol, Declaration &decl) {
   auto &raw_sym = symbol.getRawSymbol();
-  auto lines_up = symbol.getSession().findLineNumbersByAddress(
-  raw_sym.getVirtualAddress(), raw_sym.getLength());
-  if (!lines_up)
-return false;
-  auto first_line_up = lines_up->getNext();
-  if (!first_line_up)
-return false;
+  auto first_line_up = raw_sym.getSrcLineOnTypeDefn();
 
+  if (!first_line_up) {
+auto lines_up = symbol.getSession().findLineNumbersByAddress(
+raw_sym.getVirtualAddress(), raw_sym.getLength());
+if (!lines_up)
+  return false;
+first_line_up = lines_up->getNext();
+if (!first_line_up)
+  return false;
+  }
   uint32_t src_file_id = first_line_up->getSourceFileId();
   auto src_file_up = symbol.getSession().getSourceFileById(src_file_id);
   if (!src_file_up)
@@ -269,6 +272,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 if (ClangASTContext::StartTagDeclarationDefinition(ast_enum))
   ClangASTContext::CompleteTagDeclarationDefinition(ast_enum);
 
+GetDeclarationForSymbol(type, decl);
 return std::make_shared(
 type.getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name), bytes,
 nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,


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


[Lldb-commits] [lldb] r327162 - [SymbolFilePDB] Keep searching until the file name is found for the pdb compiland

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Fri Mar  9 10:50:19 2018
New Revision: 327162

URL: http://llvm.org/viewvc/llvm-project?rev=327162&view=rev
Log:
[SymbolFilePDB] Keep searching until the file name is found for the pdb 
compiland

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327162&r1=327161&r2=327162&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Fri Mar  9 
10:50:19 2018
@@ -627,9 +627,10 @@ std::string SymbolFilePDB::GetSourceFile
   auto file_extension = file_spec.GetFileNameExtension();
   if (pdb_lang == PDB_Lang::Cpp || pdb_lang == PDB_Lang::C) {
 static const char* exts[] = { "cpp", "c", "cc", "cxx" };
-if (llvm::is_contained(exts, file_extension.GetStringRef().lower()))
+if (llvm::is_contained(exts, file_extension.GetStringRef().lower())) {
   source_file_name = file_up->getFileName();
-break;
+  break;
+}
   } else if (pdb_lang == PDB_Lang::Masm &&
  ConstString::Compare(file_extension, ConstString("ASM"),
   false) == 0) {


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


[Lldb-commits] [lldb] r326870 - [SymbolFilePDB] Minor cleanup

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Mar  6 19:16:50 2018
New Revision: 326870

URL: http://llvm.org/viewvc/llvm-project?rev=326870&view=rev
Log:
[SymbolFilePDB] Minor cleanup

Summary:
 - Remove unused code

- Adding `break` statement conditionally

- Ignore empty strings in FindTypeByName

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=326870&r1=326869&r2=326870&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Tue Mar  6 
19:16:50 2018
@@ -282,16 +282,12 @@ SymbolFilePDB::ParseCompileUnitFunctionF
   if (!func_range.GetBaseAddress().IsValid())
 return nullptr;
 
-  user_id_t func_type_uid = pdb_func->getSignatureId();
-  // TODO: Function symbol with invalid signature won't be handled. We'll set 
up
-  // a white list to trace them.
-  if (!pdb_func->getSignature())
-return nullptr;
-
   lldb_private::Type* func_type = ResolveTypeUID(pdb_func->getSymIndexId());
   if (!func_type)
 return nullptr;
 
+  user_id_t func_type_uid = pdb_func->getSignatureId();
+
   Mangled mangled = GetMangledForPDBFunc(pdb_func);
 
   FunctionSP func_sp = std::make_shared(sc.comp_unit,
@@ -500,7 +496,8 @@ lldb_private::Type *SymbolFilePDB::Resol
   if (result.get()) {
 m_types.insert(std::make_pair(type_uid, result));
 auto type_list = GetTypeList();
-type_list->Insert(result);
+if (type_list)
+  type_list->Insert(result);
   }
   return result.get();
 }
@@ -607,8 +604,8 @@ std::string SymbolFilePDB::GetSourceFile
   std::string file_name = pdb_compiland->getSourceFileName();
   if (!file_name.empty()) {
 auto one_src_file_up =
-  m_session_up->findOneSourceFile(pdb_compiland, file_name,
-  PDB_NameSearchFlags::NS_CaseInsensitive);
+m_session_up->findOneSourceFile(pdb_compiland, file_name,
+
PDB_NameSearchFlags::NS_CaseInsensitive);
 if (one_src_file_up)
   source_file_name = one_src_file_up->getFileName();
   }
@@ -622,7 +619,7 @@ std::string SymbolFilePDB::GetSourceFile
   auto details_up = pdb_compiland->findOneChild();
   PDB_Lang pdb_lang = details_up ? details_up->getLanguage() : PDB_Lang::Cpp;
   auto src_files_up =
-m_session_up->getSourceFilesForCompiland(*pdb_compiland);
+  m_session_up->getSourceFilesForCompiland(*pdb_compiland);
   if (src_files_up) {
 while (auto file_up = src_files_up->getNext()) {
   FileSpec file_spec(file_up->getFileName(), false,
@@ -700,9 +697,7 @@ uint32_t SymbolFilePDB::ResolveSymbolCon
 if ((resolve_scope & eSymbolContextLineEntry) && !has_line_table) {
   // The query asks for line entries, but we can't get them for the
   // compile unit. This is not normal for `line` = 0. So just assert 
it.
-  if (line == 0) {
-assert(0 && "Couldn't get all line entries!\n");
-  }
+  assert(line && "Couldn't get all line entries!\n");
 
   // Current compiland does not have the requested line. Search next.
   continue;
@@ -825,14 +820,15 @@ void SymbolFilePDB::CacheFunctionNames()
 
   if (auto results_up = m_global_scope_up->findAllChildren()) {
 while (auto pdb_func_up = results_up->getNext()) {
-  auto uid = pdb_func_up->getSymIndexId();
+  if (pdb_func_up->isCompilerGenerated())
+continue;
+
   auto name = pdb_func_up->getName();
   auto demangled_name = pdb_func_up->getUndecoratedName();
   if (name.empty() && demangled_name.empty())
 continue;
-  if (pdb_func_up->isCompilerGenerated())
-continue;
 
+  auto uid = pdb_func_up->getSymIndexId();
   if (!demangled_name.empty() && pdb_func_up->getVirtualAddress())
 addr_ids.insert(std::make_pair(pdb_func_up->getVirtualAddress(), uid));
 
@@ -902,8 +898,6 @@ void SymbolFilePDB::CacheFunctionNames()
 continue;
 
   if (CPlusPlusLanguage::IsCPPMangledName(name.c_str())) {
-auto demangled_name = pub_sym_up->getUndecoratedName();
-std::vector ids;
 auto vm_addr = pub_sym_up->getVirtualAddress();
 
 // PDB public symbol has mangled name for its associated function.
@@ -1092,6 +1086,8 @@ void SymbolFilePDB::FindTypesByName(cons
 uint32_t max_matches,
 lldb_private::TypeMap &types) {
   std::unique_ptr results;
+  if (name.empty())
+return;
   results = m_global_scope_up->findChildren(PDB_SymType::None, name,
 

[Lldb-commits] [lldb] r324564 - [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Wed Feb  7 21:11:17 2018
New Revision: 324564

URL: http://llvm.org/viewvc/llvm-project?rev=324564&view=rev
Log:
[docs] Update docs for cmake options LLDB_TEST_C_COMPILER and 
LLDB_TEST_CXX_COMPILER

Summary:
LLDB_TEST_COMPILER is not a valid option for CMake for LLDB. There are instead 
two properties LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. Update the 
documents accordingly to reflect the correct information.


Reviewers: zturner, lldb-commits

Subscribers: llvm-commits

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

Modified:
lldb/trunk/www/build.html
lldb/trunk/www/test.html

Modified: lldb/trunk/www/build.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/build.html?rev=324564&r1=324563&r2=324564&view=diff
==
--- lldb/trunk/www/build.html (original)
+++ lldb/trunk/www/build.html Wed Feb  7 21:11:17 2018
@@ -116,14 +116,14 @@
 the PYTHONHOME environment variable if it is specified).
   
   
-LLDB_TEST_COMPILER: The test suite needs to be able to 
find a copy of clang.exe that it can use to compile
-inferior programs.  Note that MSVC is not supported here, it 
must be a path to a clang executable.
-Note that using a release clang.exe is strongly recommended 
here, as it will make the test suite run much faster.
+LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: 
The test suite needs to be able to find a copy of clang.exe
+that it can use to compile inferior programs.  Note that MSVC 
is not supported here, it must be a path to a
+clang executable.  Note that using a release clang.exe is 
strongly recommended here, as it will make the test suite run much faster.
 This can be a path to any recent clang.exe, including one you 
built yourself.
   
 
 Sample command line:
-cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 
-DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
+cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 
-DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
 Working with both Ninja and MSVC
 
   Compiling with ninja is both faster and simpler 
than compiling with MSVC, but chances are you still want

Modified: lldb/trunk/www/test.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/test.html?rev=324564&r1=324563&r2=324564&view=diff
==
--- lldb/trunk/www/test.html (original)
+++ lldb/trunk/www/test.html Wed Feb  7 21:11:17 2018
@@ -39,8 +39,8 @@
   The easiest way to run the LLDB test suite is to use the 
check-lldb build
   target. By default, the check-lldb target builds the 
test programs with
   the same compiler that was used to build LLDB. To build the 
tests with a different
-  compiler, you can set the LLDB_TEST_COMPILER 
CMake variable. It is possible to
-  customize the architecture of the test binaries and compiler 
used by appending -A
+  compiler, you can set the LLDB_TEST_C_COMPILER 
or the LLDB_TEST_CXX_COMPILER CMake variables.
+  It is possible to customize the architecture of the test 
binaries and compiler used by appending -A
   and -C options respectively to the CMake variable 
LLDB_TEST_USER_ARGS. For
   example, to test LLDB against 32-bit binaries
   built with a custom version of clang, do:


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


[Lldb-commits] [lldb] r326875 - [SymbolFilePDB] Add missing Char16 and Char32 types in a few places

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Mar  6 21:43:05 2018
New Revision: 326875

URL: http://llvm.org/viewvc/llvm-project?rev=326875&view=rev
Log:
[SymbolFilePDB] Add missing Char16 and Char32 types in a few places

Reviewers: zturner, rnk, lldb-commits

Subscribers: clayborg, llvm-commits

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

Modified:
lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
lldb/trunk/lit/SymbolFile/PDB/typedefs.test
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp

Modified: lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp?rev=326875&r1=326874&r2=326875&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (original)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp Tue Mar  6 
21:43:05 2018
@@ -35,6 +35,12 @@ EnumClass EnumClassVar;
 enum struct EnumStruct { red, blue, black };
 EnumStruct EnumStructVar;
 
+typedef char16_t WChar16Typedef;
+WChar16Typedef WC16Var;
+
+typedef char32_t WChar32Typedef;
+WChar32Typedef WC32Var;
+
 int main() {
   return 0;
 }

Modified: lldb/trunk/lit/SymbolFile/PDB/typedefs.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/typedefs.test?rev=326875&r1=326874&r2=326875&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/typedefs.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/typedefs.test Tue Mar  6 21:43:05 2018
@@ -14,6 +14,8 @@ RUN: lldb-test symbols %T/SimpleTypesTes
 
 CHECK: Module [[MOD:.*]]
 CHECK: {{^[0-9A-F]+}}: SymbolVendor ([[MOD]])
+CHECK-DAG: name = "char32_t", size = 4, compiler_type = {{.*}} char32_t
+CHECK-DAG: name = "char16_t", size = 2, compiler_type = {{.*}} char16_t
 CHECK-DAG: Type{{.*}} , name = "unsigned long", size = 4, compiler_type = 
{{.*}} unsigned long
 CHECK-DAG: Type{{.*}} , size = 40, compiler_type = {{.*}} unsigned long [10]
 CHECK-DAG: Type{{.*}} , name = "ULongArrayTypedef", compiler_type = {{.*}} 
typedef ULongArrayTypedef

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=326875&r1=326874&r2=326875&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Tue Mar  6 
21:43:05 2018
@@ -59,6 +59,8 @@ lldb::Encoding TranslateBuiltinEncoding(
   case PDB_BuiltinType::Int:
   case PDB_BuiltinType::Long:
   case PDB_BuiltinType::Char:
+  case PDB_BuiltinType::Char16:
+  case PDB_BuiltinType::Char32:
 return lldb::eEncodingSint;
   case PDB_BuiltinType::Bool:
   case PDB_BuiltinType::UInt:
@@ -126,6 +128,10 @@ CompilerType GetBuiltinTypeForPDBEncodin
 if (width == ast->getTypeSize(ast->WCharTy))
   return CompilerType(ast, ast->WCharTy);
 break;
+  case PDB_BuiltinType::Char16:
+return CompilerType(ast, ast->Char16Ty);
+  case PDB_BuiltinType::Char32:
+return CompilerType(ast, ast->Char32Ty);
   case PDB_BuiltinType::Float:
 // Note: types `long double` and `double` have same bit size in MSVC and 
there
 // is no information in the PDB to distinguish them. So when falling back
@@ -162,6 +168,10 @@ ConstString GetPDBBuiltinTypeName(const
 return ConstString("HRESULT");
   case PDB_BuiltinType::BCD:
 return ConstString("BCD");
+  case PDB_BuiltinType::Char16:
+return ConstString("char16_t");
+  case PDB_BuiltinType::Char32:
+return ConstString("char32_t");
   case PDB_BuiltinType::None:
 return ConstString("...");
   }


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


[Lldb-commits] [lldb] r324707 - [SymbolFilePDB] Add support for function symbols

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Feb  8 21:31:28 2018
New Revision: 324707

URL: http://llvm.org/viewvc/llvm-project?rev=324707&view=rev
Log:
[SymbolFilePDB] Add support for function symbols

Summary:
This is combination of following changes,

- Resolve function symbols in PDB symbol file. `lldb-test symbols` will display 
information about function symbols.

- Implement SymbolFilePDB::FindFunctions methods. On lldb console, searching 
function symbol by name and by regular expression are both available.

- Create lldb type for PDBSymbolFunc.

- Add tests to check whether functions with the same name but from different 
sources can be resolved correctly.

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: amccarth, labath, llvm-commits

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp
lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp
lldb/trunk/lit/SymbolFile/PDB/func-symbols.test
Modified:
lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp?rev=324707&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp Thu Feb  8 21:31:28 
2018
@@ -0,0 +1,16 @@
+// Static function
+namespace {
+static long StaticFunction(int a)
+{
+  return 2;
+}
+}
+
+// Inlined function
+static inline int InlinedFunction(long a) { return 10; }
+
+void FunctionCall()
+{
+  StaticFunction(1);
+  InlinedFunction(1);
+}

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp?rev=324707&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp Thu Feb  8 
21:31:28 2018
@@ -0,0 +1,59 @@
+ 
+// Global functions
+int Func_arg_array(int array[]) { return 1; }
+void Func_arg_void(void) { return; }
+void Func_arg_none(void) { return; }
+void Func_varargs(...) { return; }
+
+// Class
+namespace MemberTest {
+  class A {
+  public:
+int Func(int a, ...) { return 1; }
+  };
+}
+
+// Template
+template 
+void TemplateFunc(T ...Arg) {
+  return;
+}
+
+// namespace
+namespace {
+  void Func(int a, const long b, volatile bool c, ...) { return; }
+}
+
+namespace NS {
+  void Func(char a, int b) {
+return;
+  }
+}
+
+// Static function
+static long StaticFunction(int a)
+{
+  return 2;
+}
+
+// Inlined function
+inline void InlinedFunction(long a) { return; }
+
+extern void FunctionCall();
+
+int main() {
+  MemberTest::A v1;
+  v1.Func('a',10);
+
+  Func(1, 5, true, 10, 8);
+  NS::Func('c', 2);
+
+  TemplateFunc(10);
+  TemplateFunc(10,11,88);
+
+  StaticFunction(2);
+  InlinedFunction(1);
+
+  FunctionCall();
+  return 0;
+}

Modified: lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp?rev=324707&r1=324706&r2=324707&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (original)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp Thu Feb  8 
21:31:28 2018
@@ -34,7 +34,7 @@ EnumClass EnumClassVar;
 
 enum struct EnumStruct { red, blue, black };
 EnumStruct EnumStructVar;
-  
+
 int main() {
   return 0;
 }

Added: lldb/trunk/lit/SymbolFile/PDB/func-symbols.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/func-symbols.test?rev=324707&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/func-symbols.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/func-symbols.test Thu Feb  8 21:31:28 2018
@@ -0,0 +1,47 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/FuncSymbolsTestMain.cpp /o 
%T/FuncSymbolsTestMain.cpp.obj
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/FuncSymbols.cpp /o 
%T/FuncSymbols.cpp.obj
+RUN: link %T/FuncSymbolsTestMain.cpp.obj %T/FuncSymbols.cpp.obj /DEBUG 
/nodefaultlib /Entry:main /OUT:%T/FuncSymbolsTest.exe
+RUN: lldb-test symbols %T/FuncSymbolsTest.exe | FileCheck %s
+
+; Link multiple objects
+; In this test, We don't check demangled name of a mangled function.
+
+CHECK: Module [[MD:.*]]
+CHECK-DAG: {{.*}}: SymbolVendor ([[MD]])
+CHECK-DAG: [[TY0:.*]]:   Type{[[UID0:.*]]} , name = "Func_arg_array", decl = 
FuncSymbolsTestMain.cpp:3, compiler_ty

[Lldb-commits] [lldb] r326437 - Make Finalize tolerant of empty register sets.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Thu Mar  1 06:36:42 2018
New Revision: 326437

URL: http://llvm.org/viewvc/llvm-project?rev=326437&view=rev
Log:
Make Finalize tolerant of empty register sets.

Modified:
lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=326437&r1=326436&r2=326437&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Thu Mar  
1 06:36:42 2018
@@ -437,7 +437,7 @@ void DynamicRegisterInfo::Finalize(const
   for (size_t set = 0; set < num_sets; ++set) {
 assert(m_sets.size() == m_set_reg_nums.size());
 m_sets[set].num_registers = m_set_reg_nums[set].size();
-m_sets[set].registers = &m_set_reg_nums[set][0];
+m_sets[set].registers = m_set_reg_nums[set].data();
   }
 
   // sort and unique all value registers and make sure each is terminated with


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


[Lldb-commits] [lldb] r326859 - [SymbolFilePDB] Add support for CVR pointer type qualifier

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Mar  6 16:39:25 2018
New Revision: 326859

URL: http://llvm.org/viewvc/llvm-project?rev=326859&view=rev
Log:
[SymbolFilePDB] Add support for CVR pointer type qualifier

Summary:
- Complete element type of PDBSymbolTypeArray.

- Add a test to check types of multi-dimensional array and pointers with CVR.

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp
lldb/trunk/lit/SymbolFile/PDB/type-quals.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp?rev=326859&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp Tue Mar  6 16:39:25 
2018
@@ -0,0 +1,46 @@
+// Rank > 0 array
+typedef volatile int* RankNArray[10][100];
+RankNArray ArrayVar;
+
+typedef int __unaligned *UnalignedTypedef;
+UnalignedTypedef UnVar;
+
+typedef long* __restrict RestrictTypedef;
+RestrictTypedef RestrictVar;
+
+void Func1(const int* a, int const* b, const int ** const c, const int* const* 
d) {
+  return;
+}
+
+void Func2(volatile int* a, int volatile* b) {
+ return;
+}
+
+void Func3(int*& a, int& b, const int&c, int&& d) {
+  return;
+}
+
+void Func4(int* __unaligned a, __unaligned int* b) {
+  return;
+}
+
+void Func5(int a, int* __restrict b, int& __restrict c) {
+  return;
+}
+
+void Func6(const volatile int* __restrict b) {
+  return;
+}
+
+// LValue
+typedef int& IntRef;
+int x = 0;
+IntRef IVar = x;
+
+// RValue
+typedef int&& IIRef;
+IIRef IIVar = int(1);
+
+int main() {
+  return 0;
+}

Added: lldb/trunk/lit/SymbolFile/PDB/type-quals.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/type-quals.test?rev=326859&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/type-quals.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/type-quals.test Tue Mar  6 16:39:25 2018
@@ -0,0 +1,39 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/TypeQualsTest.cpp /o 
%T/TypeQualsTest.cpp.obj
+RUN: link %T/TypeQualsTest.cpp.obj /DEBUG /nodefaultlib /ENTRY:main 
/OUT:%T/TypeQualsTest.cpp.exe
+RUN: lldb-test symbols %T/TypeQualsTest.cpp.exe | FileCheck %s
+
+CHECK: Module [[MOD:.*]]
+CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[MOD]])
+CHECK:  Type{{.*}} , name = "const int", size = 4, compiler_type = {{.*}} 
const int
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int *
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int **const
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int *const
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int *const *
+CHECK:  Type{{.*}} , name = "Func1", {{.*}}, compiler_type = {{.*}} void 
(const int *, const int *, const int **const, const int *const *)
+
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} volatile int *
+CHECK:  Type{{.*}} , name = "Func2", {{.*}}, compiler_type = {{.*}} void 
(volatile int *, volatile int *)
+
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int *
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int *&
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int &
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} const int &
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int &&
+CHECK:  Type{{.*}} , name = "Func3", {{.*}}, compiler_type = {{.*}} void 
(int *&, int &, const int &, int &&)
+
+// FIXME: __unaligned is not supported.
+CHECK:  Type{{.*}} , name = "Func4", {{.*}}, compiler_type = {{.*}} void 
(int *, int *)
+
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int *__restrict
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} int &__restrict
+CHECK:  Type{{.*}} , name = "Func5", {{.*}}, compiler_type = {{.*}} void 
(int, int *__restrict, int &__restrict)
+
+CHECK:  Type{{.*}} , name = "Func6", {{.*}}, compiler_type = {{.*}} void 
(const volatile int *__restrict)
+
+CHECK:  Type{{.*}} , size = 400, compiler_type = {{.*}} volatile int *[100]
+CHECK:  Type{{.*}} , size = 4000, compiler_type = {{.*}} volatile int 
*[10][100]
+
+CHECK:  Type{{.*}} , size = 4, compiler_type = {{.*}} long *__restrict
+
+CHECK-DAG: {{^[0-9A-F]+}}:   CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = 
"c++", file = '{{.*}}\TypeQualsTest.cpp'

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=326859&r1=326858&r2=326859&view=diff
=

[Lldb-commits] [lldb] r324671 - Only throw -fPIC when building a shared library

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Feb  8 15:10:29 2018
New Revision: 324671

URL: http://llvm.org/viewvc/llvm-project?rev=324671&view=rev
Log:
Only throw -fPIC when building a shared library

Summary:
Update makefiles to specify -fPIC in Makefile.rules and only throw -fPIC when 
building a shared library. This change is necessary to allow building the lldb 
tests on Windows where -fPIC is not a valid option. 

Update a few places to Python 3.x syntax


Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: stella.stamenova, labath, llvm-commits

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

Modified:

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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile

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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk
lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk
lldb/trunk/packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile
lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile?rev=324671&r1=324670&r2=324671&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
 Thu Feb  8 15:10:29 2018
@@ -3,6 +3,5 @@ LEVEL = ../../../make
 DYLIB_NAME := foo
 DYLIB_CXX_SOURCES := foo.cpp
 CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS := -fPIC
 
 include $(LEVEL)/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile?rev=324671&r1=324670&r2=324671&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
 Thu Feb  8 15:10:29 2018
@@ -3,6 +3,5 @@ LEVEL = ../../../make
 DYLIB_NAME := foo
 DYLIB_CXX_SOURCES := foo.cpp
 CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS += -fPIC
 
 include $(LEVEL)/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk?rev=324671&r1=324670&r2=324671&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk 
Thu Feb  8 15:10:29 2018
@@ -2,15 +2,12 @@ LEVEL := ../../make
 
 LIB_PREFIX := loadunload_
 
-CFLAGS_EXTRAS := -fPIC
 LD_EXTRAS := -L. -l$(LIB_PREFIX)b
 
 DYLIB_NAME := $(LIB_PREFIX)a
 DYLIB_CXX_SOURCES := a.cpp
 DYLIB_ONLY := YES
 
-CXXFLAGS += -fPIC
-
 include $(LEVEL)/Makefile.rules
 
 $(DYLIB_FILENAME): lib_b

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk?rev=324671&r1=324670&r2=324671&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk 
(original)
+++ lldb/trunk/packages/Python

[Lldb-commits] [lldb] r335905 - Added test case for: r334978 - Fixed file completion for paths that start with '~'

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Jun 28 12:34:49 2018
New Revision: 335905

URL: http://llvm.org/viewvc/llvm-project?rev=335905&view=rev
Log:
 Added test case for: r334978 - Fixed file completion for paths that start with 
'~'

Reviewers: labath

Reviewed By: labath

Subscribers: lldb-commits

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

Modified:
lldb/trunk/unittests/Interpreter/TestCompletion.cpp

Modified: lldb/trunk/unittests/Interpreter/TestCompletion.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestCompletion.cpp?rev=335905&r1=335904&r2=335905&view=diff
==
--- lldb/trunk/unittests/Interpreter/TestCompletion.cpp (original)
+++ lldb/trunk/unittests/Interpreter/TestCompletion.cpp Thu Jun 28 12:34:49 2018
@@ -51,6 +51,7 @@ protected:
   static SmallString<128> DirBar;
   static SmallString<128> DirBaz;
   static SmallString<128> DirTestFolder;
+  static SmallString<128> DirNested;
 
   static SmallString<128> FileAA;
   static SmallString<128> FileAB;
@@ -65,17 +66,17 @@ protected:
 llvm::sys::fs::current_path(OriginalWorkingDir);
 
 ASSERT_NO_ERROR(fs::createUniqueDirectory("FsCompletion", BaseDir));
-const char *DirNames[] = {"foo", "fooa", "foob",   "fooc",
-  "bar", "baz",  "test_folder"};
+const char *DirNames[] = {"foo", "fooa", "foob","fooc",
+  "bar", "baz",  "test_folder", "foo/nested"};
 const char *FileNames[] = {"aa1234.tmp",  "ab1234.tmp",  "ac1234.tmp",
"foo1234.tmp", "bar1234.tmp", "baz1234.tmp"};
-SmallString<128> *Dirs[] = {&DirFoo, &DirFooA, &DirFooB,  &DirFooC,
-&DirBar, &DirBaz,  &DirTestFolder};
+SmallString<128> *Dirs[] = {&DirFoo, &DirFooA, &DirFooB,   &DirFooC,
+&DirBar, &DirBaz,  &DirTestFolder, &DirNested};
 for (auto Dir : llvm::zip(DirNames, Dirs)) {
   auto &Path = *std::get<1>(Dir);
   Path = BaseDir;
   path::append(Path, std::get<0>(Dir));
-  ASSERT_NO_ERROR(fs::create_directory(Path));
+  ASSERT_NO_ERROR(fs::create_directories(Path));
 }
 
 SmallString<128> *Files[] = {&FileAA,  &FileAB,  &FileAC,
@@ -146,6 +147,7 @@ SmallString<128> CompletionTest::DirFooC
 SmallString<128> CompletionTest::DirBar;
 SmallString<128> CompletionTest::DirBaz;
 SmallString<128> CompletionTest::DirTestFolder;
+SmallString<128> CompletionTest::DirNested;
 
 SmallString<128> CompletionTest::FileAA;
 SmallString<128> CompletionTest::FileAB;
@@ -280,6 +282,20 @@ TEST_F(CompletionTest, DirCompletionUser
   EXPECT_TRUE(ContainsExactString(
   Twine("~/test_folder") + path::get_separator(), Results));
 
+  // Check that we can complete directories in nested paths
+  Count = CommandCompletions::DiskDirectories("~/foo/", Results, Resolver);
+  ASSERT_EQ(1u, Count);
+  ASSERT_EQ(Count, Results.GetSize());
+  EXPECT_TRUE(ContainsExactString(Twine("~/foo") + path::get_separator() +
+  "nested" + path::get_separator(),
+  Results));
+  Count = CommandCompletions::DiskDirectories("~/foo/nes", Results, Resolver);
+  ASSERT_EQ(1u, Count);
+  ASSERT_EQ(Count, Results.GetSize());
+  EXPECT_TRUE(ContainsExactString(Twine("~/foo") + path::get_separator() +
+  "nested" + path::get_separator(),
+  Results));
+
   // With ~username syntax it should return one match if there is an exact
   // match.
   // It shouldn't translate to the actual directory, it should keep the form 
the


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


[Lldb-commits] [lldb] r324672 - Recognize MSVC style mangling in CPlusPlusLanguage::IsCPPMangledName

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Feb  8 15:11:56 2018
New Revision: 324672

URL: http://llvm.org/viewvc/llvm-project?rev=324672&view=rev
Log:
Recognize MSVC style mangling in CPlusPlusLanguage::IsCPPMangledName

Reviewers: zturner, lldb-commits, labath

Reviewed By: zturner

Subscribers: jingham, labath, davide, llvm-commits

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

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=324672&r1=324671&r2=324672&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Thu Feb  
8 15:11:56 2018
@@ -251,13 +251,17 @@ std::string CPlusPlusLanguage::MethodNam
 }
 
 bool CPlusPlusLanguage::IsCPPMangledName(const char *name) {
-  // FIXME, we should really run through all the known C++ Language plugins and
-  // ask each one if
-  // this is a C++ mangled name, but we can put that off till there is actually
-  // more than one
-  // we care about.
-
-  return (name != nullptr && name[0] == '_' && name[1] == 'Z');
+  // FIXME!! we should really run through all the known C++ Language
+  // plugins and ask each one if this is a C++ mangled name
+  
+  if (name == nullptr)
+return false;
+  
+  // MSVC style mangling 
+  if (name[0] == '?')
+return true;
+  
+  return (name[0] != '\0' && name[0] == '_' && name[1] == 'Z');
 }
 
 bool CPlusPlusLanguage::ExtractContextAndIdentifier(


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


Re: [Lldb-commits] [lldb] r334978 - Fixed file completion for paths that start with '~'.

2018-07-06 Thread Raphael Isemann via lldb-commits
Woops, didn't see that. Seems my email filters were a bit too strict
on messages with lldb-commits in the CC...

See https://reviews.llvm.org/D48665
Am Mi., 27. Juni 2018 um 07:15 Uhr schrieb Pavel Labath :
>
> Ping.
> On Tue, 19 Jun 2018 at 16:04, Pavel Labath  wrote:
> >
> > A test?
> >
> > It looks like it should be possible to test this in a similar way to
> > other CommandCompletion tests
> > (unittests/Interpreter/TestCompletion.cpp).
> > On Mon, 18 Jun 2018 at 21:16, Raphael Isemann via lldb-commits
> >  wrote:
> > >
> > > Author: teemperor
> > > Date: Mon Jun 18 13:11:38 2018
> > > New Revision: 334978
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=334978&view=rev
> > > Log:
> > > Fixed file completion for paths that start with '~'.
> > >
> > > We didn't add the remaining path behind the '~' to the completion string,
> > > causing it to just complete directories inside the user home directory. 
> > > This
> > > patch just adds the directory of the remaining path if there is one.
> > >
> > > Fixes rdar://problem/40147002
> > >
> > > Modified:
> > > lldb/trunk/source/Commands/CommandCompletions.cpp
> > >
> > > Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
> > > URL: 
> > > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=334978&r1=334977&r2=334978&view=diff
> > > ==
> > > --- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
> > > +++ lldb/trunk/source/Commands/CommandCompletions.cpp Mon Jun 18 13:11:38 
> > > 2018
> > > @@ -164,6 +164,12 @@ static int DiskFilesOrDirectories(const
> > >  // search in the fully resolved directory, but CompletionBuffer 
> > > keeps the
> > >  // unmodified form that the user typed.
> > >  Storage = Resolved;
> > > +llvm::StringRef RemainderDir = path::parent_path(Remainder.str());
> > > +if (!RemainderDir.empty()) {
> > > +  // Append the remaining path to the resolved directory.
> > > +  Storage.append(path::get_separator());
> > > +  Storage.append(RemainderDir);
> > > +}
> > >  SearchDir = Storage;
> > >} else {
> > >  SearchDir = path::parent_path(CompletionBuffer);
> > >
> > >
> > > ___
> > > lldb-commits mailing list
> > > lldb-commits@lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r327224 - [lldb] Unbreak lldb builds due to r327219

2018-07-06 Thread Mandeep Singh Grang via lldb-commits
Author: mgrang
Date: Sat Mar 10 13:13:55 2018
New Revision: 327224

URL: http://llvm.org/viewvc/llvm-project?rev=327224&view=rev
Log:
[lldb] Unbreak lldb builds due to r327219

Summary:
r327219 adds wrappers to sort which shuffle the container before sorting.
This causes lldb bots to break as the call to sort is now ambiguous:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/20725/steps/ninja%20build%20local/logs/stdio

So we need use llvm::sort instead of sort to avoid ambiguity with std::sort.

Note: This patch is just to unbreak the bots. I plan to have subsequent patches 
which will convert all
calls to std::sort to llvm::sort.

Reviewers: RKSimon, k8stone, jingham, labath, zturner

Subscribers: andreadb, lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/source/Breakpoint/Breakpoint.cpp

Modified: lldb/trunk/source/Breakpoint/Breakpoint.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Breakpoint.cpp?rev=327224&r1=327223&r2=327224&view=diff
==
--- lldb/trunk/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/trunk/source/Breakpoint/Breakpoint.cpp Sat Mar 10 13:13:55 2018
@@ -792,8 +792,8 @@ void Breakpoint::ModuleReplaced(ModuleSP
   // from both maps as we go.
 
   if (old_id_vec.size() == new_id_vec.size()) {
-sort(old_id_vec.begin(), old_id_vec.end());
-sort(new_id_vec.begin(), new_id_vec.end());
+llvm::sort(old_id_vec.begin(), old_id_vec.end());
+llvm::sort(new_id_vec.begin(), new_id_vec.end());
 size_t num_elements = old_id_vec.size();
 for (size_t idx = 0; idx < num_elements; idx++) {
   BreakpointLocationSP old_loc_sp =


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


[Lldb-commits] [lldb] r327925 - [SymbolFilePDB] Simplify getting the source file path

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Mon Mar 19 17:18:22 2018
New Revision: 327925

URL: http://llvm.org/viewvc/llvm-project?rev=327925&view=rev
Log:
[SymbolFilePDB] Simplify getting the source file path

Summary: Replace SymbolFilePDB::GetSourceFileNameForPDBCompiland() with 
PDBSymbolCompiland::getSourceFileFullPath().

Reviewers: zturner, rnk, lldb-commits

Subscribers: llvm-commits

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327925&r1=327924&r2=327925&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Mon Mar 19 
17:18:22 2018
@@ -614,59 +614,6 @@ SymbolFilePDB::ResolveSymbolContext(cons
   return resolved_flags;
 }
 
-std::string SymbolFilePDB::GetSourceFileNameForPDBCompiland(
-const PDBSymbolCompiland *pdb_compiland) {
-  if (!pdb_compiland)
-return std::string();
-
-  std::string source_file_name;
-  // `getSourceFileName` returns the basename of the original source file
-  // used to generate this compiland.  It does not return the full path.
-  // Currently the only way to get that is to do a basename lookup to get the
-  // IPDBSourceFile, but this is ambiguous in the case of two source files
-  // with the same name contributing to the same compiland. This is an edge
-  // case that we ignore for now, although we need to a long-term solution.
-  std::string file_name = pdb_compiland->getSourceFileName();
-  if (!file_name.empty()) {
-auto one_src_file_up =
-m_session_up->findOneSourceFile(pdb_compiland, file_name,
-
PDB_NameSearchFlags::NS_CaseInsensitive);
-if (one_src_file_up)
-  source_file_name = one_src_file_up->getFileName();
-  }
-  // For some reason, source file name could be empty, so we will walk through
-  // all source files of this compiland, and determine the right source file
-  // if any that is used to generate this compiland based on language
-  // indicated in compilanddetails language field.
-  if (!source_file_name.empty())
-return source_file_name;
-
-  auto details_up = pdb_compiland->findOneChild();
-  PDB_Lang pdb_lang = details_up ? details_up->getLanguage() : PDB_Lang::Cpp;
-  auto src_files_up =
-  m_session_up->getSourceFilesForCompiland(*pdb_compiland);
-  if (src_files_up) {
-while (auto file_up = src_files_up->getNext()) {
-  FileSpec file_spec(file_up->getFileName(), false,
- FileSpec::ePathSyntaxWindows);
-  auto file_extension = file_spec.GetFileNameExtension();
-  if (pdb_lang == PDB_Lang::Cpp || pdb_lang == PDB_Lang::C) {
-static const char* exts[] = { "cpp", "c", "cc", "cxx" };
-if (llvm::is_contained(exts, file_extension.GetStringRef().lower())) {
-  source_file_name = file_up->getFileName();
-  break;
-}
-  } else if (pdb_lang == PDB_Lang::Masm &&
- ConstString::Compare(file_extension, ConstString("ASM"),
-  false) == 0) {
-source_file_name = file_up->getFileName();
-break;
-  }
-}
-  }
-  return source_file_name;
-}
-
 uint32_t SymbolFilePDB::ResolveSymbolContext(
 const lldb_private::FileSpec &file_spec, uint32_t line, bool check_inlines,
 uint32_t resolve_scope, lldb_private::SymbolContextList &sc_list) {
@@ -690,15 +637,7 @@ uint32_t SymbolFilePDB::ResolveSymbolCon
   // For inline functions, we don't have to match the FileSpec since they
   // could be defined in headers other than file specified in FileSpec.
   if (!check_inlines) {
-// `getSourceFileName` returns the basename of the original source file
-// used to generate this compiland.  It does not return the full path.
-// Currently the only way to get that is to do a basename lookup to get
-// the IPDBSourceFile, but this is ambiguous in the case of two source
-// files with the same name contributing to the same compiland.  This 
is
-// a moderately extreme edge case, so we consider this OK for now,
-// although we need to find a long-term solution.
-std::string source_file =
-GetSourceFileNameForPDBCompiland(compiland.get());
+std::string source_file = compiland->getSourceFileFullPath();
 if (source_file.empty())
   continue;
 FileSpec this_spec(source_file, false, FileSpec::ePathSyntaxWindows);
@@ -1284,7 +1223,7 @@ SymbolFilePDB::ParseCompileUnitForUID(ui
   if (lang == lldb::LanguageType::eLanguageTypeUnknown)
 return CompUnitSP();
 
-  std::string path 

[Lldb-commits] [lldb] r327927 - [SymbolFilePDB] Simplify code with newer methods

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Mon Mar 19 17:34:18 2018
New Revision: 327927

URL: http://llvm.org/viewvc/llvm-project?rev=327927&view=rev
Log:
[SymbolFilePDB] Simplify code with newer methods

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=327927&r1=327926&r2=327927&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Mon Mar 19 
17:34:18 2018
@@ -438,7 +438,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 pointer_ast_type = pointee_type->GetFullCompilerType();
 if (pointer_type->isReference())
   pointer_ast_type = pointer_ast_type.GetLValueReferenceType();
-else if (pointer_type->getRawSymbol().isRValueReference())
+else if (pointer_type->isRValueReference())
   pointer_ast_type = pointer_ast_type.GetRValueReferenceType();
 else
   pointer_ast_type = pointer_ast_type.GetPointerType();
@@ -449,7 +449,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 if (pointer_type->isVolatileType())
   pointer_ast_type = pointer_ast_type.AddVolatileModifier();
 
-if (pointer_type->getRawSymbol().isRestrictedType())
+if (pointer_type->isRestrictedType())
   pointer_ast_type = pointer_ast_type.AddRestrictModifier();
 
 return std::make_shared(

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327927&r1=327926&r2=327927&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Mon Mar 19 
17:34:18 2018
@@ -742,23 +742,11 @@ bool SymbolFilePDB::ResolveFunction(cons
 bool include_inlines,
 lldb_private::SymbolContextList &sc_list) {
   lldb_private::SymbolContext sc;
-  auto file_vm_addr = pdb_func.getVirtualAddress();
-  if (file_vm_addr == LLDB_INVALID_ADDRESS)
-return false;
-
-  Address so_addr(file_vm_addr);
-  sc.comp_unit = GetCompileUnitContainsAddress(so_addr).get();
+  sc.comp_unit = ParseCompileUnitForUID(pdb_func.getCompilandId()).get();
   if (!sc.comp_unit)
 return false;
   sc.module_sp = sc.comp_unit->GetModule();
-  auto symbol_up =
-  m_session_up->findSymbolByAddress(file_vm_addr, PDB_SymType::Function);
-  if (!symbol_up)
-return false;
-
-  auto *func = llvm::dyn_cast(symbol_up.get());
-  assert(func);
-  sc.function = ParseCompileUnitFunctionForPDBFunc(*func, sc);
+  sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, sc);
   if (!sc.function)
 return false;
 


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


[Lldb-commits] [lldb] r327549 - Use GetItemAtIndexAsString overload for ConstString and move set rather than copy.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Mar 14 11:29:41 2018
New Revision: 327549

URL: http://llvm.org/viewvc/llvm-project?rev=327549&view=rev
Log:
Use GetItemAtIndexAsString overload for ConstString and move set rather than 
copy.

Modified:
lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=327549&r1=327548&r2=327549&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Wed Mar 
14 11:29:41 2018
@@ -44,13 +44,9 @@ DynamicRegisterInfo::SetRegisterInfo(con
   if (dict.GetValueForKeyAsArray("sets", sets)) {
 const uint32_t num_sets = sets->GetSize();
 for (uint32_t i = 0; i < num_sets; ++i) {
-  llvm::StringRef set_name_str;
   ConstString set_name;
-  if (sets->GetItemAtIndexAsString(i, set_name_str))
-set_name.SetString(set_name_str);
-  if (set_name) {
-RegisterSet new_set = {set_name.AsCString(), NULL, 0, NULL};
-m_sets.push_back(new_set);
+  if (sets->GetItemAtIndexAsString(i, set_name) && !set_name.IsEmpty()) {
+m_sets.push_back({ set_name.AsCString(), NULL, 0, NULL });
   } else {
 Clear();
 printf("error: register sets must have valid names\n");
@@ -59,6 +55,7 @@ DynamicRegisterInfo::SetRegisterInfo(con
 }
 m_set_reg_nums.resize(m_sets.size());
   }
+
   StructuredData::Array *regs = nullptr;
   if (!dict.GetValueForKeyAsArray("registers", regs))
 return 0;


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


[Lldb-commits] [lldb] r327548 - Reuse IsEmpty for ConstString::operator bool().

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Mar 14 11:29:33 2018
New Revision: 327548

URL: http://llvm.org/viewvc/llvm-project?rev=327548&view=rev
Log:
Reuse IsEmpty for ConstString::operator bool().

Modified:
lldb/trunk/include/lldb/Utility/ConstString.h

Modified: lldb/trunk/include/lldb/Utility/ConstString.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/ConstString.h?rev=327548&r1=327547&r2=327548&view=diff
==
--- lldb/trunk/include/lldb/Utility/ConstString.h (original)
+++ lldb/trunk/include/lldb/Utility/ConstString.h Wed Mar 14 11:29:33 2018
@@ -140,7 +140,7 @@ public:
   /// /b True this object contains a valid non-empty C string, \b
   /// false otherwise.
   //--
-  explicit operator bool() const { return m_string && m_string[0]; }
+  explicit operator bool() const { return !IsEmpty(); }
 
   //--
   /// Assignment operator


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


[Lldb-commits] [lldb] r336377 - Fixed redefinition warnings with LLVM_ENABLE_MODULES

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Jul  5 10:12:11 2018
New Revision: 336377

URL: http://llvm.org/viewvc/llvm-project?rev=336377&view=rev
Log:
Fixed redefinition warnings with LLVM_ENABLE_MODULES

Summary:
It seems we both have the HAVE_LIBCOMPRESSION define in the config header
and in the source files definitions of some files. This causes that the
Config.h header emits the following warning when we compile the Host module:

```
In file included from :21:
In file included from 
/Users/teemperor/llvm/llvm/tools/lldb/include/lldb/Host/MainLoop.h:13:
tools/lldb/include/lldb/Host/Config.h:33:9: warning: 'HAVE_LIBCOMPRESSION' 
macro redefined [-Wmacro-redefined]
^
:1:9: note: previous definition is here
^
```

It's not really clear why the define is in both places (the commit message
just says it fixes some unspecified bug), but we can easily work around this
by just guarding our define in Config.h.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: mgorny, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Host/Config.h.cmake

Modified: lldb/trunk/include/lldb/Host/Config.h.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=336377&r1=336376&r2=336377&view=diff
==
--- lldb/trunk/include/lldb/Host/Config.h.cmake (original)
+++ lldb/trunk/include/lldb/Host/Config.h.cmake Thu Jul  5 10:12:11 2018
@@ -30,6 +30,8 @@
 
 #cmakedefine01 HAVE_NR_PROCESS_VM_READV
 
+#ifndef HAVE_LIBCOMPRESSION
 #cmakedefine HAVE_LIBCOMPRESSION
+#endif
 
 #endif // #ifndef LLDB_HOST_CONFIG_H


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


[Lldb-commits] [lldb] r336149 - Fixed compilation failure after the code completion refactor patch

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul  2 15:18:18 2018
New Revision: 336149

URL: http://llvm.org/viewvc/llvm-project?rev=336149&view=rev
Log:
Fixed compilation failure after the code completion refactor patch

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/include/lldb/Utility/CompletionRequest.h

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=336149&r1=336148&r2=336149&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Mon Jul  2 15:18:18 2018
@@ -16,7 +16,7 @@
 #include 
 #include 
 
-#include 
+#include "lldb/Utility/CompletionRequest.h"
 
 // Other libraries and framework includes
 // Project includes

Modified: lldb/trunk/include/lldb/Utility/CompletionRequest.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/CompletionRequest.h?rev=336149&r1=336148&r2=336149&view=diff
==
--- lldb/trunk/include/lldb/Utility/CompletionRequest.h (original)
+++ lldb/trunk/include/lldb/Utility/CompletionRequest.h Mon Jul  2 15:18:18 2018
@@ -10,9 +10,9 @@
 #ifndef LLDB_UTILITY_COMPLETIONREQUEST_H
 #define LLDB_UTILITY_COMPLETIONREQUEST_H
 
-#include 
-#include 
-#include 
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/StringList.h"
+#include "llvm/ADT/StringRef.h"
 
 namespace lldb_private {
 


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


[Lldb-commits] [lldb] r336146 - Refactoring for for the internal command line completion API (NFC)

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul  2 14:29:56 2018
New Revision: 336146

URL: http://llvm.org/viewvc/llvm-project?rev=336146&view=rev
Log:
Refactoring for for the internal command line completion API (NFC)

Summary:
This patch refactors the internal completion API. It now takes (as far as 
possible) a single
CompletionRequest object instead o half a dozen in/out/in-out parameters. The 
CompletionRequest
contains a common superset of the different parameters as far as it makes 
sense. This includes
the raw command line string and raw cursor position, which should make the 
`expr` command
possible to implement (at least without hacks that reconstruct the command line 
from the args).

This patch is not intended to change the observable behavior of lldb in any 
way. It's also as
minimal as possible and doesn't attempt to fix all the problems the API has.

Some Q&A:

Q: Why is this not fixing all the problems in the completion API?
A: Because is a blocker for the expr command completion which I want to get in 
ASAP. This is the
smallest patch that unblocks the expr completion patch and which allows trivial 
refactoring in the future.
The patch also doesn't really change the internal information flow in the API, 
so that hopefully
saves us from ever having to revert and resubmit this humongous patch.

Q: Can we merge all the copy-pasted code in the completion methods
(like computing the current incomplete arg) into CompletionRequest class?
A: Yes, but it's out of scope for this patch.

Q: Why the `word_complete = request.GetWordComplete(); ... ` pattern?
A: I don't want to add a getter that returns a reference to the internal 
integer. So we have
to use a temporary variable and the Getter/Setter instead. We don't throw 
exceptions
from what I can tell, so the behavior doesn't change.

Q: Why are we not owning the list of matches?
A: Because that's how the previous API works. But that should be fixed too (in 
another patch).

Q: Can we make the constructor simpler and compute some of the values from the 
plain command?
A: I think this works, but I rather want to have this in a follow up commit. 
Especially when making nested
request it's a bit awkward that the parsed arguments behave as both 
input/output (as we should in theory
propagate the changes on the nested request back to the parent request if we 
don't want to change the
behavior too much).

Q: Can't we pass one const request object and then just return another result 
object instead of mixing
them together in one in/out parameter?
A: It's hard to get keep the same behavior with that pattern, but I think we 
can also get a nice API with just
a single request object. If we make all input parameters read-only, we have a 
clear separation between what
is actually an input and what an output parameter (and hopefully we get rid of 
the in-out parameters).

Q: Can we throw out the 'match' variables that are not implemented according to 
the comment?
A: We currently just forward them as in the old code to the different methods, 
even though I think
they are really not used. We can easily remove and readd them once every single 
completion method just
takes a CompletionRequest, but for now I prefer NFC behavior from the 
perspective of the API user.

Reviewers: davide, jingham, labath

Reviewed By: jingham

Subscribers: mgorny, friss, lldb-commits

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

Added:
lldb/trunk/include/lldb/Utility/CompletionRequest.h
lldb/trunk/source/Utility/CompletionRequest.cpp
lldb/trunk/unittests/Utility/CompletionRequestTest.cpp
Modified:
lldb/trunk/include/lldb/Interpreter/CommandAlias.h
lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/include/lldb/Interpreter/CommandObjectMultiword.h
lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectHelp.cpp
lldb/trunk/source/Commands/CommandObjectHelp.h
lldb/trunk/source/Commands/CommandObjectMultiword.cpp
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Commands/CommandObjectPlugin.cpp
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Commands/CommandObjectSettings.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Interpreter/CommandAlias.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
lldb/trunk/source/Interpreter/CommandObjectRegexCommand.cpp
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/unittests/Utility/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Interpreter/CommandAlias.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandAlias.h?rev=336146&r1=336145&r2=336146&view=diff
===

[Lldb-commits] [lldb] r336154 - FIx XCode project files for lldb

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul  2 16:27:29 2018
New Revision: 336154

URL: http://llvm.org/viewvc/llvm-project?rev=336154&view=rev
Log:
FIx XCode project files for lldb

Summary:
Fixes the XCode builds that started failing when i added 
CompletionRequest.cpp/.h.

The patch is so large because XCode decided to write the lines back in its own 
order, but essentially we only added on e file.

Subscribers: srhines, lldb-commits

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

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

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


[Lldb-commits] [lldb] r327473 - [SymbolFilePDB] Rewrite ParseTypes method

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Mar 13 21:05:27 2018
New Revision: 327473

URL: http://llvm.org/viewvc/llvm-project?rev=327473&view=rev
Log:
[SymbolFilePDB] Rewrite ParseTypes method

Summary:
The types for the compiland's children are parsed when parsing types for a PDB 
compiland. Global types also need to be parsed but unfortunately PDBs do not 
have compiland information about each global type. So we parse them all on the 
first call to ParseTypes.

If a sc.function is provided then parse the types for that function. Otherwise 
parse the types for the overall sc.comp_unit.

The ParseTypes method can be very slow if a program has a long list of compile 
units containing needed modules. Debugging clang-cl with lldb will show the 
problem.



Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327473&r1=327472&r2=327473&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Tue Mar 13 
21:05:27 2018
@@ -438,30 +438,59 @@ SymbolFilePDB::ParseFunctionBlocks(const
 
 size_t SymbolFilePDB::ParseTypes(const lldb_private::SymbolContext &sc) {
   lldbassert(sc.module_sp.get());
+  if (!sc.comp_unit)
+return 0;
+
   size_t num_added = 0;
-  auto results_up = m_session_up->getGlobalScope()->findAllChildren();
-  if (!results_up)
+  auto compiland = GetPDBCompilandByUID(sc.comp_unit->GetID());
+  if (!compiland)
 return 0;
-  while (auto symbol_up = results_up->getNext()) {
-switch (symbol_up->getSymTag()) {
-case PDB_SymType::Enum:
-case PDB_SymType::UDT:
-case PDB_SymType::Typedef:
-  break;
-default:
-  continue;
+
+  auto ParseTypesByTagFn = [&num_added, this](const PDBSymbol &raw_sym) {
+std::unique_ptr results;
+PDB_SymType tags_to_search[] = { PDB_SymType::Enum, PDB_SymType::Typedef,
+PDB_SymType::UDT };
+for (auto tag : tags_to_search) {
+  results = raw_sym.findAllChildren(tag);
+  if (!results || results->getChildCount() == 0)
+continue;
+  while (auto symbol = results->getNext()) {
+switch (symbol->getSymTag()) {
+case PDB_SymType::Enum:
+case PDB_SymType::UDT:
+case PDB_SymType::Typedef:
+  break;
+default:
+  continue;
+}
+
+// This should cause the type to get cached and stored in the `m_types`
+// lookup.
+if (!ResolveTypeUID(symbol->getSymIndexId()))
+  continue;
+
+++num_added;
+  }
 }
+  };
 
-auto type_uid = symbol_up->getSymIndexId();
-if (m_types.find(type_uid) != m_types.end())
-  continue;
-
-// This should cause the type to get cached and stored in the `m_types`
-// lookup.
-if (!ResolveTypeUID(symbol_up->getSymIndexId()))
-  continue;
+  if (sc.function) {
+auto pdb_func =
+
m_session_up->getConcreteSymbolById(sc.function->GetID());
+if (!pdb_func)
+  return 0;
+ParseTypesByTagFn(*pdb_func);
+  } else {
+ParseTypesByTagFn(*compiland);
 
-++num_added;
+// Also parse global types particularly coming from this compiland.
+// Unfortunately, PDB has no compiland information for each global type.
+// We have to parse them all. But ensure we only do this once.
+static bool parse_all_global_types = false;
+if (!parse_all_global_types) {
+  ParseTypesByTagFn(*m_global_scope_up);
+  parse_all_global_types = true;
+}
   }
   return num_added;
 }


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


[Lldb-commits] [lldb] r327908 - [SymbolFilePDB] Remove a few null pointer checks by passing ref

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Mon Mar 19 14:14:19 2018
New Revision: 327908

URL: http://llvm.org/viewvc/llvm-project?rev=327908&view=rev
Log:
[SymbolFilePDB] Remove a few null pointer checks by passing ref

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=327908&r1=327907&r2=327908&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Mon Mar 19 
14:14:19 2018
@@ -94,24 +94,20 @@ lldb::Encoding TranslateEnumEncoding(PDB
 }
 
 CompilerType GetBuiltinTypeForPDBEncodingAndBitSize(
-ClangASTContext *clang_ast, const PDBSymbolTypeBuiltin *pdb_type,
+ClangASTContext &clang_ast, const PDBSymbolTypeBuiltin &pdb_type,
 Encoding encoding, uint32_t width) {
-  if (!pdb_type)
-return CompilerType();
-  if (!clang_ast)
-return CompilerType();
-  auto *ast = clang_ast->getASTContext();
+  auto *ast = clang_ast.getASTContext();
   if (!ast)
 return CompilerType();
 
-  switch (pdb_type->getBuiltinType()) {
+  switch (pdb_type.getBuiltinType()) {
   default: break;
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
-return clang_ast->GetBasicType(eBasicTypeVoid);
+return clang_ast.GetBasicType(eBasicTypeVoid);
   case PDB_BuiltinType::Bool:
-return clang_ast->GetBasicType(eBasicTypeBool);
+return clang_ast.GetBasicType(eBasicTypeBool);
   case PDB_BuiltinType::Long:
 if (width == ast->getTypeSize(ast->LongTy))
   return CompilerType(ast, ast->LongTy);
@@ -141,15 +137,12 @@ CompilerType GetBuiltinTypeForPDBEncodin
   }
   // If there is no match on PDB_BuiltinType, fall back to default search
   // by encoding and width only
-  return clang_ast->GetBuiltinTypeForEncodingAndBitSize(encoding, width);
+  return clang_ast.GetBuiltinTypeForEncodingAndBitSize(encoding, width);
 }
 
-ConstString GetPDBBuiltinTypeName(const PDBSymbolTypeBuiltin *pdb_type,
+ConstString GetPDBBuiltinTypeName(const PDBSymbolTypeBuiltin &pdb_type,
   CompilerType &compiler_type) {
-  if (!pdb_type)
-return compiler_type.GetTypeName();
-
-  PDB_BuiltinType kind = pdb_type->getBuiltinType();
+  PDB_BuiltinType kind = pdb_type.getBuiltinType();
   switch (kind) {
   default: break;
   case PDB_BuiltinType::Currency:
@@ -262,7 +255,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 CompilerType builtin_type;
 if (bytes > 0)
   builtin_type = GetBuiltinTypeForPDBEncodingAndBitSize(
-   &m_ast, underlying_type_up.get(), encoding, bytes * 8);
+   m_ast, *underlying_type_up, encoding, bytes * 8);
 else
   builtin_type = m_ast.GetBasicType(eBasicTypeInt);
 // FIXME: PDB does not have information about scoped enumeration (Enum 
Class).
@@ -418,7 +411,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 uint64_t bytes = builtin_type->getLength();
 Encoding encoding = TranslateBuiltinEncoding(builtin_kind);
 CompilerType builtin_ast_type = GetBuiltinTypeForPDBEncodingAndBitSize(
-&m_ast, builtin_type, encoding, bytes * 8);
+m_ast, *builtin_type, encoding, bytes * 8);
 
 if (builtin_type->isConstType())
   builtin_ast_type = builtin_ast_type.AddConstModifier();
@@ -426,7 +419,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 if (builtin_type->isVolatileType())
   builtin_ast_type = builtin_ast_type.AddVolatileModifier();
 
-auto type_name = GetPDBBuiltinTypeName(builtin_type, builtin_ast_type);
+auto type_name = GetPDBBuiltinTypeName(*builtin_type, builtin_ast_type);
 
 return std::make_shared(
 builtin_type->getSymIndexId(), m_ast.GetSymbolFile(), type_name,

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327908&r1=327907&r2=327908&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Mon Mar 19 
14:14:19 2018
@@ -205,15 +205,12 @@ uint32_t SymbolFilePDB::GetNumCompileUni
 }
 
 void SymbolFilePDB::GetCompileUnitIndex(
-const llvm::pdb::PDBSymbolCompiland *pdb_compiland,
+const llvm::pdb::PDBSymbolCompiland &pdb_compiland,
 uint32_t &index) {
-  if (!pdb_compiland)
-return;
-
   auto results_up = m_global_scope_up->findAllChildren(

[Lldb-commits] [lldb] r335934 - Fix path completion test case added in rL335905 on Windows

2018-07-06 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Jun 28 15:40:10 2018
New Revision: 335934

URL: http://llvm.org/viewvc/llvm-project?rev=335934&view=rev
Log:
Fix path completion test case added in rL335905 on Windows

Summary:
The test fails because we don't rewrite the slash behind `foo` to the OS 
specific
separator (as the completion API doesn't support this kind of rewriting). 
However,
we assume that this part of the string is rewritten in the test case, which 
broke
on Windows.

Reviewers: stella.stamenova

Reviewed By: stella.stamenova

Subscribers: lldb-commits

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

Modified:
lldb/trunk/unittests/Interpreter/TestCompletion.cpp

Modified: lldb/trunk/unittests/Interpreter/TestCompletion.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestCompletion.cpp?rev=335934&r1=335933&r2=335934&view=diff
==
--- lldb/trunk/unittests/Interpreter/TestCompletion.cpp (original)
+++ lldb/trunk/unittests/Interpreter/TestCompletion.cpp Thu Jun 28 15:40:10 2018
@@ -286,14 +286,12 @@ TEST_F(CompletionTest, DirCompletionUser
   Count = CommandCompletions::DiskDirectories("~/foo/", Results, Resolver);
   ASSERT_EQ(1u, Count);
   ASSERT_EQ(Count, Results.GetSize());
-  EXPECT_TRUE(ContainsExactString(Twine("~/foo") + path::get_separator() +
-  "nested" + path::get_separator(),
+  EXPECT_TRUE(ContainsExactString(Twine("~/foo/nested") + 
path::get_separator(),
   Results));
   Count = CommandCompletions::DiskDirectories("~/foo/nes", Results, Resolver);
   ASSERT_EQ(1u, Count);
   ASSERT_EQ(Count, Results.GetSize());
-  EXPECT_TRUE(ContainsExactString(Twine("~/foo") + path::get_separator() +
-  "nested" + path::get_separator(),
+  EXPECT_TRUE(ContainsExactString(Twine("~/foo/nested") + 
path::get_separator(),
   Results));
 
   // With ~username syntax it should return one match if there is an exact


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


Re: [Lldb-commits] [PATCH] D39283: [lldb-dev] Update LLDB test cases for 'inlineStepping'

2018-07-06 Thread Carlos Alberto Enciso via lldb-commits
You are correct. Using the GUI interface to cmake, on those fields you add
just "x86_64" or "i386".

Thanks very much.

On Tue, Jan 9, 2018 at 12:55 PM, Pavel Labath  wrote:

> On 4 January 2018 at 09:00, Carlos Alberto Enciso via Phabricator via
> lldb-commits  wrote:
> > CarlosAlbertoEnciso added a comment.
> >
> > I have some issues running the LLDB Test Suite in 32-bit and 64-bit mode.
> >
> > From the LLDB documentation:
> >
> > https://lldb.llvm.org/test.html
> >
> >   It is possible to customize the architecture of the test binaries and
> compiler used by appending -A and -C options respectively to the CMake
> variable LLDB_TEST_USER_ARGS. For example, to test LLDB against 32-bit
> binaries built with a custom version of clang, do:
> >
> >   > cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G
> Ninja
> >   > ninja check-lldb
> >
> > Doing
> >
> >   > cmake -DLLDB_TEST_USER_ARGS="-A i386" -G Ninja
> >   > ninja check-lldb
> >
> >   or
> >
> >   > cmake -DLLDB_TEST_USER_ARGS="-A x86_64" -G Ninja
> >   > ninja check-lldb
> >
> > The LLDB Test Suite generates about 1538 errors related to missing cmake
> targets.
> >
> > But if I used the CMake variable LLDB_TEST_ARCH as
> >
> >   > cmake -DLLDB_TEST_ARCH="-A i386" -G Ninja
> >   > ninja check-lldb
> >
> >   or
> >
> >   > cmake -DLLDB_TEST_ARCH="-A x86_64" -G Ninja
> >   > ninja check-lldb
>
> I think the correct invocation should be -DLLDB_TEST_ARCH=x86_64 (-A
> is automatically added). I'm surprised that the test suite passes if
> you pass "-A", but that could be simply because the test suite ignores
> unknown architectures.
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r335711 - Add missing constness.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Wed Jun 27 00:01:07 2018
New Revision: 335711

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

Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.h
lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=335711&r1=335710&r2=335711&view=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Wed Jun 27 00:01:07 2018
@@ -31,7 +31,7 @@ public:
   /// stopped at the current PC. The code is generic and applies to all
   /// ARM CPUs.
   //--
-  virtual void OverrideStopInfo(Thread &thread) = 0;
+  virtual void OverrideStopInfo(Thread &thread) const = 0;
 
   //--
   /// This method is used to get the number of bytes that should be

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=335711&r1=335710&r2=335711&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Wed Jun 27 00:01:07 2018
@@ -938,7 +938,7 @@ public:
 
   bool MergeArchitecture(const ArchSpec &arch_spec);
 
-  Architecture *GetArchitecturePlugin() { return m_arch.GetPlugin(); }
+  Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
 
   Debugger &GetDebugger() { return m_debugger; }
 

Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=335711&r1=335710&r2=335711&view=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Wed Jun 27 00:01:07 
2018
@@ -367,7 +367,7 @@ BreakpointResolverName::SearchCallback(S
 if (prologue_byte_size)
   break_addr.SetOffset(break_addr.GetOffset() + 
prologue_byte_size);
 else {
-  Architecture *arch =
+  const Architecture *arch =
   m_breakpoint->GetTarget().GetArchitecturePlugin();
   if (arch)
 arch->AdjustBreakpointAddress(*sc.symbol, break_addr);

Modified: lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.cpp?rev=335711&r1=335710&r2=335711&view=diff
==
--- lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.cpp (original)
+++ lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.cpp Wed Jun 27 
00:01:07 2018
@@ -41,7 +41,7 @@ std::unique_ptr Architectu
 ConstString ArchitectureArm::GetPluginName() { return GetPluginNameStatic(); }
 uint32_t ArchitectureArm::GetPluginVersion() { return 1; }
 
-void ArchitectureArm::OverrideStopInfo(Thread &thread) {
+void ArchitectureArm::OverrideStopInfo(Thread &thread) const {
   // We need to check if we are stopped in Thumb mode in a IT instruction and
   // detect if the condition doesn't pass. If this is the case it means we
   // won't actually execute this instruction. If this happens we need to clear

Modified: lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.h?rev=335711&r1=335710&r2=335711&view=diff
==
--- lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.h (original)
+++ lldb/trunk/source/Plugins/Architecture/Arm/ArchitectureArm.h Wed Jun 27 
00:01:07 2018
@@ -23,7 +23,7 @@ public:
   ConstString GetPluginName() override;
   uint32_t GetPluginVersion() override;
 
-  void OverrideStopInfo(Thread &thread) override;
+  void OverrideStopInfo(Thread &thread) const override;
 
 private:
   static std::unique_ptr Create(const ArchSpec &arch);

Modified: lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h?rev=335711&r1=335710&r2=335711&view=diff

[Lldb-commits] [lldb] r334030 - PDB support of function-level linking and splitted functions

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Jun  5 10:19:21 2018
New Revision: 334030

URL: http://llvm.org/viewvc/llvm-project?rev=334030&view=rev
Log:
PDB support of function-level linking and splitted functions

Summary:
The patch adds support of splitted functions (when MSVC is used with PGO) and 
function-level linking feature.

SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of 
compiled source files in the binary are continuous and don't intersect each 
other. The function creates LineSequence for each file and inserts it into 
LineTable, and implementation of last one relies on continuity of the sequence. 
But it's not always true when function-level linking enabled, e.g. in added 
input test file test-pdb-function-level-linking.exe there is xstring's 
std__basic_string_char_std__char_traits_char__std__allocator_char_max_size 
(.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and 
main (.004548F0).

To fix the problem this patch renews the sequence on each address gap.

Reviewers: asmith, zturner

Reviewed By: asmith

Subscribers: mgorny, lldb-commits

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

Added:

lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp

lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe

lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.cpp
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.exe
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-splitted-function.pdb
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt
lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=334030&r1=334029&r2=334030&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Tue Jun  5 
10:19:21 2018
@@ -1571,6 +1571,9 @@ bool SymbolFilePDB::ParseCompileUnitLine
 line_table->AppendLineEntryToSequence(
 sequence.get(), prev_addr + prev_length, prev_line, 0,
 prev_source_idx, false, false, false, false, true);
+
+line_table->InsertSequence(sequence.release());
+sequence.reset(line_table->CreateLineSequenceContainer());
   }
 
   if (ShouldAddLine(match_line, lno, length)) {

Modified: lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt?rev=334030&r1=334029&r2=334030&view=diff
==
--- lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt Tue Jun  5 10:19:21 2018
@@ -17,6 +17,10 @@ add_lldb_unittest(SymbolFilePDBTests
 set(test_inputs
test-pdb.exe
test-pdb.pdb
+   test-pdb-function-level-linking.exe
+   test-pdb-function-level-linking.pdb
+   test-pdb-splitted-function.exe
+   test-pdb-splitted-function.pdb
test-pdb-types.exe
test-pdb-types.pdb)
 

Added: 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp?rev=334030&view=auto
==
--- 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp 
(added)
+++ 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.cpp 
Tue Jun  5 10:19:21 2018
@@ -0,0 +1,17 @@
+// Compile with "cl /c /ZI /sdl /EHsc /MTd /permissive-
+// test-pdb-function-level-linking.cpp"
+// Link with "link /debug:full test-pdb-function-level-linking.obj"
+
+#include 
+#include 
+
+std::string foo()
+{
+return "Hello!";
+}
+
+int main()
+{
+auto x = foo();
+return 0;
+}

Added: 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.exe?rev=334030&view=auto
==
(empty)

Added: 
lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-function-level-linking.pdb?rev=334030&view=auto
==
(empty)

Added: lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-s

[Lldb-commits] [lldb] r329971 - [docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_USE_CUSTOM_CXX_COMPILER to the build and test hmtl pages

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Apr 12 16:29:49 2018
New Revision: 329971

URL: http://llvm.org/viewvc/llvm-project?rev=329971&view=rev
Log:
[docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and 
LLDB_TEST_USE_CUSTOM_CXX_COMPILER to the build and test hmtl pages

Modified:
lldb/trunk/www/build.html
lldb/trunk/www/test.html

Modified: lldb/trunk/www/build.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/build.html?rev=329971&r1=329970&r2=329971&view=diff
==
--- lldb/trunk/www/build.html (original)
+++ lldb/trunk/www/build.html Thu Apr 12 16:29:49 2018
@@ -119,11 +119,12 @@
 LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: 
The test suite needs to be able to find a copy of clang.exe
 that it can use to compile inferior programs.  Note that MSVC 
is not supported here, it must be a path to a
 clang executable.  Note that using a release clang.exe is 
strongly recommended here, as it will make the test suite run much faster.
-This can be a path to any recent clang.exe, including one you 
built yourself.
+This can be a path to any recent clang.exe, including one you 
built yourself.  These variables are ignored unless the respective
+LLDB_TEST_USE_CUSTOM_C_COMPILER and 
LLDB_TEST_USE_CUSTOM_CXX_COMPILER are set to ON.
   
 
 Sample command line:
-cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 
-DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
+cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 -DLLDB_TEST_USE_CUSTOM_C_COMPILER=ON 
-DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
 Working with both Ninja and MSVC
 
   Compiling with ninja is both faster and simpler 
than compiling with MSVC, but chances are you still want

Modified: lldb/trunk/www/test.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/test.html?rev=329971&r1=329970&r2=329971&view=diff
==
--- lldb/trunk/www/test.html (original)
+++ lldb/trunk/www/test.html Thu Apr 12 16:29:49 2018
@@ -40,6 +40,8 @@
   target. By default, the check-lldb target builds the 
test programs with
   the same compiler that was used to build LLDB. To build the 
tests with a different
   compiler, you can set the LLDB_TEST_C_COMPILER 
or the LLDB_TEST_CXX_COMPILER CMake variables.
+  These variables are ignored unless the respective 
LLDB_TEST_USE_CUSTOM_C_COMPILER and
+  LLDB_TEST_USE_CUSTOM_CXX_COMPILER are set to ON.
   It is possible to customize the architecture of the test 
binaries and compiler used by appending -A
   and -C options respectively to the CMake variable 
LLDB_TEST_USER_ARGS. For
   example, to test LLDB against 32-bit binaries


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


[Lldb-commits] [lldb] r328176 - [SymbolFilePDB] Run clang-format; NFC

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Wed Mar 21 20:44:51 2018
New Revision: 328176

URL: http://llvm.org/viewvc/llvm-project?rev=328176&view=rev
Log:
[SymbolFilePDB] Run clang-format; NFC

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=328176&r1=328175&r2=328176&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Wed Mar 21 
20:44:51 2018
@@ -93,15 +93,17 @@ lldb::Encoding TranslateEnumEncoding(PDB
   return lldb::eEncodingSint;
 }
 
-CompilerType GetBuiltinTypeForPDBEncodingAndBitSize(
-ClangASTContext &clang_ast, const PDBSymbolTypeBuiltin &pdb_type,
-Encoding encoding, uint32_t width) {
+CompilerType
+GetBuiltinTypeForPDBEncodingAndBitSize(ClangASTContext &clang_ast,
+   const PDBSymbolTypeBuiltin &pdb_type,
+   Encoding encoding, uint32_t width) {
   auto *ast = clang_ast.getASTContext();
   if (!ast)
 return CompilerType();
 
   switch (pdb_type.getBuiltinType()) {
-  default: break;
+  default:
+break;
   case PDB_BuiltinType::None:
 return CompilerType();
   case PDB_BuiltinType::Void:
@@ -129,10 +131,10 @@ CompilerType GetBuiltinTypeForPDBEncodin
   case PDB_BuiltinType::Char32:
 return CompilerType(ast, ast->Char32Ty);
   case PDB_BuiltinType::Float:
-// Note: types `long double` and `double` have same bit size in MSVC and 
there
-// is no information in the PDB to distinguish them. So when falling back
-// to default search, the compiler type of `long double` will be 
represented by
-// the one generated for `double`.
+// Note: types `long double` and `double` have same bit size in MSVC and
+// there is no information in the PDB to distinguish them. So when falling
+// back to default search, the compiler type of `long double` will be
+// represented by the one generated for `double`.
 break;
   }
   // If there is no match on PDB_BuiltinType, fall back to default search
@@ -144,7 +146,8 @@ ConstString GetPDBBuiltinTypeName(const
   CompilerType &compiler_type) {
   PDB_BuiltinType kind = pdb_type.getBuiltinType();
   switch (kind) {
-  default: break;
+  default:
+break;
   case PDB_BuiltinType::Currency:
 return ConstString("CURRENCY");
   case PDB_BuiltinType::Date:
@@ -189,13 +192,13 @@ bool GetDeclarationForSymbol(const PDBSy
   if (!src_file_up)
 return false;
 
-  FileSpec spec(src_file_up->getFileName(), /*resolve_path*/false);
+  FileSpec spec(src_file_up->getFileName(), /*resolve_path*/ false);
   decl.SetFile(spec);
   decl.SetColumn(first_line_up->getColumnNumber());
   decl.SetLine(first_line_up->getLineNumber());
   return true;
 }
-}
+} // namespace
 
 PDBASTParser::PDBASTParser(lldb_private::ClangASTContext &ast) : m_ast(ast) {}
 
@@ -255,11 +258,11 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 CompilerType builtin_type;
 if (bytes > 0)
   builtin_type = GetBuiltinTypeForPDBEncodingAndBitSize(
-   m_ast, *underlying_type_up, encoding, bytes * 8);
+  m_ast, *underlying_type_up, encoding, bytes * 8);
 else
   builtin_type = m_ast.GetBasicType(eBasicTypeInt);
-// FIXME: PDB does not have information about scoped enumeration (Enum 
Class).
-// Set it false for now.
+// FIXME: PDB does not have information about scoped enumeration (Enum
+// Class). Set it false for now.
 bool isScoped = false;
 
 CompilerType ast_enum = m_ast.CreateEnumerationType(
@@ -316,8 +319,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
   // Function type is named.
   name = pdb_func->getName();
 } else if (auto pdb_func_sig =
-  llvm::dyn_cast(&type)) {
-  func_sig = const_cast(pdb_func_sig);
+   llvm::dyn_cast(&type)) {
+  func_sig = const_cast(pdb_func_sig);
 } else
   llvm_unreachable("Unexpected PDB symbol!");
 
@@ -357,9 +360,9 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
   type_quals |= clang::Qualifiers::Const;
 if (func_sig->isVolatileType())
   type_quals |= clang::Qualifiers::Volatile;
-CompilerType func_sig_ast_type = m_ast.CreateFunctionType(
-return_ast_type, arg_list.data(), arg_list.size(), is_variadic,
-type_quals);
+CompilerType func_sig_ast_type =
+m_ast.CreateFunctionType(return_ast_type, arg_list.data(),
+ arg_list.size(), is_variadic, type_quals);
 
 GetDeclarationForSymbol(type, decl);
 return s

[Lldb-commits] [lldb] r334260 - PDB support of function-level linking and splitted functions

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Jun  7 19:45:25 2018
New Revision: 334260

URL: http://llvm.org/viewvc/llvm-project?rev=334260&view=rev
Log:
PDB support of function-level linking and splitted functions

Summary:
The patch adds support of splitted functions (when MSVC is used with PGO) and 
function-level linking feature.

SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of 
compiled source files in the binary are continuous and don't intersect each 
other. The function creates LineSequence for each file and inserts it into 
LineTable, and implementation of last one relies on continuity of the sequence. 
But it's not always true when function-level linking enabled, e.g. in added 
input test file test-pdb-function-level-linking.exe there is xstring's 
std__basic_string_char_std__char_traits_char__std__allocator_char_max_size 
(.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and 
main (.004548F0).

To fix the problem this patch renews the sequence on each address gap.

Reviewers: asmith, zturner

Reviewed By: asmith

Subscribers: aleksandr.urakov, labath, mgorny, lldb-commits

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp
lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h
lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord
lldb/trunk/lit/SymbolFile/PDB/function-level-linking.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp?rev=334260&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp Thu Jun  
7 19:45:25 2018
@@ -0,0 +1,9 @@
+#include "FunctionLevelLinkingTest.h"
+
+int foo() {
+  return 0;
+}
+
+int main() {
+  return foo() + bar() + baz();
+}

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h?rev=334260&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h Thu Jun  7 
19:45:25 2018
@@ -0,0 +1,12 @@
+#ifndef FUNCTION_LEVEL_LINKING_TEST_H
+#define FUNCTION_LEVEL_LINKING_TEST_H
+
+int bar() {
+  return 0;
+}
+
+int baz() {
+  return 0;
+}
+
+#endif

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord?rev=334260&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord Thu Jun  
7 19:45:25 2018
@@ -0,0 +1,4 @@
+?foo@@YAHXZ
+?bar@@YAHXZ
+main
+?baz@@YAHXZ

Added: lldb/trunk/lit/SymbolFile/PDB/function-level-linking.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/function-level-linking.test?rev=334260&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/function-level-linking.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/function-level-linking.test Thu Jun  7 
19:45:25 2018
@@ -0,0 +1,4 @@
+REQUIRES: windows, lld
+RUN: clang-cl /c /Zi /Gy %S/Inputs/FunctionLevelLinkingTest.cpp /o %t.obj
+RUN: lld-link /debug:full /nodefaultlib /entry:main 
/order:@%S/Inputs/FunctionLevelLinkingTest.ord %t.obj /out:%t.exe
+RUN: lldb-test symbols -verify %t.exe

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=334260&r1=334259&r2=334260&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Thu Jun  7 
19:45:25 2018
@@ -1571,6 +1571,9 @@ bool SymbolFilePDB::ParseCompileUnitLine
 line_table->AppendLineEntryToSequence(
 sequence.get(), prev_addr + prev_length, prev_line, 0,
 prev_source_idx, false, false, false, false, true);
+
+line_table->InsertSequence(sequence.release());
+sequence.reset(line_table->CreateLineSequenceContainer());
   }
 
   if (ShouldAddLine(match_line, lno, length)) {

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/

[Lldb-commits] [lldb] r333049 - [SymbolFilePDB] Add support for resolving variable symbols

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue May 22 18:52:42 2018
New Revision: 333049

URL: http://llvm.org/viewvc/llvm-project?rev=333049&view=rev
Log:
[SymbolFilePDB] Add support for resolving variable symbols

Summary:
Implement FindGlobalVariables and ParseVariableContext methods.

Compile unit information is necessary for resolving variable context, however 
some PDB symbols do not have this information. For now an empty DWARFExpression 
is used to construct a lldb::Variable instance with the limitation that using 
lldb to lookup the value of a global or local variable is not available.

This commit may slow down lit/SymbolFile/PDB/compilands.test since the test 
includes MS specific modules that spend more time parsing variables.

Reviewers: rnk, zturner, lldb-commits

Subscribers: aprantl, JDevlieghere, llvm-commits

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

Added:
lldb/trunk/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp
lldb/trunk/lit/SymbolFile/PDB/variables.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h

Added: lldb/trunk/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp?rev=333049&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp (added)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp Tue May 22 18:52:42 
2018
@@ -0,0 +1,50 @@
+typedef int IntTypedef;
+IntTypedef g_IntVar;  // Testing globals.
+
+typedef enum Enum { // Testing constants.
+  RED,
+  GREEN,
+  BLUE
+} EnumTypedef;
+EnumTypedef g_EnumVar;  // Testing members.
+
+// FIXME: `sg_IntVar` appears both in global scope's children and compiland's
+// children but with different symbol's id.
+static int sg_IntVar = -1;  // Testing file statics.
+
+// FIXME: `g_Const` appears both in global scope's children and compiland's
+// children but with different symbol's id.
+const int g_Const = 0x88;  // Testing constant data.
+const int *g_pConst = &g_Const; // Avoid optimizing the const away
+
+thread_local int g_tls = 0;  // Testing thread-local storage.
+
+class Class {
+  static int m_StaticClassMember;
+public:
+  explicit Class(int a) {}
+  void Func() {}
+};
+int Class::m_StaticClassMember = 10; // Testing static class members.
+Class ClassVar(1);
+
+int f(int var_arg1, int var_arg2) {  // Testing parameters.
+  long same_name_var = -1;
+  return 1;
+}
+
+int same_name_var = 100;
+int main() {
+  int same_name_var = 0;  // Testing locals.
+  const char local_const = 0x1;
+
+  // FIXME: 'local_CString` is not found through compiland's children.
+  const char local_CString[] = "abc";  // Testing constant string.
+  const char *local_pCString = local_CString; // Avoid optimizing the const 
away
+
+  int a = 10;
+  a++;
+
+  ClassVar.Func();
+  return 0;
+}

Added: lldb/trunk/lit/SymbolFile/PDB/variables.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/variables.test?rev=333049&view=auto
==
--- lldb/trunk/lit/SymbolFile/PDB/variables.test (added)
+++ lldb/trunk/lit/SymbolFile/PDB/variables.test Tue May 22 18:52:42 2018
@@ -0,0 +1,58 @@
+REQUIRES: windows
+RUN: clang-cl /Z7 /c %S/Inputs/VariablesTest.cpp /o %T/VariablesTest.cpp.obj
+RUN: link %T/VariablesTest.cpp.obj /DEBUG /nodefaultlib /ENTRY:main 
/OUT:%T/VariablesTest.cpp.exe
+RUN: lldb-test symbols %T/VariablesTest.cpp.exe | FileCheck %s
+
+CHECK: Module [[MOD:.*]]
+CHECK: SymbolVendor ([[MOD]])
+CHECK: CompileUnit{{.*}}, language = "c++", file = 
'{{.*}}\VariablesTest.cpp'
+CHECK-DAG:   Variable{{.*}}, name = "g_IntVar"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "m_StaticClassMember"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "g_pConst"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "same_name_var"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "g_EnumVar"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "g_tls"
+CHECK-SAME:  scope = thread local, external
+CHECK-DAG:   Variable{{.*}}, name = "ClassVar"
+CHECK-SAME:  scope = global, external
+CHECK-DAG:   Variable{{.*}}, name = "g_Const"
+CHECK-SAME:  scope = ??? (2)
+
+CHECK-DAG:   Function{[[FID1:.*]]}, mangled = ?f@@YAHHH@Z
+CHECK-NEXT:  Block{[[FID1]]}
+CHECK-DAG: Variable{{.*}}, name = "var_arg1"
+CHECK-SAME:scope = parameter
+CHECK-DAG: Variable{{.*}}, name = "var_arg2"
+CHECK-SAME:scope = parameter
+CHECK-DAG: Variable{{.*}}, name = "same_name_var"
+CHECK-SAME:scope = local
+
+CHECK-DAG:   Function{[[FID2:.*]]}, mangled = main
+CHECK-NEXT:  Block{[[FID2]]}
+CHECK-DAG: Variable{{.*}}, name = "same_name_var"
+CHECK-SAME:scope = local
+CHECK-DAG: Variable{{.*

[Lldb-commits] [lldb] r332730 - Revert "[DWARF] Extract indexing code into a separate class hierarchy"

2018-07-06 Thread Amara Emerson via lldb-commits
Author: aemerson
Date: Fri May 18 08:59:42 2018
New Revision: 332730

URL: http://llvm.org/viewvc/llvm-project?rev=332730&view=rev
Log:
Revert "[DWARF] Extract indexing code into a separate class hierarchy"

This reverts commit r332719 due to breaking this green dragon build:
http://green.lab.llvm.org/green/job/lldb-xcode/6644

Removed:
lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Removed: lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp?rev=332729&view=auto
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp (removed)
@@ -1,306 +0,0 @@
-//===-- AppleDWARFIndex.cpp *- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "Plugins/SymbolFile/DWARF/AppleDWARFIndex.h"
-#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
-#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
-#include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
-#include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h"
-
-#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
-#include "Plugins/Language/ObjC/ObjCLanguage.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Symbol/Function.h"
-
-using namespace lldb_private;
-using namespace lldb;
-
-std::unique_ptr AppleDWARFIndex::Create(
-Module &module, DWARFDataExtractor apple_names,
-DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
-DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str) {
-  auto apple_names_table_up = llvm::make_unique(
-  apple_names, debug_str, ".apple_names");
-  if (!apple_names_table_up->IsValid())
-apple_names_table_up.reset();
-
-  auto apple_namespaces_table_up =
-  llvm::make_unique(
-  apple_namespaces, debug_str, ".apple_namespaces");
-  if (!apple_namespaces_table_up->IsValid())
-apple_namespaces_table_up.reset();
-
-  auto apple_types_table_up = llvm::make_unique(
-  apple_types, debug_str, ".apple_types");
-  if (!apple_types_table_up->IsValid())
-apple_types_table_up.reset();
-
-  auto apple_objc_table_up = llvm::make_unique(
-  apple_objc, debug_str, ".apple_objc");
-  if (!apple_objc_table_up->IsValid())
-apple_objc_table_up.reset();
-
-  if (apple_names_table_up || apple_names_table_up || apple_types_table_up ||
-  apple_objc_table_up)
-return llvm::make_unique(
-module, std::move(apple_names_table_up),
-std::move(apple_namespaces_table_up), std::move(apple_types_table_up),
-std::move(apple_objc_table_up));
-
-  return nullptr;
-}
-
-void AppleDWARFIndex::GetGlobalVariables(ConstString name, DIEArray &offsets) {
-  if (!m_apple_names_up)
-return;
-
-  const char *name_cstr = name.GetCString();
-  llvm::StringRef basename;
-  llvm::StringRef context;
-
-  if (!CPlusPlusLanguage::ExtractContextAndIdentifier(name_cstr, context,
-  basename))
-basename = name_cstr;
-
-  m_apple_names_up->FindByName(basename, offsets);
-}
-
-void AppleDWARFIndex::GetGlobalVariables(const RegularExpression ®ex,
- DIEArray &offsets) {
-  if (!m_apple_names_up)
-return;
-
-  DWARFMappedHash::DIEInfoArray hash_data;
-  if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data))
-DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
-}
-
-void AppleDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
- DIEArray &offsets) {
-  if (!m_apple_names_up)
-return;
-
-  DWARFMappedHash::DIEInfoArray hash_data;
-  if (m_apple_names_up->AppendAllDIEsInRange(
-  cu.GetOffset(), cu.GetNextCompileUnitOffset(), hash_data))
-DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
-}
-
-void AppleDWARFIndex::GetObjCMethods(Const

[Lldb-commits] [lldb] r335656 - Amend "Change AddressClass type from 'enum' to 'enum class'".

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Tue Jun 26 13:08:05 2018
New Revision: 335656

URL: http://llvm.org/viewvc/llvm-project?rev=335656&view=rev
Log:
Amend "Change AddressClass type from 'enum' to 'enum class'".

r335599 changes usages of AddressClass, but doesn't change the type itself.


Modified:
lldb/trunk/include/lldb/lldb-enumerations.h

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=335656&r1=335655&r2=335656&view=diff
==
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Tue Jun 26 13:08:05 2018
@@ -823,7 +823,7 @@ enum FrameComparison {
 // relative data and the object file might be able to tell us that an address
 // in code is data.
 //--
-enum AddressClass {
+enum class AddressClass {
   eInvalid,
   eUnknown,
   eCode,


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


[Lldb-commits] [lldb] r334745 - Add remaining fixed-point types and saturated equivalents to fix -Wswitch of r334718

2018-07-06 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Thu Jun 14 11:19:40 2018
New Revision: 334745

URL: http://llvm.org/viewvc/llvm-project?rev=334745&view=rev
Log:
Add remaining fixed-point types and saturated equivalents to fix -Wswitch of 
r334718

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

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=334745&r1=334744&r2=334745&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Jun 14 11:19:40 2018
@@ -4941,6 +4941,25 @@ lldb::Encoding ClangASTContext::GetEncod
 case clang::BuiltinType::UShortAccum:
 case clang::BuiltinType::UAccum:
 case clang::BuiltinType::ULongAccum:
+case clang::BuiltinType::ShortFract:
+case clang::BuiltinType::ShortFract:
+case clang::BuiltinType::Fract:
+case clang::BuiltinType::LongFract:
+case clang::BuiltinType::UShortFract:
+case clang::BuiltinType::UFract:
+case clang::BuiltinType::ULongFract:
+case clang::BuiltinType::SatShortAccum:
+case clang::BuiltinType::SatAccum:
+case clang::BuiltinType::SatLongAccum:
+case clang::BuiltinType::SatUShortAccum:
+case clang::BuiltinType::SatUAccum:
+case clang::BuiltinType::SatULongAccum:
+case clang::BuiltinType::SatShortFract:
+case clang::BuiltinType::SatFract:
+case clang::BuiltinType::SatLongFract:
+case clang::BuiltinType::SatUShortFract:
+case clang::BuiltinType::SatUFract:
+case clang::BuiltinType::SatULongFract:
   break;
 
 case clang::BuiltinType::Half:


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


[Lldb-commits] [lldb] r333478 - [LLDB] Revert r303907.

2018-07-06 Thread Tim Shen via lldb-commits
Author: timshen
Date: Tue May 29 16:27:26 2018
New Revision: 333478

URL: http://llvm.org/viewvc/llvm-project?rev=333478&view=rev
Log:
[LLDB] Revert r303907.

See https://reviews.llvm.org/rL303907 for details about the bug.

Modified:
lldb/trunk/include/lldb/Host/Editline.h
lldb/trunk/source/Host/common/Editline.cpp

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=333478&r1=333477&r2=333478&view=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Tue May 29 16:27:26 2018
@@ -81,14 +81,8 @@ using EditLineStringStreamType = std::st
 using EditLineCharType = char;
 #endif
 
-#ifdef EL_CLIENTDATA   /* editline with wide support + wide char read function 
*/
-using EditLineGetCharType = wchar_t;
-#else
-using EditLineGetCharType = char;
-#endif
-
 typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
-   EditLineGetCharType *c);
+   EditLineCharType *c);
 typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
  int ch);
 typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
@@ -275,7 +269,7 @@ private:
 
   /// Character reading implementation for EditLine that supports our 
multi-line
   /// editing trickery.
-  int GetCharacter(EditLineGetCharType *c);
+  int GetCharacter(EditLineCharType *c);
 
   /// Prompt implementation for EditLine.
   const char *Prompt();
@@ -328,7 +322,7 @@ private:
   /// single or multi-line editing.
   void ConfigureEditor(bool multiline);
 
-  bool CompleteCharacter(char ch, EditLineGetCharType &out);
+  bool CompleteCharacter(char ch, EditLineCharType &out);
 
 private:
 #if LLDB_EDITLINE_USE_WCHAR

Modified: lldb/trunk/source/Host/common/Editline.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=333478&r1=333477&r2=333478&view=diff
==
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Tue May 29 16:27:26 2018
@@ -467,7 +467,7 @@ unsigned char Editline::RecallHistory(bo
   return CC_NEWLINE;
 }
 
-int Editline::GetCharacter(EditLineGetCharType *c) {
+int Editline::GetCharacter(EditLineCharType *c) {
   const LineInfoW *info = el_wline(m_editline);
 
   // Paint a faint version of the desired prompt over the version libedit draws
@@ -961,7 +961,7 @@ void Editline::ConfigureEditor(bool mult
  }));
 
   el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
- EditLine *editline, EditLineGetCharType 
*c) {
+ EditLine *editline, EditLineCharType *c) {
 return Editline::InstanceFor(editline)->GetCharacter(c);
   }));
 
@@ -1350,12 +1350,12 @@ void Editline::PrintAsync(Stream *stream
   }
 }
 
-bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
+bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
 #if !LLDB_EDITLINE_USE_WCHAR
   if (ch == (char)EOF)
 return false;
 
-  out = (unsigned char)ch;
+  out = ch;
   return true;
 #else
   std::codecvt_utf8 cvt;


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


[Lldb-commits] [lldb] r335273 - Remove duplicated check and shared_ptr copying.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Thu Jun 21 12:19:57 2018
New Revision: 335273

URL: http://llvm.org/viewvc/llvm-project?rev=335273&view=rev
Log:
Remove duplicated check and shared_ptr copying.

Modified:
lldb/trunk/source/Commands/CommandObjectDisassemble.cpp

Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=335273&r1=335272&r2=335273&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Thu Jun 21 12:19:57 
2018
@@ -161,10 +161,9 @@ Status CommandObjectDisassemble::Command
 
   case 'A':
 if (execution_context) {
-  auto target_sp =
-  execution_context ? execution_context->GetTargetSP() : TargetSP();
-  auto platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP();
-  arch = Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg);
+  const auto &target_sp = execution_context->GetTargetSP();
+  auto platform_ptr = target_sp ? target_sp->GetPlatform().get() : nullptr;
+  arch = Platform::GetAugmentedArchSpec(platform_ptr, option_arg);
 }
 break;
 


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


[Lldb-commits] [lldb] r329597 - Fix compilation error caused by tgmath.h.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Mon Apr  9 10:32:56 2018
New Revision: 329597

URL: http://llvm.org/viewvc/llvm-project?rev=329597&view=rev
Log:
Fix compilation error caused by tgmath.h.

On CentOS calling functions from  produces multiple errors "'void*' 
is not a pointer-to-object type".

Modified:
lldb/trunk/lit/Expr/Inputs/anonymous-struct.cpp

Modified: lldb/trunk/lit/Expr/Inputs/anonymous-struct.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/anonymous-struct.cpp?rev=329597&r1=329596&r2=329597&view=diff
==
--- lldb/trunk/lit/Expr/Inputs/anonymous-struct.cpp (original)
+++ lldb/trunk/lit/Expr/Inputs/anonymous-struct.cpp Mon Apr  9 10:32:56 2018
@@ -1,4 +1,4 @@
-#include 
+#include 
 
 typedef struct {
 float f;


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


[Lldb-commits] [lldb] r333051 - [SymbolFilePDB] Add a test for wchar_t type in PDB.

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue May 22 18:58:23 2018
New Revision: 333051

URL: http://llvm.org/viewvc/llvm-project?rev=333051&view=rev
Log:
[SymbolFilePDB] Add a test for wchar_t type in PDB.

The wchar_t is unsigned. 

https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx


Modified:
lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
lldb/trunk/lit/SymbolFile/PDB/typedefs.test
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp

Modified: lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp?rev=333051&r1=333050&r2=333051&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (original)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp Tue May 22 
18:58:23 2018
@@ -41,6 +41,9 @@ WChar16Typedef WC16Var;
 typedef char32_t WChar32Typedef;
 WChar32Typedef WC32Var;
 
+typedef wchar_t WCharTypedef;
+WCharTypedef WCVar;
+
 int main() {
   return 0;
 }

Modified: lldb/trunk/lit/SymbolFile/PDB/typedefs.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/typedefs.test?rev=333051&r1=333050&r2=333051&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/typedefs.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/typedefs.test Tue May 22 18:58:23 2018
@@ -26,6 +26,8 @@ CHECK-DAG: Type{{.*}} , size = 4, compil
 CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} double *&
 CHECK-DAG: Type{{.*}} , name = "RefTypedef", compiler_type = {{.*}} typedef 
RefTypedef
 
+CHECK-DAG: Type{{.*}} , name = "wchar_t", size = 2, compiler_type = {{.*}} 
wchar_t
+
 CHECK-DAG: Type{{.*}} , name = "int", size = 4, compiler_type = {{.*}} int
 CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} int &
 CHECK-DAG: Type{{.*}} , name = "unsigned char", size = 1, compiler_type = 
{{.*}} unsigned char

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=333051&r1=333050&r2=333051&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Tue May 22 
18:58:23 2018
@@ -66,6 +66,7 @@ lldb::Encoding TranslateBuiltinEncoding(
   case PDB_BuiltinType::UInt:
   case PDB_BuiltinType::ULong:
   case PDB_BuiltinType::HResult:
+  case PDB_BuiltinType::WCharT:
 return lldb::eEncodingUint;
   default:
 return lldb::eEncodingInvalid;


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


[Lldb-commits] [lldb] r328230 - [SymbolFilePDB] Ignore compiler generated functions when creating the LLDB type from a PDB

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Mar 22 12:21:34 2018
New Revision: 328230

URL: http://llvm.org/viewvc/llvm-project?rev=328230&view=rev
Log:
[SymbolFilePDB] Ignore compiler generated functions when creating the LLDB type 
from a PDB

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=328230&r1=328229&r2=328230&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Thu Mar 22 
12:21:34 2018
@@ -312,6 +312,9 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
 std::string name;
 PDBSymbolTypeFunctionSig *func_sig = nullptr;
 if (auto pdb_func = llvm::dyn_cast(&type)) {
+  if (pdb_func->isCompilerGenerated())
+return nullptr;
+
   auto sig = pdb_func->getSignature();
   if (!sig)
 return nullptr;

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=328230&r1=328229&r2=328230&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Thu Mar 22 
12:21:34 2018
@@ -130,7 +130,7 @@ uint32_t SymbolFilePDB::CalculateAbiliti
   }
 }
   }
-  if (!m_session_up.get())
+  if (!m_session_up)
 return 0;
 
   auto enum_tables_up = m_session_up->getEnumTables();
@@ -507,7 +507,7 @@ lldb_private::Type *SymbolFilePDB::Resol
 return nullptr;
 
   lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type);
-  if (result.get()) {
+  if (result) {
 m_types.insert(std::make_pair(type_uid, result));
 auto type_list = GetTypeList();
 if (type_list)
@@ -637,7 +637,7 @@ uint32_t SymbolFilePDB::ResolveSymbolCon
 
   SymbolContext sc;
   auto cu = ParseCompileUnitForUID(compiland->getSymIndexId());
-  if (!cu.get())
+  if (!cu)
 continue;
   sc.comp_unit = cu.get();
   sc.module_sp = cu->GetModule();
@@ -1132,7 +1132,7 @@ size_t SymbolFilePDB::GetTypes(lldb_priv
   } else {
 for (uint32_t cu_idx = 0; cu_idx < GetNumCompileUnits(); ++cu_idx) {
   auto cu_sp = ParseCompileUnitAtIndex(cu_idx);
-  if (cu_sp.get()) {
+  if (cu_sp) {
 if (auto compiland_up = GetPDBCompilandByUID(cu_sp->GetID()))
   GetTypesForPDBSymbol(*compiland_up, type_mask, type_collection);
   }


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


[Lldb-commits] [lldb] r328232 - [SymbolFilePDB] Use section contributions as another way to determine the compiland

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Thu Mar 22 12:26:33 2018
New Revision: 328232

URL: http://llvm.org/viewvc/llvm-project?rev=328232&view=rev
Log:
[SymbolFilePDB] Use section contributions as another way to determine the 
compiland

Some PDB Symbols don't have line information. Use the section contributions to 
determine their compiland. 
This is useful to determine the parent compiland for PDBSymbolTypeData, i.e. 
variables.

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=328232&r1=328231&r2=328232&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Thu Mar 22 
12:26:33 2018
@@ -19,14 +19,15 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/SymbolVendor.h"
-#include "lldb/Symbol/TypeMap.h"
 #include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/TypeMap.h"
 #include "lldb/Utility/RegularExpression.h"
 
 #include "llvm/DebugInfo/PDB/GenericError.h"
 #include "llvm/DebugInfo/PDB/IPDBDataStream.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
+#include "llvm/DebugInfo/PDB/IPDBSectionContrib.h"
 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
 #include "llvm/DebugInfo/PDB/IPDBTable.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
@@ -264,7 +265,7 @@ lldb_private::Function *SymbolFilePDB::P
   lldbassert(sc.comp_unit && sc.module_sp.get());
 
   auto file_vm_addr = pdb_func.getVirtualAddress();
-  if (file_vm_addr == LLDB_INVALID_ADDRESS)
+  if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
 return nullptr;
 
   auto func_length = pdb_func.getLength();
@@ -677,7 +678,7 @@ uint32_t SymbolFilePDB::ResolveSymbolCon
 
 auto file_vm_addr =
 sc.line_entry.range.GetBaseAddress().GetFileAddress();
-if (file_vm_addr == LLDB_INVALID_ADDRESS)
+if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
   continue;
 
 auto symbol_up = m_session_up->findSymbolByAddress(
@@ -1341,24 +1342,26 @@ void SymbolFilePDB::BuildSupportFileIdTo
 }
 
 lldb::CompUnitSP SymbolFilePDB::GetCompileUnitContainsAddress(
- const lldb_private::Address &so_addr) {
+const lldb_private::Address &so_addr) {
   lldb::addr_t file_vm_addr = so_addr.GetFileAddress();
-  if (file_vm_addr == LLDB_INVALID_ADDRESS)
-return nullptr;
-
-  auto lines_up =
-  m_session_up->findLineNumbersByAddress(file_vm_addr, /*Length=*/200);
-  if (!lines_up)
+  if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
 return nullptr;
 
-  auto first_line_up = lines_up->getNext();
-  if (!first_line_up)
-return nullptr;
-  auto compiland_up = GetPDBCompilandByUID(first_line_up->getCompilandId());
-  if (compiland_up) {
-return ParseCompileUnitForUID(compiland_up->getSymIndexId());
+  // If it is a PDB function's vm addr, this is the first sure bet.
+  if (auto lines =
+  m_session_up->findLineNumbersByAddress(file_vm_addr, /*Length=*/1)) {
+if (auto first_line = lines->getNext())
+  return ParseCompileUnitForUID(first_line->getCompilandId());
   }
 
+  // Otherwise we resort to section contributions.
+  if (auto sec_contribs = m_session_up->getSectionContribs()) {
+while (auto section = sec_contribs->getNext()) {
+  auto va = section->getVirtualAddress();
+  if (file_vm_addr >= va && file_vm_addr < va + section->getLength())
+return ParseCompileUnitForUID(section->getCompilandId());
+}
+  }
   return nullptr;
 }
 


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


[Lldb-commits] [lldb] r334282 - Fix DynamicRegisterInfo copying/moving issue.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Fri Jun  8 04:28:15 2018
New Revision: 334282

URL: http://llvm.org/viewvc/llvm-project?rev=334282&view=rev
Log:
Fix DynamicRegisterInfo copying/moving issue.

Summary:
Default copy/move constructors and assignment operators leave wrong 
m_sets[i].registers pointers.

Made the class movable and non-copyable (it's difficult to imagine when it 
needs to be copied).

Reviewers: clayborg

Reviewed By: clayborg

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

Modified:
lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=334282&r1=334281&r2=334282&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Fri Jun  
8 04:28:15 2018
@@ -21,21 +21,42 @@
 using namespace lldb;
 using namespace lldb_private;
 
-DynamicRegisterInfo::DynamicRegisterInfo()
-: m_regs(), m_sets(), m_set_reg_nums(), m_set_names(), m_value_regs_map(),
-  m_invalidate_regs_map(), m_dynamic_reg_size_map(),
-  m_reg_data_byte_size(0), m_finalized(false) {}
-
 DynamicRegisterInfo::DynamicRegisterInfo(
 const lldb_private::StructuredData::Dictionary &dict,
-const lldb_private::ArchSpec &arch)
-: m_regs(), m_sets(), m_set_reg_nums(), m_set_names(), m_value_regs_map(),
-  m_invalidate_regs_map(), m_dynamic_reg_size_map(),
-  m_reg_data_byte_size(0), m_finalized(false) {
+const lldb_private::ArchSpec &arch) {
   SetRegisterInfo(dict, arch);
 }
 
-DynamicRegisterInfo::~DynamicRegisterInfo() {}
+DynamicRegisterInfo::DynamicRegisterInfo(DynamicRegisterInfo &&info) {
+  MoveFrom(std::move(info));
+}
+
+DynamicRegisterInfo &
+DynamicRegisterInfo::operator=(DynamicRegisterInfo &&info) {
+  MoveFrom(std::move(info));
+  return *this;
+}
+
+void DynamicRegisterInfo::MoveFrom(DynamicRegisterInfo &&info) {
+  m_regs = std::move(info.m_regs);
+  m_sets = std::move(info.m_sets);
+  m_set_reg_nums = std::move(info.m_set_reg_nums);
+  m_set_names = std::move(info.m_set_names);
+  m_value_regs_map = std::move(info.m_value_regs_map);
+  m_invalidate_regs_map = std::move(info.m_invalidate_regs_map);
+  m_dynamic_reg_size_map = std::move(info.m_dynamic_reg_size_map);
+
+  m_reg_data_byte_size = info.m_reg_data_byte_size;
+  m_finalized = info.m_finalized;
+
+  if (m_finalized) {
+const size_t num_sets = m_sets.size();
+for (size_t set = 0; set < num_sets; ++set)
+  m_sets[set].registers = m_set_reg_nums[set].data();
+  }
+
+  info.Clear();
+}
 
 size_t
 DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
@@ -136,7 +157,7 @@ DynamicRegisterInfo::SetRegisterInfo(con
 
 ConstString containing_reg_name(reg_name_str);
 
-RegisterInfo *containing_reg_info =
+const RegisterInfo *containing_reg_info =
 GetRegisterInfo(containing_reg_name);
 if (containing_reg_info) {
   const uint32_t max_bit = containing_reg_info->byte_size * 8;
@@ -205,7 +226,7 @@ DynamicRegisterInfo::SetRegisterInfo(con
   ConstString composite_reg_name;
   if (composite_reg_list->GetItemAtIndexAsString(
   composite_idx, composite_reg_name, nullptr)) {
-RegisterInfo *composite_reg_info =
+const RegisterInfo *composite_reg_info =
 GetRegisterInfo(composite_reg_name);
 if (composite_reg_info) {
   composite_offset = std::min(composite_offset,
@@ -345,7 +366,7 @@ DynamicRegisterInfo::SetRegisterInfo(con
   uint64_t invalidate_reg_num;
   if (invalidate_reg_list->GetItemAtIndexAsString(
   idx, invalidate_reg_name)) {
-RegisterInfo *invalidate_reg_info =
+const RegisterInfo *invalidate_reg_info =
 GetRegisterInfo(invalidate_reg_name);
 if (invalidate_reg_info) {
   m_invalidate_regs_map[i].push_back(
@@ -725,8 +746,8 @@ void DynamicRegisterInfo::Dump() const {
   }
 }
 
-lldb_private::RegisterInfo *DynamicRegisterInfo::GetRegisterInfo(
-const lldb_private::ConstString ®_name) {
+const lldb_private::RegisterInfo *DynamicRegisterInfo::GetRegisterInfo(
+const lldb_private::ConstString ®_name) const {
   for (auto ®_info : m_regs) {
 // We can use pointer comparison since we used a ConstString to set the
 // "name" member in AddRegister()

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h?rev=334282

[Lldb-commits] [lldb] r333055 - [SymbolFilePDB] PDB_BuiltinType::Char16 and Char32 are unsigned in MSVC.

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue May 22 19:48:25 2018
New Revision: 333055

URL: http://llvm.org/viewvc/llvm-project?rev=333055&view=rev
Log:
[SymbolFilePDB] PDB_BuiltinType::Char16 and Char32 are unsigned in MSVC.

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

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=333055&r1=333054&r2=333055&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Tue May 22 
19:48:25 2018
@@ -59,10 +59,10 @@ lldb::Encoding TranslateBuiltinEncoding(
   case PDB_BuiltinType::Int:
   case PDB_BuiltinType::Long:
   case PDB_BuiltinType::Char:
-  case PDB_BuiltinType::Char16:
-  case PDB_BuiltinType::Char32:
 return lldb::eEncodingSint;
   case PDB_BuiltinType::Bool:
+  case PDB_BuiltinType::Char16:
+  case PDB_BuiltinType::Char32:
   case PDB_BuiltinType::UInt:
   case PDB_BuiltinType::ULong:
   case PDB_BuiltinType::HResult:


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


[Lldb-commits] [lldb] r333837 - Test commit. Fix typo in comment.

2018-07-06 Thread Alexander Polyakov via lldb-commits
Author: apolyakov
Date: Sun Jun  3 05:41:00 2018
New Revision: 333837

URL: http://llvm.org/viewvc/llvm-project?rev=333837&view=rev
Log:
Test commit. Fix typo in comment.

Modified:
lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp?rev=333837&r1=333836&r2=333837&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp Sun Jun  3 05:41:00 2018
@@ -115,7 +115,7 @@ bool CMICmdCmdTargetSelect::Execute() {
   const CMIUtilString strUrl =
   CMIUtilString::Format("connect://%s", 
pArgParameters->GetValue().c_str());
 
-  // Ask LLDB to collect to the target port
+  // Ask LLDB to connect to the target port
   const char *pPlugin("gdb-remote");
   lldb::SBError error;
   lldb::SBProcess process = rSessionInfo.GetTarget().ConnectRemote(


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


[Lldb-commits] [lldb] r335710 - Move AddressClass to private enums since API doesn't provide any functions to manage it.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Tue Jun 26 23:50:10 2018
New Revision: 335710

URL: http://llvm.org/viewvc/llvm-project?rev=335710&view=rev
Log:
Move AddressClass to private enums since API doesn't provide any functions to 
manage it.

This change allows to make AddressClass strongly typed enum and not to have 
issues with old versions of SWIG that don't support enum classes.

Modified:
lldb/trunk/include/lldb/API/SBAddress.h
lldb/trunk/include/lldb/API/SBInstruction.h
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/include/lldb/Symbol/ObjectFile.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/include/lldb/lldb-private-enumerations.h
lldb/trunk/scripts/interface/SBAddress.i
lldb/trunk/scripts/interface/SBInstruction.i
lldb/trunk/source/API/SBAddress.cpp
lldb/trunk/source/API/SBInstruction.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h

Modified: lldb/trunk/include/lldb/API/SBAddress.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAddress.h?rev=335710&r1=335709&r2=335710&view=diff
==
--- lldb/trunk/include/lldb/API/SBAddress.h (original)
+++ lldb/trunk/include/lldb/API/SBAddress.h Tue Jun 26 23:50:10 2018
@@ -80,8 +80,6 @@ public:
 
   lldb::SBLineEntry GetLineEntry();
 
-  lldb::AddressClass GetAddressClass();
-
 protected:
   friend class SBBlock;
   friend class SBBreakpointLocation;

Modified: lldb/trunk/include/lldb/API/SBInstruction.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=335710&r1=335709&r2=335710&view=diff
==
--- lldb/trunk/include/lldb/API/SBInstruction.h (original)
+++ lldb/trunk/include/lldb/API/SBInstruction.h Tue Jun 26 23:50:10 2018
@@ -36,8 +36,6 @@ public:
 
   SBAddress GetAddress();
 
-  lldb::AddressClass GetAddressClass();
-
   const char *GetMnemonic(lldb::SBTarget target);
 
   const char *GetOperands(lldb::SBTarget target);

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=335710&r1=335709&r2=335710&view=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Tue Jun 26 23:50:10 2018
@@ -11,8 +11,8 @@
 #define liblldb_Address_h_
 
 #include "lldb/lldb-defines.h"  // for LLDB_INVALID_ADDRESS
-#include "lldb/lldb-enumerations.h" // for AddressClass::eInvalid
 #include "lldb/lldb-forward.h"  // for SectionWP, SectionSP, ModuleSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
 #include "lldb/lldb-types.h"// for addr_t
 
 #include  // for size_t
@@ -270,7 +270,7 @@ public:
 DumpStyle fallback_style = DumpStyleInvalid,
 uint32_t addr_byte_size = UINT32_MAX) const;
 
-  lldb::AddressClass GetAddressClass() const;
+  AddressClass GetAddressClass() const;
 
   //--
   /// Get the file address.
@@ -338,7 +338,7 @@ public:
   //--
   lldb::addr_t GetOpcodeLoadAddress(
   Target *target,
-  lldb::AddressClass addr_class = lldb::AddressClass::eInvalid) const;
+  AddressClass addr_class = AddressClass::eInvalid) const;
 
   //--
   /// Get the section relative offset value.
@@ -432,7 +432,7 @@ public:
 
   bool SetOpcodeLoadAddress(
   lldb::addr_t load_addr, Target *target,
-  lldb::AddressClass addr_class = lldb::AddressClass::eInvalid,
+  AddressClass addr_class = AddressClass::eInvalid,
   bool allow_section_end = false);
 
   bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target);

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=335710&r1=335709&r2=335710&view=diff
==
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Tue Jun 26 23:50:10 2018
@@ -22,8 +22,8 @@
 #include "lldb/Utility/ConstString.h" // for ConstString
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/lldb-defines.h"  // for DISALLOW_COPY_AND_ASSIGN
-#include "lldb/lldb-enumerations.h" // for AddressClass, AddressClass...
 #include "lldb/lldb-forward.h"  // for InstructionSP, DisassemblerSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
 #include "lldb/lldb-types.h"// for addr_t, offset_t
 
 #include "llvm/ADT/StringRef.h" // for StringR

[Lldb-commits] [lldb] r333552 - [LLDB] Re-apply r303907 that's reverted by mistake

2018-07-06 Thread Tim Shen via lldb-commits
Author: timshen
Date: Wed May 30 07:54:22 2018
New Revision: 333552

URL: http://llvm.org/viewvc/llvm-project?rev=333552&view=rev
Log:
[LLDB] Re-apply r303907 that's reverted by mistake

Modified:
lldb/trunk/include/lldb/Host/Editline.h
lldb/trunk/source/Host/common/Editline.cpp

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=333552&r1=333551&r2=333552&view=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Wed May 30 07:54:22 2018
@@ -81,8 +81,14 @@ using EditLineStringStreamType = std::st
 using EditLineCharType = char;
 #endif
 
+#ifdef EL_CLIENTDATA   /* editline with wide support + wide char read function 
*/
+using EditLineGetCharType = wchar_t;
+#else
+using EditLineGetCharType = char;
+#endif
+
 typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
-   EditLineCharType *c);
+   EditLineGetCharType *c);
 typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
  int ch);
 typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
@@ -269,7 +275,7 @@ private:
 
   /// Character reading implementation for EditLine that supports our 
multi-line
   /// editing trickery.
-  int GetCharacter(EditLineCharType *c);
+  int GetCharacter(EditLineGetCharType *c);
 
   /// Prompt implementation for EditLine.
   const char *Prompt();
@@ -322,7 +328,7 @@ private:
   /// single or multi-line editing.
   void ConfigureEditor(bool multiline);
 
-  bool CompleteCharacter(char ch, EditLineCharType &out);
+  bool CompleteCharacter(char ch, EditLineGetCharType &out);
 
 private:
 #if LLDB_EDITLINE_USE_WCHAR

Modified: lldb/trunk/source/Host/common/Editline.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=333552&r1=333551&r2=333552&view=diff
==
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Wed May 30 07:54:22 2018
@@ -467,7 +467,7 @@ unsigned char Editline::RecallHistory(bo
   return CC_NEWLINE;
 }
 
-int Editline::GetCharacter(EditLineCharType *c) {
+int Editline::GetCharacter(EditLineGetCharType *c) {
   const LineInfoW *info = el_wline(m_editline);
 
   // Paint a faint version of the desired prompt over the version libedit draws
@@ -961,7 +961,7 @@ void Editline::ConfigureEditor(bool mult
  }));
 
   el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
- EditLine *editline, EditLineCharType *c) {
+ EditLine *editline, EditLineGetCharType 
*c) {
 return Editline::InstanceFor(editline)->GetCharacter(c);
   }));
 
@@ -1350,12 +1350,12 @@ void Editline::PrintAsync(Stream *stream
   }
 }
 
-bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
+bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
 #if !LLDB_EDITLINE_USE_WCHAR
   if (ch == (char)EOF)
 return false;
 
-  out = ch;
+  out = (unsigned char)ch;
   return true;
 #else
   std::codecvt_utf8 cvt;


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


[Lldb-commits] [lldb] r335341 - ResolveAddress: check returned value of resolving functions.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Fri Jun 22 05:24:57 2018
New Revision: 335341

URL: http://llvm.org/viewvc/llvm-project?rev=335341&view=rev
Log:
ResolveAddress: check returned value of resolving functions.

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

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=335341&r1=335340&r2=335341&view=diff
==
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Fri Jun 22 05:24:57 2018
@@ -112,14 +112,15 @@ static void ResolveAddress(const Executi
 // it to something
 Target *target = exe_ctx.GetTargetPtr();
 if (target) {
-  if (target->GetSectionLoadList().IsEmpty()) {
-target->GetImages().ResolveFileAddress(addr.GetOffset(), 
resolved_addr);
-  } else {
-target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
-resolved_addr);
-  }
+  bool is_resolved =
+  target->GetSectionLoadList().IsEmpty() ?
+  target->GetImages().ResolveFileAddress(addr.GetOffset(),
+ resolved_addr) :
+  target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
+  resolved_addr);
+
   // We weren't able to resolve the address, just treat it as a raw address
-  if (resolved_addr.IsValid())
+  if (is_resolved && resolved_addr.IsValid())
 return;
 }
   }


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


[Lldb-commits] [lldb] r330740 - [lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and windows server

2018-07-06 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Tue Apr 24 10:08:05 2018
New Revision: 330740

URL: http://llvm.org/viewvc/llvm-project?rev=330740&view=rev
Log:
[lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and 
windows server

Summary:
The new script to run the lldbtests as part of lit invokes each test by calling 
dotest.py, however, we cannot rely on the system to always correctly interpret 
the script as python causing the tests to be unresolved on windows (at least). 
To fix this, we need to make sure that the first parameter in the command line 
is the python executable itself.

In Makefile.rules, there are a number of windows specific definitions that rely 
on the HOST_OS being set as Windows_NT but the logic detecting the OS currently 
does not detect server versions of windows correctly. This change updates the 
logic to detect windows server as well.

Reviewers: asmith, labath, JDevlieghere, zturner

Reviewed By: JDevlieghere, zturner

Subscribers: zturner, llvm-commits

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

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

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=330740&r1=330739&r2=330740&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Tue Apr 24 10:08:05 2018
@@ -41,7 +41,10 @@ class LLDBTest(TestFormat):
 return (lit.Test.UNSUPPORTED, 'Test is unsupported')
 
 testPath, testFile = os.path.split(test.getSourcePath())
-cmd = self.dotest_cmd + [testPath, '-p', testFile]
+# On Windows, the system does not always correctly interpret shebang 
lines.
+# To make sure we can execute the tests, add python exe as the first 
parameter
+# of the command.
+cmd = [sys.executable] + self.dotest_cmd + [testPath, '-p', testFile]
 
 try:
 out, err, exitCode = lit.util.executeCommand(

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=330740&r1=330739&r2=330740&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Apr 24 
10:08:05 2018
@@ -36,13 +36,13 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../.
 #--
 # If OS is not defined, use 'uname -s' to determine the OS name.
 #
-# uname on Windows gives "windows32", but most environments standardize
-# on "Windows_NT", so we'll make it consistent here.  When running
-# tests from Visual Studio, the environment variable isn't inherited
-# all the way down to the process spawned for make.
+# uname on Windows gives "windows32" or "server version windows32", but most
+# environments standardize on "Windows_NT", so we'll make it consistent here.
+# When running tests from Visual Studio, the environment variable isn't
+# inherited all the way down to the process spawned for make.
 #--
 HOST_OS = $(shell uname -s)
-ifeq "$(HOST_OS)" "windows32"
+ifneq (,$(findstring windows32,$(HOST_OS)))
HOST_OS = Windows_NT
 endif
 ifeq "$(OS)" ""


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


[Lldb-commits] [lldb] r333999 - Silence unhandled enums warning in ClangASTContext::GetEncoding

2018-07-06 Thread Ilya Biryukov via lldb-commits
Author: ibiryukov
Date: Tue Jun  5 03:07:07 2018
New Revision: 333999

URL: http://llvm.org/viewvc/llvm-project?rev=333999&view=rev
Log:
Silence unhandled enums warning in ClangASTContext::GetEncoding

The warning started firing after r333923, which added new builtin
types (fixed point types) into clang.
This patch merely silences the warning to unblock our integrate, does
not aim to support the new types in lldb.

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

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=333999&r1=333998&r2=333999&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jun  5 03:07:07 2018
@@ -4934,6 +4934,15 @@ lldb::Encoding ClangASTContext::GetEncod
 case clang::BuiltinType::UInt128:
   return lldb::eEncodingUint;
 
+// Fixed point types. Note that they are currently ignored.
+case clang::BuiltinType::ShortAccum:
+case clang::BuiltinType::Accum:
+case clang::BuiltinType::LongAccum:
+case clang::BuiltinType::UShortAccum:
+case clang::BuiltinType::UAccum:
+case clang::BuiltinType::ULongAccum:
+  break;
+
 case clang::BuiltinType::Half:
 case clang::BuiltinType::Float:
 case clang::BuiltinType::Float16:


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


[Lldb-commits] [lldb] r332733 - [lldb] Fix compile warnings in r332702

2018-07-06 Thread Eric Liu via lldb-commits
Author: ioeric
Date: Fri May 18 09:19:52 2018
New Revision: 332733

URL: http://llvm.org/viewvc/llvm-project?rev=332733&view=rev
Log:
[lldb] Fix compile warnings in r332702

Summary:
- Fix #include path
- Fix warning:

error: format specifies type 'unsigned long long' but the argument has type 
'uint64_t'
(aka 'unsigned long') [-Werror,-Wformat]
 ```

Reviewers: labath, javed.absar

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

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=332733&r1=332732&r2=332733&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Fri 
May 18 09:19:52 2018
@@ -29,7 +29,7 @@
 #endif
 
 // Project includes
-#include "ARM_DWARF_Registers.h"
+#include "Utility/ARM_DWARF_Registers.h"
 #include "Utility/ARM_ehframe_Registers.h"
 
 #include "llvm/ADT/STLExtras.h"

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=332733&r1=332732&r2=332733&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
Fri May 18 09:19:52 2018
@@ -33,7 +33,7 @@
 #endif
 
 // Project includes
-#include "ARM64_DWARF_Registers.h"
+#include "Utility/ARM64_DWARF_Registers.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -293,8 +293,9 @@ int RegisterContextDarwin_arm64::WriteRe
 void RegisterContextDarwin_arm64::LogDBGRegisters(Log *log, const DBG &dbg) {
   if (log) {
 for (uint32_t i = 0; i < 16; i++)
-  log->Printf("BVR%-2u/BCR%-2u = { 0x%8.8llx, 0x%8.8llx } WVR%-2u/WCR%-2u "
-  "= { 0x%8.8llx, 0x%8.8llx }",
+  log->Printf("BVR%-2u/BCR%-2u = { 0x%8.8" PRIu64 ", 0x%8.8" PRIu64
+  " } WVR%-2u/WCR%-2u "
+  "= { 0x%8.8" PRIu64 ", 0x%8.8" PRIu64 " }",
   i, i, dbg.bvr[i], dbg.bcr[i], i, i, dbg.wvr[i], dbg.wcr[i]);
   }
 }


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


[Lldb-commits] [lldb] r335599 - Change AddressClass type from 'enum' to 'enum class'.

2018-07-06 Thread Tatyana Krasnukha via lldb-commits
Author: tkrasnukha
Date: Tue Jun 26 06:06:54 2018
New Revision: 335599

URL: http://llvm.org/viewvc/llvm-project?rev=335599&view=rev
Log:
Change AddressClass type from 'enum' to 'enum class'.

If we have a function with signature f(addr_t, AddressClass), it is easy to 
muddle up the order of arguments without any warnings from compiler. 'enum 
class' prevents passing integer in place of AddressClass and vice versa.

Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/source/API/SBAddress.cpp
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/API/SBInstruction.cpp
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/trunk/source/Symbol/ObjectFile.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/RegisterContext.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/StackFrameList.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=335599&r1=335598&r2=335599&view=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Tue Jun 26 06:06:54 2018
@@ -11,7 +11,7 @@
 #define liblldb_Address_h_
 
 #include "lldb/lldb-defines.h"  // for LLDB_INVALID_ADDRESS
-#include "lldb/lldb-enumerations.h" // for AddressClass::eAddressClassInvalid
+#include "lldb/lldb-enumerations.h" // for AddressClass::eInvalid
 #include "lldb/lldb-forward.h"  // for SectionWP, SectionSP, ModuleSP
 #include "lldb/lldb-types.h"// for addr_t
 
@@ -338,7 +338,7 @@ public:
   //--
   lldb::addr_t GetOpcodeLoadAddress(
   Target *target,
-  lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
+  lldb::AddressClass addr_class = lldb::AddressClass::eInvalid) const;
 
   //--
   /// Get the section relative offset value.
@@ -432,7 +432,7 @@ public:
 
   bool SetOpcodeLoadAddress(
   lldb::addr_t load_addr, Target *target,
-  lldb::AddressClass addr_class = lldb::eAddressClassInvalid,
+  lldb::AddressClass addr_class = lldb::AddressClass::eInvalid,
   bool allow_section_end = false);
 
   bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target);

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=335599&r1=335598&r2=335599&view=diff
==
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Tue Jun 26 06:06:54 2018
@@ -78,7 +78,7 @@ namespace lldb_private {
 class Instruction {
 public:
   Instruction(const Address &address,
-  lldb::AddressClass addr_class = lldb::eAddressClassInvalid);
+  lldb::AddressClass addr_class = lldb::AddressClass::eInvalid);
 
   virtual ~Instruction();
 
@@ -106,7 +106,7 @@ public:
 
   void SetAddress(const Address &addr) {
 // Invalidate the address class to lazily discover it if we need to.
-m_address_class = lldb::eAddressClassInvalid;
+m_address_class = lldb::AddressClass::eInvalid;
 m_address = addr;
   }
 
@@ -235,9 +235,9 @@ protected:
   Address m_address; // The section offset address of this instruction
  // We include an address class in the Instruction class to
  // allow the instruction specify the
- // eAddressClassCodeAlternateISA (currently used for
- // thumb), and also to specify data (eAddressClassData).
- // The usual value will be eAddressClassCode, but often
+ // AddressClass::eCodeAlternateISA (currently used for
+ // thumb), and also to specify data (AddressClass::eData).
+ // The usual value will be AddressClass::eCode, but often
  // when disassembling memory, you might run into data.
  // This can help us to disassemble appro

[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-06 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment.

Unfortunately, I don't have an opportunity to check this out on windows, but if 
this works, I'll be glad that someone found out how to fix compilation failure 
on windows.


https://reviews.llvm.org/D49006



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


[Lldb-commits] [PATCH] D49038: [CMake] Give lldb tools functional install targets when building LLDB.framework

2018-07-06 Thread Alex Langford via Phabricator via lldb-commits
xiaobai created this revision.
xiaobai added reviewers: labath, sas, compnerd, smeenai.
Herald added a subscriber: mgorny.

This change makes the install targets for lldb tools functional when
building for the framework.

I am currently working on the install rules for lldb-framework and this will
let me make `install-lldb-framework` rely on `install-lldb-argdumper` for
instance. This is especially important for `install-lldb-framework-stripped`. It
is much better for `install-lldb-framework-stripped` to rely on
`install-lldb-argdumper-stripped` than to copy and strip lldb-argdumper
manually.


https://reviews.llvm.org/D49038

Files:
  cmake/modules/AddLLDB.cmake


Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -111,18 +111,6 @@
 RUNTIME_OUTPUT_DIRECTORY $${resource_dir}
 BUILD_WITH_INSTALL_RPATH On
 INSTALL_RPATH 
"@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
-  # For things inside the framework we don't need functional install 
targets
-  # because CMake copies the resources and headers from the build 
directory.
-  # But we still need this target to exist in order to use the
-  # LLVM_DISTRIBUTION_COMPONENTS build option. We also need the
-  # install-liblldb target to depend on this tool, so that it gets put into
-  # the Resources directory before the framework is installed.
-  if(ARG_GENERATE_INSTALL)
-add_custom_target(install-${name} DEPENDS ${name})
-add_dependencies(install-liblldb ${name})
-add_custom_target(install-${name}-stripped DEPENDS ${name})
-add_dependencies(install-liblldb-stripped ${name})
-  endif()
 endif()
   endif()
 
@@ -132,10 +120,14 @@
   INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
   endif()
 
-  if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_SUITE AND 
LLDB_BUILD_FRAMEWORK ))
+  if(ARG_GENERATE_INSTALL)
+set(out_dir "bin")
+if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE)
+  set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR})
+endif()
 install(TARGETS ${name}
   COMPONENT ${name}
-  RUNTIME DESTINATION bin)
+  RUNTIME DESTINATION ${out_dir})
 if (NOT CMAKE_CONFIGURATION_TYPES)
   add_llvm_install_targets(install-${name}
DEPENDS ${name}


Index: cmake/modules/AddLLDB.cmake
===
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -111,18 +111,6 @@
 RUNTIME_OUTPUT_DIRECTORY $${resource_dir}
 BUILD_WITH_INSTALL_RPATH On
 INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
-  # For things inside the framework we don't need functional install targets
-  # because CMake copies the resources and headers from the build directory.
-  # But we still need this target to exist in order to use the
-  # LLVM_DISTRIBUTION_COMPONENTS build option. We also need the
-  # install-liblldb target to depend on this tool, so that it gets put into
-  # the Resources directory before the framework is installed.
-  if(ARG_GENERATE_INSTALL)
-add_custom_target(install-${name} DEPENDS ${name})
-add_dependencies(install-liblldb ${name})
-add_custom_target(install-${name}-stripped DEPENDS ${name})
-add_dependencies(install-liblldb-stripped ${name})
-  endif()
 endif()
   endif()
 
@@ -132,10 +120,14 @@
   INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
   endif()
 
-  if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_SUITE AND LLDB_BUILD_FRAMEWORK ))
+  if(ARG_GENERATE_INSTALL)
+set(out_dir "bin")
+if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE)
+  set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR})
+endif()
 install(TARGETS ${name}
   COMPONENT ${name}
-  RUNTIME DESTINATION bin)
+  RUNTIME DESTINATION ${out_dir})
 if (NOT CMAKE_CONFIGURATION_TYPES)
   add_llvm_install_targets(install-${name}
DEPENDS ${name}
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D49038: [CMake] Give lldb tools functional install targets when building LLDB.framework

2018-07-06 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

I tested this by invoking cmake with `-DLLDB_BUILD_FRAMEWORK=1` and 
`-DCMAKE_INSTALL_PREFIX=""`, followed by `DESTDIR=/tmp ninja 
install-lldb-argdumper`. It installed lldb-argdumper to 
/tmp/Library/Frameworks/LLDB.framework/Versions/A/Resources/lldb-argdumper


https://reviews.llvm.org/D49038



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


[Lldb-commits] [lldb] r336463 - [test-suite] Add a decorator for the lack of libstdcxx on the system.

2018-07-06 Thread Davide Italiano via lldb-commits
Author: davide
Date: Fri Jul  6 13:40:00 2018
New Revision: 336463

URL: http://llvm.org/viewvc/llvm-project?rev=336463&view=rev
Log:
[test-suite] Add a decorator for the lack of libstdcxx on the system.

This generalizes a bunch of target-specific tests. MacOS has no
libstdcxx anymore, and neither does FreeBSD (or Windows).



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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.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=336463&r1=336462&r2=336463&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Fri Jul  6 13:40:00 
2018
@@ -687,6 +687,18 @@ def skipUnlessSupportedTypeAttribute(att
 return None
 return skipTestIfFn(compiler_doesnt_support_struct_attribute)
 
+def skipUnlessLibstdcxxAvailable(func):
+"""Decorate the item to skip test unless libstdc++ is available on the 
system."""
+def compiler_doesnt_support_libstdcxx(self):
+compiler_path = self.getCompiler()
+f = tempfile.NamedTemporaryFile()
+f = tempfile.NamedTemporaryFile()
+cmd = "echo '#include  | %s -x c++ -stdlib=libstdc++ -o %s -" 
% (compiler_path, f.name)
+if os.popen(cmd).close() is not None:
+return "libstdcxx not available on the sytem"
+return None
+return skipTestIfFn(compiler_doesnt_support_libstdcxx)(func)
+
 def skipUnlessThreadSanitizer(func):
 """Decorate the item to skip test unless Clang -fsanitize=thread is 
supported."""
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py?rev=336463&r1=336462&r2=336463&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
 Fri Jul  6 13:40:00 2018
@@ -23,8 +23,7 @@ class StdIteratorDataFormatterTestCase(T
 # Find the line number to break at.
 self.line = line_number('main.cpp', '// Set break point at this line.')
 
-@skipIfWindows  # libstdcpp not ported to Windows
-@skipIfwatchOS  # libstdcpp not ported to watchos
+@skipUnlessLibstdcxxAvailable
 def test_with_run_command(self):
 """Test that libstdcpp iterators format properly."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py?rev=336463&r1=336462&r2=336463&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdL