[Lldb-commits] [PATCH] D61833: Fix IPv6 support on lldb-server platform

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: unittests/Host/ConnectionFileDescriptorTest.cpp:41
+llvm::StringRef path;
+EXPECT_TRUE(UriParser::Parse(connection_file_descriptor.GetURI(), scheme,
+ hostname, port, path));

Judging by Davide's email, this looks like the cause of your problem. GetURI() 
returns a temporary string, which means that the StringRefs `UriParser` parses 
it into become dangling after this statement.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61833



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


[Lldb-commits] [PATCH] D61687: Update Python tests for lldb-server on Windows

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Ok, let's give this a shot.


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

https://reviews.llvm.org/D61687



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


[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The patch looks fine, modulo some inline nits. I am somewhat doubtful about the 
name of the new function though. When I first saw `GetConnectURI`, i thought 
this would be the URI used to connect to `this` socket, but in reality it is 
the URI of the other end (right?). In that case, I think `GetRemoteURI` would 
be better. Or maybe, borrowing from the BSD socket vocabulary, `GetPeerURI` ? 
WDYT?

In D62089#1507283 , @aadsm wrote:

> I'm not really sure which source version lldb-server is being shipped with 
> Android Studio today (since their version works just fine obviously)...


I'm not sure either, but I'd expect it's a pretty old one (>1yr) at this point. 
I guess this behavior regressed somehow since then..




Comment at: lldb/source/Host/posix/DomainSocket.cpp:147-151
+StreamString strm;
+strm.Printf("%s://%s",
+GetNameOffset() == 0 ? "unix-connect" : 
"unix-abstract-connect",
+GetSocketName().c_str());
+return strm.GetString();

You could just write something like `llvm::formatv("{0}://{1}", GetNameOffset() 
== 0  ? ... , GetSocketName())`



Comment at: lldb/unittests/Host/SocketTest.cpp:165-166
+  llvm::StringRef path;
+  EXPECT_TRUE(UriParser::Parse(socket_a_up->GetConnectURI(), scheme, hostname,
+   port, path));
+  EXPECT_STREQ(scheme.str().c_str(), "connect");

The same issue as in the previous patch. You'll need to store the GetConnectURI 
result in a local variable.



Comment at: lldb/unittests/Host/SocketTest.cpp:167
+   port, path));
+  EXPECT_STREQ(scheme.str().c_str(), "connect");
+  EXPECT_EQ(port, socket_a_up->GetRemotePortNumber());

`EXPECT_EQ("connect", scheme);` is enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089



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


[Lldb-commits] [lldb] r361126 - minidump: Remove checked-in files used for testing MemoryList handling

2019-05-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 20 01:22:59 2019
New Revision: 361126

URL: http://llvm.org/viewvc/llvm-project?rev=361126&view=rev
Log:
minidump: Remove checked-in files used for testing MemoryList handling

Now that yaml2obj supports this stream, we can use the yaml form
instead.

Removed:
lldb/trunk/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp
lldb/trunk/unittests/Process/minidump/Inputs/memory-list-padded.dmp
lldb/trunk/unittests/Process/minidump/Inputs/regions-linux-map.dmp
lldb/trunk/unittests/Process/minidump/Inputs/regions-memlist.dmp
Modified:
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
lldb/trunk/unittests/Process/minidump/CMakeLists.txt
lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Modified: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h?rev=361126&r1=361125&r2=361126&view=diff
==
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h (original)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h Mon May 20 
01:22:59 2019
@@ -41,6 +41,10 @@ struct Range {
 
   Range(lldb::addr_t start, llvm::ArrayRef range_ref)
   : start(start), range_ref(range_ref) {}
+
+  friend bool operator==(const Range &lhs, const Range &rhs) {
+return lhs.start == rhs.start && lhs.range_ref == rhs.range_ref;
+  }
 };
 
 class MinidumpParser {

Modified: lldb/trunk/unittests/Process/minidump/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/CMakeLists.txt?rev=361126&r1=361125&r2=361126&view=diff
==
--- lldb/trunk/unittests/Process/minidump/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Process/minidump/CMakeLists.txt Mon May 20 01:22:59 
2019
@@ -20,10 +20,6 @@ set(test_inputs
fizzbuzz_wow64.dmp
linux-x86_64.dmp
linux-x86_64_not_crashed.dmp
-   memory-list-not-padded.dmp
-   memory-list-padded.dmp
-   regions-linux-map.dmp
-   regions-memlist.dmp
regions-memlist64.dmp
)
 

Removed: lldb/trunk/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp?rev=361125&view=auto
==
Binary file - no diff available.

Removed: lldb/trunk/unittests/Process/minidump/Inputs/memory-list-padded.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/memory-list-padded.dmp?rev=361125&view=auto
==
Binary file - no diff available.

Removed: lldb/trunk/unittests/Process/minidump/Inputs/regions-linux-map.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/regions-linux-map.dmp?rev=361125&view=auto
==
Binary file - no diff available.

Removed: lldb/trunk/unittests/Process/minidump/Inputs/regions-memlist.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/regions-memlist.dmp?rev=361125&view=auto
==
Binary file - no diff available.

Modified: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp?rev=361126&r1=361125&r2=361126&view=diff
==
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp (original)
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp Mon May 20 
01:22:59 2019
@@ -75,7 +75,7 @@ TEST_F(MinidumpParserTest, InvalidMinidu
   llvm::raw_string_ostream os(duplicate_streams);
   ASSERT_THAT_ERROR(llvm::MinidumpYAML::writeAsBinary(R"(
 --- !minidump
-Streams: 
+Streams:
   - Type:LinuxAuxv
 Content: DEADBEEFBAADF00D
   - Type:LinuxAuxv
@@ -92,11 +92,11 @@ Streams:
 TEST_F(MinidumpParserTest, GetThreadsAndGetThreadContext) {
   ASSERT_THAT_ERROR(SetUpFromYaml(R"(
 --- !minidump
-Streams: 
+Streams:
   - Type:ThreadList
-Threads: 
+Threads:
   - Thread Id:   0x3E81
-Stack:   
+Stack:
   Start of Memory Range: 0x7FFCEB34A000
   Content: C84D04BCE97F00
 Context: 00
@@ -116,41 +116,17 @@ Streams:
   EXPECT_EQ(7u, context.size());
 }
 
-TEST_F(MinidumpParserTest, GetMemoryListNotPadded) {
-  // Verify that we can load a memory list that doesn't have 4 bytes of padding
-  // after the memory range count.
-  SetUpDat

[Lldb-commits] [lldb] r361127 - DWARF: Port most of other sections over to DWARFContext

2019-05-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 20 01:38:47 2019
New Revision: 361127

URL: http://llvm.org/viewvc/llvm-project?rev=361127&view=rev
Log:
DWARF: Port most of other sections over to DWARFContext

This moves the sections from SymbolFileDWARF to DWARFContext, where it
was trivial to do so. A couple of sections are still left in
SymbolFileDWARF. These will be handled by separate patches.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.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
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

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=361127&r1=361126&r2=361127&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Mon May 20 
01:38:47 2019
@@ -55,7 +55,8 @@ llvm::Expected DWARFCompile
   bool length_OK = debug_info.ValidOffset(cu_sp->GetNextUnitOffset() - 1);
   bool version_OK = SymbolFileDWARF::SupportedVersion(cu_sp->m_version);
   bool abbr_offset_OK =
-  dwarf2Data->get_debug_abbrev_data().ValidOffset(abbr_offset);
+  dwarf2Data->GetDWARFContext().getOrLoadAbbrevData().ValidOffset(
+  abbr_offset);
   bool addr_size_OK = (cu_sp->m_addr_size == 4) || (cu_sp->m_addr_size == 8);
 
   if (!length_OK)

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp?rev=361127&r1=361126&r2=361127&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp Mon May 20 
01:38:47 2019
@@ -35,6 +35,14 @@ LoadOrGetSection(SectionList *section_li
   return *extractor;
 }
 
+const DWARFDataExtractor &DWARFContext::getOrLoadAbbrevData() {
+  if (isDwo())
+return LoadOrGetSection(m_dwo_section_list, 
eSectionTypeDWARFDebugAbbrevDwo,
+m_data_debug_abbrev);
+  return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugAbbrev,
+  m_data_debug_abbrev);
+}
+
 const DWARFDataExtractor &DWARFContext::getOrLoadArangesData() {
   return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugAranges,
   m_data_debug_aranges);
@@ -47,3 +55,34 @@ const DWARFDataExtractor &DWARFContext::
   return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugInfo,
   m_data_debug_info);
 }
+
+const DWARFDataExtractor &DWARFContext::getOrLoadLineData() {
+  return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugLine,
+  m_data_debug_line);
+}
+
+const DWARFDataExtractor &DWARFContext::getOrLoadLineStrData() {
+  return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugLineStr,
+  m_data_debug_line_str);
+}
+
+const DWARFDataExtractor &DWARFContext::getOrLoadMacroData() {
+  return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugMacro,
+  m_data_debug_macro);
+}
+
+const DWARFDataExtractor &DWARFContext::getOrLoadStrData() {
+  if (isDwo())
+return LoadOrGetSection(m_dwo_section_list, eSectionTypeDWARFDebugStrDwo,
+m_data_debug_str);
+  return LoadOrGetSection(m_main_section_list, eSectionTypeDWARFDebugStr,
+  m_data_debug_str);
+}
+
+const DWARFDataExtractor &DWARFContext::getOrLoadStrOffsetsData() {
+  if (isDwo())
+return LoadOrGetSection(m_dwo_section_list, 
eSectionTypeDWARFDebugStrOffsetsDwo,
+m_data_debug_str_offsets);
+  return LoadOrGetSection(m_main_section_list, 
eSectionTypeDWARFDebugStrOffsets,
+  m_data_debug_str_offsets);
+}

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.h?rev=361127&r1=361126&r2=361127&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.h Mon May 20 
01:38:47 2019
@@ -20,8 +20,14 @@ private:
   SectionList 

[Lldb-commits] [PATCH] D61505: Implement .debug_types

2019-05-20 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil abandoned this revision.
jankratochvil added a comment.

It should be obsoleted by D62073  and future 
@labath patches.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61505



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


[Lldb-commits] [PATCH] D62073: Introduce DWARFUnitHeader and use it to parse type units out of .debug_info

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath marked an inline comment as done.
labath added a comment.

In D62073#1507001 , @aprantl wrote:

> Nice! FYI, we have a bot that runs the LLDB dotests against DWARF5 (the last 
> stage http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/) to 
> track the progress.


Cool. That's nice to know. Unfortunately, Green Dragon seems to be in a pretty 
bad shape (looks like some infrastructure problems), so I can't really see 
what's the state of things.

In D62073#1507063 , @clayborg wrote:

> Are type units still disabled with the kill switch we had in? Or is this on 
> top of the .debug_types patch?


This is on top the debug_types patch. However, I decided it makes more sense to 
do things the other way around, so I'm going to flip their order around. I am 
going to reply to the rest of your message on the debug_types patch.


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

https://reviews.llvm.org/D62073



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


[Lldb-commits] [PATCH] D62073: Introduce DWARFUnitHeader and use it to parse type units out of .debug_info

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 200227.
labath added a comment.

Rebase so that this does not require any debug_types support.


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

https://reviews.llvm.org/D62073

Files:
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -31,11 +31,46 @@
   eProcucerOther
 };
 
+/// Base class describing the header of any kind of "unit."  Some information
+/// is specific to certain unit types.  We separate this class out so we can
+/// parse the header before deciding what specific kind of unit to construct.
+class DWARFUnitHeader {
+  dw_offset_t m_offset = 0;
+  dw_offset_t m_length = 0;
+  uint16_t m_version = 0;
+  dw_offset_t m_abbr_offset = 0;
+  uint8_t m_unit_type = 0;
+  uint8_t m_addr_size = 0;
+  uint64_t m_dwo_id = 0;
+
+  DWARFUnitHeader() = default;
+
+public:
+  dw_offset_t GetOffset() const { return m_offset; }
+  uint16_t GetVersion() const { return m_version; }
+  uint16_t GetAddressByteSize() const { return m_addr_size; }
+  dw_offset_t GetLength() const { return m_length; }
+  dw_offset_t GetAbbrOffset() const { return m_abbr_offset; }
+  uint8_t GetUnitType() const { return m_unit_type; }
+  bool IsTypeUnit() const {
+return m_unit_type == DW_UT_type || m_unit_type == DW_UT_split_type;
+  }
+  uint32_t GetNextUnitOffset() const { return m_offset + m_length + 4; }
+
+  static llvm::Expected
+  extract(const lldb_private::DWARFDataExtractor &data,
+  lldb::offset_t *offset_ptr);
+};
+
 class DWARFUnit : public lldb_private::UserID {
   using die_iterator_range =
   llvm::iterator_range;
 
 public:
+  static llvm::Expected
+  extract(SymbolFileDWARF *dwarf2Data, lldb::user_id_t uid,
+  const lldb_private::DWARFDataExtractor &debug_info,
+  lldb::offset_t *offset_ptr);
   virtual ~DWARFUnit();
 
   void ExtractUnitDIEIfNeeded();
@@ -66,14 +101,16 @@
   ///
   /// \return
   ///   The correct data for the DIE information in this unit.
-  virtual const lldb_private::DWARFDataExtractor &GetData() const = 0;
-  /// Get the size in bytes of the compile unit header.
+  const lldb_private::DWARFDataExtractor &GetData() const;
+
+  /// Get the size in bytes of the unit header.
   ///
   /// \return
-  /// Byte size of the compile unit header
-  virtual uint32_t GetHeaderByteSize() const = 0;
+  /// Byte size of the unit header
+  uint32_t GetHeaderByteSize() const;
+
   // Offset of the initial length field.
-  dw_offset_t GetOffset() const { return m_offset; }
+  dw_offset_t GetOffset() const { return m_header.GetOffset(); }
   /// Get the size in bytes of the length field in the header.
   ///
   /// In DWARF32 this is just 4 bytes
@@ -87,17 +124,17 @@
die_offset < GetNextUnitOffset();
   }
   dw_offset_t GetFirstDIEOffset() const {
-return m_offset + GetHeaderByteSize();
+return GetOffset() + GetHeaderByteSize();
   }
-  dw_offset_t GetNextUnitOffset() const;
+  dw_offset_t GetNextUnitOffset() const { return m_header.GetNextUnitOffset(); }
   // Size of the CU data (without initial length and without header).
   size_t GetDebugInfoSize() const;
   // Size of the CU data incl. header but without initial length.
-  uint32_t GetLength() const { return m_length; }
-  uint16_t GetVersion() const { return m_version; }
+  uint32_t GetLength() const { return m_header.GetLength(); }
+  uint16_t GetVersion() const { return m_header.GetVersion(); }
   const DWARFAbbreviationDeclarationSet *GetAbbreviations() const;
   dw_offset_t GetAbbrevOffset() const;
-  uint8_t GetAddressByteSize() const { return m_addr_size; }
+  uint8_t GetAddressByteSize() const { return m_header.GetAddressByteSize(); }
   dw_addr_t GetBaseAddress() const { return m_base_addr; }
   dw_addr_t GetAddrBase() const { return m_addr_base; }
   dw_addr_t GetRangesBase() const { return m_ranges_base; }
@@ -170,10 +207,13 @@
   virtual DIERef::Section GetDebugSection() const = 0;
 
 protected:
-  DWARFUnit(SymbolFileDWARF *dwarf, lldb::user_id_t uid);
+  DWARFUnit(SymbolFileDWARF *dwarf, lldb::user_id_t uid,
+const DWARFUnitHeader &header,
+const DWARFAbbreviationDeclarationSet &abbrevs);
 
   SymbolFileDWARF *m_dwarf = nullptr;
   std::unique_ptr m_dwo_symbol_file;
+  DWARFUnitHeader m_header;
   const DWARFAbbreviationDeclarationSet *m_abbrevs = nullptr;
   void *m_user_data = nullptr;
   // The compile unit debug information entry item
@@ -193,11 +233,6 @@
   // exact DW_TAG_subprogram DIEs
   std::unique_ptr m_func_aranges_up;
   dw_addr_t m_base_addr = 0;
-  dw_offset_t m_length = 0;
-

[Lldb-commits] [PATCH] D62008: DWARF: Parse type units from the debug_types section

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 200230.
labath added a comment.

- rebase on top of the DWARFUnitHeader patch


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

https://reviews.llvm.org/D62008

Files:
  lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp
  lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp
  lit/SymbolFile/DWARF/debug-types-basic.test
  lit/SymbolFile/DWARF/debug-types-expressions.test
  lit/SymbolFile/DWARF/lit.local.cfg
  source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
  source/Plugins/SymbolFile/DWARF/DWARFContext.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  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

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -439,20 +439,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鈥檛 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;
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -58,7 +58,7 @@
   uint32_t GetNextUnitOffset() const { return m_offset + m_length + 4; }
 
   static llvm::Expected
-  extract(const lldb_private::DWARFDataExtractor &data,
+  extract(const lldb_private::DWARFDataExtractor &data, DIERef::Section section,
   lldb::offset_t *offset_ptr);
 };
 
@@ -70,7 +70,7 @@
   static llvm::Expected
   extract(SymbolFileDWARF *dwarf2Data, lldb::user_id_t uid,
   const lldb_private::DWARFDataExtractor &debug_info,
-  lldb::offset_t *offset_ptr);
+  DIERef::Section section, lldb::offset_t *offset_ptr);
   virtual ~DWARFUnit();
 
   void ExtractUnitDIEIfNeeded();
@@ -204,12 +204,17 @@
 return die_iterator_range(m_die_array.begin(), m_die_array.end());
   }
 
-  virtual DIERef::Section GetDebugSection() const = 0;
+  DIERef::Section GetDebugSection() const { return m_section; }
 
 protected:
   DWARFUnit(SymbolFileDWARF *dwarf, lldb::user_id_t uid,
 const DWARFUnitHeader &header,
-const DWARFAbbreviationDeclarationSet &abbrevs);
+const DWARFAbbreviationDeclarationSet &abbrevs,
+DIERef::Section section);
+
+  llvm::Error ExtractHeader(SymbolFileDWARF *dwarf,
+const lldb_private::DWARFDataExtractor &data,
+lldb::offset_t *offset_ptr);
 
   SymbolFileDWARF *m_dwarf = nullptr;
   std::unique_ptr m_dwo_symbol_file;
@@ -246,6 +251,7 @@
   // in the main object file
   dw_offset_t m_base_obj_offset = DW_INVALID_OFFSET;
   dw_offset_t m_str_offsets_base = 0; // Value of DW_AT_str_offsets_base.
+  const DIERef::Section m_section;
 
 private:
   void ParseProducerInfo();
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -21,6 +21,7 @@
 #include "DWARFCompileUnit.h"
 #include "DWARFDebugAranges.h"
 #include "DWARFDebugInfo.h"
+#include "DWARFTypeUnit.h"
 #include "LogChannelDWARF.h"
 #include "SymbolFileDWARFDebugMap.h"
 #include "SymbolFileDWARFDwo.h"
@@ -33,9 +34,10 @@
 
 DWARFUnit::DWARFUnit(SymbolFileDWARF *dwarf, lldb::user_id_t uid,
  const DWARFUnitHeader &header,
- const DWARFAbbreviationDeclarationSet &abbrevs)
+ const DWARFAbbreviationDeclarationSet &abbrevs,
+ DIERef::Section section)
 : UserID(uid), m_dwarf(dwarf), m_header(header), m_abbrevs(&abbrevs),
-  m_cancel_scopes(false) {}
+  

[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Ant贸nio Afonso via Phabricator via lldb-commits
aadsm marked an inline comment as done.
aadsm added a comment.

Glad you brought the naming up, I was also not happy with it. I guess I kind of 
convinced myself in the end with "it's the url the socket used to create its 
connection". The other name I tinkered with was `GetConnectRemoteURI`, I wanted 
to have Connect in the name because of the naming scheme that it's being using, 
it seems something specifically to be used with 
ConnectionFileDescriptor::Connect (it's not clear to me why though). Actually 
now that I re read that function maybe `GetRemoteConnectionURI` would be better?




Comment at: lldb/unittests/Host/SocketTest.cpp:165-166
+  llvm::StringRef path;
+  EXPECT_TRUE(UriParser::Parse(socket_a_up->GetConnectURI(), scheme, hostname,
+   port, path));
+  EXPECT_STREQ(scheme.str().c_str(), "connect");

labath wrote:
> The same issue as in the previous patch. You'll need to store the 
> GetConnectURI result in a local variable.
Ah! thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089



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


[Lldb-commits] [PATCH] D62008: DWARF: Introduce DWARFTypeUnit class

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Replying here as this is the relevant patch.

In D62073#1507063 , @clayborg wrote:

> Are type units still disabled with the kill switch we had in? Or is this on 
> top of the .debug_types patch? We have an internal .debug_types patch we have 
> been using on an older LLVM/Clang/LLDB and we had some major performance 
> issues regarding line tables so I am not sure where we would need to put 
> these fixes (in this patch or in the .debug_types specific patch. This patch 
> seems to enable parsing .debug_types already. The main issue we ran into were:
>
> - only search actual compile unit line tables for breakpoints as many 
> .debug_type units will point to existing line tables from real compile units
> - don't add address ranges to type unit DWARFUnits from the line tables
> - re-work how support files are parsed by sharing the line tables within a 
> SymbolFileDWARF. .debug_types has type units that reuse line tables from real 
> compile units (thousands of times) and we ended up seeing the same line table 
> being parsed over and over and over. Another way to fix this is to no vend a 
> lldb_private::CompileUnit for any units that aren't really compile units 
> (DW_UT_type and DW_UT_split_type).
>
>   So if this patch is enabling all this, we will need to fix this patch to 
> avoid all of the above mentioned issues. Let me know your thoughts.


Thanks for the heads up. This is a pretty good to-do list. I was aware of some 
of these things already (like the address ranges thing), but in the spirit of 
the incremental development policy 
, I 
deliberately tried to keep this patch small. I already have a patch for to stop 
adding address ranges for type units, but I didn't upload it yet, as I am still 
working on the test (that's the reason I side-stepped into dwarf5 a bit, 
because I believe it will make creating the test easier). Another thing, which 
this patch does not enable yet is the resolution of DW_AT_signatures, so with 
this patch alone you will be able to look up types, but not link them to 
variables. I also put that in a separate patch, because it was possible to do 
so. One more big feature, which is completely broken right now, is the 
combination of dwo+type units. For that I don't have a patch yet, and making 
that work is probably going to take a bit longer.

For these reason I don't think it's reasonable to put all of these things into 
one big patch, and have a fully functional and optimised implementation from 
the start -- having things working 100% immediately is very unlikely and a 
large patch increases the likelyhood of breaking unrelated things. I think we 
should start with this patch. The address ranges patch and DW_AT_signature 
thingy, can come pretty much immediately after that. These are the only things 
(that I am aware of) which impact correctness, so we could have an 
implementation ready for general audience to try out as early as the end of 
this week. After that the road splits up a bit, and we can proceed in several 
directions (e.g. I'm hoping that DWO support can be mostly independent of the 
line table optimizations). I might even be able to get some help with that, so 
that we increase our velocity here, once the initial building blocks are in 
place.

As for the "kill switch", I am open to keeping it in, but make it conditional 
on some setting or environment variable, until the implementation is more 
stable. However, I also don't think it's really necessary, as I believe we will 
have something sufficiently functional very quickly. (and even a slightly wonky 
experience is better than just refusing to debug a binary outright, imo)


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

https://reviews.llvm.org/D62008



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


[Lldb-commits] [PATCH] D61956: [CMake] Add first CMake cache files

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

BTW, given that we recommend using ninja pretty much everywhere, you might want 
to include `set(CMAKE_GENERATOR Ninja)`


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61956



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


[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

`GetRemoteConnectionURI` sounds fine.




Comment at: lldb/source/Host/posix/DomainSocket.cpp:130
+
+std::string DomainSocket::GetSocketName() const {
+  if (m_socket != kInvalidSocketValue) {

This should also be  `GetRemoteSocketName` or something similar (though the 
word `remote` looks a bit weird when it comes to domain sockets).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089



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


[Lldb-commits] [PATCH] D60962: [NativePDB] Extend .pdb files search folders

2019-05-20 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

In D60962#1504921 , @labath wrote:

> Adrian is on vacation now, but given that he was just waiting until you 
> resolve my comments (which you have), I think we don't have to wait for him.


Thank you for one more review.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60962



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


[Lldb-commits] [PATCH] D62008: DWARF: Introduce DWARFTypeUnit class

2019-05-20 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Ok, as long as we get things in soon, some functionality is better than none.


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

https://reviews.llvm.org/D62008



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


[Lldb-commits] [PATCH] D62073: DWARF: Introduce DWARFUnitHeader class

2019-05-20 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Fine if we get things in quick!


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

https://reviews.llvm.org/D62073



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


[Lldb-commits] [PATCH] D62008: DWARF: Introduce DWARFTypeUnit class

2019-05-20 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lit/SymbolFile/DWARF/debug-types-expressions.test:28
+# CHECK-LABEL: print ns::A()
+# CHECK: (ns::A) $1 = (i = 147)

[This is more a meta-point and I don't care very strongly about it]
For a test of the DWARF parser, is it necessary to actually attach to a running 
process, or could we statically inspect the types of, e.g., global variables 
with `target var` or something?


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

https://reviews.llvm.org/D62008



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


[Lldb-commits] [PATCH] D61833: Fix IPv6 support on lldb-server platform

2019-05-20 Thread Ant贸nio Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 200353.
aadsm edited the summary of this revision.
aadsm added a comment.

- Fixed function from const to static (mea culpa)
- Fixed inet_pton usage on windows
- Fixed issue with GetURL return creating a temp object


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61833

Files:
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  lldb/unittests/Host/CMakeLists.txt
  lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTestUtilities.cpp
  lldb/unittests/Host/SocketTestUtilities.h

Index: lldb/unittests/Host/SocketTestUtilities.h
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.h
@@ -0,0 +1,47 @@
+//===- SocketTestUtilities.h *- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLDB_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+#define LLDB_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+
+#include 
+#include 
+#include 
+
+#include "lldb/Host/Config.h"
+#include "lldb/Host/Socket.h"
+#include "lldb/Host/common/TCPSocket.h"
+#include "lldb/Host/common/UDPSocket.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Testing/Support/Error.h"
+
+#ifndef LLDB_DISABLE_POSIX
+#include "lldb/Host/posix/DomainSocket.h"
+#endif
+
+namespace lldb_private {
+template 
+void CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function &get_connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up);
+bool CreateTCPConnectedSockets(std::string listen_remote_ip,
+   std::unique_ptr *a_up,
+   std::unique_ptr *b_up);
+#ifndef LLDB_DISABLE_POSIX
+void CreateDomainConnectedSockets(llvm::StringRef path,
+  std::unique_ptr *a_up,
+  std::unique_ptr *b_up);
+#endif
+
+bool IsAddressFamilySupported(std::string ip);
+bool IsIPv4(std::string ip);
+} // namespace lldb_private
+
+#endif
\ No newline at end of file
Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -0,0 +1,104 @@
+//===- SocketTestUtilities.cpp --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "SocketTestUtilities.h"
+#include "lldb/Utility/StreamString.h"
+
+#ifdef _WIN32
+#include 
+#include 
+#else
+#include 
+#endif
+
+using namespace lldb_private;
+
+static void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
+ Socket **accept_socket, Status *error) {
+  *error = listen_socket->Accept(*accept_socket);
+}
+
+template 
+void lldb_private::CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function &get_connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up) {
+  bool child_processes_inherit = false;
+  Status error;
+  std::unique_ptr listen_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = listen_socket_up->Listen(listen_remote_address, 5);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(listen_socket_up->IsValid());
+
+  Status accept_error;
+  Socket *accept_socket;
+  std::thread accept_thread(AcceptThread, listen_socket_up.get(),
+child_processes_inherit, &accept_socket,
+&accept_error);
+
+  std::string connect_remote_address = get_connect_addr(*listen_socket_up);
+  std::unique_ptr connect_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = connect_socket_up->Connect(connect_remote_address);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(connect_socket_up->IsValid());
+
+  a_up->swap(connect_socket_up);
+  EXPECT_TRUE(error.Success());
+  EXPECT_NE(nullptr, a_up->get());
+  EXPECT_TRUE((*a_up)->IsValid());
+
+  accept_thread.join();
+  b_up->reset(static_cast(accept_socket));
+  EXPECT_TRUE(accept_error.Success());
+  EXPECT_NE(nullptr, b_up->get());
+  EXPECT_TRUE((*b_up)->IsValid());
+
+  listen_socket_up.reset();
+}
+
+bool lldb_private::CreateTCPConnectedSockets(
+std::string listen_remote_ip, std::unique_ptr *socket_a_up,
+std::unique_

[Lldb-commits] [PATCH] D62159: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd created this revision.
compnerd added reviewers: xiaobai, labath, clayborg.
Herald added subscribers: abidh, atanasyan, kristof.beyls, arichardson, 
javed.absar, sdardis.
Herald added a project: LLDB.

Enable the ARM emulation support on AArch64 which can execute ARM32 code.  
Similarly, handle MIPS 32 on 64.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D62159

Files:
  tools/lldb-server/SystemInitializerLLGS.cpp


Index: tools/lldb-server/SystemInitializerLLGS.cpp
===
--- tools/lldb-server/SystemInitializerLLGS.cpp
+++ tools/lldb-server/SystemInitializerLLGS.cpp
@@ -24,6 +24,10 @@
 #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #endif

+#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
+#define LLDB_TARGET_ARM64
+#endif
+
 #if defined(__mips__) || defined(mips) || defined(__mips) ||   
\
 defined(__MIPS__) || defined(_M_MIPS)
 #define LLDB_TARGET_MIPS
@@ -44,10 +48,10 @@

   HostObjectFile::Initialize();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Initialize();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Initialize();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
@@ -60,10 +64,10 @@
 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Terminate();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Terminate();
 #endif
 #if defined(LLDB_TARGET_MIPS64)


Index: tools/lldb-server/SystemInitializerLLGS.cpp
===
--- tools/lldb-server/SystemInitializerLLGS.cpp
+++ tools/lldb-server/SystemInitializerLLGS.cpp
@@ -24,6 +24,10 @@
 #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #endif

+#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
+#define LLDB_TARGET_ARM64
+#endif
+
 #if defined(__mips__) || defined(mips) || defined(__mips) ||   \
 defined(__MIPS__) || defined(_M_MIPS)
 #define LLDB_TARGET_MIPS
@@ -44,10 +48,10 @@

   HostObjectFile::Initialize();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Initialize();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Initialize();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
@@ -60,10 +64,10 @@
 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Terminate();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Terminate();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Ant贸nio Afonso via Phabricator via lldb-commits
aadsm marked an inline comment as done.
aadsm added inline comments.



Comment at: lldb/source/Host/posix/DomainSocket.cpp:130
+
+std::string DomainSocket::GetSocketName() const {
+  if (m_socket != kInvalidSocketValue) {

labath wrote:
> This should also be  `GetRemoteSocketName` or something similar (though the 
> word `remote` looks a bit weird when it comes to domain sockets).
uhm.. I'm a bit skeptical on this one 馃槃 
As far as I understand domain sockets don't really have endpoints, there's just 
a single point of consumption (the inode). Here's what I see in my head when 
comparing TCP to Domain sockets:

TCP:
```
consumer o-o provider
```
Domain:
```
consumer -o- provider
```
While on TCP we have 2 things that we can name "remote" and "local". On Domain 
there's only one thing to name, so I think it would be odd calling it "remote" 
given there's no parallel with the tcp model.

I don't have strong feelings on this though, and I'm happy to change to land 
the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089



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


[Lldb-commits] [PATCH] D62159: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

Unsure about the MIPS one but the ARM/ARM64 one looks right to me.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D62159



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


[Lldb-commits] [PATCH] D62159: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd updated this revision to Diff 200366.
compnerd added a comment.

Fix inclusion


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D62159

Files:
  tools/lldb-server/SystemInitializerLLGS.cpp


Index: tools/lldb-server/SystemInitializerLLGS.cpp
===
--- tools/lldb-server/SystemInitializerLLGS.cpp
+++ tools/lldb-server/SystemInitializerLLGS.cpp
@@ -19,15 +19,14 @@
 using HostObjectFile = ObjectFileELF;
 #endif

-#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM)
-#define LLDB_TARGET_ARM
-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
+#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
+#define LLDB_TARGET_ARM64
 #endif

-#if defined(__mips__) || defined(mips) || defined(__mips) ||   
\
-defined(__MIPS__) || defined(_M_MIPS)
-#define LLDB_TARGET_MIPS
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM) ||  
\
+defined(LLDB_TARGET_ARM64)
+#define LLDB_TARGET_ARM
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #endif

 #if defined(__mips64__) || defined(mips64) || defined(__mips64) || 
\
@@ -36,6 +35,12 @@
 #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #endif

+#if defined(__mips__) || defined(mips) || defined(__mips) ||   
\
+defined(__MIPS__) || defined(_M_MIPS) || defined(LLDB_TARGET_MIPS64)
+#define LLDB_TARGET_MIPS
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#endif
+
 using namespace lldb_private;

 llvm::Error SystemInitializerLLGS::Initialize() {
@@ -44,10 +49,10 @@

   HostObjectFile::Initialize();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Initialize();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Initialize();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
@@ -60,10 +65,10 @@
 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Terminate();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Terminate();
 #endif
 #if defined(LLDB_TARGET_MIPS64)


Index: tools/lldb-server/SystemInitializerLLGS.cpp
===
--- tools/lldb-server/SystemInitializerLLGS.cpp
+++ tools/lldb-server/SystemInitializerLLGS.cpp
@@ -19,15 +19,14 @@
 using HostObjectFile = ObjectFileELF;
 #endif

-#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM)
-#define LLDB_TARGET_ARM
-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
+#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
+#define LLDB_TARGET_ARM64
 #endif

-#if defined(__mips__) || defined(mips) || defined(__mips) ||   \
-defined(__MIPS__) || defined(_M_MIPS)
-#define LLDB_TARGET_MIPS
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM) ||  \
+defined(LLDB_TARGET_ARM64)
+#define LLDB_TARGET_ARM
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #endif

 #if defined(__mips64__) || defined(mips64) || defined(__mips64) || \
@@ -36,6 +35,12 @@
 #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #endif

+#if defined(__mips__) || defined(mips) || defined(__mips) ||   \
+defined(__MIPS__) || defined(_M_MIPS) || defined(LLDB_TARGET_MIPS64)
+#define LLDB_TARGET_MIPS
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#endif
+
 using namespace lldb_private;

 llvm::Error SystemInitializerLLGS::Initialize() {
@@ -44,10 +49,10 @@

   HostObjectFile::Initialize();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Initialize();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Initialize();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
@@ -60,10 +65,10 @@
 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();

-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Terminate();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Terminate();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62061: Add AST logging

2019-05-20 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/source/Symbol/ClangASTImporter.cpp:956
+  Log *log_ast(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST));
+  if (log_ast) {
+std::string name_string;

Why not `if (Log* log_ast = 
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST))`



Comment at: lldb/source/Symbol/ClangASTImporter.cpp:963
+}
+log_ast->Printf(" [ClangASTImporter][TUDecl: %p] Imported "
+"(%sDecl*)%p, named %s (from "

You can use the `LLDB_LOG` macro which provides a much nicer interface.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62061



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


[Lldb-commits] [lldb] r361210 - lldb-server: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Mon May 20 18:25:48 2019
New Revision: 361210

URL: http://llvm.org/viewvc/llvm-project?rev=361210&view=rev
Log:
lldb-server: LLGS: support 32-bit on 64-bit hosts

Enable the ARM emulation support on AArch64 which can execute ARM32
code. Similarly, handle MIPS 32 on 64.

Modified:
lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp

Modified: lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp?rev=361210&r1=361209&r2=361210&view=diff
==
--- lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp (original)
+++ lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp Mon May 20 18:25:48 
2019
@@ -19,15 +19,14 @@ using HostObjectFile = ObjectFilePECOFF;
 using HostObjectFile = ObjectFileELF;
 #endif
 
-#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM)
-#define LLDB_TARGET_ARM
-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
+#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
+#define LLDB_TARGET_ARM64
 #endif
 
-#if defined(__mips__) || defined(mips) || defined(__mips) ||   
\
-defined(__MIPS__) || defined(_M_MIPS)
-#define LLDB_TARGET_MIPS
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM) ||  
\
+defined(LLDB_TARGET_ARM64)
+#define LLDB_TARGET_ARM
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #endif
 
 #if defined(__mips64__) || defined(mips64) || defined(__mips64) || 
\
@@ -36,6 +35,12 @@ using HostObjectFile = ObjectFileELF;
 #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #endif
 
+#if defined(__mips__) || defined(mips) || defined(__mips) ||   
\
+defined(__MIPS__) || defined(_M_MIPS) || defined(LLDB_TARGET_MIPS64)
+#define LLDB_TARGET_MIPS
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#endif
+
 using namespace lldb_private;
 
 llvm::Error SystemInitializerLLGS::Initialize() {
@@ -44,10 +49,10 @@ llvm::Error SystemInitializerLLGS::Initi
 
   HostObjectFile::Initialize();
 
-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Initialize();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Initialize();
 #endif
 #if defined(LLDB_TARGET_MIPS64)
@@ -60,10 +65,10 @@ llvm::Error SystemInitializerLLGS::Initi
 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();
 
-#if defined(LLDB_TARGET_ARM)
+#if defined(LLDB_TARGET_ARM) || defined(LLDB_TARGET_ARM64)
   EmulateInstructionARM::Terminate();
 #endif
-#if defined(LLDB_TARGET_MIPS)
+#if defined(LLDB_TARGET_MIPS) || defined(LLDB_TARGET_MIPS64)
   EmulateInstructionMIPS::Terminate();
 #endif
 #if defined(LLDB_TARGET_MIPS64)


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


[Lldb-commits] [PATCH] D62159: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd closed this revision.
compnerd added a comment.

SVN r361210


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D62159



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


[Lldb-commits] [PATCH] D62168: [DynamicLoader] Make sure we always set the rendezvous breakpoint

2019-05-20 Thread Ant贸nio Afonso via Phabricator via lldb-commits
aadsm created this revision.
aadsm added reviewers: ADodds, clayborg, eugene.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Once we've attached to the process we load all current modules and also set a 
breakpoint at the rendezvous break address.
However, we don't do this if we already have a load address for the image info 
address (e.g.: DT_DEBUG on ELF). This code was added 4 years ago when adding 
support for `$qXfer:Libraries:` packet (https://reviews.llvm.org/D9471) but its 
intention is not 100% clear to me. It seems to me we're using that check to 
know if the modules have already been loaded (which they have if 
`$qXfer:Libraries:` is supported by the gdb server) and skip loading the 
modules again in the following `if` block. The problem is that we also skip 
setting the Rendezvous breakpoint so we stop knowing when the process loads new 
modules.
I fix this by moving the call to set the breakpoint to the end of the function 
so we always call it as long as we have a valid executable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62168

Files:
  lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp


Index: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
===
--- lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -150,11 +150,6 @@
  true);
 
 LoadAllCurrentModules();
-if (!SetRendezvousBreakpoint()) {
-  // If we cannot establish rendezvous breakpoint right now we'll try again
-  // at entry point.
-  ProbeEntry();
-}
 
 m_process->GetTarget().ModulesDidLoad(module_list);
 if (log) {
@@ -169,6 +164,14 @@
   }
 }
   }
+
+  if (executable_sp.get()) {
+if (!SetRendezvousBreakpoint()) {
+  // If we cannot establish rendezvous breakpoint right now we'll try again
+  // at entry point.
+  ProbeEntry();
+}
+  }
 }
 
 void DynamicLoaderPOSIXDYLD::DidLaunch() {


Index: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
===
--- lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -150,11 +150,6 @@
  true);
 
 LoadAllCurrentModules();
-if (!SetRendezvousBreakpoint()) {
-  // If we cannot establish rendezvous breakpoint right now we'll try again
-  // at entry point.
-  ProbeEntry();
-}
 
 m_process->GetTarget().ModulesDidLoad(module_list);
 if (log) {
@@ -169,6 +164,14 @@
   }
 }
   }
+
+  if (executable_sp.get()) {
+if (!SetRendezvousBreakpoint()) {
+  // If we cannot establish rendezvous breakpoint right now we'll try again
+  // at entry point.
+  ProbeEntry();
+}
+  }
 }
 
 void DynamicLoaderPOSIXDYLD::DidLaunch() {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r361216 - [CMake] Correct some dependencies

2019-05-20 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon May 20 20:41:05 2019
New Revision: 361216

URL: http://llvm.org/viewvc/llvm-project?rev=361216&view=rev
Log:
[CMake] Correct some dependencies

Symbol doesn't depend on CPlusPlusLanguage, but Expressiond does.

Modified:
lldb/trunk/source/Expression/CMakeLists.txt
lldb/trunk/source/Symbol/CMakeLists.txt

Modified: lldb/trunk/source/Expression/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=361216&r1=361215&r2=361216&view=diff
==
--- lldb/trunk/source/Expression/CMakeLists.txt (original)
+++ lldb/trunk/source/Expression/CMakeLists.txt Mon May 20 20:41:05 2019
@@ -28,6 +28,7 @@ add_lldb_library(lldbExpression
 lldbSymbol
 lldbTarget
 lldbUtility
+lldbPluginCPlusPlusLanguage
 lldbPluginObjectFileJIT
 
   LINK_COMPONENTS

Modified: lldb/trunk/source/Symbol/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CMakeLists.txt?rev=361216&r1=361215&r2=361216&view=diff
==
--- lldb/trunk/source/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/source/Symbol/CMakeLists.txt Mon May 20 20:41:05 2019
@@ -57,7 +57,6 @@ add_lldb_library(lldbSymbol
 lldbPluginExpressionParserClang
 lldbPluginSymbolFileDWARF
 lldbPluginSymbolFilePDB
-lldbPluginCPlusPlusLanguage
 lldbPluginObjCLanguage
 
   LINK_COMPONENTS


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


[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Ant贸nio Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 200403.
aadsm added a comment.
Herald added subscribers: jfb, mgorny.

- Change GetConnectURI to GetRemoteConnectionURI
- Fixes tests when it comes to using dangling pointers on ConstRefs
- Better usage of the EXPECT_* macros.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089

Files:
  lldb/include/lldb/Host/Socket.h
  lldb/include/lldb/Host/common/TCPSocket.h
  lldb/include/lldb/Host/common/UDPSocket.h
  lldb/include/lldb/Host/posix/DomainSocket.h
  lldb/source/Host/common/TCPSocket.cpp
  lldb/source/Host/common/UDPSocket.cpp
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp.rej
  lldb/source/Host/posix/DomainSocket.cpp
  
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
  lldb/unittests/Host/CMakeLists.txt
  lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTest.cpp.rej
  lldb/unittests/Host/SocketTestUtilities.cpp
  lldb/unittests/Host/SocketTestUtilities.h

Index: lldb/unittests/Host/SocketTestUtilities.h
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.h
@@ -0,0 +1,47 @@
+//===- SocketTestUtilities.h *- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLDB_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+#define LLDB_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+
+#include 
+#include 
+#include 
+
+#include "lldb/Host/Config.h"
+#include "lldb/Host/Socket.h"
+#include "lldb/Host/common/TCPSocket.h"
+#include "lldb/Host/common/UDPSocket.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Testing/Support/Error.h"
+
+#ifndef LLDB_DISABLE_POSIX
+#include "lldb/Host/posix/DomainSocket.h"
+#endif
+
+namespace lldb_private {
+template 
+void CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function &get_connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up);
+bool CreateTCPConnectedSockets(std::string listen_remote_ip,
+   std::unique_ptr *a_up,
+   std::unique_ptr *b_up);
+#ifndef LLDB_DISABLE_POSIX
+void CreateDomainConnectedSockets(llvm::StringRef path,
+  std::unique_ptr *a_up,
+  std::unique_ptr *b_up);
+#endif
+
+bool IsAddressFamilySupported(std::string ip);
+bool IsIPv4(std::string ip);
+} // namespace lldb_private
+
+#endif
\ No newline at end of file
Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -0,0 +1,104 @@
+//===- SocketTestUtilities.cpp --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "SocketTestUtilities.h"
+#include "lldb/Utility/StreamString.h"
+
+#ifdef _WIN32
+#include 
+#include 
+#else
+#include 
+#endif
+
+using namespace lldb_private;
+
+static void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
+ Socket **accept_socket, Status *error) {
+  *error = listen_socket->Accept(*accept_socket);
+}
+
+template 
+void lldb_private::CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function &get_connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up) {
+  bool child_processes_inherit = false;
+  Status error;
+  std::unique_ptr listen_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = listen_socket_up->Listen(listen_remote_address, 5);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(listen_socket_up->IsValid());
+
+  Status accept_error;
+  Socket *accept_socket;
+  std::thread accept_thread(AcceptThread, listen_socket_up.get(),
+child_processes_inherit, &accept_socket,
+&accept_error);
+
+  std::string connect_remote_address = get_connect_addr(*listen_socket_up);
+  std::unique_ptr connect_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = connect_socket_up->Connect(connect_remote_address);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(connect_socket_up->IsValid());
+

[Lldb-commits] [PATCH] D62159: LLGS: support 32-bit on 64-bit hosts

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

BTW, there's no fundamental reason why a 64-bit lldb-server has to use 
instruction emulation for debugging arm32 binaries. Since all arm64 chips 
support hardware single stepping, we could just teach the arm32 native register 
context to issue PTRACE_SINGLESTEP commands when build in 64-bit mode, and 
increase debugging reliability while decreasing lldb-server size. (The same is 
probably also true for a 32-bit lldb-server running on a 64-bit kernel, but 
that's something that we would have to detect at runtime.)

Anyway, just an idea, this patch is fine. I was under the impression that arm64 
defines __arm__, but obviously I was wrong.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D62159



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


[Lldb-commits] [PATCH] D61833: Fix IPv6 support on lldb-server platform

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/unittests/Host/CMakeLists.txt:12-13
   TaskPoolTest.cpp
+  SocketTestUtilities.cpp
+  ConnectionFileDescriptorTest.cpp
 )

Please sort this list before committing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61833



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


[Lldb-commits] [PATCH] D62089: Make ConnectionFileDescription work with all sockets

2019-05-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

It looks like diff now contains the changes from D61833 
 as well. It would be better to upload just 
the changes relative to the previous patch in the series, otherwise things get 
confusing about what is being changed where. It's kind of obvious here, but you 
can use the "parent revision" field in phabricator to indicate that one diff 
depends on another.

Other than that, I *think* this is fine.




Comment at: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp.rej:1-23
+***
+*** 758,770 
+  }
+  
+  void ConnectionFileDescriptor::InitializeSocket(Socket *socket) {
+-   assert(socket->GetSocketProtocol() == Socket::ProtocolTcp);
+-   TCPSocket *tcp_socket = static_cast(socket);

Delete this.



Comment at: lldb/source/Host/posix/DomainSocket.cpp:130
+
+std::string DomainSocket::GetSocketName() const {
+  if (m_socket != kInvalidSocketValue) {

aadsm wrote:
> labath wrote:
> > This should also be  `GetRemoteSocketName` or something similar (though the 
> > word `remote` looks a bit weird when it comes to domain sockets).
> uhm.. I'm a bit skeptical on this one 馃槃 
> As far as I understand domain sockets don't really have endpoints, there's 
> just a single point of consumption (the inode). Here's what I see in my head 
> when comparing TCP to Domain sockets:
> 
> TCP:
> ```
> consumer o-o provider
> ```
> Domain:
> ```
> consumer -o- provider
> ```
> While on TCP we have 2 things that we can name "remote" and "local". On 
> Domain there's only one thing to name, so I think it would be odd calling it 
> "remote" given there's no parallel with the tcp model.
> 
> I don't have strong feelings on this though, and I'm happy to change to land 
> the patch.
Oops, sorry, you're totally right. I just noticed this name in drive-by and 
didn't stop to think about it. Please ignore this comment.



Comment at: lldb/unittests/Host/SocketTest.cpp.rej:1-16
+***
+*** 7,12 
+  
//===--===//
+  
+  #include "SocketTestUtilities.h"
+  #include "gtest/gtest.h"
+  

Delete this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62089



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