[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-16 Thread Pavel Labath via lldb-commits
labath added inline comments.



Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:224
+  // If all else fails force the first thread to be SIGSTOP
+  m_thread_data.begin()->signo = SIGSTOP;
+}

You should not use signal numbers from the host here -- the macro may not be 
present (windows), or it may not have the same value. You need to get the 
correct set of signals with Process::GetUnixSignals(), and then look up the 
signal by name.


https://reviews.llvm.org/D26676



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


[Lldb-commits] [PATCH] D26697: Remove Windows-specific minidump plugin

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

Cool.


https://reviews.llvm.org/D26697



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


[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-11-16 Thread Pavel Labath via lldb-commits
labath added a comment.

Yes, I'd like to do similar refactorings to other contexts as well.

I'll wait until next week so Ed can give this a shot -- I am busy with other 
stuff these days anyway.

Ed, if I may suggest, while you are playing with the arm machine, could you 
grab us a core file or two? It'd be great to be able to do a basic sanity check 
on these things without physical access.


https://reviews.llvm.org/D25947



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


[Lldb-commits] [lldb] r287095 - Fix printf warning I introduced in ModuleSpec.h

2016-11-16 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov 16 04:54:17 2016
New Revision: 287095

URL: http://llvm.org/viewvc/llvm-project?rev=287095&view=rev
Log:
Fix printf warning I introduced in ModuleSpec.h

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

Modified: lldb/trunk/include/lldb/Core/ModuleSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleSpec.h?rev=287095&r1=287094&r2=287095&view=diff
==
--- lldb/trunk/include/lldb/Core/ModuleSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ModuleSpec.h Wed Nov 16 04:54:17 2016
@@ -241,7 +241,7 @@ public:
   if (dumped_something)
 strm.PutCString(", ");
   strm.Printf("object_mod_time = 0x%" PRIx64,
-  llvm::sys::toTimeT(m_object_mod_time));
+  uint64_t(llvm::sys::toTimeT(m_object_mod_time)));
 }
   }
 


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


[Lldb-commits] [lldb] r287096 - Remove TimeValue class

2016-11-16 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov 16 04:54:22 2016
New Revision: 287096

URL: http://llvm.org/viewvc/llvm-project?rev=287096&view=rev
Log:
Remove TimeValue class

Summary:
All usages have been replaced by appropriate std::chrono funcionality, and the
class is now unused. The only used part of the cpp file is the DumpTimePoint
function, which I have moved into the only caller (CommandObjectTarget.cpp).

Reviewers: clayborg, zturner

Subscribers: mgorny, lldb-commits

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

Removed:
lldb/trunk/include/lldb/Host/TimeValue.h
lldb/trunk/source/Host/common/TimeValue.cpp
Modified:
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Host/CMakeLists.txt

Removed: lldb/trunk/include/lldb/Host/TimeValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/TimeValue.h?rev=287095&view=auto
==
--- lldb/trunk/include/lldb/Host/TimeValue.h (original)
+++ lldb/trunk/include/lldb/Host/TimeValue.h (removed)
@@ -1,112 +0,0 @@
-//===-- TimeValue.h -*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#ifndef liblldb_TimeValue_h_
-#define liblldb_TimeValue_h_
-
-#include "lldb/Host/PosixApi.h"
-
-#include "lldb/lldb-private.h"
-
-#include "llvm/Support/Chrono.h"
-
-#include 
-
-namespace lldb_private {
-
-void DumpTimePoint(llvm::sys::TimePoint<>, Stream &s, uint32_t width = 0);
-
-class TimeValue {
-public:
-  static const uint64_t MicroSecPerSec = 100UL;
-  static const uint64_t NanoSecPerSec = 10UL;
-  static const uint64_t NanoSecPerMicroSec = 1000U;
-  static const uint64_t NanoSecPerMilliSec = 100UL;
-
-  //--
-  // Constructors and Destructors
-  //--
-  TimeValue();
-  TimeValue(const TimeValue &rhs);
-  TimeValue(const struct timespec &ts);
-  explicit TimeValue(uint32_t seconds, uint64_t nanos = 0);
-  TimeValue(const llvm::sys::TimePoint<> point)
-  : m_nano_seconds(point.time_since_epoch().count()) {}
-  ~TimeValue();
-
-  //--
-  // Operators
-  //--
-  const TimeValue &operator=(const TimeValue &rhs);
-  operator llvm::sys::TimePoint<>() {
-return llvm::sys::TimePoint<>(std::chrono::nanoseconds(m_nano_seconds));
-  }
-
-  void Clear();
-
-  uint64_t GetAsNanoSecondsSinceJan1_1970() const;
-
-  uint64_t GetAsMicroSecondsSinceJan1_1970() const;
-
-  uint64_t GetAsSecondsSinceJan1_1970() const;
-
-  struct timespec GetAsTimeSpec() const;
-
-  bool IsValid() const;
-
-  void OffsetWithSeconds(uint64_t sec);
-
-  void OffsetWithMicroSeconds(uint64_t usec);
-
-  void OffsetWithNanoSeconds(uint64_t nsec);
-
-  static TimeValue Now();
-
-
-  /// Returns only the seconds component of the TimeValue. The nanoseconds
-  /// portion is ignored. No rounding is performed.
-  /// @brief Retrieve the seconds component
-  uint32_t seconds() const { return m_nano_seconds / NanoSecPerSec; }
-
-  /// Returns only the nanoseconds component of the TimeValue. The seconds
-  /// portion is ignored.
-  /// @brief Retrieve the nanoseconds component.
-  uint32_t nanoseconds() const { return m_nano_seconds % NanoSecPerSec; }
-
-  /// Returns only the fractional portion of the TimeValue rounded down to the
-  /// nearest microsecond (divide by one thousand).
-  /// @brief Retrieve the fractional part as microseconds;
-  uint32_t microseconds() const {
-return (m_nano_seconds % NanoSecPerSec) / NanoSecPerMicroSec;
-  }
-
-  /// Returns only the fractional portion of the TimeValue rounded down to the
-  /// nearest millisecond (divide by one million).
-  /// @brief Retrieve the milliseconds component;
-  uint32_t milliseconds() const { return m_nano_seconds / NanoSecPerMilliSec; }
-
-protected:
-  //--
-  // Classes that inherit from TimeValue can see and modify these
-  //--
-  uint64_t m_nano_seconds;
-};
-
-bool operator==(const TimeValue &lhs, const TimeValue &rhs);
-bool operator!=(const TimeValue &lhs, const TimeValue &rhs);
-bool operator<(const TimeValue &lhs, const TimeValue &rhs);
-bool operator<=(const TimeValue &lhs, const TimeValue &rhs);
-bool operator>(const TimeValue &lhs, const TimeValue &rhs);
-bool operator>=(const TimeValue &lhs, const TimeValue &rhs);
-
-uint64_t operator-(const TimeValue &

[Lldb-commits] [PATCH] D26451: Remove TimeValue class

2016-11-16 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287096: Remove TimeValue class (authored by labath).

Changed prior to commit:
  https://reviews.llvm.org/D26451?vs=77346&id=78159#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26451

Files:
  lldb/trunk/include/lldb/Host/TimeValue.h
  lldb/trunk/include/lldb/lldb-forward.h
  lldb/trunk/lldb.xcodeproj/project.pbxproj
  lldb/trunk/source/Commands/CommandObjectTarget.cpp
  lldb/trunk/source/Host/CMakeLists.txt
  lldb/trunk/source/Host/common/TimeValue.cpp

Index: lldb/trunk/source/Commands/CommandObjectTarget.cpp
===
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp
@@ -21,7 +21,6 @@
 #include "lldb/DataFormatters/ValueObjectPrinter.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Host/Symbols.h"
-#include "lldb/Host/TimeValue.h"
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
@@ -133,6 +132,25 @@
   return num_targets;
 }
 
+// TODO: Remove this once llvm can pretty-print time points
+static void DumpTimePoint(llvm::sys::TimePoint<> tp, Stream &s, uint32_t width) {
+#ifndef LLDB_DISABLE_POSIX
+  char time_buf[32];
+  time_t time = llvm::sys::toTimeT(tp);
+  char *time_cstr = ::ctime_r(&time, time_buf);
+  if (time_cstr) {
+char *newline = ::strpbrk(time_cstr, "\n\r");
+if (newline)
+  *newline = '\0';
+if (width > 0)
+  s.Printf("%-*s", width, time_cstr);
+else
+  s.PutCString(time_cstr);
+  } else if (width > 0)
+s.Printf("%-*s", width, "");
+#endif
+}
+
 #pragma mark CommandObjectTargetCreate
 
 //-
Index: lldb/trunk/source/Host/common/TimeValue.cpp
===
--- lldb/trunk/source/Host/common/TimeValue.cpp
+++ lldb/trunk/source/Host/common/TimeValue.cpp
@@ -1,155 +0,0 @@
-//===-- TimeValue.cpp ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "lldb/Host/TimeValue.h"
-#include "lldb/Host/Config.h"
-
-// C Includes
-#include 
-#include 
-#include 
-
-#ifdef _MSC_VER
-#include "lldb/Host/windows/windows.h"
-#endif
-
-// C++ Includes
-#include 
-
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/Stream.h"
-
-using namespace lldb_private;
-
-//--
-// TimeValue constructor
-//--
-TimeValue::TimeValue() : m_nano_seconds(0) {}
-
-//--
-// TimeValue copy constructor
-//--
-TimeValue::TimeValue(const TimeValue &rhs)
-: m_nano_seconds(rhs.m_nano_seconds) {}
-
-TimeValue::TimeValue(const struct timespec &ts)
-: m_nano_seconds((uint64_t)ts.tv_sec * NanoSecPerSec + ts.tv_nsec) {}
-
-TimeValue::TimeValue(uint32_t seconds, uint64_t nanos)
-: m_nano_seconds((uint64_t)seconds * NanoSecPerSec + nanos) {}
-
-//--
-// Destructor
-//--
-TimeValue::~TimeValue() {}
-
-uint64_t TimeValue::GetAsNanoSecondsSinceJan1_1970() const {
-  return m_nano_seconds;
-}
-
-uint64_t TimeValue::GetAsMicroSecondsSinceJan1_1970() const {
-  return m_nano_seconds / NanoSecPerMicroSec;
-}
-
-uint64_t TimeValue::GetAsSecondsSinceJan1_1970() const {
-  return m_nano_seconds / NanoSecPerSec;
-}
-
-struct timespec TimeValue::GetAsTimeSpec() const {
-  struct timespec ts;
-  ts.tv_sec = m_nano_seconds / NanoSecPerSec;
-  ts.tv_nsec = m_nano_seconds % NanoSecPerSec;
-  return ts;
-}
-
-void TimeValue::Clear() { m_nano_seconds = 0; }
-
-bool TimeValue::IsValid() const { return m_nano_seconds != 0; }
-
-void TimeValue::OffsetWithSeconds(uint64_t sec) {
-  m_nano_seconds += sec * NanoSecPerSec;
-}
-
-void TimeValue::OffsetWithMicroSeconds(uint64_t usec) {
-  m_nano_seconds += usec * NanoSecPerMicroSec;
-}
-
-void TimeValue::OffsetWithNanoSeconds(uint64_t nsec) { m_nano_seconds += nsec; }
-
-TimeValue TimeValue::Now() {
-  using namespace std::chrono;
-  auto now = system_clock::now();
-  auto ns_since_epoch =
-  duration_cast(now.time_since_epoch()).count();
-
-  return TimeValue(0, ns_since_epoch);
-}
-
-//--
-// TimeValue assignment operator
-//-

[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-16 Thread Howard Hellyer via lldb-commits
hhellyer updated this revision to Diff 78163.
hhellyer added a comment.

Update with fixes from review comments.
I've run clang-format, fixed the use of iterators and added const qualifiers.
I removed the use of the SIGSTOP constant and use GetUnixSignals instead.
I've also moved that block down a few lines until after SetUnixSignals has been 
called.

I will update the patch with the test cases shortly.


https://reviews.llvm.org/D26676

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h

Index: source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- source/Plugins/Process/elf-core/ThreadElfCore.h
+++ source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -82,6 +82,38 @@
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
   "sizeof ELFLinuxPrStatus is not correct!");
 
+struct ELFLinuxSigInfo {
+  int32_t si_signo;
+  int32_t si_code;
+  int32_t si_errno;
+
+  ELFLinuxSigInfo();
+
+  lldb_private::Error Parse(lldb_private::DataExtractor &data,
+const lldb_private::ArchSpec &arch);
+
+  // Return the bytesize of the structure
+  // 64 bit - just sizeof
+  // 32 bit - hardcoded because we are reusing the struct, but some of the
+  // members are smaller -
+  // so the layout is not the same
+  static size_t GetSize(const lldb_private::ArchSpec &arch) {
+switch (arch.GetCore()) {
+case lldb_private::ArchSpec::eCore_x86_64_x86_64:
+  return sizeof(ELFLinuxSigInfo);
+case lldb_private::ArchSpec::eCore_s390x_generic:
+case lldb_private::ArchSpec::eCore_x86_32_i386:
+case lldb_private::ArchSpec::eCore_x86_32_i486:
+  return 12;
+default:
+  return 0;
+}
+  }
+};
+
+static_assert(sizeof(ELFLinuxSigInfo) == 12,
+  "sizeof ELFLinuxSigInfo is not correct!");
+
 // PRPSINFO structure's size differs based on architecture.
 // This is the layout in the x86-64 arch case.
 // In the i386 case we parse it manually and fill it again
@@ -133,7 +165,8 @@
   lldb_private::DataExtractor fpregset;
   lldb_private::DataExtractor vregset;
   lldb::tid_t tid;
-  int signo;
+  int signo = 0;
+  int prstatus_sig = 0;
   std::string name;
 };
 
Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -320,3 +320,45 @@
 
   return error;
 }
+
+//
+// Parse SIGINFO from NOTE entry
+//
+ELFLinuxSigInfo::ELFLinuxSigInfo() {
+  memset(this, 0, sizeof(ELFLinuxSigInfo));
+}
+
+Error ELFLinuxSigInfo::Parse(DataExtractor &data, const ArchSpec &arch) {
+  Error error;
+  ByteOrder byteorder = data.GetByteOrder();
+  if (GetSize(arch) > data.GetByteSize()) {
+error.SetErrorStringWithFormat(
+"NT_SIGINFO size should be %zu, but the remaining bytes are: %" PRIu64,
+GetSize(arch), data.GetByteSize());
+return error;
+  }
+
+  switch (arch.GetCore()) {
+  case ArchSpec::eCore_x86_64_x86_64:
+data.ExtractBytes(0, sizeof(ELFLinuxPrStatus), byteorder, this);
+break;
+  case ArchSpec::eCore_s390x_generic:
+  case ArchSpec::eCore_x86_32_i386:
+  case ArchSpec::eCore_x86_32_i486: {
+// Parsing from a 32 bit ELF core file, and populating/reusing the structure
+// properly, because the struct is for the 64 bit version
+offset_t offset = 0;
+si_signo = data.GetU32(&offset);
+si_code = data.GetU32(&offset);
+si_errno = data.GetU32(&offset);
+
+break;
+  }
+  default:
+error.SetErrorStringWithFormat("ELFLinuxSigInfo::%s Unknown architecture",
+   __FUNCTION__);
+break;
+  }
+
+  return error;
+}
Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp
===
--- source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -214,6 +214,29 @@
 
   SetUnixSignals(UnixSignals::Create(GetArchitecture()));
 
+  // Ensure we found at least one thread that was stopped on a signal.
+  bool siginfo_signal_found = false;
+  bool prstatus_signal_found = false;
+  // Check we found a signal in a SIGINFO note.
+  for (const auto &thread_data: m_thread_data) {
+if (thread_data.signo != 0)
+  siginfo_signal_found = true;
+if (thread_data.prstatus_sig != 0)
+  prstatus_signal_found = true;
+  }
+  if (siginfo_signal_found == false) {
+// If we don't have signal from SIGINFO use the signal from each threads
+// PRSTATUS note.
+if (prstatus_signal_found == true) {
+  for (const auto &thread_data: m_thread_data)
+thread_data.signo = thread_data.prstatus_sig;
+} else if (m_th

[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-16 Thread Howard Hellyer via lldb-commits
hhellyer updated this revision to Diff 78173.
hhellyer added a comment.

Update patch due to two missing changes.


https://reviews.llvm.org/D26676

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h

Index: source/Plugins/Process/elf-core/ThreadElfCore.h
===
--- source/Plugins/Process/elf-core/ThreadElfCore.h
+++ source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -82,6 +82,38 @@
 static_assert(sizeof(ELFLinuxPrStatus) == 112,
   "sizeof ELFLinuxPrStatus is not correct!");
 
+struct ELFLinuxSigInfo {
+  int32_t si_signo;
+  int32_t si_code;
+  int32_t si_errno;
+
+  ELFLinuxSigInfo();
+
+  lldb_private::Error Parse(lldb_private::DataExtractor &data,
+const lldb_private::ArchSpec &arch);
+
+  // Return the bytesize of the structure
+  // 64 bit - just sizeof
+  // 32 bit - hardcoded because we are reusing the struct, but some of the
+  // members are smaller -
+  // so the layout is not the same
+  static size_t GetSize(const lldb_private::ArchSpec &arch) {
+switch (arch.GetCore()) {
+case lldb_private::ArchSpec::eCore_x86_64_x86_64:
+  return sizeof(ELFLinuxSigInfo);
+case lldb_private::ArchSpec::eCore_s390x_generic:
+case lldb_private::ArchSpec::eCore_x86_32_i386:
+case lldb_private::ArchSpec::eCore_x86_32_i486:
+  return 12;
+default:
+  return 0;
+}
+  }
+};
+
+static_assert(sizeof(ELFLinuxSigInfo) == 12,
+  "sizeof ELFLinuxSigInfo is not correct!");
+
 // PRPSINFO structure's size differs based on architecture.
 // This is the layout in the x86-64 arch case.
 // In the i386 case we parse it manually and fill it again
@@ -133,7 +165,8 @@
   lldb_private::DataExtractor fpregset;
   lldb_private::DataExtractor vregset;
   lldb::tid_t tid;
-  int signo;
+  int signo = 0;
+  int prstatus_sig = 0;
   std::string name;
 };
 
Index: source/Plugins/Process/elf-core/ThreadElfCore.cpp
===
--- source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -320,3 +320,45 @@
 
   return error;
 }
+
+//
+// Parse SIGINFO from NOTE entry
+//
+ELFLinuxSigInfo::ELFLinuxSigInfo() {
+  memset(this, 0, sizeof(ELFLinuxSigInfo));
+}
+
+Error ELFLinuxSigInfo::Parse(DataExtractor &data, const ArchSpec &arch) {
+  Error error;
+  ByteOrder byteorder = data.GetByteOrder();
+  if (GetSize(arch) > data.GetByteSize()) {
+error.SetErrorStringWithFormat(
+"NT_SIGINFO size should be %zu, but the remaining bytes are: %" PRIu64,
+GetSize(arch), data.GetByteSize());
+return error;
+  }
+
+  switch (arch.GetCore()) {
+  case ArchSpec::eCore_x86_64_x86_64:
+data.ExtractBytes(0, sizeof(ELFLinuxPrStatus), byteorder, this);
+break;
+  case ArchSpec::eCore_s390x_generic:
+  case ArchSpec::eCore_x86_32_i386:
+  case ArchSpec::eCore_x86_32_i486: {
+// Parsing from a 32 bit ELF core file, and populating/reusing the structure
+// properly, because the struct is for the 64 bit version
+offset_t offset = 0;
+si_signo = data.GetU32(&offset);
+si_code = data.GetU32(&offset);
+si_errno = data.GetU32(&offset);
+
+break;
+  }
+  default:
+error.SetErrorStringWithFormat("ELFLinuxSigInfo::%s Unknown architecture",
+   __FUNCTION__);
+break;
+  }
+
+  return error;
+}
Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp
===
--- source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -214,6 +214,29 @@
 
   SetUnixSignals(UnixSignals::Create(GetArchitecture()));
 
+  // Ensure we found at least one thread that was stopped on a signal.
+  bool siginfo_signal_found = false;
+  bool prstatus_signal_found = false;
+  // Check we found a signal in a SIGINFO note.
+  for (const auto &thread_data: m_thread_data) {
+if (thread_data.signo != 0)
+  siginfo_signal_found = true;
+if (thread_data.prstatus_sig != 0)
+  prstatus_signal_found = true;
+  }
+  if (!siginfo_signal_found) {
+// If we don't have signal from SIGINFO use the signal from each threads
+// PRSTATUS note.
+if (prstatus_signal_found) {
+  for (auto &thread_data: m_thread_data)
+thread_data.signo = thread_data.prstatus_sig;
+} else if (m_thread_data.size() > 0) {
+  // If all else fails force the first thread to be SIGSTOP
+  m_thread_data.begin()->signo =
+  GetUnixSignals()->GetSignalNumberFromName("SIGSTOP");
+}
+  }
+
   // Core files are useless without the main executable. See if we can locate
   // the main
   // executable

[Lldb-commits] [PATCH] D26697: Remove Windows-specific minidump plugin

2016-11-16 Thread Adrian McCarthy via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287113: Remove Windows-specific minidump plugin (authored by 
amccarth).

Changed prior to commit:
  https://reviews.llvm.org/D26697?vs=78065&id=78194#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26697

Files:
  lldb/trunk/cmake/LLDBDependencies.cmake
  lldb/trunk/source/Plugins/Process/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
  lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h
  lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.cpp
  lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.h
  
lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.cpp
  
lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.h
  
lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp
  
lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h

Index: lldb/trunk/source/Plugins/Process/CMakeLists.txt
===
--- lldb/trunk/source/Plugins/Process/CMakeLists.txt
+++ lldb/trunk/source/Plugins/Process/CMakeLists.txt
@@ -8,7 +8,6 @@
   add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows/Live)
-  add_subdirectory(Windows/MiniDump)
   add_subdirectory(Windows/Common)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX-Kernel)
Index: lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h
===
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h
@@ -1,37 +0,0 @@
-//===-- RegisterContextWindowsMiniDump_x86.h *- C++
-//-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#ifndef liblldb_RegisterContextWindowsMiniDump_x86_H_
-#define liblldb_RegisterContextWindowsMiniDump_x86_H_
-
-#include "Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h"
-#include "lldb/lldb-forward.h"
-
-namespace lldb_private {
-
-class Thread;
-
-class RegisterContextWindowsMiniDump_x86 : public RegisterContextWindows_x86 {
-public:
-  RegisterContextWindowsMiniDump_x86(Thread &thread,
- uint32_t concrete_frame_idx,
- const CONTEXT *context);
-
-  virtual ~RegisterContextWindowsMiniDump_x86();
-
-  bool WriteRegister(const RegisterInfo *reg_info,
- const RegisterValue ®_value) override;
-
-protected:
-  bool CacheAllRegisterValues() override;
-};
-}
-
-#endif // #ifndef liblldb_RegisterContextWindowsMiniDump_x86_H_
Index: lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp
===
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp
@@ -1,42 +0,0 @@
-//===-- RegisterContextWindowsMiniDump_x86.cpp --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "lldb/Host/windows/windows.h"
-#include "lldb/lldb-private-types.h"
-
-#include "RegisterContextWindowsMiniDump_x86.h"
-
-using namespace lldb;
-
-namespace lldb_private {
-
-RegisterContextWindowsMiniDump_x86::RegisterContextWindowsMiniDump_x86(
-Thread &thread, uint32_t concrete_frame_idx, const CONTEXT *context)
-: RegisterContextWindows_x86(thread, concrete_frame_idx) {
-  if (context) {
-m_context = *context;
-m_context_stale = false;
-  }
-}
-
-RegisterContextWindowsMiniDump_x86::~RegisterContextWindowsMiniDump_x86() {}
-
-bool RegisterContextWindowsMiniDump_x86::WriteRegister(
-const RegisterInfo * /* reg_info */,
-const RegisterValue & /* reg_value */) {
-  return false;
-}
-
-bool RegisterContextWindowsMiniDump_x86::CacheAllRegisterValues() {
-  // Since this is post-mortem debugging, we either have the context or we
-  // don't.
-  return !m_context_stale;
-}
-
-} // namespace lldb_private
Index: lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindows

[Lldb-commits] [lldb] r287113 - Remove Windows-specific minidump plugin

2016-11-16 Thread Adrian McCarthy via lldb-commits
Author: amccarth
Date: Wed Nov 16 10:04:14 2016
New Revision: 287113

URL: http://llvm.org/viewvc/llvm-project?rev=287113&view=rev
Log:
Remove Windows-specific minidump plugin

With the cross-platform minidump plugin working, the Windows-specific one is no 
longer needed. This eliminates the unnecessary code.

This does not eliminate the Windows-specific tests, as they hit a few cases the 
general tests don't. (The Windows-specific tests are currently passing.) I'll 
look into a separate patch to make sure we're not doing too much duplicate 
testing.

After that I might do a little re-org in the Windows plugin, as there was some 
factoring there (Common & Live) that probably isn't necessary anymore.

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

Removed:
lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.cpp
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.h

lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.cpp

lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.h

lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp

lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h
Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/source/Plugins/Process/CMakeLists.txt

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=287113&r1=287112&r2=287113&view=diff
==
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Wed Nov 16 10:04:14 2016
@@ -21,7 +21,7 @@ set( LLDB_USED_LIBS
   lldbPluginDynamicLoaderPosixDYLD
   lldbPluginDynamicLoaderHexagonDYLD
   lldbPluginDynamicLoaderWindowsDYLD
-  
+
   lldbPluginCPlusPlusLanguage
   lldbPluginGoLanguage
   lldbPluginJavaLanguage
@@ -91,7 +91,6 @@ set( LLDB_USED_LIBS
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   list(APPEND LLDB_USED_LIBS
 lldbPluginProcessWindows
-lldbPluginProcessWinMiniDump
 lldbPluginProcessWindowsCommon
 Ws2_32
 Rpcrt4

Modified: lldb/trunk/source/Plugins/Process/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/CMakeLists.txt?rev=287113&r1=287112&r2=287113&view=diff
==
--- lldb/trunk/source/Plugins/Process/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/CMakeLists.txt Wed Nov 16 10:04:14 2016
@@ -8,7 +8,6 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "NetBS
   add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows/Live)
-  add_subdirectory(Windows/MiniDump)
   add_subdirectory(Windows/Common)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX-Kernel)

Removed: lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt?rev=287112&view=auto
==
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/CMakeLists.txt (removed)
@@ -1,21 +0,0 @@
-include_directories(../../Utility)
-include_directories(../Common)
-
-set(PROC_WINDOWS_MINIDUMP_SOURCES
-  ProcessWinMiniDump.cpp
-  ThreadWinMiniDump.cpp
-  )
-
-if (CMAKE_SIZEOF_VOID_P EQUAL 4)
-  set(PROC_WINDOWS_MINIDUMP_SOURCES ${PROC_WINDOWS_MINIDUMP_SOURCES}
-x86/RegisterContextWindowsMiniDump_x86.cpp
-)
-elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
-  set(PROC_WINDOWS_MINIDUMP_SOURCES ${PROC_WINDOWS_MINIDUMP_SOURCES}
-x64/RegisterContextWindowsMiniDump_x64.cpp
-)
-endif()
-
-add_lldb_library(lldbPluginProcessWinMiniDump
-  ${PROC_WINDOWS_MINIDUMP_SOURCES}
-  )

Removed: 
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp?rev=287112&view=auto
==
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp 
(removed)
@@ -1,631 +0,0 @@
-//===-- ProcessWinMiniDump.cpp --*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-/

Re: [Lldb-commits] [PATCH] D26451: Remove TimeValue class

2016-11-16 Thread Zachary Turner via lldb-commits
Thanks for working on this!  I love seeing code get deleted almost as much
as I love seeing it get added :)

On Wed, Nov 16, 2016 at 3:04 AM Pavel Labath  wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL287096: Remove TimeValue class (authored by labath).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D26451?vs=77346&id=78159#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D26451
>
> Files:
>   lldb/trunk/include/lldb/Host/TimeValue.h
>   lldb/trunk/include/lldb/lldb-forward.h
>   lldb/trunk/lldb.xcodeproj/project.pbxproj
>   lldb/trunk/source/Commands/CommandObjectTarget.cpp
>   lldb/trunk/source/Host/CMakeLists.txt
>   lldb/trunk/source/Host/common/TimeValue.cpp
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Hi Zachary,

I'm uploading a file of diffs I needed to get the macOS build to compile and 
link.  There were a small handful of macOS-only paths that needed an 
adjustment.  You'll want to look those over to see if I did them the right way.

I'm now in the process of running the tests.  Back on that in a bit.F2590157: 
D26698_macos_build_fixes.diff 


https://reviews.llvm.org/D26698



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


[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-16 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.


https://reviews.llvm.org/D26676



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


[Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Todd Fiala via lldb-commits
tfiala added a comment.

TestTerminal.py's test_launch_in_terminal() is timing out consistently with the 
current change + my diff attached above.

I'm looking into it now.  (It quite possibly is due to the build fixes I did 
above).

I'm attaching the 'sample' (callstack sampling) from the failure here.   
F2590212: TestTerminal.py-58148.sample.zip 


https://reviews.llvm.org/D26698



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


[Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Here is the adjusted patch that fixes the issue I was seeing on 
TestTerminal.py.  My first set of changes had a lifetime issue where I needed a 
const char* that was synthesized on the fly and went away by the time I needed 
it.

LGTM on macOS with this patch applied:
F2590224: D26698_macos_build_fixes_v2.diff 


https://reviews.llvm.org/D26698



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


[Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
tfiala added a comment.

I'm going to test this one now, stacked on top of the final macOS-working 
version of https://reviews.llvm.org/D26698.  Tell me now if you want it tested 
independently of https://reviews.llvm.org/D26698.


https://reviews.llvm.org/D26721



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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
Either way is fine, I think you might have hit a merge conflict if you
stacked them, but if you've already worked through it, then no big deal.

On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:

> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final macOS-working
> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
> tested independently of https://reviews.llvm.org/D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm created this revision.
ldrumm added reviewers: zturner, granata.enrico.
ldrumm added a subscriber: LLDB.
Herald added a subscriber: mgorny.

A combination of broken escaping in CMake and in the python swig generation 
scripts meant that the swig generation step would fail whenever there were 
spaces or special characters in parameters passed to swig.

The fix for this in `CMakeLists` is to use the `VERBATIM` option on all 
`COMMAND`-based custom builders relying on CMake to properly escape each 
argument in the generated file.

Within the python swig scripts, the fix is to call `subprocess.Popen` with a 
list of raw argument strings rather than ones that are incorrectly manually 
escaped, then passed to a shell subprocess via `subprocess.Popen(' 
'.join(params))`. This also prevents nasty things happening such as accidental 
command-injection.

This allows us to have the swig / python executables in paths containing 
special chars and spaces, (or on shared storage on Win32, e.g \\some\path or 
C:\Program Files\swig\swig.exe).


https://reviews.llvm.org/D26757

Files:
  CMakeLists.txt
  scripts/CMakeLists.txt
  scripts/Python/prepare_binding_Python.py

Index: scripts/Python/prepare_binding_Python.py
===
--- scripts/Python/prepare_binding_Python.py
+++ scripts/Python/prepare_binding_Python.py
@@ -196,34 +196,37 @@
 temp_dep_file_path = dependency_file + ".tmp"
 
 # Build the SWIG args list
-command = [
-options.swig_executable,
-"-c++",
-"-shadow",
-"-python",
-"-threads",
-"-I\"%s\"" % os.path.normcase(
-os.path.join(options.src_root, "include")),
-"-I\"%s\"" % os.path.normcase("./."),
-"-D__STDC_LIMIT_MACROS",
-"-D__STDC_CONSTANT_MACROS"]
-if options.target_platform == "Darwin":
-command.append("-D__APPLE__")
-if options.generate_dependency_file:
-command.append("-MMD -MF \"%s\"" % temp_dep_file_path)
-command.extend([
-"-outdir", "\"%s\"" % config_build_dir,
-"-o", "\"%s\"" % settings.output_file,
-"\"%s\"" % settings.input_file
-])
-logging.info("running swig with: %s", command)
+is_darwin = options.target_platform == "Darwin"
+gen_deps = options.generate_dependency_file
+darwin_extras = ["-D__APPLE__"] if is_darwin else []
+deps_args = ["-MMD", "-MF", temp_dep_file_path] if gen_deps else []
+command = ([
+options.swig_executable,
+"-c++",
+"-shadow",
+"-python",
+"-threads",
+"-I" + os.path.normpath(os.path.join(options.src_root, "include")),
+"-I.",
+"-D__STDC_LIMIT_MACROS",
+"-D__STDC_CONSTANT_MACROS"
+]
++ darwin_extras
++ deps_args
++ [
+"-outdir", config_build_dir,
+"-o", settings.output_file,
+settings.input_file
+]
+)
+logging.info("running swig with: %r", command)
 
 # Execute swig
 process = subprocess.Popen(
-' '.join(command),
+command,
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
-shell=True)
+)
 # Wait for SWIG process to terminate
 swig_stdout, swig_stderr = process.communicate()
 return_code = process.returncode
@@ -265,15 +268,14 @@
 the command line arguments to pass to it.
 """
 command = [sys.executable] + script_and_args
-command_line = " ".join(command)
-process = subprocess.Popen(command, shell=False)
+process = subprocess.Popen(command)
 script_stdout, script_stderr = process.communicate()
 return_code = process.returncode
 if return_code != 0:
-logging.error("failed to run '%s': %s", command_line, script_stderr)
+logging.error("failed to run %r: %r", command, script_stderr)
 sys.exit(return_code)
 else:
-logging.info("ran script '%s'", command_line)
+logging.info("ran script %r'", command)
 if script_stdout is not None:
 logging.info("output: %s", script_stdout)
 
Index: scripts/CMakeLists.txt
===
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -34,13 +34,15 @@
   DEPENDS ${SWIG_HEADERS}
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Python/prepare_binding_Python.py
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Python/modify-python-lldb.py
-  COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/prepare_bindings.py
-  ${framework_arg}
-  "--srcRoot=${LLDB_SOURCE_DIR}"
-  "--targetDir=${LLDB_PYTHON_TARGET_DIR}"
-  "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}"
-  "--prefix=${CMAKE_BINARY_DIR}"
-  "--swigExecutable=${SWIG_EXECUTABLE}"
+  COMMAND
+${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/prepare_bindings.py
+  ${framework_arg}
+  --srcRoot=${LLDB_SOURCE_DIR}
+ 

Re: [Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Zachary Turner via lldb-commits
Sweet.  Glad to see that such a large patch had only minor implications.
Thanks for the help!

On Wed, Nov 16, 2016 at 11:28 AM Todd Fiala  wrote:

> tfiala accepted this revision.
> tfiala added a comment.
> This revision is now accepted and ready to land.
>
> Here is the adjusted patch that fixes the issue I was seeing on
> TestTerminal.py.  My first set of changes had a lifetime issue where I
> needed a const char* that was synthesized on the fly and went away by the
> time I needed it.
>
> LGTM on macOS with this patch applied:
> F2590224: D26698_macos_build_fixes_v2.diff <
> https://reviews.llvm.org/F2590224>
>
>
> https://reviews.llvm.org/D26698
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Enrico Granata via lldb-commits
granata.enrico added a reviewer: beanz.
granata.enrico added a comment.

Chris, can you take a look at this? I am far from a CMake expert


https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Enrico Granata via lldb-commits
granata.enrico added inline comments.



Comment at: scripts/Python/prepare_binding_Python.py:229
 stderr=subprocess.PIPE,
-shell=True)
+)
 # Wait for SWIG process to terminate

This worries me a little bit.. Are we sure we are not in any way relying on the 
shell in executing the command line?


https://reviews.llvm.org/D26757



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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
BTW, I would still like to get Chris to take a look at my usage of
llvm::Twine.  Even if it works, I'm not sure if I used it correctly.

On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner  wrote:

> Either way is fine, I think you might have hit a merge conflict if you
> stacked them, but if you've already worked through it, then no big deal.
>
> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>
> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final macOS-working
> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
> tested independently of https://reviews.llvm.org/D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: scripts/Python/prepare_binding_Python.py:229
 stderr=subprocess.PIPE,
-shell=True)
+)
 # Wait for SWIG process to terminate

granata.enrico wrote:
> This worries me a little bit.. Are we sure we are not in any way relying on 
> the shell in executing the command line?
The features of the shell are not used in this expression at all, and the 
environment is identical to the previous invocation.


https://reviews.llvm.org/D26757



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


Re: [Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Zachary Turner via lldb-commits
What revision should I apply this on top of?  It doesn't apply cleanly for
me at tip.  I think it's my fault because of the original patch, but now
I'm having trouble getting this modified patch to work.  Can you give me a
diff that I can apply on top of my original patch, which is applied on a
clean repo?  So ToT > ::my original patch:: > ::your set of fixes::, and
just give me your set of fixes?

On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner  wrote:

> Sweet.  Glad to see that such a large patch had only minor implications.
> Thanks for the help!
>
> On Wed, Nov 16, 2016 at 11:28 AM Todd Fiala  wrote:
>
> tfiala accepted this revision.
> tfiala added a comment.
> This revision is now accepted and ready to land.
>
> Here is the adjusted patch that fixes the issue I was seeing on
> TestTerminal.py.  My first set of changes had a lifetime issue where I
> needed a const char* that was synthesized on the fly and went away by the
> time I needed it.
>
> LGTM on macOS with this patch applied:
> F2590224: D26698_macos_build_fixes_v2.diff <
> https://reviews.llvm.org/F2590224>
>
>
> https://reviews.llvm.org/D26698
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Zachary Turner via lldb-commits
(A full patch works too if it's easier, as long as it applies cleanly on
ToT)

On Wed, Nov 16, 2016 at 11:46 AM Zachary Turner  wrote:

> What revision should I apply this on top of?  It doesn't apply cleanly for
> me at tip.  I think it's my fault because of the original patch, but now
> I'm having trouble getting this modified patch to work.  Can you give me a
> diff that I can apply on top of my original patch, which is applied on a
> clean repo?  So ToT > ::my original patch:: > ::your set of fixes::, and
> just give me your set of fixes?
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
> Sweet.  Glad to see that such a large patch had only minor implications.
> Thanks for the help!
>
> On Wed, Nov 16, 2016 at 11:28 AM Todd Fiala  wrote:
>
> tfiala accepted this revision.
> tfiala added a comment.
> This revision is now accepted and ready to land.
>
> Here is the adjusted patch that fixes the issue I was seeing on
> TestTerminal.py.  My first set of changes had a lifetime issue where I
> needed a const char* that was synthesized on the fly and went away by the
> time I needed it.
>
> LGTM on macOS with this patch applied:
> F2590224: D26698_macos_build_fixes_v2.diff <
> https://reviews.llvm.org/F2590224>
>
>
> https://reviews.llvm.org/D26698
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: scripts/Python/prepare_binding_Python.py:229
 stderr=subprocess.PIPE,
-shell=True)
+)
 # Wait for SWIG process to terminate

bryant wrote:
> ldrumm wrote:
> > granata.enrico wrote:
> > > This worries me a little bit.. Are we sure we are not in any way relying 
> > > on the shell in executing the command line?
> > The features of the shell are not used in this expression at all, and the 
> > environment is identical to the previous invocation.
> `shell=False` for both python 2 and 3: 
> https://docs.python.org/2/library/subprocess.html#subprocess.Popen ; 
> https://docs.python.org/3/library/subprocess.html#subprocess.Popen , unless 
> I've missed your meaning.
@bryant 

> shell=False for both python 2 and 3: 
> https://docs.python.org/2/library/subprocess.html#subprocess.Popen ; 
> https://docs.python.org/3/library/subprocess.html#subprocess.Popen , unless 
> I've missed your meaning.

Yes - the intended behaviour is to not use the shell on any python



https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: CMakeLists.txt:46
+COMMAND
+   ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
+   --srcRoot=${LLDB_SOURCE_DIR}

bryant wrote:
> You can reduce diff noise by leaving formatting changes for a separate patch.
Seeing as I'm touching all these lines anyway, formatting seems appropriate. I 
tend to get pushback for formatting only commits, so I'd rather keep this as it 
is.



Comment at: CMakeLists.txt:53
+   --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}
+   ${FINISH_EXTRA_ARGS}
+VERBATIM

bryant wrote:
> The indentation here could match the above.
Good point. Will fix


https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: scripts/Python/prepare_binding_Python.py:222
+)
+logging.info("running swig with: %r", command)
 

bryant wrote:
> You can reduce diff noise by limiting your changes to removing the %s. So,
> 
> ```python
> # Build the SWIG args list
> options.swig_executable,
> "-c++",
> "-shadow",
> "-python",
> "-threads",
> "-I" + os.path.normcase(
> os.path.join(options.src_root, "include")),
> "-I" + os.path.normcase("./."),
> "-D__STDC_LIMIT_MACROS",
> "-D__STDC_CONSTANT_MACROS"]
> if options.target_platform == "Darwin":
> command.append("-D__APPLE__")
> if options.generate_dependency_file:
> command.extend(["-MMD", " -MF", temp_dep_file_path])
> command.extend([
> "-outdir", config_build_dir,
> "-o", settings.output_file,
> settings.input_file
> ])
> logging.info("running swig with: %s", command)
> ```
But `logging.info` is not a pretty printer - if the command fails for some 
reason we need to see why. `repr` allows this, and the diff noise is again 
minimal because that line is changing anyway and command is now a list, not a 
string


https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: scripts/CMakeLists.txt:38
+  COMMAND
+${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/prepare_bindings.py
+  ${framework_arg}

bryant wrote:
> Move this back up.
Will do


https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Luke Drummond via lldb-commits
ldrumm added inline comments.



Comment at: scripts/Python/prepare_binding_Python.py:222
+)
+logging.info("running swig with: %r", command)
 

bryant wrote:
> ldrumm wrote:
> > bryant wrote:
> > > You can reduce diff noise by limiting your changes to removing the %s. So,
> > > 
> > > ```python
> > > # Build the SWIG args list
> > > options.swig_executable,
> > > "-c++",
> > > "-shadow",
> > > "-python",
> > > "-threads",
> > > "-I" + os.path.normcase(
> > > os.path.join(options.src_root, "include")),
> > > "-I" + os.path.normcase("./."),
> > > "-D__STDC_LIMIT_MACROS",
> > > "-D__STDC_CONSTANT_MACROS"]
> > > if options.target_platform == "Darwin":
> > > command.append("-D__APPLE__")
> > > if options.generate_dependency_file:
> > > command.extend(["-MMD", " -MF", temp_dep_file_path])
> > > command.extend([
> > > "-outdir", config_build_dir,
> > > "-o", settings.output_file,
> > > settings.input_file
> > > ])
> > > logging.info("running swig with: %s", command)
> > > ```
> > But `logging.info` is not a pretty printer - if the command fails for some 
> > reason we need to see why. `repr` allows this, and the diff noise is again 
> > minimal because that line is changing anyway and command is now a list, not 
> > a string
> Yes, that was a typo. Keep %r too.
Sorry - I just realised you meant the whole block (I only caught on slowly 
beyond the logging call).

I don't see a problem with the current implementation - it has some technical 
advantages over the existing code: 

- The list of args is built as a single expression, which is notionally nicer 
than modifying it piecemeal
- The definition of the optional constants upfront is done such that they are 
always defined one way or another
- `os.path.normcase(os.path.join(options.src_root, "include"))` is incorrect as 
[there can be case-sensitive filesystems on win32](http://www.ext2fsd.com/)
- `os.path.normcase("./."),` doesn't make sense on any OS I’m aware of (though 
I need to change this to `os.path.curdir` as it's possible some OS or 
filesystem doesn't use `"."`)

Given that I'm fixing at least 4 broken assumptions here, I feel that the 
cleanup is worth a little diff noise


https://reviews.llvm.org/D26757



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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
Yep - I followed that.  I'm just doing the "build + test" verification on
macOS.


On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner  wrote:

> BTW, I would still like to get Chris to take a look at my usage of
> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
>> Either way is fine, I think you might have hit a merge conflict if you
>> stacked them, but if you've already worked through it, then no big deal.
>>
>> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>>
>> tfiala added a comment.
>>
>> I'm going to test this one now, stacked on top of the final macOS-working
>> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
>> tested independently of https://reviews.llvm.org/D26698.
>>
>>
>> https://reviews.llvm.org/D26721
>>
>>
>>
>>


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


Re: [Lldb-commits] [PATCH] D26698: Remove SBStream accessor that lets you manipulate the internal buffer.

2016-11-16 Thread Zachary Turner via lldb-commits
I got it applied, comitting shortly.

On Wed, Nov 16, 2016 at 11:48 AM Zachary Turner  wrote:

> (A full patch works too if it's easier, as long as it applies cleanly on
> ToT)
>
> On Wed, Nov 16, 2016 at 11:46 AM Zachary Turner 
> wrote:
>
> What revision should I apply this on top of?  It doesn't apply cleanly for
> me at tip.  I think it's my fault because of the original patch, but now
> I'm having trouble getting this modified patch to work.  Can you give me a
> diff that I can apply on top of my original patch, which is applied on a
> clean repo?  So ToT > ::my original patch:: > ::your set of fixes::, and
> just give me your set of fixes?
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
> Sweet.  Glad to see that such a large patch had only minor implications.
> Thanks for the help!
>
> On Wed, Nov 16, 2016 at 11:28 AM Todd Fiala  wrote:
>
> tfiala accepted this revision.
> tfiala added a comment.
> This revision is now accepted and ready to land.
>
> Here is the adjusted patch that fixes the issue I was seeing on
> TestTerminal.py.  My first set of changes had a lifetime issue where I
> needed a const char* that was synthesized on the fly and went away by the
> time I needed it.
>
> LGTM on macOS with this patch applied:
> F2590224: D26698_macos_build_fixes_v2.diff <
> https://reviews.llvm.org/F2590224>
>
>
> https://reviews.llvm.org/D26698
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287155 - Update GenerateAdditionalHelpAvenues to take StringRef.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 15:34:22 2016
New Revision: 287155

URL: http://llvm.org/viewvc/llvm-project?rev=287155&view=rev
Log:
Update GenerateAdditionalHelpAvenues to take StringRef.

Modified:
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Commands/CommandObjectHelp.cpp
lldb/trunk/source/Commands/CommandObjectHelp.h
lldb/trunk/source/Commands/CommandObjectSyntax.cpp

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=287155&r1=287154&r2=287155&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Wed Nov 16 15:34:22 
2016
@@ -946,7 +946,7 @@ protected:
   const bool generate_apropos = true;
   const bool generate_type_lookup = false;
   CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
-  &error_msg_stream, command_name, nullptr, nullptr, generate_apropos,
+  &error_msg_stream, command_name, llvm::StringRef(), 
llvm::StringRef(), generate_apropos,
   generate_type_lookup);
   result.AppendError(error_msg_stream.GetString());
   result.SetStatus(eReturnStatusFailed);

Modified: lldb/trunk/source/Commands/CommandObjectHelp.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectHelp.cpp?rev=287155&r1=287154&r2=287155&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectHelp.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectHelp.cpp Wed Nov 16 15:34:22 2016
@@ -25,21 +25,26 @@ using namespace lldb_private;
 //-
 
 void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
-Stream *s, const char *command, const char *prefix, const char *subcommand,
+Stream *s, llvm::StringRef command, llvm::StringRef prefix, 
llvm::StringRef subcommand,
 bool include_apropos, bool include_type_lookup) {
-  if (s && command && *command) {
-s->Printf("'%s' is not a known command.\n", command);
-s->Printf("Try '%shelp' to see a current list of commands.\n",
-  prefix ? prefix : "");
-if (include_apropos) {
-  s->Printf("Try '%sapropos %s' for a list of related commands.\n",
-prefix ? prefix : "", subcommand ? subcommand : command);
-}
-if (include_type_lookup) {
-  s->Printf("Try '%stype lookup %s' for information on types, methods, "
-"functions, modules, etc.",
-prefix ? prefix : "", subcommand ? subcommand : command);
-}
+  if (!s || command.empty())
+return;
+
+  std::string command_str = command.str();
+  std::string prefix_str = prefix.str();
+  std::string subcommand_str = subcommand.str();
+  const std::string &lookup_str = !subcommand_str.empty() ? subcommand_str : 
command_str;
+  s->Printf("'%s' is not a known command.\n", command_str.c_str());
+  s->Printf("Try '%shelp' to see a current list of commands.\n",
+prefix.str().c_str());
+  if (include_apropos) {
+s->Printf("Try '%sapropos %s' for a list of related commands.\n",
+  prefix_str.c_str(), lookup_str.c_str());
+  }
+  if (include_type_lookup) {
+s->Printf("Try '%stype lookup %s' for information on types, methods, "
+  "functions, modules, etc.",
+  prefix_str.c_str(), lookup_str.c_str());
   }
 }
 
@@ -198,7 +203,7 @@ bool CommandObjectHelp::DoExecute(Args &
 StreamString error_msg_stream;
 GenerateAdditionalHelpAvenuesMessage(&error_msg_stream,
  command.GetArgumentAtIndex(0),
- m_interpreter.GetCommandPrefix());
+ m_interpreter.GetCommandPrefix(), 
"");
 result.AppendError(error_msg_stream.GetString());
 result.SetStatus(eReturnStatusFailed);
   }

Modified: lldb/trunk/source/Commands/CommandObjectHelp.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectHelp.h?rev=287155&r1=287154&r2=287155&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectHelp.h (original)
+++ lldb/trunk/source/Commands/CommandObjectHelp.h Wed Nov 16 15:34:22 2016
@@ -35,8 +35,8 @@ public:
StringList &matches) override;
 
   static void GenerateAdditionalHelpAvenuesMessage(
-  Stream *s, const char *command, const char *prefix = nullptr,
-  const char *subcommand = nullptr, bool include_apropos = true,
+  Stream *s, llvm::StringRef command, llvm::StringRef prefix,
+  llvm::StringRef subcommand, bool include_apropos = true,
   bool include_type_lookup = true);
 
   class Co

[Lldb-commits] [lldb] r287157 - Make Apropos functions accept StringRefs.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 15:45:04 2016
New Revision: 287157

URL: http://llvm.org/viewvc/llvm-project?rev=287157&view=rev
Log:
Make Apropos functions accept StringRefs.

Modified:
lldb/trunk/include/lldb/Core/UserSettingsController.h
lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
lldb/trunk/source/Core/UserSettingsController.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Interpreter/OptionValueProperties.cpp

Modified: lldb/trunk/include/lldb/Core/UserSettingsController.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UserSettingsController.h?rev=287157&r1=287156&r2=287157&view=diff
==
--- lldb/trunk/include/lldb/Core/UserSettingsController.h (original)
+++ lldb/trunk/include/lldb/Core/UserSettingsController.h Wed Nov 16 15:45:04 
2016
@@ -1,5 +1,4 @@
-//-- UserSettingsController.h *- C++
-//-*-===//
+//-- UserSettingsController.h *- 
C++-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -63,7 +62,7 @@ public:
   virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
Stream &strm) const;
 
-  size_t Apropos(const char *keyword,
+  size_t Apropos(llvm::StringRef keyword,
  std::vector &matching_properties) const;
 
   lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx,

Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=287157&r1=287156&r2=287157&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Wed Nov 16 
15:45:04 2016
@@ -407,7 +407,7 @@ public:
 
   bool GetSynchronous();
 
-  void FindCommandsForApropos(const char *word, StringList &commands_found,
+  void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found,
   StringList &commands_help,
   bool search_builtin_commands,
   bool search_user_commands,
@@ -517,7 +517,7 @@ private:
   CommandObject *ResolveCommandImpl(std::string &command_line,
 CommandReturnObject &result);
 
-  void FindCommandsForApropos(const char *word, StringList &commands_found,
+  void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found,
   StringList &commands_help,
   CommandObject::CommandMap &command_map);
 

Modified: lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h?rev=287157&r1=287156&r2=287157&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h Wed Nov 16 
15:45:04 2016
@@ -62,7 +62,7 @@ public:
   virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
Stream &strm) const;
 
-  void Apropos(const char *keyword,
+  void Apropos(llvm::StringRef keyword,
std::vector &matching_properties) const;
 
   void Initialize(const PropertyDefinition *setting_definitions);

Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=287157&r1=287156&r2=287157&view=diff
==
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Wed Nov 16 15:45:04 2016
@@ -73,7 +73,7 @@ Error Properties::DumpPropertyValue(cons
 }
 
 size_t
-Properties::Apropos(const char *keyword,
+Properties::Apropos(llvm::StringRef keyword,
 std::vector &matching_properties) const {
   OptionValuePropertiesSP properties_sp(GetValueProperties());
   if (properties_sp) {

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=287157&r1=287156&r2=287157&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Wed Nov 16 15:45:04 
2016
@@ -2596,19 +2596,19 @@ void CommandInterpreter::OutputHelpText(
 }
 
 void CommandInterpreter::FindCommandsForApropos(
-const

[Lldb-commits] [lldb] r287158 - Fix some unit test compilation failures.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 15:45:11 2016
New Revision: 287158

URL: http://llvm.org/viewvc/llvm-project?rev=287158&view=rev
Log:
Fix some unit test compilation failures.

Modified:
lldb/trunk/unittests/Core/TimerTest.cpp
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Modified: lldb/trunk/unittests/Core/TimerTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/TimerTest.cpp?rev=287158&r1=287157&r2=287158&view=diff
==
--- lldb/trunk/unittests/Core/TimerTest.cpp (original)
+++ lldb/trunk/unittests/Core/TimerTest.cpp Wed Nov 16 15:45:11 2016
@@ -64,7 +64,7 @@ TEST(TimerTest, CategoryTimes2) {
   double seconds1, seconds2;
   ASSERT_EQ(2, sscanf(ss.GetData(), "%lf sec for CAT1%*[\n ]%lf sec for CAT2",
   &seconds1, &seconds2))
-  << "String: " << ss.GetString();
+  << "String: " << ss.GetData();
   EXPECT_LT(0.01, seconds1);
   EXPECT_GT(1, seconds1);
   EXPECT_LT(0.001, seconds2);

Modified: 
lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp?rev=287158&r1=287157&r2=287158&view=diff
==
--- lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp 
(original)
+++ lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp 
Wed Nov 16 15:45:11 2016
@@ -255,17 +255,17 @@ TEST_F(PythonDataObjectsTest, TestPython
   // Test that creating a `PythonString` object works correctly with the
   // string constructor
   PythonString constructed_string(test_string2);
-  EXPECT_STREQ(test_string2, constructed_string.c_str());
+  EXPECT_EQ(test_string2, constructed_string.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonStringToStr) {
-  const char *c_str = "PythonDataObjectsTest::TestPythonStringToStr";
+  const char *GetString = "PythonDataObjectsTest::TestPythonStringToStr";
 
-  PythonString str(c_str);
-  EXPECT_STREQ(c_str, str.c_str());
+  PythonString str(GetString);
+  EXPECT_EQ(GetString, str.GetString());
 
   PythonString str_str = str.Str();
-  EXPECT_STREQ(c_str, str_str.c_str());
+  EXPECT_EQ(GetString, str_str.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonIntegerToStr) {}
@@ -281,7 +281,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   "PythonDataObjectsTest::TestPythonStringToStructuredString";
   PythonString constructed_string(test_string);
   auto string_sp = constructed_string.CreateStructuredString();
-  EXPECT_STREQ(test_string, string_sp->GetStringValue().c_str());
+  EXPECT_EQ(test_string, string_sp->GetStringValue());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonListValueEquality) {
@@ -315,7 +315,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   PythonString chk_str(PyRefType::Borrowed, chk_value2.get());
 
   EXPECT_EQ(long_value0, chk_int.GetInteger());
-  EXPECT_STREQ(string_value1, chk_str.c_str());
+  EXPECT_EQ(string_value1, chk_str.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonListManipulation) {
@@ -343,7 +343,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   PythonString chk_str(PyRefType::Borrowed, chk_value2.get());
 
   EXPECT_EQ(long_value0, chk_int.GetInteger());
-  EXPECT_STREQ(string_value1, chk_str.c_str());
+  EXPECT_EQ(string_value1, chk_str.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonListToStructuredList) {
@@ -364,7 +364,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   auto string_sp = array_sp->GetItemAtIndex(1)->GetAsString();
 
   EXPECT_EQ(long_value0, long(int_sp->GetValue()));
-  EXPECT_STREQ(string_value1, string_sp->GetValue().c_str());
+  EXPECT_EQ(string_value1, string_sp->GetValue());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonTupleSize) {
@@ -466,7 +466,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   PythonString chk_str(PyRefType::Borrowed, chk_value2.get());
 
   EXPECT_EQ(value_0, chk_int.GetInteger());
-  EXPECT_STREQ(value_1, chk_str.c_str());
+  EXPECT_EQ(value_1, chk_str.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonDictionaryManipulation) {
@@ -503,7 +503,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   PythonString chk_str(PyRefType::Borrowed, chk_value2.get());
 
   EXPECT_EQ(value_0, chk_int.GetInteger());
-  EXPECT_STREQ(value_1, chk_str.c_str());
+  EXPECT_EQ(value_1, chk_str.GetString());
 }
 
 TEST_F(PythonDataObjectsTest, TestPythonDictionaryToStructuredDictionary) {
@@ -526,7 +526,7 @@ TEST_F(PythonDataObjectsTest, TestPython
   auto string_sp = dict_sp->GetValueForKey(string_key0)->GetAsString();
   auto int_sp = dict_sp->GetValueForKey(string_key1)->GetAsInteger();
 
-  EXPECT_STREQ(string_value0, string_sp->GetValue().c_str());
+  EXPECT_EQ(string_value0, string_sp->GetValue());
   EXPECT_EQ(int_value1, long(int_sp->GetValue()));
 }
 


__

[Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Chris Bieneman via lldb-commits
beanz accepted this revision.
beanz added a comment.
This revision is now accepted and ready to land.

LGTM!

The big thing to be aware of about Twines is that they are designed so that 
when you construct one the underlying string storage can vanish after the Twine 
goes out of scope. Here it looks like you're really just allowing some 
functions to take Twines, it doesn't look like you're constructing any, so it 
seems all good to me.


https://reviews.llvm.org/D26721



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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
Hey Todd, Did you run the tests earlier?  If so what was the result?  No
worries if you didn't run them yet, but it sounded like you were already
kicking it off at 11:30.  Just want to make sure you didn't finish and
forget to update with the result :)

On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  wrote:

> Yep - I followed that.  I'm just doing the "build + test" verification on
> macOS.
>
>
> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner 
> wrote:
>
> BTW, I would still like to get Chris to take a look at my usage of
> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
> Either way is fine, I think you might have hit a merge conflict if you
> stacked them, but if you've already worked through it, then no big deal.
>
> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>
> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final macOS-working
> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
> tested independently of https://reviews.llvm.org/D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
>
>
> --
> -Todd
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
Hey Zachary,

I had to run home unexpectedly. The build worked but I left before the test
results came out.

If you ran it on Linux and the Linux tests passed, we can address issues
that show up on the macOS side.

I will also try it at home on macOS, but I don't think you need to hold up
with the aforementioned caveat on running the Linux tests.

On Wednesday, November 16, 2016, Zachary Turner  wrote:

> Hey Todd, Did you run the tests earlier?  If so what was the result?  No
> worries if you didn't run them yet, but it sounded like you were already
> kicking it off at 11:30.  Just want to make sure you didn't finish and
> forget to update with the result :)
>
> On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  > wrote:
>
>> Yep - I followed that.  I'm just doing the "build + test" verification on
>> macOS.
>>
>>
>> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner > > wrote:
>>
>>> BTW, I would still like to get Chris to take a look at my usage of
>>> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>>>
>>> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner >> > wrote:
>>>
 Either way is fine, I think you might have hit a merge conflict if you
 stacked them, but if you've already worked through it, then no big deal.

 On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala >>> > wrote:

> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final
> macOS-working version of https://reviews.llvm.org/D26698.  Tell me
> now if you want it tested independently of https://reviews.llvm.org/
> D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
>>
>>
>> --
>> -Todd
>>
>

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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
It's no problem, I actually found a few functions I forgot to convert, so
I'm making some additional changes.  Nothing that requires additional
testing, but at the very least I won't be able to get this in until
tomorrow at the earliest, so it's no biggie.

On Wed, Nov 16, 2016 at 3:17 PM Todd Fiala  wrote:

> Hey Zachary,
>
> I had to run home unexpectedly. The build worked but I left before the
> test results came out.
>
> If you ran it on Linux and the Linux tests passed, we can address issues
> that show up on the macOS side.
>
> I will also try it at home on macOS, but I don't think you need to hold up
> with the aforementioned caveat on running the Linux tests.
>
>
> On Wednesday, November 16, 2016, Zachary Turner 
> wrote:
>
> Hey Todd, Did you run the tests earlier?  If so what was the result?  No
> worries if you didn't run them yet, but it sounded like you were already
> kicking it off at 11:30.  Just want to make sure you didn't finish and
> forget to update with the result :)
>
> On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  wrote:
>
> Yep - I followed that.  I'm just doing the "build + test" verification on
> macOS.
>
>
> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner 
> wrote:
>
> BTW, I would still like to get Chris to take a look at my usage of
> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
> Either way is fine, I think you might have hit a merge conflict if you
> stacked them, but if you've already worked through it, then no big deal.
>
> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>
> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final macOS-working
> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
> tested independently of https://reviews.llvm.org/D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
>
>
> --
> -Todd
>
>
>
> --
> -Todd
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
Okay cool.  I'm building against this now.  Should I hold off testing?

On Wed, Nov 16, 2016 at 3:41 PM, Zachary Turner  wrote:

> It's no problem, I actually found a few functions I forgot to convert, so
> I'm making some additional changes.  Nothing that requires additional
> testing, but at the very least I won't be able to get this in until
> tomorrow at the earliest, so it's no biggie.
>
> On Wed, Nov 16, 2016 at 3:17 PM Todd Fiala  wrote:
>
>> Hey Zachary,
>>
>> I had to run home unexpectedly. The build worked but I left before the
>> test results came out.
>>
>> If you ran it on Linux and the Linux tests passed, we can address issues
>> that show up on the macOS side.
>>
>> I will also try it at home on macOS, but I don't think you need to hold
>> up with the aforementioned caveat on running the Linux tests.
>>
>>
>> On Wednesday, November 16, 2016, Zachary Turner 
>> wrote:
>>
>> Hey Todd, Did you run the tests earlier?  If so what was the result?  No
>> worries if you didn't run them yet, but it sounded like you were already
>> kicking it off at 11:30.  Just want to make sure you didn't finish and
>> forget to update with the result :)
>>
>> On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  wrote:
>>
>> Yep - I followed that.  I'm just doing the "build + test" verification on
>> macOS.
>>
>>
>> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner 
>> wrote:
>>
>> BTW, I would still like to get Chris to take a look at my usage of
>> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>>
>> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
>> wrote:
>>
>> Either way is fine, I think you might have hit a merge conflict if you
>> stacked them, but if you've already worked through it, then no big deal.
>>
>> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>>
>> tfiala added a comment.
>>
>> I'm going to test this one now, stacked on top of the final macOS-working
>> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
>> tested independently of https://reviews.llvm.org/D26698.
>>
>>
>> https://reviews.llvm.org/D26721
>>
>>
>>
>>
>>
>>
>> --
>> -Todd
>>
>>
>>
>> --
>> -Todd
>>
>>


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


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
No you can go ahead.  The new changes I found are not specific to Mac, I
should find problems if there's any with the additional changes.

On Wed, Nov 16, 2016 at 3:42 PM Todd Fiala  wrote:

> Okay cool.  I'm building against this now.  Should I hold off testing?
>
> On Wed, Nov 16, 2016 at 3:41 PM, Zachary Turner 
> wrote:
>
> It's no problem, I actually found a few functions I forgot to convert, so
> I'm making some additional changes.  Nothing that requires additional
> testing, but at the very least I won't be able to get this in until
> tomorrow at the earliest, so it's no biggie.
>
> On Wed, Nov 16, 2016 at 3:17 PM Todd Fiala  wrote:
>
> Hey Zachary,
>
> I had to run home unexpectedly. The build worked but I left before the
> test results came out.
>
> If you ran it on Linux and the Linux tests passed, we can address issues
> that show up on the macOS side.
>
> I will also try it at home on macOS, but I don't think you need to hold up
> with the aforementioned caveat on running the Linux tests.
>
>
> On Wednesday, November 16, 2016, Zachary Turner 
> wrote:
>
> Hey Todd, Did you run the tests earlier?  If so what was the result?  No
> worries if you didn't run them yet, but it sounded like you were already
> kicking it off at 11:30.  Just want to make sure you didn't finish and
> forget to update with the result :)
>
> On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  wrote:
>
> Yep - I followed that.  I'm just doing the "build + test" verification on
> macOS.
>
>
> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner 
> wrote:
>
> BTW, I would still like to get Chris to take a look at my usage of
> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>
> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
> wrote:
>
> Either way is fine, I think you might have hit a merge conflict if you
> stacked them, but if you've already worked through it, then no big deal.
>
> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>
> tfiala added a comment.
>
> I'm going to test this one now, stacked on top of the final macOS-working
> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
> tested independently of https://reviews.llvm.org/D26698.
>
>
> https://reviews.llvm.org/D26721
>
>
>
>
>
>
> --
> -Todd
>
>
>
> --
> -Todd
>
>
>
>
> --
> -Todd
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
Great.  Back soon...

On Wed, Nov 16, 2016 at 3:50 PM, Zachary Turner  wrote:

> No you can go ahead.  The new changes I found are not specific to Mac, I
> should find problems if there's any with the additional changes.
>
> On Wed, Nov 16, 2016 at 3:42 PM Todd Fiala  wrote:
>
>> Okay cool.  I'm building against this now.  Should I hold off testing?
>>
>> On Wed, Nov 16, 2016 at 3:41 PM, Zachary Turner 
>> wrote:
>>
>> It's no problem, I actually found a few functions I forgot to convert, so
>> I'm making some additional changes.  Nothing that requires additional
>> testing, but at the very least I won't be able to get this in until
>> tomorrow at the earliest, so it's no biggie.
>>
>> On Wed, Nov 16, 2016 at 3:17 PM Todd Fiala  wrote:
>>
>> Hey Zachary,
>>
>> I had to run home unexpectedly. The build worked but I left before the
>> test results came out.
>>
>> If you ran it on Linux and the Linux tests passed, we can address issues
>> that show up on the macOS side.
>>
>> I will also try it at home on macOS, but I don't think you need to hold
>> up with the aforementioned caveat on running the Linux tests.
>>
>>
>> On Wednesday, November 16, 2016, Zachary Turner 
>> wrote:
>>
>> Hey Todd, Did you run the tests earlier?  If so what was the result?  No
>> worries if you didn't run them yet, but it sounded like you were already
>> kicking it off at 11:30.  Just want to make sure you didn't finish and
>> forget to update with the result :)
>>
>> On Wed, Nov 16, 2016 at 12:38 PM Todd Fiala  wrote:
>>
>> Yep - I followed that.  I'm just doing the "build + test" verification on
>> macOS.
>>
>>
>> On Wed, Nov 16, 2016 at 11:41 AM, Zachary Turner 
>> wrote:
>>
>> BTW, I would still like to get Chris to take a look at my usage of
>> llvm::Twine.  Even if it works, I'm not sure if I used it correctly.
>>
>> On Wed, Nov 16, 2016 at 11:36 AM Zachary Turner 
>> wrote:
>>
>> Either way is fine, I think you might have hit a merge conflict if you
>> stacked them, but if you've already worked through it, then no big deal.
>>
>> On Wed, Nov 16, 2016 at 11:30 AM Todd Fiala  wrote:
>>
>> tfiala added a comment.
>>
>> I'm going to test this one now, stacked on top of the final macOS-working
>> version of https://reviews.llvm.org/D26698.  Tell me now if you want it
>> tested independently of https://reviews.llvm.org/D26698.
>>
>>
>> https://reviews.llvm.org/D26721
>>
>>
>>
>>
>>
>>
>> --
>> -Todd
>>
>>
>>
>> --
>> -Todd
>>
>>
>>
>>
>> --
>> -Todd
>>
>


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


[Lldb-commits] [PATCH] D26757: Fix broken escaping of commands in the build

2016-11-16 Thread Chris Bieneman via lldb-commits
beanz added a comment.

The CMake all LGTM.


https://reviews.llvm.org/D26757



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


[Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.

LGTM!  All tests passed on macOS 10.12.2 public beta with Xcode 8.1.


https://reviews.llvm.org/D26721



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


[Lldb-commits] [lldb] r287188 - Convert AutoComplete related code to StringRef.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 19:37:42 2016
New Revision: 287188

URL: http://llvm.org/viewvc/llvm-project?rev=287188&view=rev
Log:
Convert AutoComplete related code to StringRef.

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

Modified:
lldb/trunk/include/lldb/Core/ArchSpec.h
lldb/trunk/include/lldb/Core/FormatEntity.h
lldb/trunk/include/lldb/Core/PluginManager.h
lldb/trunk/include/lldb/Core/StringList.h
lldb/trunk/include/lldb/Core/UUID.h
lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
lldb/trunk/include/lldb/Interpreter/OptionValue.h
lldb/trunk/include/lldb/Interpreter/OptionValueArch.h
lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h
lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
lldb/trunk/include/lldb/Interpreter/OptionValueFormatEntity.h
lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h
lldb/trunk/include/lldb/Symbol/Variable.h
lldb/trunk/include/lldb/Utility/NameMatches.h
lldb/trunk/source/Commands/CommandCompletions.cpp
lldb/trunk/source/Core/ArchSpec.cpp
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Core/PluginManager.cpp
lldb/trunk/source/Core/StringList.cpp
lldb/trunk/source/Core/UUID.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
lldb/trunk/source/Interpreter/OptionValue.cpp
lldb/trunk/source/Interpreter/OptionValueArch.cpp
lldb/trunk/source/Interpreter/OptionValueBoolean.cpp
lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp
lldb/trunk/source/Interpreter/OptionValueUUID.cpp
lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Utility/NameMatches.cpp

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=287188&r1=287187&r2=287188&view=diff
==
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Wed Nov 16 19:37:42 2016
@@ -283,7 +283,7 @@ public:
   //--
   const ArchSpec &operator=(const ArchSpec &rhs);
 
-  static size_t AutoComplete(const char *name, StringList &matches);
+  static size_t AutoComplete(llvm::StringRef name, StringList &matches);
 
   //--
   /// Returns a static string representing the current architecture.

Modified: lldb/trunk/include/lldb/Core/FormatEntity.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatEntity.h?rev=287188&r1=287187&r2=287188&view=diff
==
--- lldb/trunk/include/lldb/Core/FormatEntity.h (original)
+++ lldb/trunk/include/lldb/Core/FormatEntity.h Wed Nov 16 19:37:42 2016
@@ -192,7 +192,7 @@ public:
llvm::StringRef &variable_name,
llvm::StringRef &variable_format);
 
-  static size_t AutoComplete(const char *s, int match_start_point,
+  static size_t AutoComplete(llvm::StringRef s, int match_start_point,
  int max_return_elements, bool &word_complete,
  StringList &matches);
 

Modified: lldb/trunk/include/lldb/Core/PluginManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=287188&r1=287187&r2=287188&view=diff
==
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)
+++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Nov 16 19:37:42 2016
@@ -244,7 +244,7 @@ public:
 
   static const char *GetPlatformPluginDescriptionAtIndex(uint32_t idx);
 
-  static size_t AutoCompletePlatformName(const char *partial_name,
+  static size_t AutoCompletePlatformName(llvm::StringRef partial_name,
  StringList &matches);
   //--
   // Process

Modified: lldb/trunk/include/lldb/Core/StringList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StringList.h?rev=287188&r1=287187&r2=287188&view=diff
==
--- lldb/trunk/include/lldb/Core/StringList.h (original)
+++ lldb/trunk/include/lldb/Core/StringList.h Wed Nov 16 19:37:42 2016
@@ -109,7 +109,7 @@ public:
   // values in this collection, will have "exact_matches_idx"
   // filled in to match the index, or "exact_matches_idx" will
   // have SIZE_MAX
-  size_t AutoComplete(const char *s, StringList &matches,
+  size

[Lldb-commits] [lldb] r287189 - Make GetValueForVariableExpression use StringRef.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 19:37:52 2016
New Revision: 287189

URL: http://llvm.org/viewvc/llvm-project?rev=287189&view=rev
Log:
Make GetValueForVariableExpression use StringRef.

Also significantly reduced the indentation level by use of
early returns, and simplified some of the logic by using
StringRef functions such as consumeInteger() and getAsInteger()
instead of strtoll, etc.

Modified:
lldb/trunk/include/lldb/Target/StackFrame.h
lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=287189&r1=287188&r2=287189&view=diff
==
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Wed Nov 16 19:37:52 2016
@@ -313,7 +313,7 @@ public:
   /// A shared pointer to the ValueObject described by var_expr.
   //--
   lldb::ValueObjectSP GetValueForVariableExpressionPath(
-  const char *var_expr, lldb::DynamicValueType use_dynamic,
+  llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
   uint32_t options, lldb::VariableSP &var_sp, Error &error);
 
   //--

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=287189&r1=287188&r2=287189&view=diff
==
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Nov 16 19:37:52 2016
@@ -221,18 +221,17 @@ bool StackFrame::ChangePC(addr_t pc) {
 
 const char *StackFrame::Disassemble() {
   std::lock_guard guard(m_mutex);
-  if (m_disassembly.GetSize() == 0) {
-ExecutionContext exe_ctx(shared_from_this());
-Target *target = exe_ctx.GetTargetPtr();
-if (target) {
-  const char *plugin_name = nullptr;
-  const char *flavor = nullptr;
-  Disassembler::Disassemble(target->GetDebugger(),
-target->GetArchitecture(), plugin_name, flavor,
-exe_ctx, 0, false, 0, 0, m_disassembly);
-}
-if (m_disassembly.GetSize() == 0)
-  return nullptr;
+  if (m_disassembly.Empty())
+return nullptr;
+
+  ExecutionContext exe_ctx(shared_from_this());
+  Target *target = exe_ctx.GetTargetPtr();
+  if (target) {
+const char *plugin_name = nullptr;
+const char *flavor = nullptr;
+Disassembler::Disassemble(target->GetDebugger(), target->GetArchitecture(),
+  plugin_name, flavor, exe_ctx, 0, false, 0, 0,
+  m_disassembly);
   }
   return m_disassembly.GetData();
 }
@@ -485,579 +484,557 @@ StackFrame::GetInScopeVariableList(bool
 }
 
 ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
-const char *var_expr_cstr, DynamicValueType use_dynamic, uint32_t options,
-VariableSP &var_sp, Error &error) {
+llvm::StringRef var_expr_cstr, DynamicValueType use_dynamic,
+uint32_t options, VariableSP &var_sp, Error &error) {
   // We can't fetch variable information for a history stack frame.
   if (m_is_history_frame)
 return ValueObjectSP();
 
-  if (var_expr_cstr && var_expr_cstr[0]) {
-const bool check_ptr_vs_member =
-(options & eExpressionPathOptionCheckPtrVsMember) != 0;
-const bool no_fragile_ivar =
-(options & eExpressionPathOptionsNoFragileObjcIvar) != 0;
-const bool no_synth_child =
-(options & eExpressionPathOptionsNoSyntheticChildren) != 0;
-// const bool no_synth_array = (options &
-// eExpressionPathOptionsNoSyntheticArrayRange) != 0;
-error.Clear();
-bool deref = false;
-bool address_of = false;
-ValueObjectSP valobj_sp;
-const bool get_file_globals = true;
-// When looking up a variable for an expression, we need only consider the
-// variables that are in scope.
-VariableListSP var_list_sp(GetInScopeVariableList(get_file_globals));
-VariableList *variable_list = var_list_sp.get();
-
-if (variable_list) {
-  // If first character is a '*', then show pointer contents
-  const char *var_expr = var_expr_cstr;
-  if (var_expr[0] == '*') {
-deref = true;
-var_expr++; // Skip the '*'
-  } else if (var_expr[0] == '&') {
-address_of = true;
-var_expr++; // Skip the '&'
-  }
-
-  std::string var_path(var_expr);
-  size_t separator_idx = var_path.find_first_of(".-[=+~|&^%#@!/?,<>{}");
-  StreamString var_expr_path_strm;
-
-  ConstString name_const_string;
-  if (separator_idx == std::string::npos)
-name_const_string.SetCString(var_path.c_str());
-  else
-name_const_string.SetCStringWithLength(var_path.c_str(), 
separator_idx)

[Lldb-commits] [lldb] r287190 - Convert UriParser to use StringRef.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 19:38:02 2016
New Revision: 287190

URL: http://llvm.org/viewvc/llvm-project?rev=287190&view=rev
Log:
Convert UriParser to use StringRef.

Modified:
lldb/trunk/include/lldb/Core/UUID.h
lldb/trunk/source/Core/UUID.cpp
lldb/trunk/source/Interpreter/OptionValueUUID.cpp
lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp

lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Utility/UriParser.cpp
lldb/trunk/source/Utility/UriParser.h
lldb/trunk/unittests/Utility/UriParserTest.cpp

Modified: lldb/trunk/include/lldb/Core/UUID.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UUID.h?rev=287190&r1=287189&r2=287190&view=diff
==
--- lldb/trunk/include/lldb/Core/UUID.h (original)
+++ lldb/trunk/include/lldb/Core/UUID.h Wed Nov 16 19:38:02 2016
@@ -73,6 +73,7 @@ public:
   //--
   static llvm::StringRef
   DecodeUUIDBytesFromString(llvm::StringRef str, ValueType &uuid_bytes,
+uint32_t &bytes_decoded,
 uint32_t num_uuid_bytes = 16);
 
 protected:

Modified: lldb/trunk/source/Core/UUID.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UUID.cpp?rev=287190&r1=287189&r2=287190&view=diff
==
--- lldb/trunk/source/Core/UUID.cpp (original)
+++ lldb/trunk/source/Core/UUID.cpp Wed Nov 16 19:38:02 2016
@@ -128,6 +128,7 @@ static inline int xdigit_to_int(char ch)
 
 llvm::StringRef UUID::DecodeUUIDBytesFromString(llvm::StringRef p,
 ValueType &uuid_bytes,
+uint32_t &bytes_decoded,
 uint32_t num_uuid_bytes) {
   ::memset(uuid_bytes, 0, sizeof(uuid_bytes));
   size_t uuid_byte_idx = 0;
@@ -157,6 +158,7 @@ llvm::StringRef UUID::DecodeUUIDBytesFro
   // Clear trailing bytes to 0.
   for (uint32_t i = uuid_byte_idx; i < sizeof(ValueType); i++)
 uuid_bytes[i] = 0;
+  bytes_decoded = uuid_byte_idx;
   return p;
 }
 size_t UUID::SetFromCString(const char *cstr, uint32_t num_uuid_bytes) {
@@ -169,9 +171,9 @@ size_t UUID::SetFromCString(const char *
   // Skip leading whitespace characters
   p = p.ltrim();
 
+  uint32_t bytes_decoded = 0;
   llvm::StringRef rest =
-  UUID::DecodeUUIDBytesFromString(p, m_uuid, num_uuid_bytes);
-  size_t bytes_decoded = p.size() - rest.size();
+  UUID::DecodeUUIDBytesFromString(p, m_uuid, bytes_decoded, 
num_uuid_bytes);
 
   // If we successfully decoded a UUID, return the amount of characters that
   // were consumed

Modified: lldb/trunk/source/Interpreter/OptionValueUUID.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUUID.cpp?rev=287190&r1=287189&r2=287190&view=diff
==
--- lldb/trunk/source/Interpreter/OptionValueUUID.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp Wed Nov 16 19:38:02 2016
@@ -79,8 +79,9 @@ size_t OptionValueUUID::AutoComplete(Com
 const size_t num_modules = target->GetImages().GetSize();
 if (num_modules > 0) {
   UUID::ValueType uuid_bytes;
-  llvm::StringRef rest = UUID::DecodeUUIDBytesFromString(s, uuid_bytes);
-  const size_t num_bytes_decoded = s.size() - rest.size();
+  size_t num_bytes_decoded = 0;
+  llvm::StringRef rest =
+  UUID::DecodeUUIDBytesFromString(s, uuid_bytes, num_bytes_decoded);
   for (size_t i = 0; i < num_modules; ++i) {
 ModuleSP module_sp(target->GetImages().GetModuleAtIndex(i));
 if (module_sp) {

Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=287190&r1=287189&r2=287190&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Wed Nov 16 
19:38:02 2016
@@ -185,7 +185,7 @@ Error AdbClient::SetPortForwarding(const
 }
 
 Error AdbClient::SetPortForwarding(const uint16_t local_port,
-   const char *remote_socket_name,
+   llvm::StringRef remote_socket_name,
   

[Lldb-commits] [PATCH] D26721: Make AutoComplete code use StringRef

2016-11-16 Thread Zachary Turner via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287188: Convert AutoComplete related code to StringRef. 
(authored by zturner).

Changed prior to commit:
  https://reviews.llvm.org/D26721?vs=78110&id=78299#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26721

Files:
  lldb/trunk/include/lldb/Core/ArchSpec.h
  lldb/trunk/include/lldb/Core/FormatEntity.h
  lldb/trunk/include/lldb/Core/PluginManager.h
  lldb/trunk/include/lldb/Core/StringList.h
  lldb/trunk/include/lldb/Core/UUID.h
  lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
  lldb/trunk/include/lldb/Interpreter/OptionValue.h
  lldb/trunk/include/lldb/Interpreter/OptionValueArch.h
  lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h
  lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
  lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
  lldb/trunk/include/lldb/Interpreter/OptionValueFormatEntity.h
  lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h
  lldb/trunk/include/lldb/Symbol/Variable.h
  lldb/trunk/include/lldb/Utility/NameMatches.h
  lldb/trunk/source/Commands/CommandCompletions.cpp
  lldb/trunk/source/Core/ArchSpec.cpp
  lldb/trunk/source/Core/FormatEntity.cpp
  lldb/trunk/source/Core/PluginManager.cpp
  lldb/trunk/source/Core/StringList.cpp
  lldb/trunk/source/Core/UUID.cpp
  lldb/trunk/source/Interpreter/CommandObject.cpp
  lldb/trunk/source/Interpreter/OptionValue.cpp
  lldb/trunk/source/Interpreter/OptionValueArch.cpp
  lldb/trunk/source/Interpreter/OptionValueBoolean.cpp
  lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
  lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
  lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp
  lldb/trunk/source/Interpreter/OptionValueUUID.cpp
  lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
  lldb/trunk/source/Symbol/Variable.cpp
  lldb/trunk/source/Utility/NameMatches.cpp

Index: lldb/trunk/include/lldb/Symbol/Variable.h
===
--- lldb/trunk/include/lldb/Symbol/Variable.h
+++ lldb/trunk/include/lldb/Symbol/Variable.h
@@ -1,5 +1,4 @@
-//===-- Variable.h --*- C++
-//-*-===//
+//===-- Variable.h ---*- C++-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -103,8 +102,9 @@
   GetVariableCallback callback, void *baton, VariableList &variable_list,
   ValueObjectList &valobj_list);
 
-  static size_t AutoComplete(const ExecutionContext &exe_ctx, const char *name,
- StringList &matches, bool &word_complete);
+  static size_t AutoComplete(const ExecutionContext &exe_ctx,
+ llvm::StringRef name, StringList &matches,
+ bool &word_complete);
 
   CompilerDeclContext GetDeclContext();
 
Index: lldb/trunk/include/lldb/Utility/NameMatches.h
===
--- lldb/trunk/include/lldb/Utility/NameMatches.h
+++ lldb/trunk/include/lldb/Utility/NameMatches.h
@@ -11,8 +11,11 @@
 
 #include "lldb/lldb-private-enumerations.h"
 
+#include "llvm/ADT/StringRef.h"
+
 namespace lldb_private {
-bool NameMatches(const char *name, NameMatchType match_type, const char *match);
+bool NameMatches(llvm::StringRef name, NameMatchType match_type,
+ llvm::StringRef match);
 }
 
 #endif
Index: lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
===
--- lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
+++ lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
@@ -32,7 +32,7 @@
   //--
   typedef int (*CompletionCallback)(
   CommandInterpreter &interpreter,
-  const char *completion_str, // This is the argument we are completing
+  llvm::StringRef completion_str, // This is the argument we are completing
   int match_start_point,   // This is the point in the list of matches that
// you should start returning elements
   int max_return_elements, // This is the number of matches requested.
@@ -64,61 +64,62 @@
 
   static bool InvokeCommonCompletionCallbacks(
   CommandInterpreter &interpreter, uint32_t completion_mask,
-  const char *completion_str, int match_start_point,
+  llvm::StringRef completion_str, int match_start_point,
   int max_return_elements, SearchFilter *searcher, bool &word_complete,
   StringList &matches);
 
   //--
   // These are the generic completer functions:
   //--
   static int DiskFiles(CommandInterpreter &interpreter,
-   const char *partial_file_name, int match_start_point,
+ 

Re: [Lldb-commits] [lldb] r287189 - Make GetValueForVariableExpression use StringRef.

2016-11-16 Thread Jim Ingham via lldb-commits
Probably just an oversight, but changing var_expr_cstr to a StringRef, but 
leaving it called "_cstr" will cause confusion.

Jim

> On Nov 16, 2016, at 5:37 PM, Zachary Turner via lldb-commits 
>  wrote:
> 
> Author: zturner
> Date: Wed Nov 16 19:37:52 2016
> New Revision: 287189
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=287189&view=rev
> Log:
> Make GetValueForVariableExpression use StringRef.
> 
> Also significantly reduced the indentation level by use of
> early returns, and simplified some of the logic by using
> StringRef functions such as consumeInteger() and getAsInteger()
> instead of strtoll, etc.
> 
> Modified:
>lldb/trunk/include/lldb/Target/StackFrame.h
>lldb/trunk/source/Target/StackFrame.cpp
> 
> Modified: lldb/trunk/include/lldb/Target/StackFrame.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=287189&r1=287188&r2=287189&view=diff
> ==
> --- lldb/trunk/include/lldb/Target/StackFrame.h (original)
> +++ lldb/trunk/include/lldb/Target/StackFrame.h Wed Nov 16 19:37:52 2016
> @@ -313,7 +313,7 @@ public:
>   /// A shared pointer to the ValueObject described by var_expr.
>   //--
>   lldb::ValueObjectSP GetValueForVariableExpressionPath(
> -  const char *var_expr, lldb::DynamicValueType use_dynamic,
> +  llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,
>   uint32_t options, lldb::VariableSP &var_sp, Error &error);
> 
>   //--
> 
> Modified: lldb/trunk/source/Target/StackFrame.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=287189&r1=287188&r2=287189&view=diff
> ==
> --- lldb/trunk/source/Target/StackFrame.cpp (original)
> +++ lldb/trunk/source/Target/StackFrame.cpp Wed Nov 16 19:37:52 2016
> @@ -221,18 +221,17 @@ bool StackFrame::ChangePC(addr_t pc) {
> 
> const char *StackFrame::Disassemble() {
>   std::lock_guard guard(m_mutex);
> -  if (m_disassembly.GetSize() == 0) {
> -ExecutionContext exe_ctx(shared_from_this());
> -Target *target = exe_ctx.GetTargetPtr();
> -if (target) {
> -  const char *plugin_name = nullptr;
> -  const char *flavor = nullptr;
> -  Disassembler::Disassemble(target->GetDebugger(),
> -target->GetArchitecture(), plugin_name, 
> flavor,
> -exe_ctx, 0, false, 0, 0, m_disassembly);
> -}
> -if (m_disassembly.GetSize() == 0)
> -  return nullptr;
> +  if (m_disassembly.Empty())
> +return nullptr;
> +
> +  ExecutionContext exe_ctx(shared_from_this());
> +  Target *target = exe_ctx.GetTargetPtr();
> +  if (target) {
> +const char *plugin_name = nullptr;
> +const char *flavor = nullptr;
> +Disassembler::Disassemble(target->GetDebugger(), 
> target->GetArchitecture(),
> +  plugin_name, flavor, exe_ctx, 0, false, 0, 0,
> +  m_disassembly);
>   }
>   return m_disassembly.GetData();
> }
> @@ -485,579 +484,557 @@ StackFrame::GetInScopeVariableList(bool
> }
> 
> ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
> -const char *var_expr_cstr, DynamicValueType use_dynamic, uint32_t 
> options,
> -VariableSP &var_sp, Error &error) {
> +llvm::StringRef var_expr_cstr, DynamicValueType use_dynamic,
> +uint32_t options, VariableSP &var_sp, Error &error) {
>   // We can't fetch variable information for a history stack frame.
>   if (m_is_history_frame)
> return ValueObjectSP();
> 
> -  if (var_expr_cstr && var_expr_cstr[0]) {
> -const bool check_ptr_vs_member =
> -(options & eExpressionPathOptionCheckPtrVsMember) != 0;
> -const bool no_fragile_ivar =
> -(options & eExpressionPathOptionsNoFragileObjcIvar) != 0;
> -const bool no_synth_child =
> -(options & eExpressionPathOptionsNoSyntheticChildren) != 0;
> -// const bool no_synth_array = (options &
> -// eExpressionPathOptionsNoSyntheticArrayRange) != 0;
> -error.Clear();
> -bool deref = false;
> -bool address_of = false;
> -ValueObjectSP valobj_sp;
> -const bool get_file_globals = true;
> -// When looking up a variable for an expression, we need only consider 
> the
> -// variables that are in scope.
> -VariableListSP var_list_sp(GetInScopeVariableList(get_file_globals));
> -VariableList *variable_list = var_list_sp.get();
> -
> -if (variable_list) {
> -  // If first character is a '*', then show pointer contents
> -  const char *var_expr = var_expr_cstr;
> -  if (var_expr[0] == '*') {
> -deref = true;
> -var_expr++; // Skip the '*'
> -  } else if (var_expr[0] == '&') {
> -address_of = true;
> -var_expr++; // Sk

Re: [Lldb-commits] [lldb] r287190 - Convert UriParser to use StringRef.

2016-11-16 Thread Zachary Turner via lldb-commits
Looks like this broke some bots, i can fix it up in about 30 minutes
On Wed, Nov 16, 2016 at 5:47 PM Zachary Turner via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: zturner
> Date: Wed Nov 16 19:38:02 2016
> New Revision: 287190
>
> URL: http://llvm.org/viewvc/llvm-project?rev=287190&view=rev
> Log:
> Convert UriParser to use StringRef.
>
> Modified:
> lldb/trunk/include/lldb/Core/UUID.h
> lldb/trunk/source/Core/UUID.cpp
> lldb/trunk/source/Interpreter/OptionValueUUID.cpp
> lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
> lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
> lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
>
> lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
>
> lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
>
> lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
>
> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
> lldb/trunk/source/Utility/UriParser.cpp
> lldb/trunk/source/Utility/UriParser.h
> lldb/trunk/unittests/Utility/UriParserTest.cpp
>
> Modified: lldb/trunk/include/lldb/Core/UUID.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UUID.h?rev=287190&r1=287189&r2=287190&view=diff
>
> ==
> --- lldb/trunk/include/lldb/Core/UUID.h (original)
> +++ lldb/trunk/include/lldb/Core/UUID.h Wed Nov 16 19:38:02 2016
> @@ -73,6 +73,7 @@ public:
>//--
>static llvm::StringRef
>DecodeUUIDBytesFromString(llvm::StringRef str, ValueType &uuid_bytes,
> +uint32_t &bytes_decoded,
>  uint32_t num_uuid_bytes = 16);
>
>  protected:
>
> Modified: lldb/trunk/source/Core/UUID.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UUID.cpp?rev=287190&r1=287189&r2=287190&view=diff
>
> ==
> --- lldb/trunk/source/Core/UUID.cpp (original)
> +++ lldb/trunk/source/Core/UUID.cpp Wed Nov 16 19:38:02 2016
> @@ -128,6 +128,7 @@ static inline int xdigit_to_int(char ch)
>
>  llvm::StringRef UUID::DecodeUUIDBytesFromString(llvm::StringRef p,
>  ValueType &uuid_bytes,
> +uint32_t &bytes_decoded,
>  uint32_t num_uuid_bytes) {
>::memset(uuid_bytes, 0, sizeof(uuid_bytes));
>size_t uuid_byte_idx = 0;
> @@ -157,6 +158,7 @@ llvm::StringRef UUID::DecodeUUIDBytesFro
>// Clear trailing bytes to 0.
>for (uint32_t i = uuid_byte_idx; i < sizeof(ValueType); i++)
>  uuid_bytes[i] = 0;
> +  bytes_decoded = uuid_byte_idx;
>return p;
>  }
>  size_t UUID::SetFromCString(const char *cstr, uint32_t num_uuid_bytes) {
> @@ -169,9 +171,9 @@ size_t UUID::SetFromCString(const char *
>// Skip leading whitespace characters
>p = p.ltrim();
>
> +  uint32_t bytes_decoded = 0;
>llvm::StringRef rest =
> -  UUID::DecodeUUIDBytesFromString(p, m_uuid, num_uuid_bytes);
> -  size_t bytes_decoded = p.size() - rest.size();
> +  UUID::DecodeUUIDBytesFromString(p, m_uuid, bytes_decoded,
> num_uuid_bytes);
>
>// If we successfully decoded a UUID, return the amount of characters
> that
>// were consumed
>
> Modified: lldb/trunk/source/Interpreter/OptionValueUUID.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUUID.cpp?rev=287190&r1=287189&r2=287190&view=diff
>
> ==
> --- lldb/trunk/source/Interpreter/OptionValueUUID.cpp (original)
> +++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp Wed Nov 16 19:38:02
> 2016
> @@ -79,8 +79,9 @@ size_t OptionValueUUID::AutoComplete(Com
>  const size_t num_modules = target->GetImages().GetSize();
>  if (num_modules > 0) {
>UUID::ValueType uuid_bytes;
> -  llvm::StringRef rest = UUID::DecodeUUIDBytesFromString(s,
> uuid_bytes);
> -  const size_t num_bytes_decoded = s.size() - rest.size();
> +  size_t num_bytes_decoded = 0;
> +  llvm::StringRef rest =
> +  UUID::DecodeUUIDBytesFromString(s, uuid_bytes,
> num_bytes_decoded);
>for (size_t i = 0; i < num_modules; ++i) {
>  ModuleSP module_sp(target->GetImages().GetModuleAtIndex(i));
>  if (module_sp) {
>
> Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=287190&r1=287189&r2=287190&view=diff
>
> ==
> --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original)
> +++ lldb/trunk/source/Plugins/Plat

[Lldb-commits] [lldb] r287208 - Fix warnings and errors introduced with UUID changes.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Nov 16 23:14:32 2016
New Revision: 287208

URL: http://llvm.org/viewvc/llvm-project?rev=287208&view=rev
Log:
Fix warnings and errors introduced with UUID changes.

Modified:
lldb/trunk/source/Interpreter/OptionValueUUID.cpp
lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/source/Interpreter/OptionValueUUID.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUUID.cpp?rev=287208&r1=287207&r2=287208&view=diff
==
--- lldb/trunk/source/Interpreter/OptionValueUUID.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp Wed Nov 16 23:14:32 2016
@@ -79,9 +79,8 @@ size_t OptionValueUUID::AutoComplete(Com
 const size_t num_modules = target->GetImages().GetSize();
 if (num_modules > 0) {
   UUID::ValueType uuid_bytes;
-  size_t num_bytes_decoded = 0;
-  llvm::StringRef rest =
-  UUID::DecodeUUIDBytesFromString(s, uuid_bytes, num_bytes_decoded);
+  uint32_t num_bytes_decoded = 0;
+  UUID::DecodeUUIDBytesFromString(s, uuid_bytes, num_bytes_decoded);
   for (size_t i = 0; i < num_modules; ++i) {
 ModuleSP module_sp(target->GetImages().GetModuleAtIndex(i));
 if (module_sp) {

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=287208&r1=287207&r2=287208&view=diff
==
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Nov 16 23:14:32 2016
@@ -484,14 +484,16 @@ StackFrame::GetInScopeVariableList(bool
 }
 
 ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
-llvm::StringRef var_expr_cstr, DynamicValueType use_dynamic,
-uint32_t options, VariableSP &var_sp, Error &error) {
+llvm::StringRef var_expr, DynamicValueType use_dynamic, uint32_t options,
+VariableSP &var_sp, Error &error) {
+  llvm::StringRef original_var_expr = var_expr;
   // We can't fetch variable information for a history stack frame.
   if (m_is_history_frame)
 return ValueObjectSP();
 
-  if (var_expr_cstr.empty()) {
-error.SetErrorStringWithFormat("invalid variable path '%s'", 
var_expr_cstr);
+  if (var_expr.empty()) {
+error.SetErrorStringWithFormat("invalid variable path '%s'",
+   var_expr.str().c_str());
 return ValueObjectSP();
   }
 
@@ -517,7 +519,6 @@ ValueObjectSP StackFrame::GetValueForVar
 return ValueObjectSP();
 
   // If first character is a '*', then show pointer contents
-  llvm::StringRef var_expr = var_expr_cstr;
   std::string var_expr_storage;
   if (var_expr[0] == '*') {
 deref = true;
@@ -688,7 +689,8 @@ ValueObjectSP StackFrame::GetValueForVar
 } else {
   error.SetErrorStringWithFormat(
   "incomplete expression path after \"%s\" in \"%s\"",
-  var_expr_path_strm.GetData(), var_expr_cstr);
+  var_expr_path_strm.GetData(),
+  original_var_expr.str().c_str());
 }
   }
   return ValueObjectSP();


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


[Lldb-commits] [lldb] r287212 - Fix one more build error with lldb-server.

2016-11-16 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Nov 17 00:13:54 2016
New Revision: 287212

URL: http://llvm.org/viewvc/llvm-project?rev=287212&view=rev
Log:
Fix one more build error with lldb-server.

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

Modified: lldb/trunk/tools/lldb-server/Acceptor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/Acceptor.cpp?rev=287212&r1=287211&r2=287212&view=diff
==
--- lldb/trunk/tools/lldb-server/Acceptor.cpp (original)
+++ lldb/trunk/tools/lldb-server/Acceptor.cpp Thu Nov 17 00:13:54 2016
@@ -88,12 +88,12 @@ std::unique_ptr Acceptor::Crea
 
   Socket::SocketProtocol socket_protocol = Socket::ProtocolUnixDomain;
   int port;
-  std::string scheme, host, path;
+  StringRef scheme, host, path;
   // Try to match socket name as URL - e.g., tcp://localhost:
   if (UriParser::Parse(name.str(), scheme, host, port, path)) {
-if (!FindProtocolByScheme(scheme.c_str(), socket_protocol))
+if (!FindProtocolByScheme(scheme.str().c_str(), socket_protocol))
   error.SetErrorStringWithFormat("Unknown protocol scheme \"%s\"",
- scheme.c_str());
+ scheme.str().c_str());
 else
   name = name.drop_front(scheme.size() + strlen("://"));
   } else {


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