[Lldb-commits] [PATCH] D39487: Add float/vector registers for ppc64le

2017-11-01 Thread Alexandre Yukio Yamashita via Phabricator via lldb-commits
alexandreyy created this revision.
Herald added subscribers: JDevlieghere, kbarton, nemanjai.

Add read and write functions for VSX, VMX and float registers and fix 
watchpoint size


https://reviews.llvm.org/D39487

Files:
  packages/Python/lldbsuite/test/make/Makefile.rules
  source/Core/ArchSpec.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
  source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
  source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h
  source/Utility/PPC64LE_DWARF_Registers.h
  source/Utility/PPC64LE_ehframe_Registers.h

Index: source/Utility/PPC64LE_ehframe_Registers.h
===
--- source/Utility/PPC64LE_ehframe_Registers.h
+++ source/Utility/PPC64LE_ehframe_Registers.h
@@ -48,15 +48,146 @@
   r29,
   r30,
   r31,
+  f0,
+  f1,
+  f2,
+  f3,
+  f4,
+  f5,
+  f6,
+  f7,
+  f8,
+  f9,
+  f10,
+  f11,
+  f12,
+  f13,
+  f14,
+  f15,
+  f16,
+  f17,
+  f18,
+  f19,
+  f20,
+  f21,
+  f22,
+  f23,
+  f24,
+  f25,
+  f26,
+  f27,
+  f28,
+  f29,
+  f30,
+  f31,
   lr = 65,
   ctr,
   cr = 68,
   xer = 76,
+  vr0,
+  vr1,
+  vr2,
+  vr3,
+  vr4,
+  vr5,
+  vr6,
+  vr7,
+  vr8,
+  vr9,
+  vr10,
+  vr11,
+  vr12,
+  vr13,
+  vr14,
+  vr15,
+  vr16,
+  vr17,
+  vr18,
+  vr19,
+  vr20,
+  vr21,
+  vr22,
+  vr23,
+  vr24,
+  vr25,
+  vr26,
+  vr27,
+  vr28,
+  vr29,
+  vr30,
+  vr31,
+  vscr = 110,
+  vrsave = 117,
   pc,
   softe,
   trap,
   origr3,
+  fpscr,
   msr,
+  vs0,
+  vs1,
+  vs2,
+  vs3,
+  vs4,
+  vs5,
+  vs6,
+  vs7,
+  vs8,
+  vs9,
+  vs10,
+  vs11,
+  vs12,
+  vs13,
+  vs14,
+  vs15,
+  vs16,
+  vs17,
+  vs18,
+  vs19,
+  vs20,
+  vs21,
+  vs22,
+  vs23,
+  vs24,
+  vs25,
+  vs26,
+  vs27,
+  vs28,
+  vs29,
+  vs30,
+  vs31,
+  vs32,
+  vs33,
+  vs34,
+  vs35,
+  vs36,
+  vs37,
+  vs38,
+  vs39,
+  vs40,
+  vs41,
+  vs42,
+  vs43,
+  vs44,
+  vs45,
+  vs46,
+  vs47,
+  vs48,
+  vs49,
+  vs50,
+  vs51,
+  vs52,
+  vs53,
+  vs54,
+  vs55,
+  vs56,
+  vs57,
+  vs58,
+  vs59,
+  vs60,
+  vs61,
+  vs62,
+  vs63,
 };
 }
 
Index: source/Utility/PPC64LE_DWARF_Registers.h
===
--- source/Utility/PPC64LE_DWARF_Registers.h
+++ source/Utility/PPC64LE_DWARF_Registers.h
@@ -47,15 +47,146 @@
   dwarf_r29_ppc64le,
   dwarf_r30_ppc64le,
   dwarf_r31_ppc64le,
+  dwarf_f0_ppc64le,
+  dwarf_f1_ppc64le,
+  dwarf_f2_ppc64le,
+  dwarf_f3_ppc64le,
+  dwarf_f4_ppc64le,
+  dwarf_f5_ppc64le,
+  dwarf_f6_ppc64le,
+  dwarf_f7_ppc64le,
+  dwarf_f8_ppc64le,
+  dwarf_f9_ppc64le,
+  dwarf_f10_ppc64le,
+  dwarf_f11_ppc64le,
+  dwarf_f12_ppc64le,
+  dwarf_f13_ppc64le,
+  dwarf_f14_ppc64le,
+  dwarf_f15_ppc64le,
+  dwarf_f16_ppc64le,
+  dwarf_f17_ppc64le,
+  dwarf_f18_ppc64le,
+  dwarf_f19_ppc64le,
+  dwarf_f20_ppc64le,
+  dwarf_f21_ppc64le,
+  dwarf_f22_ppc64le,
+  dwarf_f23_ppc64le,
+  dwarf_f24_ppc64le,
+  dwarf_f25_ppc64le,
+  dwarf_f26_ppc64le,
+  dwarf_f27_ppc64le,
+  dwarf_f28_ppc64le,
+  dwarf_f29_ppc64le,
+  dwarf_f30_ppc64le,
+  dwarf_f31_ppc64le,
   dwarf_lr_ppc64le = 65,
   dwarf_ctr_ppc64le,
   dwarf_cr_ppc64le = 68,
   dwarf_xer_ppc64le = 76,
+  dwarf_vr0_ppc64le,
+  dwarf_vr1_ppc64le,
+  dwarf_vr2_ppc64le,
+  dwarf_vr3_ppc64le,
+  dwarf_vr4_ppc64le,
+  dwarf_vr5_ppc64le,
+  dwarf_vr6_ppc64le,
+  dwarf_vr7_ppc64le,
+  dwarf_vr8_ppc64le,
+  dwarf_vr9_ppc64le,
+  dwarf_vr10_ppc64le,
+  dwarf_vr11_ppc64le,
+  dwarf_vr12_ppc64le,
+  dwarf_vr13_ppc64le,
+  dwarf_vr14_ppc64le,
+  dwarf_vr15_ppc64le,
+  dwarf_vr16_ppc64le,
+  dwarf_vr17_ppc64le,
+  dwarf_vr18_ppc64le,
+  dwarf_vr19_ppc64le,
+  dwarf_vr20_ppc64le,
+  dwarf_vr21_ppc64le,
+  dwarf_vr22_ppc64le,
+  dwarf_vr23_ppc64le,
+  dwarf_vr24_ppc64le,
+  dwarf_vr25_ppc64le,
+  dwarf_vr26_ppc64le,
+  dwarf_vr27_ppc64le,
+  dwarf_vr28_ppc64le,
+  dwarf_vr29_ppc64le,
+  dwarf_vr30_ppc64le,
+  dwarf_vr31_ppc64le,
+  dwarf_vscr_ppc64le = 110,
+  dwarf_vrsave_ppc64le = 117,
   dwarf_pc_ppc64le,
   dwarf_softe_ppc64le,
   dwarf_trap_ppc64le,
   dwarf_origr3_ppc64le,
+  dwarf_fpscr_ppc64le,
   dwarf_msr_ppc64le,
+  dwarf_vs0_ppc64le,
+  dwarf_vs1_ppc64le,
+  dwarf_vs2_ppc64le,
+  dwarf_vs3_ppc64le,
+  dwarf_vs4_ppc64le,
+  dwarf_vs5_ppc64le,
+  dwarf_vs6_ppc64le,
+  dwarf_vs7_ppc64le,
+  dwarf_vs8_ppc64le,
+  dwarf_vs9_ppc64le,
+  dwarf_vs10_ppc64le,
+  dwarf_vs11_ppc64le,
+  dwarf_vs12_ppc64le,
+  dwarf_vs13_ppc64le,
+  dwarf_vs14_ppc64le,
+  dwarf_vs15_ppc64le,
+  dwarf_vs16_ppc64le,
+  dwarf_vs17_ppc64le,
+  dwarf_vs18_ppc64le,
+  dwarf_vs19_ppc64le,
+  dwarf_vs20_ppc64le,
+  dwarf_vs21_ppc64le,
+  dwarf_vs22_ppc64le,
+  dwarf_vs23_ppc64le,
+  dwarf_vs24_ppc64le,
+  dwarf_vs25_ppc64le,
+  dwarf_vs26_ppc64le,
+  dwarf_vs27_ppc64le,
+  dwarf_vs28_ppc64le,
+  dwarf_vs29_ppc64le,
+  dwarf_vs30_ppc64le,
+  dwarf_vs31_ppc64le,
+  dwarf_vs32_ppc64le,
+  dwarf_vs33_ppc64le,
+  dwarf_vs34_ppc64le,
+  dwarf_vs35_ppc64le,
+  dwarf_vs36_ppc64le,
+  dwa

[Lldb-commits] [lldb] r317093 - Remove uint32_t assignment operator from Status

2017-11-01 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov  1 08:00:58 2017
New Revision: 317093

URL: http://llvm.org/viewvc/llvm-project?rev=317093&view=rev
Log:
Remove uint32_t assignment operator from Status

Summary:
It is not presently used, and it's quite dangerous to use -- it assumes the
integer is an osx kern_return_t, but very few of the integers we have lying
around are mach kernel error codes. The error can still be used to a
mach error using a slightly longer (but more explicit) syntax.

Reviewers: jingham

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/Utility/Status.h
lldb/trunk/source/Utility/Status.cpp

Modified: lldb/trunk/include/lldb/Utility/Status.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Status.h?rev=317093&r1=317092&r2=317093&view=diff
==
--- lldb/trunk/include/lldb/Utility/Status.h (original)
+++ lldb/trunk/include/lldb/Utility/Status.h Wed Nov  1 08:00:58 2017
@@ -88,19 +88,6 @@ public:
   //--
   const Status &operator=(const Status &rhs);
 
-  //--
-  /// Assignment operator from a kern_return_t.
-  ///
-  /// Sets the type to \c MachKernel and the error code to \a err.
-  ///
-  /// @param[in] err
-  /// A mach error code.
-  ///
-  /// @return
-  /// A const reference to this object.
-  //--
-  const Status &operator=(uint32_t err);
-
   ~Status();
 
   // llvm::Error support

Modified: lldb/trunk/source/Utility/Status.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Status.cpp?rev=317093&r1=317092&r2=317093&view=diff
==
--- lldb/trunk/source/Utility/Status.cpp (original)
+++ lldb/trunk/source/Utility/Status.cpp Wed Nov  1 08:00:58 2017
@@ -104,16 +104,6 @@ const Status &Status::operator=(const St
   return *this;
 }
 
-//--
-// Assignment operator
-//--
-const Status &Status::operator=(uint32_t err) {
-  m_code = err;
-  m_type = eErrorTypeMachKernel;
-  m_string.clear();
-  return *this;
-}
-
 Status::~Status() = default;
 
 //--


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


[Lldb-commits] [PATCH] D35305: Remove uint32_t assignment operator from Status

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317093: Remove uint32_t assignment operator from Status 
(authored by labath).

Repository:
  rL LLVM

https://reviews.llvm.org/D35305

Files:
  lldb/trunk/include/lldb/Utility/Status.h
  lldb/trunk/source/Utility/Status.cpp


Index: lldb/trunk/include/lldb/Utility/Status.h
===
--- lldb/trunk/include/lldb/Utility/Status.h
+++ lldb/trunk/include/lldb/Utility/Status.h
@@ -88,19 +88,6 @@
   //--
   const Status &operator=(const Status &rhs);
 
-  //--
-  /// Assignment operator from a kern_return_t.
-  ///
-  /// Sets the type to \c MachKernel and the error code to \a err.
-  ///
-  /// @param[in] err
-  /// A mach error code.
-  ///
-  /// @return
-  /// A const reference to this object.
-  //--
-  const Status &operator=(uint32_t err);
-
   ~Status();
 
   // llvm::Error support
Index: lldb/trunk/source/Utility/Status.cpp
===
--- lldb/trunk/source/Utility/Status.cpp
+++ lldb/trunk/source/Utility/Status.cpp
@@ -104,16 +104,6 @@
   return *this;
 }
 
-//--
-// Assignment operator
-//--
-const Status &Status::operator=(uint32_t err) {
-  m_code = err;
-  m_type = eErrorTypeMachKernel;
-  m_string.clear();
-  return *this;
-}
-
 Status::~Status() = default;
 
 //--


Index: lldb/trunk/include/lldb/Utility/Status.h
===
--- lldb/trunk/include/lldb/Utility/Status.h
+++ lldb/trunk/include/lldb/Utility/Status.h
@@ -88,19 +88,6 @@
   //--
   const Status &operator=(const Status &rhs);
 
-  //--
-  /// Assignment operator from a kern_return_t.
-  ///
-  /// Sets the type to \c MachKernel and the error code to \a err.
-  ///
-  /// @param[in] err
-  /// A mach error code.
-  ///
-  /// @return
-  /// A const reference to this object.
-  //--
-  const Status &operator=(uint32_t err);
-
   ~Status();
 
   // llvm::Error support
Index: lldb/trunk/source/Utility/Status.cpp
===
--- lldb/trunk/source/Utility/Status.cpp
+++ lldb/trunk/source/Utility/Status.cpp
@@ -104,16 +104,6 @@
   return *this;
 }
 
-//--
-// Assignment operator
-//--
-const Status &Status::operator=(uint32_t err) {
-  m_code = err;
-  m_type = eErrorTypeMachKernel;
-  m_string.clear();
-  return *this;
-}
-
 Status::~Status() = default;
 
 //--
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D35615: Add data formatter for libc++ std::tuple

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

There wasn't a strong reason for using nullptr, I can convert those to 
ValueObjectSP().

Given that this was your only objection to this patch, I'm going to assume it 
is ok to land after this.


https://reviews.llvm.org/D35615



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


[Lldb-commits] [PATCH] D35615: Add data formatter for libc++ std::tuple

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 121131.
labath added a comment.

s/nullptr/ValueObjectSP()


https://reviews.llvm.org/D35615

Files:
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
  source/Plugins/Language/CPlusPlus/CMakeLists.txt
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/LibCxx.h
  source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp

Index: source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
===
--- /dev/null
+++ source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
@@ -0,0 +1,79 @@
+//===-- LibCxxTuple.cpp -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "LibCxx.h"
+#include "lldb/DataFormatters/FormattersHelpers.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+
+class TupleFrontEnd: public SyntheticChildrenFrontEnd {
+public:
+  TupleFrontEnd(ValueObject &valobj) : SyntheticChildrenFrontEnd(valobj) {
+Update();
+  }
+
+  size_t GetIndexOfChildWithName(const ConstString &name) override {
+return formatters::ExtractIndexFromString(name.GetCString());
+  }
+
+  bool MightHaveChildren() override { return true; }
+  bool Update() override;
+  size_t CalculateNumChildren() override { return m_elements.size(); }
+  ValueObjectSP GetChildAtIndex(size_t idx) override;
+
+private:
+  std::vector m_elements;
+  ValueObjectSP m_base_sp;
+};
+}
+
+bool TupleFrontEnd::Update() {
+  m_elements.clear();
+  m_base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true);
+  if (! m_base_sp)
+return false;
+  m_elements.assign(m_base_sp->GetCompilerType().GetNumDirectBaseClasses(),
+ValueObjectSP());
+  return false;
+}
+
+ValueObjectSP TupleFrontEnd::GetChildAtIndex(size_t idx) {
+  if (idx >= m_elements.size())
+return ValueObjectSP();
+  if (!m_base_sp)
+return ValueObjectSP();
+  if (m_elements[idx])
+return m_elements[idx];
+
+  CompilerType holder_type =
+  m_base_sp->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr);
+  if (!holder_type)
+return ValueObjectSP();
+  ValueObjectSP holder_sp = m_base_sp->GetChildAtIndex(idx, true);
+  if (!holder_sp)
+return ValueObjectSP();
+
+  ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0, true);
+  if (elem_sp)
+m_elements[idx] =
+elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str()));
+
+  return m_elements[idx];
+}
+
+SyntheticChildrenFrontEnd *
+formatters::LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
+   lldb::ValueObjectSP valobj_sp) {
+  if (valobj_sp)
+return new TupleFrontEnd(*valobj_sp);
+  return nullptr;
+}
Index: source/Plugins/Language/CPlusPlus/LibCxx.h
===
--- source/Plugins/Language/CPlusPlus/LibCxx.h
+++ source/Plugins/Language/CPlusPlus/LibCxx.h
@@ -123,6 +123,9 @@
 SyntheticChildrenFrontEnd *LibcxxFunctionFrontEndCreator(CXXSyntheticChildren *,
  lldb::ValueObjectSP);
 
+SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
+  lldb::ValueObjectSP);
+
 } // namespace formatters
 } // namespace lldb_private
 
Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -473,6 +473,10 @@
   "libc++ std::initializer_list synthetic children",
   ConstString("^std::initializer_list<.+>(( )?&)?$"), stl_synth_flags,
   true);
+  AddCXXSynthetic(cpp_category_sp, LibcxxTupleFrontEndCreator,
+  "libc++ std::tuple synthetic children",
+  ConstString("^std::__(ndk)?1::tuple<.*>(( )?&)?$"), stl_synth_flags,
+  true);
   AddCXXSynthetic(
   cpp_category_sp,
   lldb_private::formatters::LibcxxAtomicSyntheticFrontEndCreator,
@@ -546,6 +550,10 @@
   "libc++ std::unordered containers summary provider",
   ConstString("^(std::__(ndk)?1::)unordered_(multi)?(map|set)<.+> >$"),
   stl_summary_flags, true);
+  AddCXXSummary(cpp_category_sp, LibcxxContainerSummaryProvider,
+"libc++ std::tuple summary provider",
+ConstString("^std::__(ndk)?1::tup

[Lldb-commits] [lldb] r317095 - Add data formatter for libc++ std::tuple

2017-11-01 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov  1 08:19:52 2017
New Revision: 317095

URL: http://llvm.org/viewvc/llvm-project?rev=317095&view=rev
Log:
Add data formatter for libc++ std::tuple

Reviewers: jingham, EricWF

Subscribers: srhines, eugene, lldb-commits, mgorny

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile?rev=317095&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile
 Wed Nov  1 08:19:52 2017
@@ -0,0 +1,6 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+USE_LIBCPP := 1
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py?rev=317095&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
 Wed Nov  1 08:19:52 2017
@@ -0,0 +1,51 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestDataFormatterLibcxxTuple(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+self.line = line_number('main.cpp', '// break here')
+ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+self.namespace = 'std::__' + ns + '1'
+
+@add_test_categories(["libc++"])
+def test(self):
+"""Test that std::tuple is displayed correctly"""
+self.build()
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+tuple_name = self.namespace + '::tuple'
+self.expect("frame variable empty",
+substrs=[tuple_name,
+ 'size=0',
+ '{}'])
+
+self.expect("frame variable one_elt",
+substrs=[tuple_name,
+ 'size=1',
+ '{',
+ '[0] = 47',
+ '}'])
+
+self.expect("frame variable three_elts",
+substrs=[tuple_name,
+ 'size=3',
+ '{',
+ '[0] = 1',
+ '[1] = 47',
+ '[2] = "foo"',
+ '}'])

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp?rev=317095&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
 Wed Nov  1 08:19:52 2017
@@ -0,0 +1,11 @@
+#include 
+#include 
+
+using namespace std;
+
+int main() {
+  tuple<> empty;
+  tuple one_elt{47};
+  tuple

[Lldb-commits] [PATCH] D35615: Add data formatter for libc++ std::tuple

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317095: Add data formatter for libc++ std::tuple (authored 
by labath).

Repository:
  rL LLVM

https://reviews.llvm.org/D35615

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
  lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp

Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
@@ -0,0 +1,79 @@
+//===-- LibCxxTuple.cpp -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "LibCxx.h"
+#include "lldb/DataFormatters/FormattersHelpers.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+
+class TupleFrontEnd: public SyntheticChildrenFrontEnd {
+public:
+  TupleFrontEnd(ValueObject &valobj) : SyntheticChildrenFrontEnd(valobj) {
+Update();
+  }
+
+  size_t GetIndexOfChildWithName(const ConstString &name) override {
+return formatters::ExtractIndexFromString(name.GetCString());
+  }
+
+  bool MightHaveChildren() override { return true; }
+  bool Update() override;
+  size_t CalculateNumChildren() override { return m_elements.size(); }
+  ValueObjectSP GetChildAtIndex(size_t idx) override;
+
+private:
+  std::vector m_elements;
+  ValueObjectSP m_base_sp;
+};
+}
+
+bool TupleFrontEnd::Update() {
+  m_elements.clear();
+  m_base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true);
+  if (! m_base_sp)
+return false;
+  m_elements.assign(m_base_sp->GetCompilerType().GetNumDirectBaseClasses(),
+ValueObjectSP());
+  return false;
+}
+
+ValueObjectSP TupleFrontEnd::GetChildAtIndex(size_t idx) {
+  if (idx >= m_elements.size())
+return ValueObjectSP();
+  if (!m_base_sp)
+return ValueObjectSP();
+  if (m_elements[idx])
+return m_elements[idx];
+
+  CompilerType holder_type =
+  m_base_sp->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr);
+  if (!holder_type)
+return ValueObjectSP();
+  ValueObjectSP holder_sp = m_base_sp->GetChildAtIndex(idx, true);
+  if (!holder_sp)
+return ValueObjectSP();
+
+  ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0, true);
+  if (elem_sp)
+m_elements[idx] =
+elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str()));
+
+  return m_elements[idx];
+}
+
+SyntheticChildrenFrontEnd *
+formatters::LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
+   lldb::ValueObjectSP valobj_sp) {
+  if (valobj_sp)
+return new TupleFrontEnd(*valobj_sp);
+  return nullptr;
+}
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
@@ -123,6 +123,9 @@
 SyntheticChildrenFrontEnd *LibcxxFunctionFrontEndCreator(CXXSyntheticChildren *,
  lldb::ValueObjectSP);
 
+SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
+  lldb::ValueObjectSP);
+
 } // namespace formatters
 } // namespace lldb_private
 
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -473,6 +473,10 @@
   "libc++ std::initializer_list synthetic children",
   ConstString("^std::initializer_list<.+>(( )?&)?$"), stl_synth_flags,
   true);
+  AddCXXSynthetic(cpp_category_sp, LibcxxTupleFrontEndCreator,
+  "libc++ std::tuple synthetic children",
+  ConstString("^std::__(ndk)?1::tuple<.*>(( )?&)?$"), stl_synth_flags,
+  true);
   AddCXXSynthetic(
   cpp_category_sp,
   lldb_private::formatters::LibcxxAtomicSyntheticFrontEndCreator,
@@ -546,6 +550,10 @@
   "libc++ std::unordered cont

[Lldb-commits] [lldb] r317099 - Add data formatter for libc++ std::queue

2017-11-01 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov  1 08:52:08 2017
New Revision: 317099

URL: http://llvm.org/viewvc/llvm-project?rev=317099&view=rev
Log:
Add data formatter for libc++ std::queue

Summary:
std::queue is just a fancy wrapper around another container, so all we
need to do is to delegate to the it.

Reviewers: jingham, EricWF

Subscribers: srhines, mgorny, lldb-commits, eugene

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp
Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile?rev=317099&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
 Wed Nov  1 08:52:08 2017
@@ -0,0 +1,6 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+USE_LIBCPP := 1
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py?rev=317099&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
 Wed Nov  1 08:52:08 2017
@@ -0,0 +1,43 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestDataFormatterLibcxxQueue(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+self.namespace = 'std::__' + ns + '1'
+
+def check_variable(self, name):
+var = self.frame().FindVariable(name)
+self.assertTrue(var.IsValid())
+
+queue = self.namespace + '::queue'
+self.assertTrue(queue in var.GetTypeName())
+self.assertEqual(var.GetNumChildren(), 5)
+for i in range(5):
+ch = var.GetChildAtIndex(i)
+self.assertTrue(ch.IsValid())
+self.assertEqual(ch.GetValueAsSigned(), i+1)
+
+@add_test_categories(["libc++"])
+def test(self):
+"""Test that std::queue is displayed correctly"""
+self.build()
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.check_variable('q1')
+self.check_variable('q2')

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp?rev=317099&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
 Wed Nov  1 08:52:08 2017
@@ -0,0 +1,11 @@
+#include 
+#include 
+
+using namespace std;
+
+int main() {
+  queue q1{{1,2,3,4,5}};
+  queue> q2{{1,2,3,4,5}};
+  int ret = q1.size() + q2.size(); // break here
+  return ret;
+}

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Langua

[Lldb-commits] [PATCH] D35666: Add data formatter for libc++ std::queue

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317099: Add data formatter for libc++ std::queue (authored 
by labath).

Changed prior to commit:
  https://reviews.llvm.org/D35666?vs=107464&id=121137#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35666

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
  lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp

Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../../../make
+
+CXX_SOURCES := main.cpp
+
+USE_LIBCPP := 1
+include $(LEVEL)/Makefile.rules
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp
@@ -0,0 +1,11 @@
+#include 
+#include 
+
+using namespace std;
+
+int main() {
+  queue q1{{1,2,3,4,5}};
+  queue> q2{{1,2,3,4,5}};
+  int ret = q1.size() + q2.size(); // break here
+  return ret;
+}
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
@@ -0,0 +1,43 @@
+"""
+Test lldb data formatter subsystem.
+"""
+
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestDataFormatterLibcxxQueue(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+self.namespace = 'std::__' + ns + '1'
+
+def check_variable(self, name):
+var = self.frame().FindVariable(name)
+self.assertTrue(var.IsValid())
+
+queue = self.namespace + '::queue'
+self.assertTrue(queue in var.GetTypeName())
+self.assertEqual(var.GetNumChildren(), 5)
+for i in range(5):
+ch = var.GetChildAtIndex(i)
+self.assertTrue(ch.IsValid())
+self.assertEqual(ch.GetValueAsSigned(), i+1)
+
+@add_test_categories(["libc++"])
+def test(self):
+"""Test that std::queue is displayed correctly"""
+self.build()
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.check_variable('q1')
+self.check_variable('q2')
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
@@ -123,6 +123,9 @@
 SyntheticChildrenFrontEnd *LibcxxFunctionFrontEndCreator(CXXSyntheticChildren *,
  lldb::ValueObjectSP);
 
+SyntheticChildrenFrontEnd *LibcxxQueueFrontEndCreator(CXXSyntheticChildren *,
+  lldb::ValueObjectSP);
+
 SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *,
   lldb::ValueObjectSP);
 
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -473,6 +473,10 @@
   "libc++ std::initializer_list synthetic children",

[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

I was unhappy when we went over two pointers for a FileSpec when m_syntax was 
added due to the extra size. Anything we can do to make this smaller would be 
great, so the type on the enum would work, but as you say the alignment will 
nullify that. The two ConstString members contain a pointer which isn't aligned 
so we can't use any bits from the low end of the pointer. Are there any classes 
that take advantage of high bits in pointers? Most if not all OS's don't use 
the entire 64 bit address space... It would be great to get 
lldb_private::FileSpec down to just 2 pointers again.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39487: Add float/vector registers for ppc64le

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

Looks fine.


https://reviews.llvm.org/D39487



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

In https://reviews.llvm.org/D39436#912810, @clayborg wrote:

> I was unhappy when we went over two pointers for a FileSpec when m_syntax was 
> added due to the extra size. Anything we can do to make this smaller would be 
> great, so the type on the enum would work, but as you say the alignment will 
> nullify that. The two ConstString members contain a pointer which isn't 
> aligned so we can't use any bits from the low end of the pointer. Are there 
> any classes that take advantage of high bits in pointers? Most if not all 
> OS's don't use the entire 64 bit address space... It would be great to get 
> lldb_private::FileSpec down to just 2 pointers again.


`ConstString` doesn't *currently* contain aligned pointers, but there's no 
reason we couldn't make it contain aligned pointers.  Then we could use 
`llvm::PointerUnion`.

That said, I want to state again that I think this change is the wrong 
direction.  I don't think we need this functionality in `FileSpec`, or even in 
another class.  I think it is better served in the script.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In https://reviews.llvm.org/D39436#912828, @zturner wrote:

> In https://reviews.llvm.org/D39436#912810, @clayborg wrote:
>
> > I was unhappy when we went over two pointers for a FileSpec when m_syntax 
> > was added due to the extra size. Anything we can do to make this smaller 
> > would be great, so the type on the enum would work, but as you say the 
> > alignment will nullify that. The two ConstString members contain a pointer 
> > which isn't aligned so we can't use any bits from the low end of the 
> > pointer. Are there any classes that take advantage of high bits in 
> > pointers? Most if not all OS's don't use the entire 64 bit address space... 
> > It would be great to get lldb_private::FileSpec down to just 2 pointers 
> > again.
>
>
> `ConstString` doesn't *currently* contain aligned pointers, but there's no 
> reason we couldn't make it contain aligned pointers.  Then we could use 
> `llvm::PointerUnion`.


I would be fine with that.

> That said, I want to state again that I think this change is the wrong 
> direction.  I don't think we need this functionality in `FileSpec`, or even 
> in another class.  I think it is better served in the script.

Agreed as well. I do like the idea of source path regexes, but only if we have 
a real need to add it to the API.


https://reviews.llvm.org/D39436



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


Re: [Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Jim Ingham via lldb-commits


> On Nov 1, 2017, at 9:54 AM, Greg Clayton via Phabricator 
>  wrote:
> 
> clayborg added a comment.
> 
> In https://reviews.llvm.org/D39436#912828, @zturner wrote:
> 
>> In https://reviews.llvm.org/D39436#912810, @clayborg wrote:
>> 
>>> I was unhappy when we went over two pointers for a FileSpec when m_syntax 
>>> was added due to the extra size. Anything we can do to make this smaller 
>>> would be great, so the type on the enum would work, but as you say the 
>>> alignment will nullify that. The two ConstString members contain a pointer 
>>> which isn't aligned so we can't use any bits from the low end of the 
>>> pointer. Are there any classes that take advantage of high bits in 
>>> pointers? Most if not all OS's don't use the entire 64 bit address space... 
>>> It would be great to get lldb_private::FileSpec down to just 2 pointers 
>>> again.
>> 
>> 
>> `ConstString` doesn't *currently* contain aligned pointers, but there's no 
>> reason we couldn't make it contain aligned pointers.  Then we could use 
>> `llvm::PointerUnion`.
> 
> 
> I would be fine with that.
> 
>> That said, I want to state again that I think this change is the wrong 
>> direction.  I don't think we need this functionality in `FileSpec`, or even 
>> in another class.  I think it is better served in the script.
> 
> Agreed as well. I do like the idea of source path regexes, but only if we 
> have a real need to add it to the API.

I also agree with Greg & Zachary that we shouldn't add this to FileSpec.  It's 
not really meant for that purpose.

I also agee with Greg that  it would be a good idea to have a source filter 
option for the breakpoint types.  We already use the notion of source filters 
for -p and -n and -r, but we do it by passing multiple -f options, which is 
often good enough but as Don's example shows is sometimes not convenient.  It 
would also be useful to say "break on foo.h when inlined in bar.c" and because 
we overload -f you can't do that at present.  Another argument for the option.  
It's also a little confusing to have -f have multiple meanings, though I'm not 
too bothered by that.  So making that a separate option to "break set" seems 
useful to me.

As for the SB API, as a principle you should never be able to set a breakpoint 
through the command-line that you can't set through the SB API's.  The SB API's 
should be able to implement all the functionality of the command line.  So if 
we add the command line option we should make adding it to the SB API's a task. 
 Mea culpa for not doing that for the "-m" option...  I cheesed out by also 
making this a setting, so you could get the SB API behavior you want by 
temporarily flipping the setting, but that's not really right.

That said, we really can't keep adding more and more overloads to the creation 
functions, so on the SB API side I'd rather not add yet another overload, but 
gate that job on making settings & options classes, and using them as the way 
to pass any new breakpoint setting options.

Jim


> 
> 
> https://reviews.llvm.org/D39436
> 
> 
> 

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


[Lldb-commits] [PATCH] D39487: Add float/vector registers for ppc64le

2017-11-01 Thread Alexandre Yukio Yamashita via Phabricator via lldb-commits
alexandreyy added a comment.

@clayborg Thanks for the review.

@eugene , @labath Could you, please, commit this patch?
I don't have the permission for it.


https://reviews.llvm.org/D39487



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda added a comment.

In https://reviews.llvm.org/D39436#912829, @clayborg wrote:

> In https://reviews.llvm.org/D39436#912828, @zturner wrote:
>
> > In https://reviews.llvm.org/D39436#912810, @clayborg wrote:
> >
> > > I was unhappy when we went over two pointers for a FileSpec when m_syntax 
> > > was added due to the extra size. Anything we can do to make this smaller 
> > > would be great, so the type on the enum would work, but as you say the 
> > > alignment will nullify that. The two ConstString members contain a 
> > > pointer which isn't aligned so we can't use any bits from the low end of 
> > > the pointer. Are there any classes that take advantage of high bits in 
> > > pointers? Most if not all OS's don't use the entire 64 bit address 
> > > space... It would be great to get lldb_private::FileSpec down to just 2 
> > > pointers again.
> >
> >
> > `ConstString` doesn't *currently* contain aligned pointers, but there's no 
> > reason we couldn't make it contain aligned pointers.  Then we could use 
> > `llvm::PointerUnion`.
>
>
> I would be fine with that.
>
> > That said, I want to state again that I think this change is the wrong 
> > direction.  I don't think we need this functionality in `FileSpec`, or even 
> > in another class.  I think it is better served in the script.
>
> Agreed as well. I do like the idea of source path regexes, but only if we 
> have a real need to add it to the API.


I haven't had time to really look into this, but it seems that maintaining two 
independent strings, one for directory and one for basename, is just for 
convenience.   We could easily keep it in a single string with an index to 
basename.  When the directory portion is updated, e.g., resolved, etc., we just 
overwrite the string and adjust the index.  And adjust accessors as needed.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

In https://reviews.llvm.org/D39436#912902, @hintonda wrote:

> In https://reviews.llvm.org/D39436#912829, @clayborg wrote:
>
> > In https://reviews.llvm.org/D39436#912828, @zturner wrote:
> >
> > > In https://reviews.llvm.org/D39436#912810, @clayborg wrote:
> > >
> > > > I was unhappy when we went over two pointers for a FileSpec when 
> > > > m_syntax was added due to the extra size. Anything we can do to make 
> > > > this smaller would be great, so the type on the enum would work, but as 
> > > > you say the alignment will nullify that. The two ConstString members 
> > > > contain a pointer which isn't aligned so we can't use any bits from the 
> > > > low end of the pointer. Are there any classes that take advantage of 
> > > > high bits in pointers? Most if not all OS's don't use the entire 64 bit 
> > > > address space... It would be great to get lldb_private::FileSpec down 
> > > > to just 2 pointers again.
> > >
> > >
> > > `ConstString` doesn't *currently* contain aligned pointers, but there's 
> > > no reason we couldn't make it contain aligned pointers.  Then we could 
> > > use `llvm::PointerUnion`.
> >
> >
> > I would be fine with that.
> >
> > > That said, I want to state again that I think this change is the wrong 
> > > direction.  I don't think we need this functionality in `FileSpec`, or 
> > > even in another class.  I think it is better served in the script.
> >
> > Agreed as well. I do like the idea of source path regexes, but only if we 
> > have a real need to add it to the API.
>
>
> I haven't had time to really look into this, but it seems that maintaining 
> two independent strings, one for directory and one for basename, is just for 
> convenience.   We could easily keep it in a single string with an index to 
> basename.  When the directory portion is updated, e.g., resolved, etc., we 
> just overwrite the string and adjust the index.  And adjust accessors as 
> needed.


The reason it's two strings is for memory efficiency and de-duplication.  
Suppose you make `FileSpec` instances from  `foo/bar/baz/` and `foo/bar/buzz`.  
This gets separated into 4 instances of `ConstString`.  `foo/bar`, `baz`, 
`foo/bar`, and `buzz`.  Because `ConstString`s are pooled, there's actually 
only 3 strings here.  `foo/bar`, `baz`, and `buzz`.

It probably doesn't seem like a lot, but over the course of thousands and 
thousands of files (which debuggers often examine and which often share a 
common parent directory) this is a large memory savings.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

The main reason for two strings is for searching efficiency. Most people don't 
set breakpoints using full paths, they give the basename:

  (lldb) b main.c:12

When setting breakpoints is it very easy to search for matches by basename 
since this is what users usually type in. Easy to do full paths as well if 
needed. So we should not try to use a single string as it will adversely affect 
the speed of file and line breakpoints.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

And yes, the memory savings are quite large as well when sharing directories.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda added a comment.

In https://reviews.llvm.org/D39436#912910, @zturner wrote:

>




>> I haven't had time to really look into this, but it seems that maintaining 
>> two independent strings, one for directory and one for basename, is just for 
>> convenience.   We could easily keep it in a single string with an index to 
>> basename.  When the directory portion is updated, e.g., resolved, etc., we 
>> just overwrite the string and adjust the index.  And adjust accessors as 
>> needed.
> 
> The reason it's two strings is for memory efficiency and de-duplication.  
> Suppose you make `FileSpec` instances from  `foo/bar/baz/` and 
> `foo/bar/buzz`.  This gets separated into 4 instances of `ConstString`.  
> `foo/bar`, `baz`, `foo/bar`, and `buzz`.  Because `ConstString`s are pooled, 
> there's actually only 3 strings here.  `foo/bar`, `baz`, and `buzz`.
> 
> It probably doesn't seem like a lot, but over the course of thousands and 
> thousands of files (which debuggers often examine and which often share a 
> common parent directory) this is a large memory savings.

Ah, thanks for the explanation.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [lldb] r317129 - add LibCxxTuple.cpp, LibCxxQueue.cpp to xcode project file.

2017-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  1 14:55:35 2017
New Revision: 317129

URL: http://llvm.org/viewvc/llvm-project?rev=317129&view=rev
Log:
add LibCxxTuple.cpp, LibCxxQueue.cpp to xcode project file.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=317129&r1=317128&r2=317129&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Nov  1 14:55:35 2017
@@ -992,6 +992,8 @@
AF9107EE168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* 
SystemRuntimeMacOSX.cpp */; };
+   AF9FF1F51FAA79A400474976 /* LibCxxTuple.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */; 
};
+   AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */; 
};
AFAFD80A1E57E1B90017A14F /* ModuleCacheTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp 
*/; };
AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp 
*/; };
AFC234091AF85CE100CDE8B6 /* CommandObjectLanguage.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AFC234061AF85CE000CDE8B6 /* 
CommandObjectLanguage.cpp */; };
@@ -3097,6 +3099,8 @@
AF9472701B575E5F0063D65C /* ValueObjectConstResultCast.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ValueObjectConstResultCast.h; path = 
include/lldb/Core/ValueObjectConstResultCast.h; sourceTree = ""; };
AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = SystemRuntimeMacOSX.cpp; sourceTree = ""; };
AF9B8F32182DB52900DA866F /* SystemRuntimeMacOSX.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SystemRuntimeMacOSX.h; sourceTree = ""; };
+   AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxTuple.cpp; path = Language/CPlusPlus/LibCxxTuple.cpp; sourceTree = 
""; };
+   AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxQueue.cpp; path = Language/CPlusPlus/LibCxxQueue.cpp; sourceTree = 
""; };
AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ModuleCacheTest.cpp; path = Target/ModuleCacheTest.cpp; sourceTree = 
""; };
AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; 
sourceTree = SOURCE_ROOT; };
AFB3D27F1AC262AB003B4B30 /* MICmdCmdGdbShow.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MICmdCmdGdbShow.h; path = "tools/lldb-mi/MICmdCmdGdbShow.h"; sourceTree = 
SOURCE_ROOT; };
@@ -6199,6 +6203,8 @@
945261B71B9A11E800BF138D /* 
LibCxxInitializerList.cpp */,
945261B81B9A11E800BF138D /* LibCxxList.cpp */,
945261B91B9A11E800BF138D /* LibCxxMap.cpp */,
+   AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */,
+   AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */,
945261BA1B9A11E800BF138D /* 
LibCxxUnorderedMap.cpp */,
945261BB1B9A11E800BF138D /* LibCxxVector.cpp */,
945261BD1B9A11E800BF138D /* LibStdcpp.h */,
@@ -7632,6 +7638,7 @@
9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in 
Sources */,
2689009F13353E4200698AC0 /* 
ProcessGDBRemote.cpp in Sources */,
268900A013353E4200698AC0 /* 
ProcessGDBRemoteLog.cpp in Sources */,
+   AF9FF1F71FAA79FE004749

[Lldb-commits] [lldb] r317130 - dotest: consistently call finalize_build_dictionary in debug info variants

2017-11-01 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Nov  1 15:01:03 2017
New Revision: 317130

URL: http://llvm.org/viewvc/llvm-project?rev=317130&view=rev
Log:
dotest: consistently call finalize_build_dictionary in debug info variants

dwarf&dwo versions were doing it, but gmodules and dsym weren't. All
this function does right now is pass OS=Android to make when targeting
android. This enables us to run dotest without manually passing --env
OS=Android.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=317130&r1=317129&r2=317130&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed Nov  1 15:01:03 
2017
@@ -1510,6 +1510,7 @@ class Base(unittest2.TestCase):
 clean=True):
 """Platform specific way to build binaries with dsym info."""
 module = builder_module()
+dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
 if not module.buildDsym(
 self,
 architecture,
@@ -1560,6 +1561,7 @@ class Base(unittest2.TestCase):
 clean=True):
 """Platform specific way to build binaries with gmodules info."""
 module = builder_module()
+dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
 if not module.buildGModules(
 self,
 architecture,


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


[Lldb-commits] [PATCH] D39515: Remove TestMyFirstWatchpoint and TestStepOverWatchpoint from basic_process category

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.

Does anyone care about these tests being in the basic_process category?
The getCategories function is interfering with the filesystem-based
watchpoint category kicking in. If there's any interest in keeping it,
then I can certainly make it happen. However, I haven't seen anyone
using these, so I'm thinking, if that's the case, why bother?


https://reviews.llvm.org/D39515

Files:
  
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
  
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py


Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -13,9 +13,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-def getCategories(self):
-return ['basic_process']
-
 @expectedFailureAll(
 oslist=["linux"],
 archs=[
Index: 
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
===
--- 
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ 
packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -15,9 +15,6 @@
 
 class HelloWatchpointTestCase(TestBase):
 
-def getCategories(self):
-return ['basic_process']
-
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):


Index: packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -13,9 +13,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-def getCategories(self):
-return ['basic_process']
-
 @expectedFailureAll(
 oslist=["linux"],
 archs=[
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -15,9 +15,6 @@
 
 class HelloWatchpointTestCase(TestBase):
 
-def getCategories(self):
-return ['basic_process']
-
 mydir = TestBase.compute_mydir(__file__)
 
 def setUp(self):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D39515: Remove TestMyFirstWatchpoint and TestStepOverWatchpoint from basic_process category

2017-11-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

No objections from me as I don't use these categories.


https://reviews.llvm.org/D39515



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


[Lldb-commits] [PATCH] D39515: Remove TestMyFirstWatchpoint and TestStepOverWatchpoint from basic_process category

2017-11-01 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Setting categories on directories seems much less useful if you then have to 
scan through all the tests and see if any of the tests in the directories 
you've added categories to implement getCategories then add the new category to 
the return from getCategories list as well.

So it seems to me either getCategories should add to the directory category 
list that's already been computed, or we should remove it altogether.

There are only a few other tests that implement getCategories (all to set it to 
basic_process).  So it does look like this is more degrees of freedom than we 
actually need.  Maybe we should just remove it altogether?  I don't feel too 
strongly, but if we're going to remove it from these tests we should probably 
remove it everywhere or we'll make somebody else have to figure this out again 
down the line.


https://reviews.llvm.org/D39515



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


[Lldb-commits] [lldb] r317143 - [Interpreter] Remove unused variable usage. NFCI.

2017-11-01 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Nov  1 16:46:21 2017
New Revision: 317143

URL: http://llvm.org/viewvc/llvm-project?rev=317143&view=rev
Log:
[Interpreter] Remove unused variable usage. NFCI.

Modified:
lldb/trunk/source/Interpreter/OptionValueDictionary.cpp

Modified: lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=317143&r1=317142&r2=317143&view=diff
==
--- lldb/trunk/source/Interpreter/OptionValueDictionary.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueDictionary.cpp Wed Nov  1 16:46:21 
2017
@@ -227,8 +227,7 @@ OptionValueDictionary::GetSubValue(const
   }
   assert(!temp.empty());
 
-  llvm::StringRef key, value;
-  llvm::StringRef quote_char;
+  llvm::StringRef key, quote_char;
 
   if (temp[0] == '\"' || temp[0] == '\'') {
 quote_char = temp.take_front();


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


[Lldb-commits] [lldb] r317144 - [XML] Simplify lambda removing unused capture. NFCI.

2017-11-01 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Nov  1 16:48:07 2017
New Revision: 317144

URL: http://llvm.org/viewvc/llvm-project?rev=317144&view=rev
Log:
[XML] Simplify lambda removing unused capture. NFCI.

Modified:
lldb/trunk/source/Host/common/XML.cpp

Modified: lldb/trunk/source/Host/common/XML.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/XML.cpp?rev=317144&r1=317143&r2=317144&view=diff
==
--- lldb/trunk/source/Host/common/XML.cpp (original)
+++ lldb/trunk/source/Host/common/XML.cpp Wed Nov  1 16:48:07 2017
@@ -339,7 +339,7 @@ XMLNode XMLNode::FindFirstChildElementWi
 
 #if defined(LIBXML2_DEFINED)
   ForEachChildElementWithName(
-  name, [&result_node, name](const XMLNode &node) -> bool {
+  name, [&result_node](const XMLNode &node) -> bool {
 result_node = node;
 // Stop iterating, we found the node we wanted
 return false;


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


[Lldb-commits] [lldb] r317145 - [Core] Comparison for unsigned >= 0 is redundant. NFCI.

2017-11-01 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Nov  1 16:49:23 2017
New Revision: 317145

URL: http://llvm.org/viewvc/llvm-project?rev=317145&view=rev
Log:
[Core] Comparison for unsigned >= 0 is redundant. NFCI.

Modified:
lldb/trunk/source/Core/ArchSpec.cpp

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=317145&r1=317144&r2=317145&view=diff
==
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Wed Nov  1 16:49:23 2017
@@ -516,7 +516,7 @@ static const CoreDefinition *FindCoreDef
 }
 
 static inline const CoreDefinition *FindCoreDefinition(ArchSpec::Core core) {
-  if (core >= 0 && core < llvm::array_lengthof(g_core_definitions))
+  if (core < llvm::array_lengthof(g_core_definitions))
 return &g_core_definitions[core];
   return nullptr;
 }


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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda updated this revision to Diff 121214.
hintonda added a comment.

Addressed @clayborg's comments.

- Added FileSpec ctor that takes an explicit RegularExpression object when 
using FileSpec as a regex pattern.

- Removed the RegularExpression member variable, added a flag, and create the 
regex on demand in operator==().

- Added type to PathSyntax enum, and reordered member variables from, largest 
to smallest (evens thought the last three are now the same size) to make sure 
sizeof(FileSpec) doesn't grow with this change.

- Removed implementation of special methods that had default behavior, and 
declared the default ctor '= default', which should reduce the maintenance 
burden.

Next steps:

- Create SBRegularExpression and add ctor to SBFileSpec that takes it as 
parameter.  That will allow this use case without any other changes:

  regex = lldb.SBRegularExpression(".*/some/path/.*") 
target.BreakpointCreateBySourceRegex(name, lldb.SBFileSpec(regex))

- Then wire up SBFileSpec to do the right thing.  SBRegularExpression can 
validate the expression on construction to give immediate feedback.


https://reviews.llvm.org/D39436

Files:
  include/lldb/Utility/FileSpec.h
  source/Commands/CommandObjectBreakpoint.cpp
  source/Utility/FileSpec.cpp

Index: source/Utility/FileSpec.cpp
===
--- source/Utility/FileSpec.cpp
+++ source/Utility/FileSpec.cpp
@@ -164,8 +164,6 @@
   }
 }
 
-FileSpec::FileSpec() : m_syntax(GetNativeSyntax()) {}
-
 //--
 // Default constructor that can take an optional full path to a
 // file on disk.
@@ -180,12 +178,12 @@
 : FileSpec{path, resolve_path,
Triple.isOSWindows() ? ePathSyntaxWindows : ePathSyntaxPosix} {}
 
-//--
-// Copy constructor
-//--
-FileSpec::FileSpec(const FileSpec &rhs)
-: m_directory(rhs.m_directory), m_filename(rhs.m_filename),
-  m_is_resolved(rhs.m_is_resolved), m_syntax(rhs.m_syntax) {}
+FileSpec::FileSpec(RegularExpression regex) {
+  if(regex.IsValid()) {
+m_filename.SetString(regex.GetText());
+m_is_regex = true;
+  }
+}
 
 //--
 // Copy constructor
@@ -196,24 +194,6 @@
 }
 
 //--
-// Virtual destructor in case anyone inherits from this class.
-//--
-FileSpec::~FileSpec() {}
-
-//--
-// Assignment operator.
-//--
-const FileSpec &FileSpec::operator=(const FileSpec &rhs) {
-  if (this != &rhs) {
-m_directory = rhs.m_directory;
-m_filename = rhs.m_filename;
-m_is_resolved = rhs.m_is_resolved;
-m_syntax = rhs.m_syntax;
-  }
-  return *this;
-}
-
-//--
 // Update the contents of this object with a new path. The path will
 // be split up into a directory and filename and stored as uniqued
 // string values for quick comparison and efficient memory usage.
@@ -301,6 +281,12 @@
 // Equal to operator
 //--
 bool FileSpec::operator==(const FileSpec &rhs) const {
+  if(m_is_regex) {
+RegularExpression regex(m_filename.GetStringRef());
+if (regex.IsValid())
+  return regex.Execute(rhs.GetPath());
+  }
+
   if (!FileEquals(rhs))
 return false;
   if (DirectoryEquals(rhs))
@@ -411,6 +397,9 @@
 
 bool FileSpec::Equal(const FileSpec &a, const FileSpec &b, bool full,
  bool remove_backups) {
+  if (a.m_is_regex)
+return a == b;
+
   static ConstString g_dot_string(".");
   static ConstString g_dot_dot_string("..");
 
Index: source/Commands/CommandObjectBreakpoint.cpp
===
--- source/Commands/CommandObjectBreakpoint.cpp
+++ source/Commands/CommandObjectBreakpoint.cpp
@@ -256,6 +256,8 @@
   { LLDB_OPT_NOT_10,   false, "shlib",  's', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eModuleCompletion, eArgTypeShlibName,   "Set the breakpoint only in this shared library.  Can repeat this option "
   "multiple times to specify multiple shared libraries." },
   { LLDB_OPT_SET_ALL,  false, "hardware",   'H', OptionParser::eNoArgument,   nullptr, nullptr, 0, eArgTypeNone,"Require the breakpoint to use hardware breakpoints." },
+  { LLDB_OPT_FILE, false, "source-file-regex",  'z', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSourceFileCompleti

[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Zachary Turner via Phabricator via lldb-commits
zturner added inline comments.



Comment at: include/lldb/Utility/FileSpec.h:65-69
+  enum PathSyntax : unsigned char {
 ePathSyntaxPosix,
 ePathSyntaxWindows,
 ePathSyntaxHostNative
   };

This is actually a very nice change, as it reduces the size of `FileSpec` by a 
couple of bytes.  I think you can submit this change as a one-liner by itself, 
independent of this patch.



Comment at: include/lldb/Utility/FileSpec.h:557
   mutable bool m_is_resolved = false; ///< True if this path has been resolved.
-  PathSyntax
-  m_syntax; ///< The syntax that this path uses (e.g. Windows / Posix)
+  bool m_is_regex = false;///< Filename is a regular expression.
 };

I thought in previous comments we had decided that this wasn't really the right 
direction, and that `FileSpec` should represent one file.  //If// we want this 
functionality in LLDB (and again, I'm not convinced), it should be done in such 
a way that the `FileSpec` class remains unmodified.  We should not have to 
touch this class for any of this.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In case there isn't enough people disagreeing, I'd like to say that I also 
think this does not belong in FileSpec. If for nothing else, then for the 
FileSpec::Equal implementation: the semantics of the IsEqual method are 
complicated enough to follow even without having regexes. Now it seems that in 
case of regexes the meaning of a == b and b == a is completely different. Also, 
what are you going to do if both FileSpecs are regexes? What if one of them is 
a *case-insensitive* regex, while the other is a regular one? ...


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Jim Ingham via Phabricator via lldb-commits
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

IIUC, Zachary, Greg and I have all said we don't think adding regular 
expressions patterns to FileSpec is a good idea.  I'm not sure why you are 
pursuing this avenue.

Of course, if this were likely to get accepted, you'd have to add tests for it 
since this is totally new behavior.  But I almost don't want to bring that up 
since I don't want you to spend your time going off writing tests for a 
direction that we are unlikely to accept...


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda added inline comments.



Comment at: include/lldb/Utility/FileSpec.h:65-69
+  enum PathSyntax : unsigned char {
 ePathSyntaxPosix,
 ePathSyntaxWindows,
 ePathSyntaxHostNative
   };

zturner wrote:
> This is actually a very nice change, as it reduces the size of `FileSpec` by 
> a couple of bytes.  I think you can submit this change as a one-liner by 
> itself, independent of this patch.
I suppose it depends on you compiler/OS, but this by it self doesn't change the 
size of FileSpec at all -- just changes the padding from 3 to 6.  It's still 
the size of 3 pointers due to alignment -- at least that's my understanding.

However, if you did have a way to encode this stuff into the two existing 
pointers, it might help -- you still need at least 4 bits if I'm not mistaken.



Comment at: include/lldb/Utility/FileSpec.h:557
   mutable bool m_is_resolved = false; ///< True if this path has been resolved.
-  PathSyntax
-  m_syntax; ///< The syntax that this path uses (e.g. Windows / Posix)
+  bool m_is_regex = false;///< Filename is a regular expression.
 };

zturner wrote:
> I thought in previous comments we had decided that this wasn't really the 
> right direction, and that `FileSpec` should represent one file.  //If// we 
> want this functionality in LLDB (and again, I'm not convinced), it should be 
> done in such a way that the `FileSpec` class remains unmodified.  We should 
> not have to touch this class for any of this.
I actually spent quite a bit of time trying to do it the other way, i.e., not 
touching FileSpec, but the diff got so big, I decided it was probably a 
mistake.  I still have it in a local branch, but it's not ready to commit.



https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda abandoned this revision.
hintonda added a comment.

Okay, got the message.

Sorry for the noise.


https://reviews.llvm.org/D39436



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


[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Zachary Turner via Phabricator via lldb-commits
zturner added inline comments.



Comment at: include/lldb/Utility/FileSpec.h:65-69
+  enum PathSyntax : unsigned char {
 ePathSyntaxPosix,
 ePathSyntaxWindows,
 ePathSyntaxHostNative
   };

hintonda wrote:
> zturner wrote:
> > This is actually a very nice change, as it reduces the size of `FileSpec` 
> > by a couple of bytes.  I think you can submit this change as a one-liner by 
> > itself, independent of this patch.
> I suppose it depends on you compiler/OS, but this by it self doesn't change 
> the size of FileSpec at all -- just changes the padding from 3 to 6.  It's 
> still the size of 3 pointers due to alignment -- at least that's my 
> understanding.
> 
> However, if you did have a way to encode this stuff into the two existing 
> pointers, it might help -- you still need at least 4 bits if I'm not mistaken.
It's possible for `sizeof(int)` to be equal to the size of a pointer.  This 
happens **always** when building x86, but it can happen on x64 too.  [[ 
https://godbolt.org/g/GN91oZ | For example ]].  Note that it returns 12.  If 
you remove the specification of the underlying type, it returns 16 instead.



https://reviews.llvm.org/D39436



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


[Lldb-commits] [lldb] r317180 - Commit Lawrence D'Anna's patch to change

2017-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  1 19:02:56 2017
New Revision: 317180

URL: http://llvm.org/viewvc/llvm-project?rev=317180&view=rev
Log:
Commit Lawrence D'Anna's patch to change
SetOututFileHandle to work with IOBase.

I did make one change after checking with Larry --
I renamed SBDebugger::Flush to FlushDebuggerOutputHandles
and added a short docstring to the .i file to make it
a little clearer under which context programs may need
to use this API.

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

Modified:
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Host/File.h
lldb/trunk/scripts/interface/SBDebugger.i
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Host/common/File.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=317180&r1=317179&r2=317180&view=diff
==
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Wed Nov  1 19:02:56 2017
@@ -78,6 +78,9 @@ public:
   void SetOutputFileHandle(FILE *f, bool transfer_ownership);
 
   void SetErrorFileHandle(FILE *f, bool transfer_ownership);
+  
+  // Force a flush of the OutputFileHandle and ErrorFileHandle.
+  void FlushDebuggerOutputHandles();
 
   FILE *GetInputFileHandle();
 

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=317180&r1=317179&r2=317180&view=diff
==
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Nov  1 19:02:56 2017
@@ -139,6 +139,8 @@ public:
   void SetOutputFileHandle(FILE *fh, bool tranfer_ownership);
 
   void SetErrorFileHandle(FILE *fh, bool tranfer_ownership);
+ 
+  void Flush();
 
   void SaveInputTerminalState();
 

Modified: lldb/trunk/include/lldb/Host/File.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=317180&r1=317179&r2=317180&view=diff
==
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Wed Nov  1 19:02:56 2017
@@ -62,6 +62,17 @@ public:
 m_is_interactive(eLazyBoolCalculate),
 m_is_real_terminal(eLazyBoolCalculate) {}
 
+  File(File &&rhs);
+
+  File& operator= (File &&rhs);
+
+  void Swap(File &other);
+
+  File(void *cookie,
+   int (*readfn)(void *, char *, int),
+   int (*writefn)(void *, const char *, int),
+   int (*closefn)(void *));
+
   //--
   /// Constructor with path.
   ///
@@ -479,9 +490,6 @@ protected:
   LazyBool m_is_interactive;
   LazyBool m_is_real_terminal;
   LazyBool m_supports_colors;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(File);
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/scripts/interface/SBDebugger.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBDebugger.i?rev=317180&r1=317179&r2=317180&view=diff
==
--- lldb/trunk/scripts/interface/SBDebugger.i (original)
+++ lldb/trunk/scripts/interface/SBDebugger.i Wed Nov  1 19:02:56 2017
@@ -171,6 +171,14 @@ public:
 void
 SetErrorFileHandle (FILE *f, bool transfer_ownership);
 
+%feature("docstring",
+"Flush the Debugger's Output/Error file handles.
+For instance, this is needed by a repl implementation on top of 
+the SB API, where fine grained control of output timing was needed."
+) FlushDebuggerOutputHandles;
+void
+FlushDebuggerOutputHandles ();
+
 FILE *
 GetInputFileHandle ();
 

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=317180&r1=317179&r2=317180&view=diff
==
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Wed Nov  1 19:02:56 2017
@@ -270,6 +270,18 @@ void SBDebugger::SetInputFileHandle(FILE
 m_opaque_sp->SetInputFileHandle(fh, transfer_ownership);
 }
 
+void SBDebugger::FlushDebuggerOutputHandles() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  
+  if (log)
+log->Printf(
+"SBDebugger(%p)::FlushDebuggerOutputHandles ()",
+static_cast(m_opaque_sp.get()));
+
+  if (m_opaque_sp)
+m_opaq

[Lldb-commits] [lldb] r317181 - Ahhhh roll back that commit, I didn't see that Lawrence had filed

2017-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  1 19:33:59 2017
New Revision: 317181

URL: http://llvm.org/viewvc/llvm-project?rev=317181&view=rev
Log:
A roll back that commit, I didn't see that Lawrence had filed
a separate phabracator with the revised change.  This was his
first atttempt which broke on the bots the second time too.

Modified:
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Host/File.h
lldb/trunk/scripts/interface/SBDebugger.i
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Host/common/File.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=317181&r1=317180&r2=317181&view=diff
==
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Wed Nov  1 19:33:59 2017
@@ -78,9 +78,6 @@ public:
   void SetOutputFileHandle(FILE *f, bool transfer_ownership);
 
   void SetErrorFileHandle(FILE *f, bool transfer_ownership);
-  
-  // Force a flush of the OutputFileHandle and ErrorFileHandle.
-  void FlushDebuggerOutputHandles();
 
   FILE *GetInputFileHandle();
 

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=317181&r1=317180&r2=317181&view=diff
==
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Nov  1 19:33:59 2017
@@ -139,8 +139,6 @@ public:
   void SetOutputFileHandle(FILE *fh, bool tranfer_ownership);
 
   void SetErrorFileHandle(FILE *fh, bool tranfer_ownership);
- 
-  void Flush();
 
   void SaveInputTerminalState();
 

Modified: lldb/trunk/include/lldb/Host/File.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=317181&r1=317180&r2=317181&view=diff
==
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Wed Nov  1 19:33:59 2017
@@ -62,17 +62,6 @@ public:
 m_is_interactive(eLazyBoolCalculate),
 m_is_real_terminal(eLazyBoolCalculate) {}
 
-  File(File &&rhs);
-
-  File& operator= (File &&rhs);
-
-  void Swap(File &other);
-
-  File(void *cookie,
-   int (*readfn)(void *, char *, int),
-   int (*writefn)(void *, const char *, int),
-   int (*closefn)(void *));
-
   //--
   /// Constructor with path.
   ///
@@ -490,6 +479,9 @@ protected:
   LazyBool m_is_interactive;
   LazyBool m_is_real_terminal;
   LazyBool m_supports_colors;
+
+private:
+  DISALLOW_COPY_AND_ASSIGN(File);
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/scripts/interface/SBDebugger.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBDebugger.i?rev=317181&r1=317180&r2=317181&view=diff
==
--- lldb/trunk/scripts/interface/SBDebugger.i (original)
+++ lldb/trunk/scripts/interface/SBDebugger.i Wed Nov  1 19:33:59 2017
@@ -171,14 +171,6 @@ public:
 void
 SetErrorFileHandle (FILE *f, bool transfer_ownership);
 
-%feature("docstring",
-"Flush the Debugger's Output/Error file handles.
-For instance, this is needed by a repl implementation on top of 
-the SB API, where fine grained control of output timing was needed."
-) FlushDebuggerOutputHandles;
-void
-FlushDebuggerOutputHandles ();
-
 FILE *
 GetInputFileHandle ();
 

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=317181&r1=317180&r2=317181&view=diff
==
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Wed Nov  1 19:33:59 2017
@@ -270,18 +270,6 @@ void SBDebugger::SetInputFileHandle(FILE
 m_opaque_sp->SetInputFileHandle(fh, transfer_ownership);
 }
 
-void SBDebugger::FlushDebuggerOutputHandles() {
-  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-  
-  if (log)
-log->Printf(
-"SBDebugger(%p)::FlushDebuggerOutputHandles ()",
-static_cast(m_opaque_sp.get()));
-
-  if (m_opaque_sp)
-m_opaque_sp->Flush();
-}
-
 void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
   Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 

Modified: lldb/trunk/source/Co

[Lldb-commits] [lldb] r317182 - Commit Lawrence D'Anna's patch to change

2017-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  1 19:43:27 2017
New Revision: 317182

URL: http://llvm.org/viewvc/llvm-project?rev=317182&view=rev
Log:
Commit Lawrence D'Anna's patch to change
SetOututFileHandle to work with IOBase.

I did make one change after checking with Larry --
I renamed SBDebugger::Flush to FlushDebuggerOutputHandles
and added a short docstring to the .i file to make it
a little clearer under which context programs may need
to use this API.

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


Added:
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/

lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
Modified:
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Host/File.h
lldb/trunk/scripts/interface/SBDebugger.i
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Host/common/File.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=317182&r1=317181&r2=317182&view=diff
==
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Wed Nov  1 19:43:27 2017
@@ -78,6 +78,8 @@ public:
   void SetOutputFileHandle(FILE *f, bool transfer_ownership);
 
   void SetErrorFileHandle(FILE *f, bool transfer_ownership);
+  
+  void FlushDebuggerOutputHandles();
 
   FILE *GetInputFileHandle();
 

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=317182&r1=317181&r2=317182&view=diff
==
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Nov  1 19:43:27 2017
@@ -139,6 +139,8 @@ public:
   void SetOutputFileHandle(FILE *fh, bool tranfer_ownership);
 
   void SetErrorFileHandle(FILE *fh, bool tranfer_ownership);
+ 
+  void FlushDebuggerOutputHandles();
 
   void SaveInputTerminalState();
 

Modified: lldb/trunk/include/lldb/Host/File.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=317182&r1=317181&r2=317182&view=diff
==
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Wed Nov  1 19:43:27 2017
@@ -62,6 +62,17 @@ public:
 m_is_interactive(eLazyBoolCalculate),
 m_is_real_terminal(eLazyBoolCalculate) {}
 
+  File(File &&rhs);
+
+  File& operator= (File &&rhs);
+
+  void Swap(File &other);
+
+  File(void *cookie,
+   int (*readfn)(void *, char *, int),
+   int (*writefn)(void *, const char *, int),
+   int (*closefn)(void *));
+
   //--
   /// Constructor with path.
   ///
@@ -479,9 +490,6 @@ protected:
   LazyBool m_is_interactive;
   LazyBool m_is_real_terminal;
   LazyBool m_supports_colors;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(File);
 };
 
 } // namespace lldb_private

Added: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py?rev=317182&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
 Wed Nov  1 19:43:27 2017
@@ -0,0 +1,228 @@
+"""
+Test lldb Python API for setting output and error file handles 
+"""
+
+from __future__ import print_function
+
+
+import contextlib
+import os
+import io
+import re
+import platform
+import unittest
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class StringIO(io.TextIOBase):
+
+def __init__(self, buf=''):
+self.buf = buf
+
+def writable(self):
+return True
+
+def write(self, s):
+self.buf += s
+return len(s)
+
+
+class BadIO(io.TextIOBase):
+
+def writable(self):
+return True
+
+def write(self, s):
+raise Exception('OH NOE')
+
+
+@contextlib.contextmanager
+def replace_stdout(new):
+old = sys.stdout
+sys.stdout = new
+try:
+yield
+finally:
+sys.stdout = o

[Lldb-commits] [lldb] r317183 - Revert r317182 for https://reviews.llvm.org/D39128

2017-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  1 20:17:07 2017
New Revision: 317183

URL: http://llvm.org/viewvc/llvm-project?rev=317183&view=rev
Log:
Revert r317182 for  https://reviews.llvm.org/D39128
we're still failing on android.  I'll ask Larry to 
ask Pavel for any tips he might be able to give.

Modified:
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Host/File.h

lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
lldb/trunk/scripts/interface/SBDebugger.i
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Host/common/File.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=317183&r1=317182&r2=317183&view=diff
==
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Wed Nov  1 20:17:07 2017
@@ -78,8 +78,6 @@ public:
   void SetOutputFileHandle(FILE *f, bool transfer_ownership);
 
   void SetErrorFileHandle(FILE *f, bool transfer_ownership);
-  
-  void FlushDebuggerOutputHandles();
 
   FILE *GetInputFileHandle();
 

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=317183&r1=317182&r2=317183&view=diff
==
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Nov  1 20:17:07 2017
@@ -139,8 +139,6 @@ public:
   void SetOutputFileHandle(FILE *fh, bool tranfer_ownership);
 
   void SetErrorFileHandle(FILE *fh, bool tranfer_ownership);
- 
-  void FlushDebuggerOutputHandles();
 
   void SaveInputTerminalState();
 

Modified: lldb/trunk/include/lldb/Host/File.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=317183&r1=317182&r2=317183&view=diff
==
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Wed Nov  1 20:17:07 2017
@@ -62,17 +62,6 @@ public:
 m_is_interactive(eLazyBoolCalculate),
 m_is_real_terminal(eLazyBoolCalculate) {}
 
-  File(File &&rhs);
-
-  File& operator= (File &&rhs);
-
-  void Swap(File &other);
-
-  File(void *cookie,
-   int (*readfn)(void *, char *, int),
-   int (*writefn)(void *, const char *, int),
-   int (*closefn)(void *));
-
   //--
   /// Constructor with path.
   ///
@@ -490,6 +479,9 @@ protected:
   LazyBool m_is_interactive;
   LazyBool m_is_real_terminal;
   LazyBool m_supports_colors;
+
+private:
+  DISALLOW_COPY_AND_ASSIGN(File);
 };
 
 } // namespace lldb_private

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py?rev=317183&r1=317182&r2=317183&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
 Wed Nov  1 20:17:07 2017
@@ -1,228 +0,0 @@
-"""
-Test lldb Python API for setting output and error file handles 
-"""
-
-from __future__ import print_function
-
-
-import contextlib
-import os
-import io
-import re
-import platform
-import unittest
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class StringIO(io.TextIOBase):
-
-def __init__(self, buf=''):
-self.buf = buf
-
-def writable(self):
-return True
-
-def write(self, s):
-self.buf += s
-return len(s)
-
-
-class BadIO(io.TextIOBase):
-
-def writable(self):
-return True
-
-def write(self, s):
-raise Exception('OH NOE')
-
-
-@contextlib.contextmanager
-def replace_stdout(new):
-old = sys.stdout
-sys.stdout = new
-try:
-yield
-finally:
-sys.stdout = old
-
-
-def handle_command(debugger, cmd, raise_on_fail=True, collect_result=True):
-
-ret = lldb.SBCommandReturnObject()
-
-if collect_result:
-interpreter = debugger.GetCommandInterpreter()
-interpreter.HandleCommand(cmd, ret)
-else:
- 

[Lldb-commits] [PATCH] D39436: Add regex support to file (-f) and module (-s) breakpoint options.

2017-11-01 Thread Don Hinton via Phabricator via lldb-commits
hintonda added inline comments.



Comment at: include/lldb/Utility/FileSpec.h:65-69
+  enum PathSyntax : unsigned char {
 ePathSyntaxPosix,
 ePathSyntaxWindows,
 ePathSyntaxHostNative
   };

zturner wrote:
> hintonda wrote:
> > zturner wrote:
> > > This is actually a very nice change, as it reduces the size of `FileSpec` 
> > > by a couple of bytes.  I think you can submit this change as a one-liner 
> > > by itself, independent of this patch.
> > I suppose it depends on you compiler/OS, but this by it self doesn't change 
> > the size of FileSpec at all -- just changes the padding from 3 to 6.  It's 
> > still the size of 3 pointers due to alignment -- at least that's my 
> > understanding.
> > 
> > However, if you did have a way to encode this stuff into the two existing 
> > pointers, it might help -- you still need at least 4 bits if I'm not 
> > mistaken.
> It's possible for `sizeof(int)` to be equal to the size of a pointer.  This 
> happens **always** when building x86, but it can happen on x64 too.  [[ 
> https://godbolt.org/g/GN91oZ | For example ]].  Note that it returns 12.  If 
> you remove the specification of the underlying type, it returns 16 instead.
> 
You're absolutely correct.  I don't do much on 32 bit, but this would 
definitely help when compiling with -m32.

Good catch...


https://reviews.llvm.org/D39436



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