[Lldb-commits] [PATCH] D54385: Remove comments after header includes.

2018-11-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision as: vsk.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks, lgtm.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54385



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


[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167

2018-11-10 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 173535.
jankratochvil marked 2 inline comments as done.

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51578

Files:
  include/lldb/lldb-forward.h
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/make/Makefile.rules
  packages/Python/lldbsuite/test/plugins/builder_base.py
  packages/Python/lldbsuite/test/test_categories.py
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -242,6 +242,7 @@
   const lldb_private::DWARFDataExtractor _debug_aranges_data();
   const lldb_private::DWARFDataExtractor _debug_frame_data();
   const lldb_private::DWARFDataExtractor _debug_info_data();
+  const lldb_private::DWARFDataExtractor _raw_debug_info_data();
   const lldb_private::DWARFDataExtractor _debug_line_data();
   const lldb_private::DWARFDataExtractor _debug_line_str_data();
   const lldb_private::DWARFDataExtractor _debug_macro_data();
@@ -251,7 +252,7 @@
   const lldb_private::DWARFDataExtractor _debug_rnglists_data();
   const lldb_private::DWARFDataExtractor _debug_str_data();
   const lldb_private::DWARFDataExtractor _debug_str_offsets_data();
-  const lldb_private::DWARFDataExtractor _debug_types_data();
+  const lldb_private::DWARFDataExtractor _raw_debug_types_data();
   const lldb_private::DWARFDataExtractor _apple_names_data();
   const lldb_private::DWARFDataExtractor _apple_types_data();
   const lldb_private::DWARFDataExtractor _apple_namespaces_data();
@@ -331,6 +332,10 @@
 
   void DumpClangAST(lldb_private::Stream ) override;
 
+  uint64_t get_debug_types_offset() const {
+return m_debug_info_concatenated_types_offset;
+  }
+
 protected:
   typedef llvm::DenseMap
   DIEToTypePtr;
@@ -477,7 +482,7 @@
   DWARFDataSegment m_data_debug_addr;
   DWARFDataSegment m_data_debug_aranges;
   DWARFDataSegment m_data_debug_frame;
-  DWARFDataSegment m_data_debug_info;
+  DWARFDataSegment m_data_raw_debug_info;
   DWARFDataSegment m_data_debug_line;
   DWARFDataSegment m_data_debug_line_str;
   DWARFDataSegment m_data_debug_macro;
@@ -487,13 +492,17 @@
   DWARFDataSegment m_data_debug_rnglists;
   DWARFDataSegment m_data_debug_str;
   DWARFDataSegment m_data_debug_str_offsets;
-  DWARFDataSegment m_data_debug_types;
+  DWARFDataSegment m_data_raw_debug_types;
   DWARFDataSegment m_data_apple_names;
   DWARFDataSegment m_data_apple_types;
   DWARFDataSegment m_data_apple_namespaces;
   DWARFDataSegment m_data_apple_objc;
   DWARFDataSegment m_data_gnu_debugaltlink;
 
+  llvm::once_flag m_concatenated_data_once;
+  lldb_private::DWARFDataExtractor m_data_debug_info_concatenated;
+  uint64_t m_debug_info_concatenated_types_offset;
+
   // The unique pointer items below are generated on demand if and when someone
   // accesses
   // them through a non const version of this class.
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -412,7 +412,7 @@
   // when this class parses .o files to
   // contain the .o file index/ID
   m_debug_map_module_wp(), m_debug_map_symfile(NULL), m_data_debug_abbrev(),
-  m_data_debug_aranges(), m_data_debug_frame(), m_data_debug_info(),
+  m_data_debug_aranges(), m_data_debug_frame(), m_data_raw_debug_info(),
   m_data_debug_line(), m_data_debug_macro(), m_data_debug_loc(),
   m_data_debug_ranges(), m_data_debug_rnglists(), m_data_debug_str(),
   m_data_apple_names(), m_data_apple_types(), m_data_apple_namespaces(),
@@ -506,20 +506,6 @@
 if (section_list == NULL)
   return 0;
 
-// On non Apple platforms we might have .debug_types debug info that is
-// created by using "-fdebug-types-section". LLDB currently will try to
-// load this debug info, but it causes crashes during debugging when types
-// are missing since it doesn't know how to parse the 

[Lldb-commits] [PATCH] D51578: Contiguous .debug_info+.debug_types for D32167

2018-11-10 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 173533.
jankratochvil edited the summary of this revision.

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51578

Files:
  include/lldb/lldb-forward.h
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/make/Makefile.rules
  packages/Python/lldbsuite/test/plugins/builder_base.py
  packages/Python/lldbsuite/test/test_categories.py
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -242,6 +242,7 @@
   const lldb_private::DWARFDataExtractor _debug_aranges_data();
   const lldb_private::DWARFDataExtractor _debug_frame_data();
   const lldb_private::DWARFDataExtractor _debug_info_data();
+  const lldb_private::DWARFDataExtractor _raw_debug_info_data();
   const lldb_private::DWARFDataExtractor _debug_line_data();
   const lldb_private::DWARFDataExtractor _debug_line_str_data();
   const lldb_private::DWARFDataExtractor _debug_macro_data();
@@ -251,7 +252,7 @@
   const lldb_private::DWARFDataExtractor _debug_rnglists_data();
   const lldb_private::DWARFDataExtractor _debug_str_data();
   const lldb_private::DWARFDataExtractor _debug_str_offsets_data();
-  const lldb_private::DWARFDataExtractor _debug_types_data();
+  const lldb_private::DWARFDataExtractor _raw_debug_types_data();
   const lldb_private::DWARFDataExtractor _apple_names_data();
   const lldb_private::DWARFDataExtractor _apple_types_data();
   const lldb_private::DWARFDataExtractor _apple_namespaces_data();
@@ -331,6 +332,10 @@
 
   void DumpClangAST(lldb_private::Stream ) override;
 
+  uint64_t get_debug_types_offset() const {
+return m_debug_info_concatenated_types_offset;
+  }
+
 protected:
   typedef llvm::DenseMap
   DIEToTypePtr;
@@ -477,7 +482,7 @@
   DWARFDataSegment m_data_debug_addr;
   DWARFDataSegment m_data_debug_aranges;
   DWARFDataSegment m_data_debug_frame;
-  DWARFDataSegment m_data_debug_info;
+  DWARFDataSegment m_data_raw_debug_info;
   DWARFDataSegment m_data_debug_line;
   DWARFDataSegment m_data_debug_line_str;
   DWARFDataSegment m_data_debug_macro;
@@ -487,13 +492,17 @@
   DWARFDataSegment m_data_debug_rnglists;
   DWARFDataSegment m_data_debug_str;
   DWARFDataSegment m_data_debug_str_offsets;
-  DWARFDataSegment m_data_debug_types;
+  DWARFDataSegment m_data_raw_debug_types;
   DWARFDataSegment m_data_apple_names;
   DWARFDataSegment m_data_apple_types;
   DWARFDataSegment m_data_apple_namespaces;
   DWARFDataSegment m_data_apple_objc;
   DWARFDataSegment m_data_gnu_debugaltlink;
 
+  llvm::once_flag m_concatenated_data_once;
+  lldb_private::DWARFDataExtractor m_data_debug_info_concatenated;
+  uint64_t m_debug_info_concatenated_types_offset;
+
   // The unique pointer items below are generated on demand if and when someone
   // accesses
   // them through a non const version of this class.
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -412,7 +412,7 @@
   // when this class parses .o files to
   // contain the .o file index/ID
   m_debug_map_module_wp(), m_debug_map_symfile(NULL), m_data_debug_abbrev(),
-  m_data_debug_aranges(), m_data_debug_frame(), m_data_debug_info(),
+  m_data_debug_aranges(), m_data_debug_frame(), m_data_raw_debug_info(),
   m_data_debug_line(), m_data_debug_macro(), m_data_debug_loc(),
   m_data_debug_ranges(), m_data_debug_rnglists(), m_data_debug_str(),
   m_data_apple_names(), m_data_apple_types(), m_data_apple_namespaces(),
@@ -506,20 +506,6 @@
 if (section_list == NULL)
   return 0;
 
-// On non Apple platforms we might have .debug_types debug info that is
-// created by using "-fdebug-types-section". LLDB currently will try to
-// load this debug info, but it causes crashes during debugging when types
-// are missing since it doesn't know how to parse 

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

2018-11-10 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Sat Nov 10 14:54:44 2018
New Revision: 346599

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

Modified:
lldb/trunk/source/Host/linux/Host.cpp

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=346599=346598=346599=diff
==
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Sat Nov 10 14:54:44 2018
@@ -28,6 +28,7 @@
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Status.h"
 
+#include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/linux/Support.h"


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


[Lldb-commits] [PATCH] D54272: Extract construction of DataBufferLLVM into FileSystem

2018-11-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346598: Extract construction of DataBufferLLVM into 
FileSystem (authored by JDevlieghere, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D54272?vs=173216=173531#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D54272

Files:
  lldb/trunk/include/lldb/Host/FileSystem.h
  lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
  lldb/trunk/source/API/SBSection.cpp
  lldb/trunk/source/Commands/CommandObjectMemory.cpp
  lldb/trunk/source/Core/SourceManager.cpp
  lldb/trunk/source/Host/common/FileSystem.cpp
  lldb/trunk/source/Host/common/Host.cpp
  lldb/trunk/source/Host/linux/Host.cpp
  lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
  lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
  lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/trunk/source/Symbol/ObjectFile.cpp
  lldb/trunk/source/Utility/DataBufferLLVM.cpp
  lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Index: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
===
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -16,9 +16,9 @@
 #include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h"
 
 #include "TestingSupport/TestUtilities.h"
+#include "lldb/Host/FileSystem.h"
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Utility/ArchSpec.h"
-#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/FileSpec.h"
 #include "llvm/ADT/ArrayRef.h"
@@ -38,9 +38,13 @@
 
 class MinidumpParserTest : public testing::Test {
 public:
+  void SetUp() override { FileSystem::Initialize(); }
+
+  void TearDown() override { FileSystem::Terminate(); }
+
   void SetUpData(const char *minidump_filename) {
 std::string filename = GetInputFilePath(minidump_filename);
-auto BufferPtr = DataBufferLLVM::CreateSliceFromPath(filename, -1, 0);
+auto BufferPtr = FileSystem::Instance().CreateDataBuffer(filename, -1, 0);
 ASSERT_NE(BufferPtr, nullptr);
 llvm::Optional optional_parser =
 MinidumpParser::Create(BufferPtr);
@@ -54,7 +58,7 @@
   void InvalidMinidump(const char *minidump_filename, uint64_t load_size) {
 std::string filename = GetInputFilePath(minidump_filename);
 auto BufferPtr =
-DataBufferLLVM::CreateSliceFromPath(filename, load_size, 0);
+FileSystem::Instance().CreateDataBuffer(filename, load_size, 0);
 ASSERT_NE(BufferPtr, nullptr);
 
 llvm::Optional optional_parser =
@@ -89,7 +93,7 @@
   // after the thread count.
   SetUpData("thread-list-not-padded.dmp");
   llvm::ArrayRef thread_list;
-  
+
   thread_list = parser->GetThreads();
   ASSERT_EQ(2UL, thread_list.size());
   EXPECT_EQ(0x11223344UL, thread_list[0].thread_id);
Index: lldb/trunk/source/API/SBSection.cpp
===
--- lldb/trunk/source/API/SBSection.cpp
+++ lldb/trunk/source/API/SBSection.cpp
@@ -14,7 +14,6 @@
 #include "lldb/Core/Section.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Utility/DataBuffer.h"
-#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
@@ -166,7 +165,7 @@
 else
   file_size = 0;
   }
-  auto data_buffer_sp = DataBufferLLVM::CreateSliceFromPath(
+  auto data_buffer_sp = FileSystem::Instance().CreateDataBuffer(
   objfile->GetFileSpec().GetPath(), file_size, file_offset);
   if (data_buffer_sp && data_buffer_sp->GetByteSize() > 0) {
 DataExtractorSP data_extractor_sp(
Index: lldb/trunk/source/Core/SourceManager.cpp
===
--- lldb/trunk/source/Core/SourceManager.cpp
+++ lldb/trunk/source/Core/SourceManager.cpp
@@ -442,7 +442,7 @@
   }
 
   if (m_mod_time != llvm::sys::TimePoint<>())
-m_data_sp = DataBufferLLVM::CreateFromPath(m_file_spec.GetPath());
+m_data_sp = FileSystem::Instance().CreateDataBuffer(m_file_spec);
 }
 
 uint32_t SourceManager::File::GetLineOffset(uint32_t line) {
@@ -520,7 +520,7 @@
   if (curr_mod_time != llvm::sys::TimePoint<>() &&
   m_mod_time != curr_mod_time) {
 m_mod_time = curr_mod_time;
-m_data_sp = DataBufferLLVM::CreateFromPath(m_file_spec.GetPath());
+m_data_sp = FileSystem::Instance().CreateDataBuffer(m_file_spec);
 

[Lldb-commits] [lldb] r346598 - Extract construction of DataBufferLLVM into FileSystem

2018-11-10 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Sat Nov 10 14:44:06 2018
New Revision: 346598

URL: http://llvm.org/viewvc/llvm-project?rev=346598=rev
Log:
Extract construction of DataBufferLLVM into FileSystem

This moves construction of data buffers into the FileSystem class. Like
some of the previous refactorings we don't translate the path yet
because the functionality hasn't been landed in LLVM yet.

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

Modified:
lldb/trunk/include/lldb/Host/FileSystem.h
lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
lldb/trunk/source/API/SBSection.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Core/SourceManager.cpp
lldb/trunk/source/Host/common/FileSystem.cpp
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/linux/Host.cpp
lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/trunk/source/Symbol/ObjectFile.cpp
lldb/trunk/source/Utility/DataBufferLLVM.cpp
lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Modified: lldb/trunk/include/lldb/Host/FileSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=346598=346597=346598=diff
==
--- lldb/trunk/include/lldb/Host/FileSystem.h (original)
+++ lldb/trunk/include/lldb/Host/FileSystem.h Sat Nov 10 14:44:06 2018
@@ -11,6 +11,7 @@
 #define liblldb_Host_FileSystem_h
 
 #include "lldb/Host/File.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Status.h"
 
@@ -94,6 +95,12 @@ public:
   bool IsDirectory(const llvm::Twine ) const;
   /// @}
 
+  /// Returns whether the given path is local to the file system.
+  /// @{
+  bool IsLocal(const FileSpec _spec) const;
+  bool IsLocal(const llvm::Twine ) const;
+  /// @}
+
   /// Make the given file path absolute.
   /// @{
   std::error_code MakeAbsolute(llvm::SmallVectorImpl ) const;
@@ -106,6 +113,16 @@ public:
   void Resolve(FileSpec _spec);
   /// @}
 
+   Create memory buffer from path.
+  /// @{
+  std::shared_ptr CreateDataBuffer(const llvm::Twine ,
+   uint64_t size = 0,
+   uint64_t offset = 0);
+  std::shared_ptr CreateDataBuffer(const FileSpec _spec,
+   uint64_t size = 0,
+   uint64_t offset = 0);
+  /// @}
+
   /// Call into the Host to see if it can help find the file.
   bool ResolveExecutableLocation(FileSpec _spec);
 

Modified: lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBufferLLVM.h?rev=346598=346597=346598=diff
==
--- lldb/trunk/include/lldb/Utility/DataBufferLLVM.h (original)
+++ lldb/trunk/include/lldb/Utility/DataBufferLLVM.h Sat Nov 10 14:44:06 2018
@@ -23,16 +23,11 @@ class Twine;
 
 namespace lldb_private {
 
+class FileSystem;
 class DataBufferLLVM : public DataBuffer {
 public:
   ~DataBufferLLVM();
 
-  static std::shared_ptr
-  CreateSliceFromPath(const llvm::Twine , uint64_t Size, uint64_t Offset);
-
-  static std::shared_ptr
-  CreateFromPath(const llvm::Twine );
-
   uint8_t *GetBytes() override;
   const uint8_t *GetBytes() const override;
   lldb::offset_t GetByteSize() const override;
@@ -40,6 +35,7 @@ public:
   char *GetChars() { return reinterpret_cast(GetBytes()); }
 
 private:
+  friend FileSystem;
   /// Construct a DataBufferLLVM from \p Buffer.  \p Buffer must be a valid
   /// pointer.
   explicit DataBufferLLVM(std::unique_ptr Buffer);

Modified: lldb/trunk/source/API/SBSection.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSection.cpp?rev=346598=346597=346598=diff
==
--- lldb/trunk/source/API/SBSection.cpp (original)
+++ lldb/trunk/source/API/SBSection.cpp Sat Nov 10 14:44:06 2018
@@ -14,7 +14,6 @@
 #include "lldb/Core/Section.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Utility/DataBuffer.h"
-#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
@@ -166,7 +165,7 @@ SBData SBSection::GetSectionData(uint64_
 else
   file_size = 0;
   }
-  auto 

Re: [Lldb-commits] [lldb] r346466 - Revert "[FileSystem] Make use of FS in TildeExpressionResolver"

2018-11-10 Thread Pavel Labath via lldb-commits
I think the right way to resolve this would be to move
"StandardTildeExpressionResolver" into the host module. The non-standard
TildeExpressionResolver is just an abstract class, so it does not need
the filesystem. This way, anyone wanting to use the resolver can just
depend on the interface, and the concrete class may not even have to be
a public one as it the FileSystem can just vend the interface.

Although, at this point it's a question whether we need the resolver
class in the first place. It was introduced so we could mock/test
resolution of paths with usernames in them. However that is something
you will also need to do for the repro feature, so it may make sense to
fold everything into the Filesystem class.


On 09/11/18 02:59, Jonas Devlieghere via lldb-commits wrote:
> Author: jdevlieghere
> Date: Thu Nov  8 17:59:28 2018
> New Revision: 346466
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=346466=rev
> Log:
> Revert "[FileSystem] Make use of FS in TildeExpressionResolver"
> 
> The whole point of this change was making it possible to resolve paths
> without depending on the FileSystem, which is not what I did here. Not
> sure what I was thinking...
> 
> Modified:
> lldb/trunk/include/lldb/Host/FileSystem.h
> lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h
> lldb/trunk/source/Commands/CommandCompletions.cpp
> lldb/trunk/source/Host/common/FileSystem.cpp
> lldb/trunk/source/Target/TargetList.cpp
> lldb/trunk/source/Utility/TildeExpressionResolver.cpp
> lldb/trunk/unittests/Host/FileSystemTest.cpp
> lldb/trunk/unittests/Interpreter/TestCompletion.cpp
> lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.cpp
> lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.h
> lldb/trunk/unittests/Utility/TildeExpressionResolverTest.cpp
> 
> Modified: lldb/trunk/include/lldb/Host/FileSystem.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=346466=346465=346466=diff
> ==
> --- lldb/trunk/include/lldb/Host/FileSystem.h (original)
> +++ lldb/trunk/include/lldb/Host/FileSystem.h Thu Nov  8 17:59:28 2018
> @@ -132,8 +132,7 @@ public:
>void *callback_baton);
>  
>std::error_code GetRealPath(const llvm::Twine ,
> -  llvm::SmallVectorImpl ,
> -  bool expand_tilde) const;
> +  llvm::SmallVectorImpl ) const;
>  
>  private:
>static llvm::Optional ();
> 
> Modified: lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h?rev=346466=346465=346466=diff
> ==
> --- lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h (original)
> +++ lldb/trunk/include/lldb/Utility/TildeExpressionResolver.h Thu Nov  8 
> 17:59:28 2018
> @@ -18,10 +18,8 @@ template  class SmallVectorI
>  }
>  
>  namespace lldb_private {
> -class FileSystem;
>  class TildeExpressionResolver {
>  public:
> -  TildeExpressionResolver(FileSystem ) : m_fs(fs) {}
>virtual ~TildeExpressionResolver();
>  
>/// Resolve a Tilde Expression contained according to bash rules.
> @@ -54,20 +52,14 @@ public:
>/// the username portion with the matched result.
>bool ResolveFullPath(llvm::StringRef Expr,
> llvm::SmallVectorImpl );
> -
> -protected:
> -  FileSystem _fs;
>  };
>  
>  class StandardTildeExpressionResolver : public TildeExpressionResolver {
>  public:
> -  StandardTildeExpressionResolver(FileSystem )
> -  : TildeExpressionResolver(fs) {}
> -
>bool ResolveExact(llvm::StringRef Expr,
>  llvm::SmallVectorImpl ) override;
>bool ResolvePartial(llvm::StringRef Expr, llvm::StringSet<> ) 
> override;
>  };
> -} // namespace lldb_private
> +}
>  
>  #endif // #ifndef LLDB_UTILITY_TILDE_EXPRESSION_RESOLVER_H
> 
> Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=346466=346465=346466=diff
> ==
> --- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
> +++ lldb/trunk/source/Commands/CommandCompletions.cpp Thu Nov  8 17:59:28 2018
> @@ -231,7 +231,7 @@ static int DiskFilesOrDirectories(const
>  static int DiskFilesOrDirectories(CompletionRequest ,
>bool only_directories) {
>request.SetWordComplete(false);
> -  StandardTildeExpressionResolver resolver(FileSystem::Instance());
> +  StandardTildeExpressionResolver resolver;
>StringList matches;
>DiskFilesOrDirectories(request.GetCursorArgumentPrefix(), only_directories,
>   matches, resolver);
> 
> 

[Lldb-commits] [PATCH] D54272: Extract construction of DataBufferLLVM into FileSystem

2018-11-10 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks fine to me, I'd just ask you to consider shortening the method names a 
bit.




Comment at: include/lldb/Host/FileSystem.h:119-122
+  CreateDataBufferFromPath(const llvm::Twine , uint64_t size = 0,
+   uint64_t offset = 0);
+  std::shared_ptr
+  CreateDataBufferFromPath(const FileSpec _spec, uint64_t size = 0,

Can we streamline these names? I don't think the `FromPath` part brings 
anything here when the method is on the filesystem class, as it's completely 
natural and expected for those methods to take paths. Maybe just 
`CreateDataBuffer` or `ToDataBuffer`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54272



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


[Lldb-commits] [PATCH] D54335: [CMake] Fix: add_host_subdirectory source/Host/macosx

2018-11-10 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, sorry for that!


https://reviews.llvm.org/D54335



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


[Lldb-commits] [PATCH] D54221: Add setting to require hardware breakpoints.

2018-11-10 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In https://reviews.llvm.org/D54221#1290638, @JDevlieghere wrote:

> In https://reviews.llvm.org/D54221#1290572, @labath wrote:
>
> > I recall something about linux on arm having a magic unmodifiable (even by 
> > ptrace) page of memory, so this could be useful there too. However, it's 
> > not clear to me how a user is going to figure out that he needs to enable 
> > this setting. Would it make sense to automatically try setting a hardware 
> > breakpoint if software breakpoint fails?
>
>
> My main concern would be that hardware breakpoints are a limited resource and 
> not something we want to make transparent to the user, because it's only a 
> matter of time before it fails.


That is true, but on the other hand, you would only use hw breakpoints on those 
pieces of memory where you really need to instead of everywhere, which means 
(at least for the use case I have in mind) it be used very rarely. Of course, 
we would have to be careful do differentiate between reasons why setting a sw 
breakpoint failed (is it because the memory is RO, or some other reason like 
there is no memory at that address).

However, with this approach, it's still not clear to me how will the user know 
that he has to enable this setting? Will he get some sort of an error pointing 
here when the sw breakpoint fails? Or will you just enable this setting by 
default for targets where you know this is an issue?


https://reviews.llvm.org/D54221



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