[Lldb-commits] [PATCH] D31877: Remove Plugins/Process/POSIX from include_directories

2017-04-10 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
Herald added a subscriber: mgorny.

The files there can always be referred to using their full path, which
is what most of the code has been doing already, so this makes the
situation more consistent. Also fix the the code in the FreeBSD plugin
to use the new paths.


https://reviews.llvm.org/D31877

Files:
  source/CMakeLists.txt
  source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
  source/Plugins/Process/FreeBSD/POSIXStopInfo.h
  source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
  source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
  source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Index: source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
===
--- source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -33,9 +33,9 @@
 
 #include "FreeBSDThread.h"
 #include "Plugins/Process/POSIX/CrashReason.h"
+#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"
-#include "ProcessPOSIXLog.h"
 
 extern "C" {
 extern char **environ;
Index: source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
===
--- source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
+++ source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
@@ -11,19 +11,13 @@
 #ifndef liblldb_ProcessFreeBSD_H_
 #define liblldb_ProcessFreeBSD_H_
 
-// C Includes
-
-// C++ Includes
+#include "Plugins/Process/POSIX/ProcessMessage.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/ThreadList.h"
 #include 
 #include 
 #include 
 
-// Other libraries and framework includes
-#include "ProcessFreeBSD.h"
-#include "ProcessMessage.h"
-#include "lldb/Target/Process.h"
-#include "lldb/Target/ThreadList.h"
-
 class ProcessMonitor;
 class FreeBSDThread;
 
Index: source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
===
--- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -32,11 +32,11 @@
 #include "lldb/Target/Target.h"
 
 #include "FreeBSDThread.h"
+#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "Plugins/Process/Utility/FreeBSDSignals.h"
 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"
-#include "ProcessPOSIXLog.h"
 
 // Other libraries and framework includes
 #include "lldb/Breakpoint/BreakpointLocation.h"
Index: source/Plugins/Process/FreeBSD/POSIXStopInfo.h
===
--- source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -10,15 +10,9 @@
 #ifndef liblldb_POSIXStopInfo_H_
 #define liblldb_POSIXStopInfo_H_
 
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Target/StopInfo.h"
-
-#include "CrashReason.h"
 #include "FreeBSDThread.h"
-
+#include "Plugins/Process/POSIX/CrashReason.h"
+#include "lldb/Target/StopInfo.h"
 #include 
 
 //===--===//
Index: source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
===
--- source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
+++ source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
@@ -24,6 +24,7 @@
 // Project includes
 #include "FreeBSDThread.h"
 #include "POSIXStopInfo.h"
+#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
@@ -33,7 +34,6 @@
 #include "Plugins/Process/Utility/UnwindLLDB.h"
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"
-#include "ProcessPOSIXLog.h"
 #include "RegisterContextPOSIXProcessMonitor_arm.h"
 #include "RegisterContextPOSIXProcessMonitor_arm64.h"
 #include "RegisterContextPOSIXProcessMonitor_mips64.h"
Index: source/CMakeLists.txt
===
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -1,31 +1,5 @@
 include_directories(.)
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
-include_directories(
-  Plugins/Process/Linux
-  Plugins/Process/POSIX
-  )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
-include_directories(
-  Plugins/Process/FreeBSD
-  Plugins/Process/POSIX
-  )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
-include_directories(
-  Plugins/Process/POSIX
-  )
-endif ()
-
-if ( CMAKE_SYSTEM_NAME MATCHES "OpenBSD" )
-include_directories(
-  Plugins/Process/POSIX
-  )
-endif ()
-
 set(lldbBase_SOURCES
 lldb.cpp
   )
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D31357: Support Unit Testing debugserver

2017-04-10 Thread Chris Bieneman via Phabricator via lldb-commits
beanz updated this revision to Diff 94526.
beanz added a comment.

Fixing variable naming conventions


https://reviews.llvm.org/D31357

Files:
  tools/debugserver/source/CMakeLists.txt
  tools/debugserver/source/MacOSX/CMakeLists.txt
  unittests/CMakeLists.txt
  unittests/debugserver/CMakeLists.txt
  unittests/debugserver/RNBSocketTest.cpp
  unittests/debugserver/debugserver_LogCallback.cpp

Index: unittests/debugserver/debugserver_LogCallback.cpp
===
--- /dev/null
+++ unittests/debugserver/debugserver_LogCallback.cpp
@@ -0,0 +1,20 @@
+//===-- debugserver_LogCallback.cpp -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+//--
+// this function is defined in debugserver.cpp, but is needed to link the
+// debugserver Common library. It is for logging only, so it is left
+// unimplemented here.
+//--
+
+#include 
+#include 
+
+void FileLogCallback(void *baton, uint32_t flags, const char *format,
+ va_list args) {}
Index: unittests/debugserver/RNBSocketTest.cpp
===
--- /dev/null
+++ unittests/debugserver/RNBSocketTest.cpp
@@ -0,0 +1,133 @@
+//===-- RNBSocketTest.cpp ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include 
+#include 
+#include 
+
+#include "RNBDefs.h"
+#include "RNBSocket.h"
+#include "lldb/Host/Socket.h"
+#include "lldb/Host/StringConvert.h"
+#include "lldb/Host/common/TCPSocket.h"
+
+using namespace lldb_private;
+
+std::string hello = "Hello, world!";
+std::string goodbye = "Goodbye!";
+
+static void ServerCallbackv4(const void *baton, in_port_t port) {
+  auto child_pid = fork();
+  if (child_pid == 0) {
+Socket *client_socket;
+char addr_buffer[256];
+sprintf(addr_buffer, "%s:%d", baton, port);
+Error err = Socket::TcpConnect(addr_buffer, false, client_socket);
+if (err.Fail())
+  abort();
+char buffer[32];
+size_t read_size = 32;
+err = client_socket->Read((void *)&buffer[0], read_size);
+if (err.Fail())
+  abort();
+std::string Recv(&buffer[0], read_size);
+if (Recv != hello)
+  abort();
+size_t write_size = goodbye.length();
+err = client_socket->Write(goodbye.c_str(), write_size);
+if (err.Fail())
+  abort();
+if (write_size != goodbye.length())
+  abort();
+delete client_socket;
+exit(0);
+  }
+}
+
+void TestSocketListen(const char *addr) {
+  RNBSocket server_socket;
+  auto result =
+  server_socket.Listen(addr, 0, ServerCallbackv4, (const void *)addr);
+  ASSERT_TRUE(result == rnb_success);
+  result = server_socket.Write(hello.c_str(), hello.length());
+  ASSERT_TRUE(result == rnb_success);
+  std::string bye;
+  result = server_socket.Read(bye);
+  ASSERT_TRUE(result == rnb_success);
+  ASSERT_EQ(bye, goodbye);
+
+  int exit_status;
+  wait(&exit_status);
+  ASSERT_EQ(exit_status, 0);
+}
+
+TEST(RNBSocket, LoopBackListenIPv4) { TestSocketListen("127.0.0.1"); }
+
+void TestSocketConnect(const char *addr) {
+  char addr_wrap[256];
+  sprintf(addr_wrap, "%s:0", addr);
+
+  Socket *server_socket;
+  Predicate port_predicate;
+  port_predicate.SetValue(0, eBroadcastNever);
+  Error err =
+  Socket::TcpListen(addr_wrap, false, server_socket, &port_predicate);
+  ASSERT_FALSE(err.Fail());
+
+  auto port = ((TCPSocket *)server_socket)->GetLocalPortNumber();
+  auto child_pid = fork();
+  if (child_pid != 0) {
+RNBSocket client_socket;
+auto result = client_socket.Connect(addr, port);
+ASSERT_TRUE(result == rnb_success);
+result = client_socket.Write(hello.c_str(), hello.length());
+ASSERT_TRUE(result == rnb_success);
+std::string bye;
+result = client_socket.Read(bye);
+ASSERT_TRUE(result == rnb_success);
+ASSERT_EQ(bye, goodbye);
+  } else {
+Socket *connected_socket;
+err = server_socket->Accept(connected_socket);
+if (err.Fail()) {
+  llvm::errs() << err.AsCString();
+  abort();
+}
+char buffer[32];
+size_t read_size = 32;
+err = connected_socket->Read((void *)&buffer[0], read_size);
+if (err.Fail()) {
+  llvm::errs() << err.AsCString();
+  abort();
+}
+std::string Recv(&buffer[0], read_size);
+if (Recv != hello) {
+  llvm::errs() << err.

[Lldb-commits] [PATCH] D31822: [NFC] Adding a new wrapper for getaddrinfo

2017-04-10 Thread Chris Bieneman via Phabricator via lldb-commits
beanz created this revision.

This patch adds a new wrapper for getaddrinfo which returns a std::vector of 
SocketAddresses. While this patch doesn't add any uses of the new function, I 
have two separable patches that are dependent on this, so I put it in its own 
patch.


https://reviews.llvm.org/D31822

Files:
  include/lldb/Host/SocketAddress.h
  source/Host/common/SocketAddress.cpp

Index: source/Host/common/SocketAddress.cpp
===
--- source/Host/common/SocketAddress.cpp
+++ source/Host/common/SocketAddress.cpp
@@ -89,6 +89,10 @@
   m_socket_addr.sa_storage = s;
 }
 
+SocketAddress::SocketAddress(const struct addrinfo *addr_info) {
+  *this = addr_info;
+}
+
 //--
 // SocketAddress copy constructor
 //--
@@ -244,6 +248,24 @@
   return result;
 }
 
+std::vector SocketAddress::GetAddressInfo(const char *hostname,
+   const char *servname) {
+  std::vector addr_list;
+
+  struct addrinfo *service_info_list = NULL;
+  int err = ::getaddrinfo(hostname, servname, NULL, &service_info_list);
+  if (err == 0 && service_info_list) {
+for (struct addrinfo *service_ptr = service_info_list; service_ptr != NULL;
+ service_ptr = service_ptr->ai_next) {
+  addr_list.push_back(SocketAddress(service_ptr));
+}
+  }
+
+  if (service_info_list)
+::freeaddrinfo(service_info_list);
+  return addr_list;
+}
+
 bool SocketAddress::SetToLocalhost(sa_family_t family, uint16_t port) {
   switch (family) {
   case AF_INET:
@@ -287,3 +309,29 @@
   Clear();
   return false;
 }
+
+bool SocketAddress::IsAnyAddr() const {
+  return (GetFamily() == AF_INET)
+ ? m_socket_addr.sa_ipv4.sin_addr.s_addr == htonl(INADDR_ANY)
+ : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_any, 16);
+}
+
+bool SocketAddress::operator==(const SocketAddress &rhs) const {
+  if (GetFamily() != rhs.GetFamily())
+return false;
+  if (GetLength() != rhs.GetLength())
+return false;
+  switch (GetFamily()) {
+  case AF_INET:
+return m_socket_addr.sa_ipv4.sin_addr.s_addr ==
+   rhs.m_socket_addr.sa_ipv4.sin_addr.s_addr;
+  case AF_INET6:
+return 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr,
+   &rhs.m_socket_addr.sa_ipv6.sin6_addr, 16);
+  }
+  return false;
+}
+
+bool SocketAddress::operator!=(const SocketAddress &rhs) const {
+  return !(*this == rhs);
+}
Index: include/lldb/Host/SocketAddress.h
===
--- include/lldb/Host/SocketAddress.h
+++ include/lldb/Host/SocketAddress.h
@@ -32,15 +32,23 @@
 // Other libraries and framework includes
 // Project includes
 #include 
+#include 
 
 namespace lldb_private {
 
 class SocketAddress {
 public:
+  //
+  // Static method to get all address information for a host and/or service
+  //
+  static std::vector GetAddressInfo(const char *hostname,
+ const char *servname);
+
   //--
   // Constructors and Destructors
   //--
   SocketAddress();
+  SocketAddress(const struct addrinfo *addr_info);
   SocketAddress(const struct sockaddr &s);
   SocketAddress(const struct sockaddr_in &s);
   SocketAddress(const struct sockaddr_in6 &s);
@@ -63,6 +71,9 @@
 
   const SocketAddress &operator=(const struct sockaddr_storage &s);
 
+  bool operator==(const SocketAddress &rhs) const;
+  bool operator!=(const SocketAddress &rhs) const;
+
   //--
   // Clear the contents of this socket address
   //--
@@ -135,6 +146,11 @@
   bool IsValid() const;
 
   //--
+  // Returns true if the socket is INADDR_ANY
+  //--
+  bool IsAnyAddr() const;
+
+  //--
   // Direct access to all of the sockaddr structures
   //--
   struct sockaddr &sockaddr() {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D31877: Remove Plugins/Process/POSIX from include_directories

2017-04-10 Thread Zachary Turner via lldb-commits
Lgtm
On Mon, Apr 10, 2017 at 11:03 AM Pavel Labath via Phabricator via
lldb-commits  wrote:

> labath created this revision.
> Herald added a subscriber: mgorny.
>
> The files there can always be referred to using their full path, which
> is what most of the code has been doing already, so this makes the
> situation more consistent. Also fix the the code in the FreeBSD plugin
> to use the new paths.
>
>
> https://reviews.llvm.org/D31877
>
> Files:
>   source/CMakeLists.txt
>   source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
>   source/Plugins/Process/FreeBSD/POSIXStopInfo.h
>   source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
>   source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
>   source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Hmm still wrong.

Later in this code:

  // NetBSD per-thread information is stored in notes named
  // "NetBSD-CORE@nnn" so match on the initial part of the string.
  m_os = llvm::Triple::NetBSD;
  if (note.n_type == NETBSD::NT_PROCINFO) {
ParseNetBSDProcInfo(*thread_data, note_data);
  } else if (note.n_type == NETBSD::NT_AUXV) {
m_auxv = DataExtractor(note_data);
  } else if (arch.GetMachine() == llvm::Triple::x86_64 &&
 note.n_type == NETBSD::NT_AMD64_REGS) {
thread_data->gpregset = note_data;
  } else if (arch.GetMachine() == llvm::Triple::x86_64 &&
 note.n_type == NETBSD::NT_AMD64_FPREGS) {
thread_data->fpregset = note_data;
  }

`arch.GetMachine()` evaluates to `llvm::Triple::UnknownArch` and `gpregset` and 
`fpregset` is never set.

Changing `ArchSpec arch = GetArchitecture();` to `ArchSpec arch = 
GetTarget().GetArchitecture();` does not help... I'm trying to investigate.


Repository:
  rL LLVM

https://reviews.llvm.org/D31825



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


[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Other BSDs work.


Repository:
  rL LLVM

https://reviews.llvm.org/D31825



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


[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)

2017-04-10 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
Herald added a reviewer: EricWF.

The iteration list through the available data formatters was undefined,
which meant that the vector formatter kicked in only in cases
where it happened to be queried before the general vector formatter. To
fix this, I merge the two data formatter entries into one, and select
which implementation to use in the factory function.


https://reviews.llvm.org/D31880

Files:
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.h
  source/Plugins/Language/CPlusPlus/LibCxxVector.cpp

Index: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
===
--- source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
+++ source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
@@ -45,6 +45,31 @@
   CompilerType m_element_type;
   uint32_t m_element_size;
 };
+
+class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
+public:
+  LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
+
+  ~LibcxxVectorBoolSyntheticFrontEnd() override = default;
+
+  size_t CalculateNumChildren() override;
+
+  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
+
+  bool Update() override;
+
+  bool MightHaveChildren() override { return true; }
+
+  size_t GetIndexOfChildWithName(const ConstString &name) override;
+
+private:
+  CompilerType m_bool_type;
+  ExecutionContextRef m_exe_ctx_ref;
+  uint64_t m_count;
+  lldb::addr_t m_base_data_address;
+  std::map m_children;
+};
+
 } // namespace formatters
 } // namespace lldb_private
 
@@ -133,9 +158,155 @@
   return ExtractIndexFromString(name.GetCString());
 }
 
+lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
+LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
+: SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(),
+  m_count(0), m_base_data_address(0), m_children() {
+  if (valobj_sp) {
+Update();
+m_bool_type =
+valobj_sp->GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeBool);
+  }
+}
+
+size_t lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
+CalculateNumChildren() {
+  return m_count;
+}
+
+lldb::ValueObjectSP
+lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::GetChildAtIndex(
+size_t idx) {
+  auto iter = m_children.find(idx), end = m_children.end();
+  if (iter != end)
+return iter->second;
+  if (idx >= m_count)
+return ValueObjectSP();
+  if (m_base_data_address == 0 || m_count == 0)
+return ValueObjectSP();
+  if (!m_bool_type)
+return ValueObjectSP();
+  size_t byte_idx = (idx >> 3); // divide by 8 to get byte index
+  size_t bit_index = (idx & 7); // efficient idx % 8 for bit index
+  lldb::addr_t byte_location = m_base_data_address + byte_idx;
+  ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
+  if (!process_sp)
+return ValueObjectSP();
+  uint8_t byte = 0;
+  uint8_t mask = 0;
+  Error err;
+  size_t bytes_read = process_sp->ReadMemory(byte_location, &byte, 1, err);
+  if (err.Fail() || bytes_read == 0)
+return ValueObjectSP();
+  switch (bit_index) {
+  case 0:
+mask = 1;
+break;
+  case 1:
+mask = 2;
+break;
+  case 2:
+mask = 4;
+break;
+  case 3:
+mask = 8;
+break;
+  case 4:
+mask = 16;
+break;
+  case 5:
+mask = 32;
+break;
+  case 6:
+mask = 64;
+break;
+  case 7:
+mask = 128;
+break;
+  default:
+return ValueObjectSP();
+  }
+  bool bit_set = ((byte & mask) != 0);
+  DataBufferSP buffer_sp(
+  new DataBufferHeap(m_bool_type.GetByteSize(nullptr), 0));
+  if (bit_set && buffer_sp && buffer_sp->GetBytes())
+*(buffer_sp->GetBytes()) =
+1; // regardless of endianness, anything non-zero is true
+  StreamString name;
+  name.Printf("[%" PRIu64 "]", (uint64_t)idx);
+  ValueObjectSP retval_sp(CreateValueObjectFromData(
+  name.GetString(),
+  DataExtractor(buffer_sp, process_sp->GetByteOrder(),
+process_sp->GetAddressByteSize()),
+  m_exe_ctx_ref, m_bool_type));
+  if (retval_sp)
+m_children[idx] = retval_sp;
+  return retval_sp;
+}
+
+/*(std::__1::vector >) vBool = {
+ __begin_ = 0x0001001000e0
+ __size_ = 56
+ __cap_alloc_ = {
+ std::__1::__libcpp_compressed_pair_imp > = {
+ __first_ = 1
+ }
+ }
+ }*/
+
+bool lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::Update() {
+  m_children.clear();
+  ValueObjectSP valobj_sp = m_backend.GetSP();
+  if (!valobj_sp)
+return false;
+  m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
+  ValueObjectSP size_sp(
+  valobj_sp->GetChildMemberWithName(ConstString("__size_"), true));
+  if (!size_sp)
+return false;
+  m_count = size_sp->GetValueAsUnsigned(0);
+  if (!m_count)
+return tru

[Lldb-commits] [PATCH] D31882: Fix the libc++ std::vector data formatter

2017-04-10 Thread Tamas Berghammer via Phabricator via lldb-commits
tberghammer created this revision.
Herald added a reviewer: EricWF.

Fix the libc++ std::vector data formatter

Previously we randomly triggered either the std::vector<...> or the
std::vector data formatter causing an issue when the former got
triggered for an std::vector.

This change moves the logic to decide which one to trigger from the
regular expression used to register the formatter into the formatter
creation logic as the former had no way to specify precedence.

Bug: llvm.org/pr32553


https://reviews.llvm.org/D31882

Files:
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.h
  source/Plugins/Language/CPlusPlus/LibCxxVector.cpp

Index: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
===
--- source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
+++ source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
@@ -23,6 +23,7 @@
 
 namespace lldb_private {
 namespace formatters {
+namespace {
 class LibcxxStdVectorSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
 public:
   LibcxxStdVectorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
@@ -45,6 +46,29 @@
   CompilerType m_element_type;
   uint32_t m_element_size;
 };
+
+class LibcxxStdVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
+public:
+  LibcxxStdVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
+
+  size_t CalculateNumChildren() override;
+
+  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
+
+  bool Update() override;
+
+  bool MightHaveChildren() override;
+
+  size_t GetIndexOfChildWithName(const ConstString &name) override;
+
+private:
+  CompilerType m_bool_type;
+  ExecutionContextRef m_exe_ctx_ref;
+  uint64_t m_count;
+  lldb::addr_t m_base_data_address;
+  std::map m_children;
+};
+} // anonymous namespace
 } // namespace formatters
 } // namespace lldb_private
 
@@ -133,9 +157,129 @@
   return ExtractIndexFromString(name.GetCString());
 }
 
+lldb_private::formatters::LibcxxStdVectorBoolSyntheticFrontEnd::
+LibcxxStdVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
+: SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(),
+  m_count(0), m_base_data_address(0), m_children() {
+  if (valobj_sp) {
+Update();
+m_bool_type =
+valobj_sp->GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeBool);
+  }
+}
+
+size_t lldb_private::formatters::LibcxxStdVectorBoolSyntheticFrontEnd::
+CalculateNumChildren() {
+  return m_count;
+}
+
+lldb::ValueObjectSP
+lldb_private::formatters::LibcxxStdVectorBoolSyntheticFrontEnd::GetChildAtIndex(
+size_t idx) {
+  auto iter = m_children.find(idx), end = m_children.end();
+  if (iter != end)
+return iter->second;
+  if (idx >= m_count)
+return ValueObjectSP();
+  if (m_base_data_address == 0 || m_count == 0)
+return ValueObjectSP();
+  if (!m_bool_type)
+return ValueObjectSP();
+  size_t byte_idx = (idx >> 3); // divide by 8 to get byte index
+  size_t bit_index = (idx & 7); // efficient idx % 8 for bit index
+  lldb::addr_t byte_location = m_base_data_address + byte_idx;
+  ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
+  if (!process_sp)
+return ValueObjectSP();
+  uint8_t byte = 0;
+  Error err;
+  size_t bytes_read = process_sp->ReadMemory(byte_location, &byte, 1, err);
+  if (err.Fail() || bytes_read == 0)
+return ValueObjectSP();
+  bool bit_set = ((byte & (1 << bit_index)) != 0);
+  DataBufferSP buffer_sp(
+  new DataBufferHeap(m_bool_type.GetByteSize(nullptr), 0));
+  if (bit_set && buffer_sp && buffer_sp->GetBytes()) {
+// regardless of endianness, anything non-zero is true
+*(buffer_sp->GetBytes()) = 1;
+  }
+  StreamString name;
+  name.Printf("[%" PRIu64 "]", (uint64_t)idx);
+  ValueObjectSP retval_sp(CreateValueObjectFromData(
+  name.GetString(), DataExtractor(buffer_sp, process_sp->GetByteOrder(),
+  process_sp->GetAddressByteSize()),
+  m_exe_ctx_ref, m_bool_type));
+  if (retval_sp)
+m_children[idx] = retval_sp;
+  return retval_sp;
+}
+
+/*(std::__1::vector >) vBool = {
+ __begin_ = 0x0001001000e0
+ __size_ = 56
+ __cap_alloc_ = {
+ std::__1::__libcpp_compressed_pair_imp > = {
+ __first_ = 1
+ }
+ }
+ }*/
+
+bool lldb_private::formatters::LibcxxStdVectorBoolSyntheticFrontEnd::Update() {
+  m_children.clear();
+  ValueObjectSP valobj_sp = m_backend.GetSP();
+  if (!valobj_sp)
+return false;
+  m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
+  ValueObjectSP size_sp(
+  valobj_sp->GetChildMemberWithName(ConstString("__size_"), true));
+  if (!size_sp)
+return false;
+  m_count = size_sp->GetValueAsUnsigned(0);
+  if (!m_count)
+return true;
+  ValueObjectSP begin_sp(
+  valobj_sp->GetChildMemberWit

[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

For the reference, I uploaded FreeBSD/amd64 and OpenBSD/i386 core(5) files:

http://netbsd.org/~kamil/lldb/freebsd.10.3.release.p11-top.core.93102
http://netbsd.org/~kamil/lldb/openbsd.6.0-top.core


Repository:
  rL LLVM

https://reviews.llvm.org/D31825



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


[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)

2017-04-10 Thread Tamas Berghammer via Phabricator via lldb-commits
tberghammer added a comment.

The previous version of the data formatter was triggering for 
std::vector> as well. Jason, do you know why was it the 
case? Do we need that functionality because of a broken compiler version or can 
it be removed?

Note: I added a few comments about the data formatter itself but feel free to 
ignore them if you want to keep this change small.




Comment at: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp:52-53
+  LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
+
+  ~LibcxxVectorBoolSyntheticFrontEnd() override = default;
+

Not needed



Comment at: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp:201-228
+  switch (bit_index) {
+  case 0:
+mask = 1;
+break;
+  case 1:
+mask = 2;
+break;

This switch seems silly. You can just replace it with "mask = (1 << bit_index)"



Comment at: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp:233-234
+  if (bit_set && buffer_sp && buffer_sp->GetBytes())
+*(buffer_sp->GetBytes()) =
+1; // regardless of endianness, anything non-zero is true
+  StreamString name;

I think the formatting here makes the code pretty hard to read



Comment at: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp:301-304
+  TypeImpl type = valobj_sp->GetTypeImpl();
+  if (!type.IsValid())
+return nullptr;
+  CompilerType compiler_type = type.GetCompilerType(false);

Is there a reason you are not using ValueObject::GetCompilerType()?


https://reviews.llvm.org/D31880



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


[Lldb-commits] [PATCH] D31882: Fix the libc++ std::vector data formatter

2017-04-10 Thread Tamas Berghammer via Phabricator via lldb-commits
tberghammer abandoned this revision.
tberghammer added a comment.

Pavel created a separate fix as https://reviews.llvm.org/D31880. Abandoning 
this one.


https://reviews.llvm.org/D31882



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


[Lldb-commits] [PATCH] D31880: Fix libc++ vector data formatter (bug #32553)

2017-04-10 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 94667.
labath added a comment.

Remove the vector summary provider as well (picked up from Tamas's 
version of the patch).


https://reviews.llvm.org/D31880

Files:
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.h
  source/Plugins/Language/CPlusPlus/LibCxxVector.cpp

Index: source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
===
--- source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
+++ source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
@@ -45,6 +45,31 @@
   CompilerType m_element_type;
   uint32_t m_element_size;
 };
+
+class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
+public:
+  LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp);
+
+  ~LibcxxVectorBoolSyntheticFrontEnd() override = default;
+
+  size_t CalculateNumChildren() override;
+
+  lldb::ValueObjectSP GetChildAtIndex(size_t idx) override;
+
+  bool Update() override;
+
+  bool MightHaveChildren() override { return true; }
+
+  size_t GetIndexOfChildWithName(const ConstString &name) override;
+
+private:
+  CompilerType m_bool_type;
+  ExecutionContextRef m_exe_ctx_ref;
+  uint64_t m_count;
+  lldb::addr_t m_base_data_address;
+  std::map m_children;
+};
+
 } // namespace formatters
 } // namespace lldb_private
 
@@ -133,9 +158,155 @@
   return ExtractIndexFromString(name.GetCString());
 }
 
+lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
+LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
+: SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(),
+  m_count(0), m_base_data_address(0), m_children() {
+  if (valobj_sp) {
+Update();
+m_bool_type =
+valobj_sp->GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeBool);
+  }
+}
+
+size_t lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
+CalculateNumChildren() {
+  return m_count;
+}
+
+lldb::ValueObjectSP
+lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::GetChildAtIndex(
+size_t idx) {
+  auto iter = m_children.find(idx), end = m_children.end();
+  if (iter != end)
+return iter->second;
+  if (idx >= m_count)
+return ValueObjectSP();
+  if (m_base_data_address == 0 || m_count == 0)
+return ValueObjectSP();
+  if (!m_bool_type)
+return ValueObjectSP();
+  size_t byte_idx = (idx >> 3); // divide by 8 to get byte index
+  size_t bit_index = (idx & 7); // efficient idx % 8 for bit index
+  lldb::addr_t byte_location = m_base_data_address + byte_idx;
+  ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
+  if (!process_sp)
+return ValueObjectSP();
+  uint8_t byte = 0;
+  uint8_t mask = 0;
+  Error err;
+  size_t bytes_read = process_sp->ReadMemory(byte_location, &byte, 1, err);
+  if (err.Fail() || bytes_read == 0)
+return ValueObjectSP();
+  switch (bit_index) {
+  case 0:
+mask = 1;
+break;
+  case 1:
+mask = 2;
+break;
+  case 2:
+mask = 4;
+break;
+  case 3:
+mask = 8;
+break;
+  case 4:
+mask = 16;
+break;
+  case 5:
+mask = 32;
+break;
+  case 6:
+mask = 64;
+break;
+  case 7:
+mask = 128;
+break;
+  default:
+return ValueObjectSP();
+  }
+  bool bit_set = ((byte & mask) != 0);
+  DataBufferSP buffer_sp(
+  new DataBufferHeap(m_bool_type.GetByteSize(nullptr), 0));
+  if (bit_set && buffer_sp && buffer_sp->GetBytes())
+*(buffer_sp->GetBytes()) =
+1; // regardless of endianness, anything non-zero is true
+  StreamString name;
+  name.Printf("[%" PRIu64 "]", (uint64_t)idx);
+  ValueObjectSP retval_sp(CreateValueObjectFromData(
+  name.GetString(),
+  DataExtractor(buffer_sp, process_sp->GetByteOrder(),
+process_sp->GetAddressByteSize()),
+  m_exe_ctx_ref, m_bool_type));
+  if (retval_sp)
+m_children[idx] = retval_sp;
+  return retval_sp;
+}
+
+/*(std::__1::vector >) vBool = {
+ __begin_ = 0x0001001000e0
+ __size_ = 56
+ __cap_alloc_ = {
+ std::__1::__libcpp_compressed_pair_imp > = {
+ __first_ = 1
+ }
+ }
+ }*/
+
+bool lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::Update() {
+  m_children.clear();
+  ValueObjectSP valobj_sp = m_backend.GetSP();
+  if (!valobj_sp)
+return false;
+  m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
+  ValueObjectSP size_sp(
+  valobj_sp->GetChildMemberWithName(ConstString("__size_"), true));
+  if (!size_sp)
+return false;
+  m_count = size_sp->GetValueAsUnsigned(0);
+  if (!m_count)
+return true;
+  ValueObjectSP begin_sp(
+  valobj_sp->GetChildMemberWithName(ConstString("__begin_"), true));
+  if (!begin_sp) {
+m_count = 0;
+return false;
+  }
+  m_base_data_address = begin_sp->GetValueAsUnsigned(0);
+  if (!m

[Lldb-commits] [PATCH] D31877: Remove Plugins/Process/POSIX from include_directories

2017-04-10 Thread Eugene Zemtsov via Phabricator via lldb-commits
eugene accepted this revision.
eugene added a comment.
This revision is now accepted and ready to land.

Thanks for doing it. IMO we should always strive to use "absolute" path for all 
headers.


https://reviews.llvm.org/D31877



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


[Lldb-commits] [PATCH] D31877: Remove Plugins/Process/POSIX from include_directories

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Thank you for working on it!


https://reviews.llvm.org/D31877



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


[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP

2017-04-10 Thread Chris Bieneman via Phabricator via lldb-commits
beanz created this revision.
Herald added a subscriber: emaste.

This patch adds IPv6 support to LLDB/Host's TCP socket implementation. 
Supporting IPv6 involved a few significant changes to the implementation of the 
socket layers, and I have performed some significant code cleanup along the way.

This patch changes the Socket constructors for all types of sockets to not 
create sockets until first use. This is required for IPv6 support because the 
socket type will vary based on the address you are connecting to. This also has 
the benefit of removing code that could have errors from the Socket subclass 
constructors (which seems like a win to me).

The patch also slightly changes the API and behaviors of the Listen/Accept 
pattern. Previously both Listen and Accept calls took an address specified as a 
string. Now only listen does. This change was made because the Listen call can 
result in opening more than one socket. In order to support listening for both 
IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 
socket. During the listen call we construct a map of file descriptors to addrin 
structures which represent the allowable incoming connection address. This map 
removes the need for taking an address into the Accept call.

This does have a change in functionality. Previously you could Listen for 
connections based on one address, and Accept connections from a different 
address. This is no longer supported. I could not find anywhere in LLDB where 
we actually used the APIs in that way. The new API does still support AnyAddr 
for allowing incoming connections from any address.

The Listen implementation is implemented using kqueue on FreeBSD and Darwin, 
WSAPoll on Windows and poll(2) everywhere else.


https://reviews.llvm.org/D31823

Files:
  include/lldb/Host/Socket.h
  include/lldb/Host/common/TCPSocket.h
  include/lldb/Host/common/UDPSocket.h
  include/lldb/Host/freebsd/Config.h
  include/lldb/Host/linux/AbstractSocket.h
  include/lldb/Host/macosx/Config.h
  include/lldb/Host/posix/DomainSocket.h
  source/Host/common/Socket.cpp
  source/Host/common/TCPSocket.cpp
  source/Host/common/UDPSocket.cpp
  source/Host/linux/AbstractSocket.cpp
  source/Host/posix/ConnectionFileDescriptorPosix.cpp
  source/Host/posix/DomainSocket.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  tools/lldb-server/Acceptor.cpp
  unittests/Host/SocketTest.cpp
  unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp

Index: unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
===
--- unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
+++ unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
@@ -33,15 +33,14 @@
 void Connect(GDBRemoteCommunication &client, GDBRemoteCommunication &server) {
   bool child_processes_inherit = false;
   Error error;
-  TCPSocket listen_socket(child_processes_inherit, error);
+  TCPSocket listen_socket(true, child_processes_inherit);
   ASSERT_FALSE(error.Fail());
   error = listen_socket.Listen("127.0.0.1:0", 5);
   ASSERT_FALSE(error.Fail());
 
   Socket *accept_socket;
   std::future accept_error = std::async(std::launch::async, [&] {
-return listen_socket.Accept("127.0.0.1:0", child_processes_inherit,
-accept_socket);
+return listen_socket.Accept(accept_socket);
   });
 
   char connect_remote_address[64];
Index: unittests/Host/SocketTest.cpp
===
--- unittests/Host/SocketTest.cpp
+++ unittests/Host/SocketTest.cpp
@@ -44,8 +44,7 @@
const char *listen_remote_address,
bool child_processes_inherit, Socket **accept_socket,
Error *error) {
-*error = listen_socket->Accept(listen_remote_address,
-   child_processes_inherit, *accept_socket);
+*error = listen_socket->Accept(*accept_socket);
   }
 
   template 
@@ -56,7 +55,7 @@
 bool child_processes_inherit = false;
 Error error;
 std::unique_ptr listen_socket_up(
-new SocketType(child_processes_inherit, error));
+new SocketType(true, child_processes_inherit));
 EXPECT_FALSE(error.Fail());
 error = listen_socket_up->Listen(listen_remote_address, 5);
 EXPECT_FALSE(error.Fail());
@@ -70,7 +69,7 @@
 
 std::string connect_remote_address = get_connect_addr(*listen_socket_up);
 std::unique_ptr connect_socket_up(
-new SocketType(child_processes_inherit, error));
+new SocketType(true, child_processes_inherit));
 EXPECT_FALSE(error.Fail());
 error = connect_socket_up->Connect(connect_remote_address);
 EXPECT_FALSE(error.Fail());
@@ -141,6 +140,20 @@
   EXPECT_STREQ("65535", port_str.c_str());
   EXPECT_EQ(65535, port);
   EXPECT_TRUE(error.Success());
+
+  EXPECT_TRUE(
+  Socket::DecodeHostAndPort("[::1]:12345", host_str, port_str, port, &error));
+

[Lldb-commits] [PATCH] D31824: Update DebugServer to support IPv6 over TCP

2017-04-10 Thread Chris Bieneman via Phabricator via lldb-commits
beanz created this revision.
Herald added a subscriber: mgorny.

This patch adds IPv6 support to debugserver. It follows a similar pattern to 
the changes proposed for LLDB/Host except that the listen implementation is 
only with kqueue(2) because debugserver is only supported on Darwin.


https://reviews.llvm.org/D31824

Files:
  tools/debugserver/debugserver.xcodeproj/project.pbxproj
  tools/debugserver/source/CMakeLists.txt
  tools/debugserver/source/RNBSocket.cpp
  tools/debugserver/source/debugserver.cpp
  unittests/debugserver/RNBSocketTest.cpp

Index: unittests/debugserver/RNBSocketTest.cpp
===
--- unittests/debugserver/RNBSocketTest.cpp
+++ unittests/debugserver/RNBSocketTest.cpp
@@ -53,9 +53,20 @@
 }
 
 void TestSocketListen(const char *addr) {
+  // Skip IPv6 tests if there isn't a valid interafce
+  auto addresses = lldb_private::SocketAddress::GetAddressInfo(addr, NULL);
+  if (addresses.size() == 0)
+return;
+
+  char addr_wrap[256];
+  if (addresses.front().GetFamily() == AF_INET6)
+sprintf(addr_wrap, "[%s]", addr);
+  else
+sprintf(addr_wrap, "%s", addr);
+
   RNBSocket server_socket;
   auto result =
-  server_socket.Listen(addr, 0, ServerCallbackv4, (const void *)addr);
+  server_socket.Listen(addr, 0, ServerCallbackv4, (const void *)addr_wrap);
   ASSERT_TRUE(result == rnb_success);
   result = server_socket.Write(hello.c_str(), hello.length());
   ASSERT_TRUE(result == rnb_success);
@@ -71,9 +82,19 @@
 
 TEST(RNBSocket, LoopBackListenIPv4) { TestSocketListen("127.0.0.1"); }
 
+TEST(RNBSocket, LoopBackListenIPv6) { TestSocketListen("::1"); }
+
 void TestSocketConnect(const char *addr) {
+  // Skip IPv6 tests if there isn't a valid interafce
+  auto addresses = lldb_private::SocketAddress::GetAddressInfo(addr, NULL);
+  if (addresses.size() == 0)
+return;
+
   char addr_wrap[256];
-  sprintf(addr_wrap, "%s:0", addr);
+  if (addresses.front().GetFamily() == AF_INET6)
+sprintf(addr_wrap, "[%s]:0", addr);
+  else
+sprintf(addr_wrap, "%s:0", addr);
 
   Socket *server_socket;
   Predicate port_predicate;
@@ -131,3 +152,5 @@
 }
 
 TEST(RNBSocket, LoopBackConnectIPv4) { TestSocketConnect("127.0.0.1"); }
+
+TEST(RNBSocket, LoopBackConnectIPv6) { TestSocketConnect("::1"); }
Index: tools/debugserver/source/debugserver.cpp
===
--- tools/debugserver/source/debugserver.cpp
+++ tools/debugserver/source/debugserver.cpp
@@ -1345,10 +1345,16 @@
   show_usage_and_exit(1);
 }
 // accept 'localhost:' prefix on port number
-
-int items_scanned = ::sscanf(argv[0], "%[^:]:%i", str, &port);
-if (items_scanned == 2) {
-  host = str;
+std::string host_specifier = argv[0];
+auto colon_location = host_specifier.rfind(':');
+if (colon_location != std::string::npos) {
+  host = host_specifier.substr(0, colon_location);
+  std::string port_str =
+  host_specifier.substr(colon_location + 1, std::string::npos);
+  char *end_ptr;
+  port = strtoul(port_str.c_str(), &end_ptr, 0);
+  if (end_ptr < port_str.c_str() + port_str.size())
+show_usage_and_exit(2);
   DNBLogDebug("host = '%s'  port = %i", host.c_str(), port);
 } else {
   // No hostname means "localhost"
Index: tools/debugserver/source/RNBSocket.cpp
===
--- tools/debugserver/source/RNBSocket.cpp
+++ tools/debugserver/source/RNBSocket.cpp
@@ -17,10 +17,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+
+#include "lldb/Host/SocketAddress.h"
 
 #ifdef WITH_LOCKDOWN
 #include "lockdown.h"
@@ -66,176 +71,160 @@
   // Disconnect without saving errno
   Disconnect(false);
 
-  // Now figure out the hostname that will be attaching and palce it into
-  struct sockaddr_in listen_addr;
-  ::memset(&listen_addr, 0, sizeof listen_addr);
-  listen_addr.sin_len = sizeof listen_addr;
-  listen_addr.sin_family = AF_INET;
-  listen_addr.sin_port = htons(port);
-  listen_addr.sin_addr.s_addr = INADDR_ANY;
-
-  if (!ResolveIPV4HostName(listen_host, listen_addr.sin_addr.s_addr)) {
-DNBLogThreaded("error: failed to resolve connecting host '%s'",
-   listen_host);
+  DNBError err;
+  int queue_id = kqueue();
+  if (queue_id < 0) {
+err.SetError(errno, DNBError::MachKernel);
+err.LogThreaded("error: failed to create kqueue.");
 return rnb_err;
   }
 
-  DNBError err;
-  int listen_fd = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-  if (listen_fd == -1)
-err.SetError(errno, DNBError::POSIX);
+  std::map sockets;
+  auto addresses =
+  lldb_private::SocketAddress::GetAddressInfo(listen_host, NULL);
 
-  if (err.Fail() || DNBLogCheckLogBit(LOG_RNB_COMM))
-err.LogThreaded("::socket ( domain = AF_INET, type = SOCK_STREAM, protocol "
-"= IPPROTO_TCP ) => socket =

[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski created this revision.
krytarowski added a project: LLDB.

This change has been authored by Zachary Turner.

It fixes loading into the debugger core(5) files generated
by NetBSD x86_64 v. 7.99.67. These core(5) files have the
e_ident[EI_OSABI] property set to ELFOSABI_SYSV.

It might change in future versions to ELFOSABI_NETBSD.

However it still should not crash the debugger. With this
change applied, LLDB can be loaded properly with:

  `
  lldb -c ./core
  `


Repository:
  rL LLVM

https://reviews.llvm.org/D31825

Files:
  source/Core/ArchSpec.cpp
  source/Plugins/Process/elf-core/ProcessElfCore.cpp


Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp
===
--- source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -220,7 +220,7 @@
   target_arch.MergeFrom(core_arch);
   GetTarget().SetArchitecture(target_arch);
  
-  SetUnixSignals(UnixSignals::Create(GetArchitecture()));
+  SetUnixSignals(UnixSignals::Create(target_arch));
 
   // Ensure we found at least one thread that was stopped on a signal.
   bool siginfo_signal_found = false;
@@ -724,17 +724,7 @@
 }
 
 ArchSpec ProcessElfCore::GetArchitecture() {
-  ObjectFileELF *core_file =
-  (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
-  ArchSpec arch;
-  core_file->GetArchitecture(arch);
-
-  ArchSpec target_arch = GetTarget().GetArchitecture();
-  
-  if (target_arch.IsMIPS())
-return target_arch;
-
-  return arch;
+  return GetTarget().GetArchitecture();
 }
 
 const lldb::DataBufferSP ProcessElfCore::GetAuxvData() {
Index: source/Core/ArchSpec.cpp
===
--- source/Core/ArchSpec.cpp
+++ source/Core/ArchSpec.cpp
@@ -989,29 +989,34 @@
 }
 
 void ArchSpec::MergeFrom(const ArchSpec &other) {
-  if (TripleVendorIsUnspecifiedUnknown() &&
-  !other.TripleVendorIsUnspecifiedUnknown())
-GetTriple().setVendor(other.GetTriple().getVendor());
-  if (TripleOSIsUnspecifiedUnknown() && !other.TripleOSIsUnspecifiedUnknown())
-GetTriple().setOS(other.GetTriple().getOS());
-  if (GetTriple().getArch() == llvm::Triple::UnknownArch)
-GetTriple().setArch(other.GetTriple().getArch());
-  if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
-  !TripleVendorWasSpecified()) {
-if (other.TripleVendorWasSpecified())
-  GetTriple().setEnvironment(other.GetTriple().getEnvironment());
-  }
   // If this and other are both arm ArchSpecs and this ArchSpec is a generic
-  // "some kind of arm"
-  // spec but the other ArchSpec is a specific arm core, adopt the specific arm
-  // core.
+  // "some kind of arm" spec but the other ArchSpec is a specific arm core, 
adopt
+  // the specific arm core.
+  bool ShouldOverrideCore = false;
+
+  if (GetCore() == ArchSpec::kCore_invalid && other.GetCore() != 
ArchSpec::kCore_invalid)
+ShouldOverrideCore = true;
   if (GetTriple().getArch() == llvm::Triple::arm &&
-  other.GetTriple().getArch() == llvm::Triple::arm &&
-  IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic &&
-  other.GetCore() != ArchSpec::eCore_arm_generic) {
+other.GetTriple().getArch() == llvm::Triple::arm &&
+IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic &&
+other.GetCore() != ArchSpec::eCore_arm_generic)
+ShouldOverrideCore = true;
+  if (ShouldOverrideCore) {
 m_core = other.GetCore();
 CoreUpdated(true);
   }
+
+  if (GetTriple().getVendor() == llvm::Triple::UnknownVendor)
+GetTriple().setVendor(other.GetTriple().getVendor());
+
+  if (GetTriple().getOS() == llvm::Triple::UnknownOS)
+GetTriple().setOS(other.GetTriple().getOS());
+
+  if (GetTriple().getArch() == llvm::Triple::UnknownArch)
+GetTriple().setArch(other.GetTriple().getArch());
+
+  if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment)
+GetTriple().setEnvironment(other.GetTriple().getEnvironment());
 }
 
 bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,


Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp
===
--- source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -220,7 +220,7 @@
   target_arch.MergeFrom(core_arch);
   GetTarget().SetArchitecture(target_arch);
  
-  SetUnixSignals(UnixSignals::Create(GetArchitecture()));
+  SetUnixSignals(UnixSignals::Create(target_arch));
 
   // Ensure we found at least one thread that was stopped on a signal.
   bool siginfo_signal_found = false;
@@ -724,17 +724,7 @@
 }
 
 ArchSpec ProcessElfCore::GetArchitecture() {
-  ObjectFileELF *core_file =
-  (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
-  ArchSpec arch;
-  core_file->GetArchitecture(arch);
-
-  ArchSpec target_arch = GetTarget().GetArchitecture();
-  
-  if (target_arch.IsMIPS())
-retur

[Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-10 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Example core(5) file:
http://netbsd.org/~kamil/lldb/top.core

Generated with gcore(1), which snapshoted a running top(1) program.


Repository:
  rL LLVM

https://reviews.llvm.org/D31825



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


Re: [Lldb-commits] [lldb] r294019 - Push down more common code into PlatformPOSIX

2017-04-10 Thread Geoff Berry via lldb-commits

Hans,

Sorry for the confusion, but this isn't the change I was referring to.  
I included the phabricator review numbers in my original message, not 
svn commit numbers.



On 2/3/2017 4:54 PM, Hans Wennborg wrote:

Geoff asked for this to be merged to 4.0. It looks like a nice change,
but I'm a little hesitant since it doesn't look like it's fixing a
regression. Pavel, what do you think?

On Fri, Feb 3, 2017 at 9:42 AM, Pavel Labath via lldb-commits
 wrote:

Author: labath
Date: Fri Feb  3 11:42:04 2017
New Revision: 294019

URL: http://llvm.org/viewvc/llvm-project?rev=294019&view=rev
Log:
Push down more common code into PlatformPOSIX

Summary:
- GetFileWithUUID: All platforms except PlatformDarwin had this.
However, I see no reason why this code would not apply there as well.

- GetProcessInfo, FindProcesses: The implementation was the same in all classes.

- GetFullNameForDylib: This code should apply to all non-darwin
platforms. I've kept the PlatformDarwin override as the situation is
different there.

Reviewers: clayborg, krytarowski, emaste

Subscribers: lldb-commits

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


--
Geoff Berry
Employee of Qualcomm Datacenter Technologies, Inc.
 Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm 
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the Code Aurora 
Forum, a Linux Foundation Collaborative Project.

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


[Lldb-commits] [lldb] r299898 - Update for alloca construction changes

2017-04-10 Thread Matt Arsenault via lldb-commits
Author: arsenm
Date: Mon Apr 10 18:27:53 2017
New Revision: 299898

URL: http://llvm.org/viewvc/llvm-project?rev=299898&view=rev
Log:
Update for alloca construction changes

Modified:

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

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp?rev=299898&r1=299897&r2=299898&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
 Mon Apr 10 18:27:53 2017
@@ -182,8 +182,10 @@ bool fixupX86StructRetCalls(llvm::Module
 // we pass a pointer to this allocation as the StructRet param, and then
 // copy its
 // value into the lldb return value
+const llvm::DataLayout &DL = module.getDataLayout();
 llvm::AllocaInst *return_value_alloc = new llvm::AllocaInst(
-func->getReturnType(), "var_vector_return_alloc", call_inst);
+  func->getReturnType(), DL.getAllocaAddrSpace(), 
"var_vector_return_alloc",
+  call_inst);
 // use the new allocation as the new first argument
 new_call_args.emplace(new_call_args.begin(),
   llvm::cast(return_value_alloc));
@@ -194,7 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module
 llvm::Instruction::BitCast, func, new_func_ptr_type);
 // create an allocation for a new function pointer
 llvm::AllocaInst *new_func_ptr =
-new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst);
+new llvm::AllocaInst(new_func_ptr_type, DL.getAllocaAddrSpace(),
+ "new_func_ptr", call_inst);
 // store the new_func_cast to the newly allocated space
 (new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst))
 ->setName("new_func_ptr_load_cast");


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


[Lldb-commits] [lldb] r299845 - [lldb] Fix ninja URL

2017-04-10 Thread Shoaib Meenai via lldb-commits
Author: smeenai
Date: Mon Apr 10 10:41:15 2017
New Revision: 299845

URL: http://llvm.org/viewvc/llvm-project?rev=299845&view=rev
Log:
[lldb] Fix ninja URL

The old URL is a 404 now. Pointed out by Smirftsch1 on IRC.

Modified:
lldb/trunk/www/build.html

Modified: lldb/trunk/www/build.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/build.html?rev=299845&r1=299844&r2=299845&view=diff
==
--- lldb/trunk/www/build.html (original)
+++ lldb/trunk/www/build.html Mon Apr 10 10:41:15 2017
@@ -62,7 +62,7 @@
 versions of Python can be made to work by compiling your own 
distribution from source,
 but this workflow is unsupported and you are own your own.
   
-  http://martine.github.io/ninja/";>Ninja build 
tool (strongly recommended)
+  https://ninja-build.org/";>Ninja build tool 
(strongly recommended)
   http://gnuwin32.sourceforge.net/";>GnuWin32
   http://www.swig.org/download.html";>SWIG for Windows 
(version 3+)
 


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


Re: [Lldb-commits] [lldb] r296925 - Fix Darwin failures introduced in r296909

2017-04-10 Thread Tim Hammerquist via lldb-commits
Hi Zachary!

Thank you for your prompt attention!

I notice you added DumpHexBytes() back, but Dump() is still missing. Was Dump() 
slated for a later patch?

-Tim

> On 3 Mar 2017, at 15:48, Zachary Turner  wrote:
> 
> Yea, it was a static method of DataExtractor before.  I noticed the same 
> thing when i saw it wasn't using any methods of DataExtractor.  Oops!  Anyway 
> since this is no less weird than before I'll leave it this way for now until 
> we figure out something better.
> 
> On Fri, Mar 3, 2017 at 3:46 PM Jim Ingham  > wrote:
> Yeah, looks like you need to keep DumpHexBytes in DumpDataExtractor.  That's 
> a little weird because it doesn't actually take a DataExtractor, but...
> 
> Jim
> 
> > On Mar 3, 2017, at 3:45 PM, Zachary Turner via lldb-commits 
> > mailto:lldb-commits@lists.llvm.org>> wrote:
> >
> > I can fix that, I didn't see it in my tests because it doesn't compile that 
> > file on Windows.  I'll get a fix in shortly.
> >
> > On Fri, Mar 3, 2017 at 3:38 PM Tim Hammerquist  > > wrote:
> > Sure, Zachary. I try to step in when I can.
> >
> > Now that you mention it, your r296910 (DumpDataExtractor) patch is breaking 
> > building CommunicationKDP.cpp in MacOSX-Kernel. Namely, the removal of 
> > Dump/DumpHexBytes from DataExtractor. I've coordinated with the Apple LLDB 
> > team on how they want to follow up on that, but they might want to reach 
> > out to you about it.
> >
> > -Tim
> >
> >> On 3 Mar 2017, at 15:33, Zachary Turner  >> > wrote:
> >>
> >> Thanks Tim!
> >>
> >> I have a few more file moves coming up as well, sorry for the trouble!
> >>
> >> On Fri, Mar 3, 2017 at 3:29 PM Tim Hammerquist via lldb-commits 
> >> mailto:lldb-commits@lists.llvm.org>> wrote:
> >> Author: penryu
> >> Date: Fri Mar  3 17:17:29 2017
> >> New Revision: 296925
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=296925&view=rev 
> >> 
> >> Log:
> >> Fix Darwin failures introduced in r296909
> >>
> >> Modified:
> >> lldb/trunk/lldb.xcodeproj/project.pbxproj
> >>
> >> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> >> URL: 
> >> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=296925&r1=296924&r2=296925&view=diff
> >>  
> >> 
> >> ==
> >> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> >> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Mar  3 17:17:29 2017
> >> @@ -2052,7 +2052,7 @@
> >> 26BC7D6310F1B77400F91463 /* FileSpecList.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = FileSpecList.h; path = include/lldb/Core/FileSpecList.h; sourceTree 
> >> = ""; };
> >> 26BC7D6510F1B77400F91463 /* IOStreamMacros.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = IOStreamMacros.h; path = include/lldb/Core/IOStreamMacros.h; 
> >> sourceTree = ""; };
> >> 26BC7D6710F1B77400F91463 /* Listener.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = Listener.h; path = include/lldb/Core/Listener.h; sourceTree = 
> >> ""; };
> >> -   26BC7D6810F1B77400F91463 /* Log.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = Log.h; path = include/lldb/Core/Log.h; sourceTree = ""; };
> >> +   26BC7D6810F1B77400F91463 /* Log.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = Log.h; path = include/lldb/Utility/Log.h; sourceTree = ""; };
> >> 26BC7D6910F1B77400F91463 /* Mangled.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = Mangled.h; path = include/lldb/Core/Mangled.h; sourceTree = 
> >> ""; };
> >> 26BC7D6A10F1B77400F91463 /* Module.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = Module.h; path = include/lldb/Core/Module.h; sourceTree = 
> >> ""; };
> >> 26BC7D6B10F1B77400F91463 /* ModuleChild.h */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
> >> name = ModuleChild.h; path = include/lldb/Core/ModuleChild.h; sourceTree = 
> >> ""; };
> >> @@ -2139,7 +2139,7 @@
> >> 26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = 
> >> PBXFileReference; fileEncoding = 4; lastKnownFileType = 
> >> sourcecode.cpp.cpp; name = Event.cpp; path = source/Core/Event.cpp; 
> >> sourceTree = ""; };
> >> 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = 
> >> PBXFileReference; fileEncoding =

Re: [Lldb-commits] [lldb] r296925 - Fix Darwin failures introduced in r296909

2017-04-10 Thread Tim Hammerquist via lldb-commits
Sure, Zachary. I try to step in when I can.

Now that you mention it, your r296910 (DumpDataExtractor) patch is breaking 
building CommunicationKDP.cpp in MacOSX-Kernel. Namely, the removal of 
Dump/DumpHexBytes from DataExtractor. I've coordinated with the Apple LLDB team 
on how they want to follow up on that, but they might want to reach out to you 
about it.

-Tim

> On 3 Mar 2017, at 15:33, Zachary Turner  wrote:
> 
> Thanks Tim!
> 
> I have a few more file moves coming up as well, sorry for the trouble!
> 
> On Fri, Mar 3, 2017 at 3:29 PM Tim Hammerquist via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: penryu
> Date: Fri Mar  3 17:17:29 2017
> New Revision: 296925
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=296925&view=rev 
> 
> Log:
> Fix Darwin failures introduced in r296909
> 
> Modified:
> lldb/trunk/lldb.xcodeproj/project.pbxproj
> 
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=296925&r1=296924&r2=296925&view=diff
>  
> 
> ==
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Mar  3 17:17:29 2017
> @@ -2052,7 +2052,7 @@
> 26BC7D6310F1B77400F91463 /* FileSpecList.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = FileSpecList.h; path = include/lldb/Core/FileSpecList.h; sourceTree = 
> ""; };
> 26BC7D6510F1B77400F91463 /* IOStreamMacros.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = IOStreamMacros.h; path = include/lldb/Core/IOStreamMacros.h; sourceTree = 
> ""; };
> 26BC7D6710F1B77400F91463 /* Listener.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = Listener.h; path = include/lldb/Core/Listener.h; sourceTree = ""; };
> -   26BC7D6810F1B77400F91463 /* Log.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = Log.h; path = include/lldb/Core/Log.h; sourceTree = ""; };
> +   26BC7D6810F1B77400F91463 /* Log.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = Log.h; path = include/lldb/Utility/Log.h; sourceTree = ""; };
> 26BC7D6910F1B77400F91463 /* Mangled.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = Mangled.h; path = include/lldb/Core/Mangled.h; sourceTree = ""; };
> 26BC7D6A10F1B77400F91463 /* Module.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = Module.h; path = include/lldb/Core/Module.h; sourceTree = ""; };
> 26BC7D6B10F1B77400F91463 /* ModuleChild.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = ModuleChild.h; path = include/lldb/Core/ModuleChild.h; sourceTree = 
> ""; };
> @@ -2139,7 +2139,7 @@
> 26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Event.cpp; path = source/Core/Event.cpp; sourceTree = ""; };
> 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = FileSpecList.cpp; path = source/Core/FileSpecList.cpp; sourceTree = 
> ""; };
> 26BC7E7E10F1B85900F91463 /* Listener.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Listener.cpp; path = source/Core/Listener.cpp; sourceTree = ""; 
> };
> -   26BC7E7F10F1B85900F91463 /* Log.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Log.cpp; path = source/Core/Log.cpp; sourceTree = ""; };
> +   26BC7E7F10F1B85900F91463 /* Log.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Log.cpp; path = source/Utility/Log.cpp; sourceTree = ""; };
> 26BC7E8010F1B85900F91463 /* Mangled.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Mangled.cpp; path = source/Core/Mangled.cpp; sourceTree = ""; };
> 26BC7E8110F1B85900F91463 /* Module.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = Module.cpp; path = source/Core/Module.cpp; sourceTree = ""; };
> 26BC7E8210F1B85900F91463 /* ModuleChild.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnown