[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-02-17 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked 2 inline comments as done.
teemperor added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/Makefile:3
+USE_LIBCPP := 1
+CXXFLAGS += -std=c++11 -fmodules -glldb -fimplicit-module-maps
+CXX_SOURCES := main.cpp

aprantl wrote:
> Makefile.rules defines MANDATORY_MODULE_BUILD_FLAGS for this. Can you instead 
> add -fimplicit-module-maps to that variable and use it here?
Well, we would need to add `-glldb` (needed on Linux at least, where this is 
not default) and `-fimplicit-module-maps` to that flag (and maybe even 
`-fcxx-modules` on macOS, but I'm not sure about that). Also I'm not sure if we 
want to have `-gmodules` in the same flag set as the importing of `std` should 
also work without. What about a separate `MANDATORY_CXXMODULE_BUILD_FLAGS` that 
we use in all the tests?


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [lldb] r354225 - Remove unused extern declaration as removed by D32167

2019-02-17 Thread Jan Kratochvil via lldb-commits
Author: jankratochvil
Date: Sun Feb 17 09:12:37 2019
New Revision: 354225

URL: http://llvm.org/viewvc/llvm-project?rev=354225&view=rev
Log:
Remove unused extern declaration as removed by D32167

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=354225&r1=354224&r2=354225&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Sun Feb 17 
09:12:37 2019
@@ -14,8 +14,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-extern int g_verbose;
-
 DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF *dwarf2Data)
 : DWARFUnit(dwarf2Data) {}
 


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


[Lldb-commits] [PATCH] D58330: 01/03: new SectionPart for Section subranges (for effective .debug_types concatenation)

2019-02-17 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added a reviewer: clayborg.
jankratochvil added a project: LLDB.
Herald added subscribers: jdoerfert, arichardson, emaste.
Herald added a reviewer: espindola.

@clayborg requested  more effective 
loading of concatenated sections. For compressed sections it means one has to 
measure decompressed size of both to be able to effectively allocate memory for 
both of them. But current `LoadSectionData()` can only load the data without 
knowing first how big it will be. Therefore D51578 
 introduces `SectionReader` but it needs to 
also handle subranges of DWP `Section`. Despite DWP `Section` is not supported 
to be compressed and compressed sections do not need to support subranges to 
unify the API I had to replace `Section *` by `SectionPart` for all the cases.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D58330

Files:
  lldb/include/lldb/Symbol/ObjectFile.h
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
  lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
  lldb/source/Symbol/ObjectFile.cpp

Index: lldb/source/Symbol/ObjectFile.cpp
===
--- lldb/source/Symbol/ObjectFile.cpp
+++ lldb/source/Symbol/ObjectFile.cpp
@@ -536,11 +536,13 @@
 //--
 // Get the section data the file on disk
 //--
-size_t ObjectFile::ReadSectionData(Section *section,
-   DataExtractor §ion_data) {
+size_t ObjectFile::ReadSectionData(
+const SectionPart §ion_part, DataExtractor §ion_data) {
+  Section *section = section_part.GetSection();
   // If some other objectfile owns this data, pass this to them.
   if (section->GetObjectFile() != this)
-return section->GetObjectFile()->ReadSectionData(section, section_data);
+return section->GetObjectFile()->ReadSectionData(
+section_part, section_data);
 
   if (IsInMemory()) {
 ProcessSP process_sp(m_process_wp.lock());
@@ -549,7 +551,9 @@
   section->GetLoadBaseAddress(&process_sp->GetTarget());
   if (base_load_addr != LLDB_INVALID_ADDRESS) {
 DataBufferSP data_sp(
-ReadMemory(process_sp, base_load_addr, section->GetByteSize()));
+ReadMemory(process_sp,
+base_load_addr + section_part.GetOffsetInSection(),
+section_part.GetLength()));
 if (data_sp) {
   section_data.SetData(data_sp, 0, data_sp->GetByteSize());
   section_data.SetByteOrder(process_sp->GetByteOrder());
@@ -558,17 +562,14 @@
 }
   }
 }
-return GetData(section->GetFileOffset(), section->GetFileSize(),
-   section_data);
   } else {
 // The object file now contains a full mmap'ed copy of the object file
 // data, so just use this
 if (!section->IsRelocated())
   RelocateSection(section);
-
-return GetData(section->GetFileOffset(), section->GetFileSize(),
-   section_data);
   }
+  return GetData(section_part.GetOffsetInFile(), section_part.GetLength(),
+ section_data);
 }
 
 bool ObjectFile::SplitArchivePathWithObject(const char *path_with_object,
@@ -743,3 +744,46 @@
 break;
   }
 }
+
+SectionPart::SectionPart() : m_section(nullptr),
+m_offset(LLDB_INVALID_ADDRESS), m_length(LLDB_INVALID_ADDRESS) {}
+
+SectionPart::SectionPart(Section *section)
+: m_section(section), m_offset(0), m_length(section->GetFileSize()) {
+  assert(m_section);
+}
+
+SectionPart::SectionPart(Section *section, lldb::addr_t offset, lldb::addr_t length)
+: m_section(section), m_offset(offset), m_length(length) {
+  assert(m_section);
+  lldbassert(m_offset + m_length <= m_section->GetFileSize());
+}
+
+Section *SectionPart::GetSection() const {
+  assert(m_section);
+  return m_section;
+}
+
+lldb::addr_t SectionPart::GetOffsetInSection() const {
+  assert(m_section);
+  return m_offset;
+}
+
+lldb::addr_t SectionPart::GetOffsetInFile() const {
+  assert(m_section);
+  return m_section->GetFileOffset() + GetOffsetInSection();
+}
+
+lldb::addr_t SectionPart::GetOffsetInParentSection() const {
+  assert(m_section);
+  return m_section->GetOffset() + GetOffsetInSection();
+}
+
+lldb::addr

[Lldb-commits] [PATCH] D51578: 02/03: Contiguous sections (.debug_info+.debug_types) for D54670==D32167 (.debug_types)

2019-02-17 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 187169.
jankratochvil added a comment.

> So if we have 3GB of .debug_info and 1GB of .debug_types, we are expecting to 
> allocate a heap based buffer and copy all the data into this? This will fail.

That fallback code path is used only when there is no way to access 
`.debug_info` and `.debug_types` from mmapped area.  I was thinking that 
fallback would be used for example for Linux vDSO which needs to be read by 
`Process::ReadModuleFromMemory()` but that has only about 16KB so its size does 
not matter.  But maybe on OSX (or for GDB JIT modules) the data can be bigger 
so in this patch I have implemented the most effective merging of non-mmapped 
sections.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D51578

Files:
  lldb/include/lldb/Symbol/ObjectFile.h
  lldb/include/lldb/lldb-enumerations.h
  lldb/source/Core/Section.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
  lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
  lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  lldb/source/Symbol/ObjectFile.cpp

Index: lldb/source/Symbol/ObjectFile.cpp
===
--- lldb/source/Symbol/ObjectFile.cpp
+++ lldb/source/Symbol/ObjectFile.cpp
@@ -365,6 +365,7 @@
   case eSectionTypeDWARFDebugStrOffsets:
   case eSectionTypeDWARFDebugStrOffsetsDwo:
   case eSectionTypeDWARFDebugTypes:
+  case eSectionTypeDWARFDebugTypesDwo:
   case eSectionTypeDWARFAppleNames:
   case eSectionTypeDWARFAppleTypes:
   case eSectionTypeDWARFAppleNamespaces:
@@ -533,19 +534,54 @@
   return 0;
 }
 
-//--
-// Get the section data the file on disk
-//--
-size_t ObjectFile::ReadSectionData(
-const SectionPart §ion_part, DataExtractor §ion_data) {
+size_t ObjectFile::ReadSectionData(const SectionPart §ion_part,
+   DataExtractor §ion_data) {
   Section *section = section_part.GetSection();
   // If some other objectfile owns this data, pass this to them.
   if (section->GetObjectFile() != this)
 return section->GetObjectFile()->ReadSectionData(
 section_part, section_data);
 
-  if (IsInMemory()) {
-ProcessSP process_sp(m_process_wp.lock());
+  auto reader_up = SectionReaderFactory(section_part);
+  if (!reader_up)
+return 0;
+  return reader_up->read(section_data);
+}
+
+ObjectFile::SectionReader::SectionReader(const SectionPart §ion_part_)
+: section_part(section_part_) {}
+
+std::unique_ptr
+ObjectFile::SectionReaderFactory(const SectionPart §ion_part) {
+  // llvm::make_unique() is not a friend like we are.
+  return std::unique_ptr(new SectionReader(section_part));
+}
+
+ObjectFile::SectionReader::~SectionReader() {}
+
+uint64_t ObjectFile::SectionReader::getDecompressedSize() {
+  return !section_part ? 0 : section_part.GetSection()->GetFileSize();
+}
+
+size_t ObjectFile::SectionReader::read(uint8_t *dst) {
+  if (!section_part)
+return 0;
+  Section *section = section_part.GetSection();
+  return section->GetObjectFile()->ObjectFile::ReadSectionData(section,
+  section_part.GetOffsetInSection(), dst, section_part.GetLength());
+}
+
+//--
+// Get the section data the file on disk
+//--
+size_t ObjectFile::SectionReader::read(DataExtractor §ion_data) {
+  if (!section_part)
+return 0;
+  Section *section = section_part.GetSection();
+  ObjectFile *obj_file = section->GetObjectFile();
+
+  if (obj_file->IsInMemory()) {
+ProcessSP process_sp(obj_file->GetProcessWP().lock());
 if (process_sp) {
   const addr_t base_load_addr =
   section->GetLoadBaseAddress(&process_sp->GetTarget());
@@ -566,10 +602,10 @@
 // The object file now contains a full mmap'ed copy of the object file
 // data, so just use this
 if (!section->IsRelocated())
-  RelocateSection(section);
+  obj_file->RelocateSection(section);
   }
-  return GetData(section_part.GetOffsetInFile(), section_part.GetLength(),
- sec

[Lldb-commits] [PATCH] D51578: 02/03: Contiguous sections (.debug_info+.debug_types) for D54670==D32167 (.debug_types)

2019-02-17 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked 2 inline comments as done.
jankratochvil added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:693-707
+DataBufferHeap *databufferheap = new DataBufferHeap();
+DataBufferSP databuffer = DataBufferSP(databufferheap);
+databufferheap->AppendData(
+debug_info_data.GetDataStart(),
+debug_info_data.GetByteSize());
+m_debug_info_concatenated_types_offset =
+databufferheap->GetByteSize();

clayborg wrote:
> So if we have 3GB of .debug_info and 1GB of .debug_types, we are expecting to 
> allocate a heap based buffer and copy all the data into this? This will fail.
replied by: https://reviews.llvm.org/D51578#1400641


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D51578



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


[Lldb-commits] [PATCH] D54670: 03/03: .debug_types: Update of D32167 (.debug_types) on top of D51578 (section concatenation)

2019-02-17 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil updated this revision to Diff 187170.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D54670

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

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -451,20 +451,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 info in the
-// .debug_types type units. This causes all complex debug info types to be
-// unresolved. Because this causes LLDB to crash and since it really
-// doesn't provide a solid debuggiung experience, we should disable trying
-// to debug this kind of DWARF until support gets added or deprecated.
-if (section_list->FindSectionByName(ConstString(".debug_types"))) {
-  m_obj_file->GetModule()->ReportWarning(
-"lldb doesn’t support .debug_types debug info");
-  return 0;
-}
-
 uint64_t debug_abbrev_file_size = 0;
 uint64_t debug_info_file_size = 0;
 uint64_t debug_line_file_size = 0;
@@ -847,7 +833,7 @@
 cu_sp = std::make_shared(
 module_sp, dwarf_cu, cu_file_spec, dwarf_cu->GetID(),
 cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo);
-if (cu_sp) {
+if (dwarf_cu->GetAsCompileUnit() && cu_sp) {
   // If we just created a compile unit with an invalid file spec,
   // try and get the first entry in the supports files from the
   // line table as that should be the compile unit.
@@ -860,16 +846,16 @@
   cu_sp->GetSupportFiles().Replace(0, cu_file_spec);
 }
   }
+}
 
-  dwarf_cu->SetUserData(cu_sp.get());
+dwarf_cu->SetUserData(cu_sp.get());
 
-  // Figure out the compile unit index if we weren't given one
-  if (cu_idx == UINT32_MAX)
-DebugInfo()->GetCompileUnit(dwarf_cu->GetOffset(), &cu_idx);
+// Figure out the compile unit index if we weren't given one
+if (cu_idx == UINT32_MAX)
+  DebugInfo()->GetCompileUnit(dwarf_cu->GetOffset(), &cu_idx);
 
-  m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
-  cu_idx, cu_sp);
-}
+m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
+cu_idx, cu_sp);
   }
 }
   }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -16,12 +16,15 @@
 #include 
 
 class DWARFUnit;
+class DWARFTypeUnit;
 class DWARFCompileUnit;
 class NameToDIE;
 class SymbolFileDWARF;
 class SymbolFileDWARFDwo;
 
 typedef std::shared_ptr DWARFUnitSP;
+typedef std::shared_ptr DWARFTypeUnitSP;
+typedef std::shared_ptr DWARFCompileUnitSP;
 
 enum DWARFProducer {
   eProducerInvalid = 0,
@@ -38,6 +41,12 @@
 public:
   virtual ~DWARFUnit();
 
+  bool ExtractHeader(SymbolFileDWARF *dwarf,
+ const lldb_private::DWARFDataExtractor &data,
+ lldb::offset_t *offset_ptr);
+
+  DWARFTypeUnit *GetAsTypeUnit();
+  DWARFCompileUnit *GetAsCompileUnit();
   void ExtractUnitDIEIfNeeded();
   void ExtractDIEsIfNeeded();
 
@@ -180,6 +189,10 @@
 return die_iterator_range(m_die_array.begin(), m_die_array.end());
   }
 
+  DWARFDIE FindTypeSignatureDIE(uint64_t type_sig) const;
+
+  dw_offset_

[Lldb-commits] [PATCH] D58339: Changes for running LLDB test suite for Swift on PowerPC64LE

2019-02-17 Thread Sarvesh Tamba via Phabricator via lldb-commits
sarveshtamba created this revision.
sarveshtamba added a project: LLDB.
Herald added subscribers: lldb-commits, jsji, mgorny, nemanjai.

The attached changes are required for running LLDB test suite related test 
cases for Apple Swift 5 on PowerPC64LE.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D58339

Files:
  source/Target/SwiftLanguageRuntime.cpp
  tools/repl/swift/CMakeLists.txt


Index: tools/repl/swift/CMakeLists.txt
===
--- tools/repl/swift/CMakeLists.txt
+++ tools/repl/swift/CMakeLists.txt
@@ -4,8 +4,13 @@
   
-Wl,${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR}/Swift/macosx")
 elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
   # Set the correct rpath to locate libswiftCore
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
-  
-Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-x86_64/lib${LLVM_LIBDIR_SUFFIX}/swift/linux
 -Wl,-ldl")
+  if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc64le")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
+
-Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-powerpc64le/lib${LLVM_LIBDIR_SUFFIX}/swift/linux/powerpc64le
 -Wl,-ldl")
+  else()
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
+
-Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-x86_64/lib${LLVM_LIBDIR_SUFFIX}/swift/linux
 -Wl,-ldl")
+  endif()
   set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/swift/linux:${CMAKE_INSTALL_RPATH}")
 endif()
 
Index: source/Target/SwiftLanguageRuntime.cpp
===
--- source/Target/SwiftLanguageRuntime.cpp
+++ source/Target/SwiftLanguageRuntime.cpp
@@ -2678,6 +2678,9 @@
 case llvm::Triple::ArchType::systemz:
   addr &= ~SWIFT_ABI_S390X_SWIFT_SPARE_BITS_MASK;
   break;
+case llvm::Triple::ArchType::ppc64le:
+  addr &= ~SWIFT_ABI_POWERPC64_SWIFT_SPARE_BITS_MASK;
+  break;
 default:
   break;
 }


Index: tools/repl/swift/CMakeLists.txt
===
--- tools/repl/swift/CMakeLists.txt
+++ tools/repl/swift/CMakeLists.txt
@@ -4,8 +4,13 @@
   -Wl,${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR}/Swift/macosx")
 elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
   # Set the correct rpath to locate libswiftCore
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
-  -Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-x86_64/lib${LLVM_LIBDIR_SUFFIX}/swift/linux -Wl,-ldl")
+  if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc64le")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
+-Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-powerpc64le/lib${LLVM_LIBDIR_SUFFIX}/swift/linux/powerpc64le -Wl,-ldl")
+  else()
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \
+-Wl,-rpath,${CMAKE_BINARY_DIR}/../swift-linux-x86_64/lib${LLVM_LIBDIR_SUFFIX}/swift/linux -Wl,-ldl")
+  endif()
   set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/swift/linux:${CMAKE_INSTALL_RPATH}")
 endif()
 
Index: source/Target/SwiftLanguageRuntime.cpp
===
--- source/Target/SwiftLanguageRuntime.cpp
+++ source/Target/SwiftLanguageRuntime.cpp
@@ -2678,6 +2678,9 @@
 case llvm::Triple::ArchType::systemz:
   addr &= ~SWIFT_ABI_S390X_SWIFT_SPARE_BITS_MASK;
   break;
+case llvm::Triple::ArchType::ppc64le:
+  addr &= ~SWIFT_ABI_POWERPC64_SWIFT_SPARE_BITS_MASK;
+  break;
 default:
   break;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-02-17 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D58125#1399474 , @teemperor wrote:

> @labath Thanks for the hint with the sysroot, but I'm not really sure what's 
> the best way to test this. Making a whole fake sysroot that can be used to 
> compile a std module seems overkill, and not sure if symlinking or so is a 
> good approach either. I'm open to suggestions.


How much of the sysroot would you actually need to recreate? Would a modulemap 
file and a one or two simple headers be enough?

Since we're simply testing here that the prefix gets prepended, I am not too 
worried if we just don't test that. What would make this super-interesting for 
me is if it would enable testing of this feature without a hard dependency on 
having libc++ installed on their system (a lot of people on linux still don't 
have libc++ by default, or may have an older non-modularized version), so if 
the "sysroot" test could be made to run on those systems, it would be awesome. 
I am not sure though what would be needed to make that happen. I suspect this 
could be pretty tricky, since our test suite is not really prepared for that. 
The most tractable path may be via something like a core file. Like, open a 
core file, while specifying the sysroot, import @std, then try to display 
something, which would not be possible without it.


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58330: 01/03: new SectionPart for Section subranges (for effective .debug_types concatenation)

2019-02-17 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

This all still seems very messy to me. It also appears that we will still end 
up mmapping the object file, and then copying all of the debug info out of it 
into a heap buffer.

What's the reason we're trying so hard to concatenate things? IIRC, it was 
because it makes things appear DWARF5-like, but this is now creating a lot of 
infrastructure that will be completely unused in the dwarf5 case, so I think 
we're missing that goal. Can't we just admit that we are dealing with two 
sections here, and use one bit from the user_id_t (or whereever it's needed) to 
tell which one are we talking about?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58330



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


[Lldb-commits] [PATCH] D58339: Changes for running LLDB test suite for Swift on PowerPC64LE

2019-02-17 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I think you wanted to submit this patch to the downstream swift repo. I don't 
know exactly how that works, but I think they accept github pull requests.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58339



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