[Lldb-commits] [lldb] r370301 - Provide a real link to the doc and remove old information

2019-08-29 Thread Sylvestre Ledru via lldb-commits
Author: sylvestre
Date: Thu Aug 29 00:14:09 2019
New Revision: 370301

URL: http://llvm.org/viewvc/llvm-project?rev=370301&view=rev
Log:
Provide a real link to the doc and remove old information

Modified:
lldb/trunk/docs/resources/download.rst

Modified: lldb/trunk/docs/resources/download.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/download.rst?rev=370301&r1=370300&r2=370301&view=diff
==
--- lldb/trunk/docs/resources/download.rst (original)
+++ lldb/trunk/docs/resources/download.rst Thu Aug 29 00:14:09 2019
@@ -6,7 +6,7 @@ Nightly Builds
 
 Nightly builds of LLDB are packaged and tested from trunk:
 
-Debian and Ubuntu: llvm.org/apt
+Debian and Ubuntu: https://apt.llvm.org
 
 The pkgsrc framework offers a package with recent LLDB in the wip repository:
 
@@ -18,17 +18,4 @@ The pkgsrc framework offers a package wi
 Releases
 
 
-Debian packages are available for LLDB 3.5 and later.
-
-* `Jessie - LLDB 3.5 `_
-* `Stretch - LLDB 3.8 `_
-* `Buster - LLDB 6.0 `_
-* `Sid - LLDB 6.0 `_
-
-Ubuntu packages are available for LLDB 3.8 and later.
-
-* `Ubuntu 16.04LTS - LLDB 3.8 `_
-* `Ubuntu 18.04LTS - LLDB 6.0 `_
-
-Arch Linux packages the latest `LLDB 6.0
-`_.
+LLDB is packaged in most of the Debian & Ubuntu releases.


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


[Lldb-commits] [lldb] r370302 - fix the bugzilla url

2019-08-29 Thread Sylvestre Ledru via lldb-commits
Author: sylvestre
Date: Thu Aug 29 00:19:14 2019
New Revision: 370302

URL: http://llvm.org/viewvc/llvm-project?rev=370302&view=rev
Log:
fix the bugzilla url

Modified:
lldb/trunk/docs/lldb.1

Modified: lldb/trunk/docs/lldb.1
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb.1?rev=370302&r1=370301&r2=370302&view=diff
==
--- lldb/trunk/docs/lldb.1 (original)
+++ lldb/trunk/docs/lldb.1 Thu Aug 29 00:19:14 2019
@@ -149,6 +149,6 @@ The LLDB project page http://lldb.llvm.o
 users -- the gdb/lldb command equivalence page 
http://lldb.llvm.org/lldb-gdb.html can
 be especially helpful for users coming from gdb.
 .Sh BUGS
-To report bugs, please visit http://llvm.org/bugs/
+To report bugs, please visit https://bugs.llvm.org/
 .Sh AUTHOR
 Maintained by the LLDB Team, http://lldb.llvm.org/


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


[Lldb-commits] [lldb] r370303 - use https for llvm.org in the doc

2019-08-29 Thread Sylvestre Ledru via lldb-commits
Author: sylvestre
Date: Thu Aug 29 00:20:08 2019
New Revision: 370303

URL: http://llvm.org/viewvc/llvm-project?rev=370303&view=rev
Log:
use https for llvm.org in the doc

Modified:
lldb/trunk/docs/index.rst
lldb/trunk/docs/resources/build.rst
lldb/trunk/docs/resources/source.rst

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=370303&r1=370302&r2=370303&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Thu Aug 29 00:20:08 2019
@@ -15,7 +15,7 @@ Objective-C and C++ on the desktop and i
 All of the code in the LLDB project is available under the
 `"Apache 2.0 License with LLVM exceptions"`_.
 
-.. _"Apache 2.0 License with LLVM exceptions": 
http://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
+.. _"Apache 2.0 License with LLVM exceptions": 
https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
 
 Why a New Debugger?
 ---
@@ -159,6 +159,6 @@ interesting areas to contribute to lldb.
:maxdepth: 1
:caption: External Links
 
-   Source Code 
+   Source Code 
Code Reviews 
Bug Reports 

Modified: lldb/trunk/docs/resources/build.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/build.rst?rev=370303&r1=370302&r2=370303&view=diff
==
--- lldb/trunk/docs/resources/build.rst (original)
+++ lldb/trunk/docs/resources/build.rst Thu Aug 29 00:20:08 2019
@@ -12,7 +12,7 @@ In particular, it requires both Clang an
 this tight integration the Getting Started guides for both of these projects
 come as prerequisite reading:
 
-* `LLVM `_
+* `LLVM `_
 * `Clang `_
 
 The following requirements are shared on all platforms.
@@ -93,7 +93,7 @@ CMake is a cross-platform build-generato
 project, it generates the files needed by your build tool. The recommended
 build tool for LLVM is Ninja, but other generators like Xcode or Visual Studio
 may be used as well. Please also read `Building LLVM with CMake
-`_.
+`_.
 
 Regular in-tree builds
 **
@@ -278,7 +278,7 @@ CMake caches
 
 CMake caches allow to store common sets of configuration options in the form of
 CMake scripts and can be useful to reproduce builds for particular use-cases
-(see by analogy `usage in LLVM and Clang 
`_).
+(see by analogy `usage in LLVM and Clang 
`_).
 A cache is passed to CMake with the ``-C`` flag, following the absolute path to
 the file on disk. Subsequent ``-D`` options are still allowed. Please find the
 currently available caches in the `lldb/cmake/caches/
@@ -290,7 +290,7 @@ Common configurations on macOS
 
 Build, test and install a distribution of LLDB from the `monorepo
 `_ (see also `Building a Distribution of
-LLVM `_):
+LLVM `_):
 
 ::
 

Modified: lldb/trunk/docs/resources/source.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/source.rst?rev=370303&r1=370302&r2=370303&view=diff
==
--- lldb/trunk/docs/resources/source.rst (original)
+++ lldb/trunk/docs/resources/source.rst Thu Aug 29 00:20:08 2019
@@ -2,7 +2,7 @@ Getting the Sources
 ===
 
 Refer to the `LLVM Getting Started Guide
-`_
+`_
 for general instructions on how to check out source. Note that LLDB
 depends on having a working checkout of LLVM and Clang, so the first
 step is to download and build as described at the above URL. The same
@@ -17,7 +17,7 @@ Contributing to LLDB
 
 
 Please refer to the `LLVM Developer Policy
-`_ for information about
+`_ for information about
 authoring and uploading a patch. LLDB differs from the LLVM Developer
 Policy in the following respects.
 
@@ -40,9 +40,9 @@ rules of thumb:
 * Invalid input.  To deal with invalid input, such as malformed DWARF,
   missing object files, or otherwise inconsistent debug info, LLVM's
   error handling types such as `llvm::Expected
-  `_ or
+  

[Lldb-commits] [lldb] r370315 - [lldb][NFC] Also test operator new/new[]/delete/delete[]/comma/addr-of

2019-08-29 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Aug 29 02:39:33 2019
New Revision: 370315

URL: http://llvm.org/viewvc/llvm-project?rev=370315&view=rev
Log:
[lldb][NFC] Also test operator new/new[]/delete/delete[]/comma/addr-of

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370315&r1=370314&r2=370315&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Thu 
Aug 29 02:39:33 2019
@@ -1,8 +1,13 @@
 #include 
 
+int side_effect = 0;
+
 struct B { int dummy = 2324; };
 struct C {
   void *operator new(size_t size) { C* r = ::new C; r->custom_new = true; 
return r; }
+  void *operator new[](size_t size) { C* r = 
static_cast(std::malloc(size)); r->custom_new = true; return r; }
+  void operator delete(void *p) { std::free(p); side_effect = 1; }
+  void operator delete[](void *p) { std::free(p); side_effect = 2; }
 
   bool custom_new = false;
   B b;
@@ -48,6 +53,9 @@ struct C {
   int operator>=(int) { return 87; }
   int operator>>=(int) { return 88; }
 
+  int operator,(int) { return 2012; }
+  int operator&() { return 2013; }
+
   int operator()(int) { return 91; }
   int operator[](int) { return 92; }
 
@@ -104,6 +112,9 @@ int main(int argc, char **argv) {
   result += c>=2;
   result += c>>=2;
 
+  result += (c , 2);
+  result += &c;
+
   result += c(1);
   result += c[1];
 
@@ -113,6 +124,7 @@ int main(int argc, char **argv) {
   result += c.operatornew();
 
   C *c2 = new C();
+  C *c3 = new C[3];
 
   //% self.expect("expr c->dummy", endstr=" 2324\n")
   //% self.expect("expr c->*2", endstr=" 2\n")
@@ -151,6 +163,8 @@ int main(int argc, char **argv) {
   //% self.expect("expr c>>1", endstr=" 86\n")
   //% self.expect("expr c>=1", endstr=" 87\n")
   //% self.expect("expr c>>=1", endstr=" 88\n")
+  //% self.expect("expr c,1", endstr=" 2012\n")
+  //% self.expect("expr &c", endstr=" 2013\n")
   //% self.expect("expr c(1)", endstr=" 91\n")
   //% self.expect("expr c[1]", endstr=" 92\n")
   //% self.expect("expr static_cast(c)", endstr=" 11\n")
@@ -158,6 +172,10 @@ int main(int argc, char **argv) {
   //% self.expect("expr c.operatorint()", endstr=" 13\n")
   //% self.expect("expr c.operatornew()", endstr=" 14\n")
   //% self.expect("expr (new C)->custom_new", endstr=" true\n")
+  //% self.expect("expr (new struct C[1])->custom_new", endstr=" true\n")
+  //% self.expect("expr delete c2; side_effect", endstr=" = 1\n")
+  //% self.expect("expr delete[] c3; side_effect", endstr=" = 2\n")
   delete c2;
+  delete[] c3;
   return 0;
 }


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


[Lldb-commits] [lldb] r370316 - [lldb][NFC] Try fixing TestCompletion.py on Windows

2019-08-29 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Aug 29 02:57:02 2019
New Revision: 370316

URL: http://llvm.org/viewvc/llvm-project?rev=370316&view=rev
Log:
[lldb][NFC] Try fixing TestCompletion.py on Windows

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=370316&r1=370315&r2=370316&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Thu Aug 29 02:57:02 2019
@@ -144,13 +144,12 @@ class CommandLineCompletionTestCase(Test
 self.complete_from_to('log enable lldb expr -f ' + src_dir,
   ['main.cpp'])
 
-@skipIfWindows
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot
 def test_log_dir(self):
 # Complete our source directory.
 src_dir =  os.path.dirname(os.path.realpath(__file__))
 self.complete_from_to('log enable lldb expr -f ' + src_dir,
-  [src_dir + "/"])
+  [src_dir + os.sep], turn_off_re_match=True)
 
 # 
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot


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


[Lldb-commits] [PATCH] D66934: [ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array

2019-08-29 Thread Muhammad Omair Javaid via Phabricator via lldb-commits
omjavaid created this revision.
omjavaid added reviewers: labath, jasonmolenda.
Herald added subscribers: kristof.beyls, javed.absar.
Herald added a reviewer: rengolin.

This patches paves way for upcoming SVE RegisterInfo definitions. This is 
cosmetic change which allows us to define ARM64 RegisterInfo using macros.

In future we ll have define two different RegisterInfos to choose between SVE 
vs non-SVE RegisterInfo with decision being made at thread creation.


https://reviews.llvm.org/D66934

Files:
  source/Plugins/Process/Utility/RegisterInfos_arm64.h

Index: source/Plugins/Process/Utility/RegisterInfos_arm64.h
===
--- source/Plugins/Process/Utility/RegisterInfos_arm64.h
+++ source/Plugins/Process/Utility/RegisterInfos_arm64.h
@@ -456,188 +456,256 @@
 static uint32_t g_d30_invalidates[] = {fpu_v30, fpu_s30, LLDB_INVALID_REGNUM};
 static uint32_t g_d31_invalidates[] = {fpu_v31, fpu_s31, LLDB_INVALID_REGNUM};
 
+// Generates register kinds array for 64-bit general purpose registers
+#define GPR64_KIND(reg, generic_kind)  \
+  {\
+arm64_ehframe::reg, arm64_dwarf::reg, generic_kind, LLDB_INVALID_REGNUM,   \
+gpr_##reg  \
+  }
+
+// Generates register kinds array for registers with lldb kind
+#define MISC_KIND(lldb_kind)   \
+  {\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
+LLDB_INVALID_REGNUM, lldb_kind \
+  }
+
+// Generates register kinds array for vector registers
+#define VREG_KIND(reg) \
+  {\
+LLDB_INVALID_REGNUM, arm64_dwarf::reg, LLDB_INVALID_REGNUM,\
+LLDB_INVALID_REGNUM, fpu_##reg \
+  }
+
+// Generates register kinds array for cpsr
+#define CPSR_KIND(lldb_kind)   \
+  {\
+arm64_ehframe::cpsr, arm64_dwarf::cpsr, LLDB_REGNUM_GENERIC_FLAGS, \
+LLDB_INVALID_REGNUM, lldb_kind \
+  }
+
+#define MISC_GPR_KIND(lldb_kind) CPSR_KIND(lldb_kind)
+#define MISC_FPU_KIND(lldb_kind) MISC_KIND(lldb_kind)
+#define MISC_EXC_KIND(lldb_kind) MISC_KIND(lldb_kind)
+
+// Defines a 64-bit general purpose register
+#define DEFINE_GPR64(reg, alt, generic_kind)   \
+  {\
+#reg, alt, 8, GPR_OFFSET(gpr_##reg), lldb::eEncodingUint,  \
+lldb::eFormatHex, GPR64_KIND(reg, generic_kind), nullptr, nullptr, \
+nullptr, 0 \
+  }
+
+// Defines a 32-bit general purpose pseudo register
+#define DEFINE_GPR32(wreg, xreg)   \
+  {\
+#wreg, nullptr, 4, \
+GPR_OFFSET(gpr_##xreg) + GPR_W_PSEUDO_REG_ENDIAN_OFFSET,   \
+lldb::eEncodingUint, lldb::eFormatHex, MISC_KIND(gpr_##wreg),  \
+g_contained_##xreg, g_##wreg##_invalidates, nullptr, 0 \
+  }
+
+// Defines a vector register with 16-byte size
+#define DEFINE_VREG(reg)   \
+  {\
+#reg, nullptr, 16, FPU_OFFSET(fpu_##reg - fpu_v0), lldb::eEncodingVector,  \
+lldb::eFormatVectorOfUInt8, VREG_KIND(reg), nullptr, nullptr, nullptr, \
+0  \
+  }
+
+// Defines S and D pseudo registers mapping over correspondig vector register
+#define DEFINE_FPU_PSEUDO(reg, size, offset, vreg) \
+  {\
+#reg, nullptr, size, FPU_OFFSET(fpu_##vreg - fpu_v0) + offset, \
+lldb::eEncodingIEEE754, lldb::eFormatFloat, MISC_KIND(fpu_##reg),  \
+g_contained_##vreg, g_##reg##_invalidates, nullptr, 0  \
+  }
+
+// Defines miscellaneous status and control registers like cpsr, fpsr etc
+#define DEFINE_MISC_REGS(reg, size, TYPE, lldb_kind)   \
+  {\
+#reg, nullptr, size, TYPE##_OFFSET_NAME(r

[Lldb-commits] [PATCH] D66915: [TSanRuntime] Upstream thread swift race detector.

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Patch by Kuba Mracek! 

Somehow, I don't think this patch would be so "self-contained" if we were 
following llvm developer policy 
. I also doubt you would 
be so enthusiastic if other people started "upstreaming" random chunks of their 
downstream repositories without any tests...


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66915



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


[Lldb-commits] [PATCH] D66920: [dotest] Remove deprecated loggin through env variables.

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

Looks good.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66920



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


[Lldb-commits] [PATCH] D66634: Postfix: move more code out of the PDB plugin

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D66634#1648119 , @amccarth wrote:

> When I added my comments, Phabricator showed this patch as still open.  Now 
> it looks like it landed four hours before that. :-(


Yeah, :(, but that doesn't mean I can't address any comments in a follow-up. If 
you have any additional feedback, or thoughts on my previous comments, let me 
know.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66634



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


[Lldb-commits] [PATCH] D63591: DWARFDebugLoc: Make parsing and error reporting more robust

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370363: DWARFDebugLoc: Make parsing and error reporting more 
robust (authored by labath, committed by ).

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63591

Files:
  llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp
  llvm/trunk/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s
  llvm/trunk/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s

Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
===
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
@@ -29,7 +29,7 @@
 /// The ending address of the instruction range.
 uint64_t End;
 /// The location of the variable within the specified range.
-SmallString<4> Loc;
+SmallVector Loc;
   };
 
   /// A list of locations that contain one variable.
@@ -68,8 +68,8 @@
   /// Return the location list at the given offset or nullptr.
   LocationList const *getLocationListAtOffset(uint64_t Offset) const;
 
-  Optional parseOneLocationList(DWARFDataExtractor Data,
-  uint64_t *Offset);
+  static Expected
+  parseOneLocationList(const DWARFDataExtractor &Data, uint64_t *Offset);
 };
 
 class DWARFDebugLoclists {
@@ -78,7 +78,7 @@
 uint8_t Kind;
 uint64_t Value0;
 uint64_t Value1;
-SmallVector Loc;
+SmallVector Loc;
   };
 
   struct LocationList {
@@ -106,8 +106,9 @@
   /// Return the location list at the given offset or nullptr.
   LocationList const *getLocationListAtOffset(uint64_t Offset) const;
 
-  static Optional
-  parseOneLocationList(DataExtractor Data, uint64_t *Offset, unsigned Version);
+  static Expected parseOneLocationList(const DataExtractor &Data,
+ uint64_t *Offset,
+ unsigned Version);
 };
 
 } // end namespace llvm
Index: llvm/trunk/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
===
--- llvm/trunk/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
+++ llvm/trunk/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
@@ -0,0 +1,71 @@
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o
+# RUN: llvm-dwarfdump -debug-loclists %t1.o 2>&1 | FileCheck %s --check-prefix=ULEB
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o
+# RUN: llvm-dwarfdump -debug-loclists %t2.o 2>&1 | FileCheck %s --check-prefix=ULEB
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o
+# RUN: llvm-dwarfdump -debug-loclists %t3.o 2>&1 | FileCheck %s --check-prefix=ULEB
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o
+# RUN: llvm-dwarfdump -debug-loclists %t4.o 2>&1 | FileCheck %s
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE5=0 -o %t5.o
+# RUN: llvm-dwarfdump -debug-loclists %t5.o 2>&1 | FileCheck %s
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE6=0 -o %t6.o
+# RUN: llvm-dwarfdump -debug-loclists %t6.o 2>&1 | FileCheck %s
+
+# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o
+# RUN: llvm-dwarfdump -debug-loclists %t7.o 2>&1 | FileCheck %s --check-prefix=UNIMPL
+
+# CHECK: error: unexpected end of data
+# ULEB: error: malformed uleb128, extends past end
+# UNIMPL: error: LLE of kind 47 not supported
+
+.section  .debug_loclists,"",@progbits
+  .long  .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0
+.Ldebug_loclist_table_start0:
+ .short 5# Version.
+ .byte 8 # Address size.
+ .byte 0 # Segment selector size.
+ .long 0 # Offset entry count.
+.Lloclists_table_base0:
+.Ldebug_loc0:
+.ifdef CASE1
+  .byte  4   # DW_LLE_offset_pair
+.endif
+.ifdef CASE2
+  .byte  4   # DW_LLE_offset_pair
+  .uleb128 0x0   #   starting offset
+.endif
+.ifdef CASE3
+  .byte  4   # DW_LLE_offset_pair
+  .uleb128 0x0   #   starting offset
+  .uleb128 0x10  #   ending offset
+.endif
+.ifdef CASE4
+  .byte  4   # DW_LLE_offset_pair
+  .uleb128 0x0   #   starting offset
+  .uleb128 0x10  #   ending offset
+  .byte  1   # Loc expr size
+.endif
+.ifdef CASE5
+  .byte  4   # DW_LLE_offset_pair
+  .uleb128 0x0   #   starting offset
+  .uleb128 0x10  #   ending offset
+  .byte  1 

[Lldb-commits] [lldb] r370373 - Remove DWARFExpression::LocationListSize

2019-08-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Aug 29 08:21:26 2019
New Revision: 370373

URL: http://llvm.org/viewvc/llvm-project?rev=370373&view=rev
Log:
Remove DWARFExpression::LocationListSize

Summary:
The only reason for this function's existance is so that we could pass
the correct size into the DWARFExpression constructor. However, there is
no harm in passing the entire data extractor into the DWARFExpression,
since the same code is performing the size determination as well as the
subsequent parse. So, if we get malformed input or there's a bug in the
parser, we'd compute the wrong size anyway.

Additionally, reducing the number of entry points into the location list
parsing machinery makes it easier to switch the llvm debug_loc(lists)
parsers.

While inside, I added a couple of tests for invalid location list
handling.

Reviewers: JDevlieghere, clayborg

Subscribers: aprantl, javed.absar, kristof.beyls, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=370373&r1=370372&r2=370373&view=diff
==
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Thu Aug 29 08:21:26 
2019
@@ -238,10 +238,6 @@ public:
   lldb::addr_t loclist_base_load_addr,
   lldb::addr_t address, ABI *abi);
 
-  static size_t LocationListSize(const DWARFUnit *dwarf_cu,
- const DataExtractor &debug_loc_data,
- lldb::offset_t offset);
-
   static bool PrintDWARFExpression(Stream &s, const DataExtractor &data,
int address_size, int dwarf_ref_size,
bool location_expression);

Modified: lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s?rev=370373&r1=370372&r2=370373&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s Thu Aug 29 08:21:26 2019
@@ -1,14 +1,22 @@
+# Test debug_loc parsing, including the cases of invalid input. The exact
+# behavior in the invalid cases is not particularly important, but it should be
+# "reasonable".
+
 # REQUIRES: x86
 
 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
-# RUN: lldb %t -o "image lookup -v -a 0" -o "image lookup -v -a 2" -o exit \
+# RUN: %lldb %t -o "image lookup -v -a 0" -o "image lookup -v -a 2" -o exit \
 # RUN:   | FileCheck %s
 
 # CHECK-LABEL: image lookup -v -a 0
-# CHECK: Variable: {{.*}}, name = "x", type = "int", location = rdi,
+# CHECK: Variable: {{.*}}, name = "x0", type = "int", location = rdi,
+# CHECK: Variable: {{.*}}, name = "x1", type = "int", location = ,
+# CHECK: Variable: {{.*}}, name = "x2", type = "int", location = ,
 
 # CHECK-LABEL: image lookup -v -a 2
-# CHECK: Variable: {{.*}}, name = "x", type = "int", location = rax,
+# CHECK: Variable: {{.*}}, name = "x0", type = "int", location = rax,
+# CHECK: Variable: {{.*}}, name = "x1", type = "int", location = ,
+# CHECK: Variable: {{.*}}, name = "x2", type = "int", location = ,
 
 .type   f,@function
 f:  # @f
@@ -27,8 +35,12 @@ f:
 .asciz  "f"
 .Linfo_string4:
 .asciz  "int"
-.Linfo_string5:
-.asciz  "x"
+.Lx0:
+.asciz  "x0"
+.Lx1:
+.asciz  "x1"
+.Lx2:
+.asciz  "x2"
 
 .section.debug_loc,"",@progbits
 .Ldebug_loc0:
@@ -42,6 +54,10 @@ f:
 .byte   80  # super-register DW_OP_reg0
 .quad   0
 .quad   0
+.Ldebug_loc2:
+.quad   .Lfunc_begin0-.Lfunc_begin0
+.quad   .Lfunc_end0-.Lfunc_begin0
+.short  0xdead  # Loc expr size
 
 .section.debug_abbrev,"",@progbits
 .byte   1   # Abbreviation Code
@@ -104,10 +120,18 @@ f:
 .quad   .Lfunc_begin0   # DW_AT_low_pc
 .long   .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
 .long   .Linfo_string3  # DW_AT_name
-.long   83  # DW_AT_type
-.byte   3   # Abbrev [3] 0x43:0xf 
DW_TAG_formal_parameter
+.long   .Lint   # DW_AT_type
+.byte   3   # Abbrev [3] DW_TAG_formal_parameter
 .long   .L

[Lldb-commits] [PATCH] D66789: Remove DWARFExpression::LocationListSize

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370373: Remove DWARFExpression::LocationListSize (authored 
by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66789

Files:
  lldb/trunk/include/lldb/Expression/DWARFExpression.h
  lldb/trunk/lit/SymbolFile/DWARF/debug_loc.s
  lldb/trunk/source/Expression/DWARFExpression.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3302,17 +3302,11 @@
   module, DataExtractor(data, block_offset, block_length),
   die.GetCU());
 } else {
-  const DWARFDataExtractor &debug_loc_data = DebugLocData();
-  const dw_offset_t debug_loc_offset = form_value.Unsigned();
-
-  size_t loc_list_length = DWARFExpression::LocationListSize(
-  die.GetCU(), debug_loc_data, debug_loc_offset);
-  if (loc_list_length > 0) {
-location = DWARFExpression(module,
-   DataExtractor(debug_loc_data,
- debug_loc_offset,
- loc_list_length),
-   die.GetCU());
+  DataExtractor data = DebugLocData();
+  const dw_offset_t offset = form_value.Unsigned();
+  if (data.ValidOffset(offset)) {
+data = DataExtractor(data, offset, data.GetByteSize() - offset);
+location = DWARFExpression(module, data, die.GetCU());
 assert(func_low_pc != LLDB_INVALID_ADDRESS);
 location.SetLocationListSlide(
 func_low_pc -
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -343,17 +343,11 @@
   *frame_base = DWARFExpression(
   module, DataExtractor(data, block_offset, block_length), cu);
 } else {
-  const DWARFDataExtractor &debug_loc_data = dwarf.DebugLocData();
-  const dw_offset_t debug_loc_offset = form_value.Unsigned();
-
-  size_t loc_list_length = DWARFExpression::LocationListSize(
-  cu, debug_loc_data, debug_loc_offset);
-  if (loc_list_length > 0) {
-*frame_base = DWARFExpression(module,
-  DataExtractor(debug_loc_data,
-debug_loc_offset,
-loc_list_length),
-  cu);
+  DataExtractor data = dwarf.DebugLocData();
+  const dw_offset_t offset = form_value.Unsigned();
+  if (data.ValidOffset(offset)) {
+data = DataExtractor(data, offset, data.GetByteSize() - offset);
+*frame_base = DWARFExpression(module, data, cu);
 if (lo_pc != LLDB_INVALID_ADDRESS) {
   assert(lo_pc >= cu->GetBaseAddress());
   frame_base->SetLocationListSlide(lo_pc -
Index: lldb/trunk/source/Expression/DWARFExpression.cpp
===
--- lldb/trunk/source/Expression/DWARFExpression.cpp
+++ lldb/trunk/source/Expression/DWARFExpression.cpp
@@ -2708,29 +2708,6 @@
   return true; // Return true on success
 }
 
-size_t DWARFExpression::LocationListSize(const DWARFUnit *dwarf_cu,
- const DataExtractor &debug_loc_data,
- lldb::offset_t offset) {
-  const lldb::offset_t debug_loc_offset = offset;
-  while (debug_loc_data.ValidOffset(offset)) {
-lldb::addr_t start_addr = LLDB_INVALID_ADDRESS;
-lldb::addr_t end_addr = LLDB_INVALID_ADDRESS;
-if (!AddressRangeForLocationListEntry(dwarf_cu, debug_loc_data, &offset,
-  start_addr, end_addr))
-  break;
-
-if (start_addr == 0 && end_addr == 0)
-  break;
-
-uint16_t loc_length = debug_loc_data.GetU16(&offset);
-offset += loc_length;
-  }
-
-  if (offset > debug_loc_offset)
-return offset - debug_loc_offset;
-  return 0;
-}
-
 bool DWARFExpression::Address

[Lldb-commits] [lldb] r370374 - Fix GetDIEForDeclContext so it only returns entries matching the provided context

2019-08-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Aug 29 08:30:52 2019
New Revision: 370374

URL: http://llvm.org/viewvc/llvm-project?rev=370374&view=rev
Log:
Fix GetDIEForDeclContext so it only returns entries matching the provided 
context

Currently, we return all the entries such that their decl_ctx pointer >= 
decl_ctx provided.
Instead, we should return only the ones that decl_ctx pointer == decl_ctx 
provided.

Differential Revision: https://reviews.llvm.org/D66357
Patch by Guilherme Andrade .

Added:
lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=370374&r1=370373&r2=370374&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Thu Aug 
29 08:30:52 2019
@@ -2186,9 +2186,10 @@ bool DWARFASTParserClang::CompleteTypeFr
 std::vector DWARFASTParserClang::GetDIEForDeclContext(
 lldb_private::CompilerDeclContext decl_context) {
   std::vector result;
-  for (auto it = m_decl_ctx_to_die.find(
-   (clang::DeclContext *)decl_context.GetOpaqueDeclContext());
-   it != m_decl_ctx_to_die.end(); it++)
+  auto opaque_decl_ctx =
+  (clang::DeclContext *)decl_context.GetOpaqueDeclContext();
+  for (auto it = m_decl_ctx_to_die.find(opaque_decl_ctx);
+   it != m_decl_ctx_to_die.end() && it->first == opaque_decl_ctx; it++)
 result.push_back(it->second);
   return result;
 }

Modified: lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt?rev=370374&r1=370373&r2=370374&view=diff
==
--- lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt (original)
+++ lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt Thu Aug 29 08:30:52 
2019
@@ -1,4 +1,5 @@
 add_lldb_unittest(SymbolFileDWARFTests
+  DWARFASTParserClangTests.cpp
   SymbolFileDWARFTests.cpp
 
   LINK_LIBS

Added: lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp?rev=370374&view=auto
==
--- lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp (added)
+++ lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp Thu Aug 
29 08:30:52 2019
@@ -0,0 +1,47 @@
+//===-- DWARFASTParserClangTests.cpp *- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+class DWARFASTParserClangStub : public DWARFASTParserClang {
+public:
+  using DWARFASTParserClang::DWARFASTParserClang;
+  using DWARFASTParserClang::LinkDeclContextToDIE;
+};
+} // namespace
+
+// If your implementation needs to dereference the dummy pointers we are
+// defining here, causing this test to fail, feel free to delete it.
+TEST(DWARFASTParserClangTests,
+ TestGetDIEForDeclContextReturnsOnlyMatchingEntries) {
+  ClangASTContext ast_ctx;
+  DWARFASTParserClangStub ast_parser(ast_ctx);
+
+  DWARFUnit *unit = nullptr;
+  DWARFDIE die1(unit, (DWARFDebugInfoEntry *)1LL);
+  DWARFDIE die2(unit, (DWARFDebugInfoEntry *)2LL);
+  DWARFDIE die3(unit, (DWARFDebugInfoEntry *)3LL);
+  DWARFDIE die4(unit, (DWARFDebugInfoEntry *)4LL);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)1LL, die1);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)2LL, die2);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)2LL, die3);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)3LL, die4);
+
+  auto die_list = ast_parser.GetDIEForDeclContext(
+  CompilerDeclContext(nullptr, (clang::DeclContext *)2LL));
+  ASSERT_EQ(2u, die_list.size());
+  ASSERT_EQ(die2, die_list[0]);
+  ASSERT_EQ(die3, die_list[1]);
+}


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


[Lldb-commits] [PATCH] D66357: Fix GetDIEForDeclContext so it only returns entries matching the provided context

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370374: Fix GetDIEForDeclContext so it only returns entries 
matching the provided… (authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66357?vs=216166&id=217891#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66357

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
  lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp


Index: lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
===
--- lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -0,0 +1,47 @@
+//===-- DWARFASTParserClangTests.cpp *- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+class DWARFASTParserClangStub : public DWARFASTParserClang {
+public:
+  using DWARFASTParserClang::DWARFASTParserClang;
+  using DWARFASTParserClang::LinkDeclContextToDIE;
+};
+} // namespace
+
+// If your implementation needs to dereference the dummy pointers we are
+// defining here, causing this test to fail, feel free to delete it.
+TEST(DWARFASTParserClangTests,
+ TestGetDIEForDeclContextReturnsOnlyMatchingEntries) {
+  ClangASTContext ast_ctx;
+  DWARFASTParserClangStub ast_parser(ast_ctx);
+
+  DWARFUnit *unit = nullptr;
+  DWARFDIE die1(unit, (DWARFDebugInfoEntry *)1LL);
+  DWARFDIE die2(unit, (DWARFDebugInfoEntry *)2LL);
+  DWARFDIE die3(unit, (DWARFDebugInfoEntry *)3LL);
+  DWARFDIE die4(unit, (DWARFDebugInfoEntry *)4LL);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)1LL, die1);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)2LL, die2);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)2LL, die3);
+  ast_parser.LinkDeclContextToDIE((clang::DeclContext *)3LL, die4);
+
+  auto die_list = ast_parser.GetDIEForDeclContext(
+  CompilerDeclContext(nullptr, (clang::DeclContext *)2LL));
+  ASSERT_EQ(2u, die_list.size());
+  ASSERT_EQ(die2, die_list[0]);
+  ASSERT_EQ(die3, die_list[1]);
+}
Index: lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
===
--- lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
+++ lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_unittest(SymbolFileDWARFTests
+  DWARFASTParserClangTests.cpp
   SymbolFileDWARFTests.cpp
 
   LINK_LIBS
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2186,9 +2186,10 @@
 std::vector DWARFASTParserClang::GetDIEForDeclContext(
 lldb_private::CompilerDeclContext decl_context) {
   std::vector result;
-  for (auto it = m_decl_ctx_to_die.find(
-   (clang::DeclContext *)decl_context.GetOpaqueDeclContext());
-   it != m_decl_ctx_to_die.end(); it++)
+  auto opaque_decl_ctx =
+  (clang::DeclContext *)decl_context.GetOpaqueDeclContext();
+  for (auto it = m_decl_ctx_to_die.find(opaque_decl_ctx);
+   it != m_decl_ctx_to_die.end() && it->first == opaque_decl_ctx; it++)
 result.push_back(it->second);
   return result;
 }


Index: lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
===
--- lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ lldb/trunk/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -0,0 +1,47 @@
+//===-- DWARFASTParserClangTests.cpp *- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+namespace {
+class DWARFASTParserClangS

[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk updated this revision to Diff 217894.
kwk marked 4 inline comments as done.
kwk added a comment.

- Apply review comments
- Move LZMA logic to lldb/Host/LZMA.h as suggested by labath
- Simplify LZMA function signatures
- Remove LZMA_OK from switch
- Add llvm-nm to the list of lldb test dependencies as it is needed by the 
minidebuginfo test
- Use llvm-nm and llvm-strip in minidebuginfo test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791

Files:
  lldb/include/lldb/Host/LZMA.h
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/Makefile
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/TestMiniDebugInfo.py
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/main.c
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Host/CMakeLists.txt
  lldb/source/Host/common/LZMA.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/test/CMakeLists.txt
  llvm/CMakeLists.txt

Index: llvm/CMakeLists.txt
===
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -50,6 +50,8 @@
   VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
   LANGUAGES C CXX ASM)
 
+include(CMakeDependentOption)
+
 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "No build type selected, default to Debug")
   set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
@@ -345,6 +347,18 @@
 
 option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
 
+find_package(LibLZMA)
+cmake_dependent_option(LLVM_ENABLE_LZMA "Support LZMA compression" ON "LIBLZMA_FOUND" OFF)
+set(LLVM_LIBLZMA_LIBRARIES)
+if (LLVM_ENABLE_LZMA)
+  if (LIBLZMA_FOUND)
+	add_definitions(-DLLVM_ENABLE_LZMA)
+include_directories(${LIBLZMA_INCLUDE_DIRS})
+  else()
+message(FATAL_ERROR "LZMA devel package is required when LLVM_ENABLE_LZMA is On.")
+  endif()
+endif()
+
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
 
 find_package(Z3 4.7.1)
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -116,6 +116,10 @@
   endif()
 endif()
 
+if (LLVM_ENABLE_LZMA)
+  add_dependencies(lldb-test-deps llvm-nm llvm-strip)
+endif()
+
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
 
Index: lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -67,6 +67,30 @@
   if (!obj_file)
 return nullptr;
 
+  std::unique_ptr symbol_vendor(
+  new SymbolVendorELF(module_sp));
+  SectionList *module_section_list = module_sp->GetSectionList();
+
+  // If there's a .gnu_debugdata section, we'll try to read the .symtab that's
+  // embedded in there and replace the one in the original object file (if any).
+  // If there's none in the orignal object file, we add it to it.
+  if (auto gdd_obj_file =
+  obj_file->GetGnuDebugDataObjectFile()) {
+if (auto gdd_objfile_section_list = gdd_obj_file->GetSectionList()) {
+  if (SectionSP symtab_section_sp =
+  gdd_objfile_section_list->FindSectionByType(
+  eSectionTypeELFSymbolTable, true)) {
+SectionSP module_section_sp = module_section_list->FindSectionByType(
+eSectionTypeELFSymbolTable, true);
+if (module_section_sp)
+  module_section_list->ReplaceSection(module_section_sp->GetID(),
+  symtab_section_sp);
+else
+  module_section_list->AddSection(symtab_section_sp);
+  }
+}
+  }
+
   lldb_private::UUID uuid = obj_file->GetUUID();
   if (!uuid)
 return nullptr;
@@ -111,11 +135,9 @@
   // have stripped the code sections, etc.
   dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
 
-  SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
-
   // Get the module unified section list and add our debug sections to
   // that.
-  SectionList *module_section_list = module_sp->GetSectionList();
+  module_section_list = module_sp->GetSectionList();
   SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
 
   static const SectionType g_sections[] = {
@@ -141,7 +163,8 @@
   }
 
   symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
-  return symbol_vendor;
+
+  return symbol_vendor.release();
 }
 
 // PluginInterface protocol
Index: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
==

[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk updated this revision to Diff 217895.
kwk added a comment.

- fixed lzma functions when LLVM_ENABLE_LZMA is not enabled


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791

Files:
  lldb/include/lldb/Host/LZMA.h
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/Makefile
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/TestMiniDebugInfo.py
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/main.c
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Host/CMakeLists.txt
  lldb/source/Host/common/LZMA.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/test/CMakeLists.txt
  llvm/CMakeLists.txt

Index: llvm/CMakeLists.txt
===
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -50,6 +50,8 @@
   VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
   LANGUAGES C CXX ASM)
 
+include(CMakeDependentOption)
+
 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "No build type selected, default to Debug")
   set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
@@ -345,6 +347,18 @@
 
 option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
 
+find_package(LibLZMA)
+cmake_dependent_option(LLVM_ENABLE_LZMA "Support LZMA compression" ON "LIBLZMA_FOUND" OFF)
+set(LLVM_LIBLZMA_LIBRARIES)
+if (LLVM_ENABLE_LZMA)
+  if (LIBLZMA_FOUND)
+	add_definitions(-DLLVM_ENABLE_LZMA)
+include_directories(${LIBLZMA_INCLUDE_DIRS})
+  else()
+message(FATAL_ERROR "LZMA devel package is required when LLVM_ENABLE_LZMA is On.")
+  endif()
+endif()
+
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
 
 find_package(Z3 4.7.1)
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -116,6 +116,10 @@
   endif()
 endif()
 
+if (LLVM_ENABLE_LZMA)
+  add_dependencies(lldb-test-deps llvm-nm llvm-strip)
+endif()
+
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
 
Index: lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -67,6 +67,30 @@
   if (!obj_file)
 return nullptr;
 
+  std::unique_ptr symbol_vendor(
+  new SymbolVendorELF(module_sp));
+  SectionList *module_section_list = module_sp->GetSectionList();
+
+  // If there's a .gnu_debugdata section, we'll try to read the .symtab that's
+  // embedded in there and replace the one in the original object file (if any).
+  // If there's none in the orignal object file, we add it to it.
+  if (auto gdd_obj_file =
+  obj_file->GetGnuDebugDataObjectFile()) {
+if (auto gdd_objfile_section_list = gdd_obj_file->GetSectionList()) {
+  if (SectionSP symtab_section_sp =
+  gdd_objfile_section_list->FindSectionByType(
+  eSectionTypeELFSymbolTable, true)) {
+SectionSP module_section_sp = module_section_list->FindSectionByType(
+eSectionTypeELFSymbolTable, true);
+if (module_section_sp)
+  module_section_list->ReplaceSection(module_section_sp->GetID(),
+  symtab_section_sp);
+else
+  module_section_list->AddSection(symtab_section_sp);
+  }
+}
+  }
+
   lldb_private::UUID uuid = obj_file->GetUUID();
   if (!uuid)
 return nullptr;
@@ -111,11 +135,9 @@
   // have stripped the code sections, etc.
   dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
 
-  SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
-
   // Get the module unified section list and add our debug sections to
   // that.
-  SectionList *module_section_list = module_sp->GetSectionList();
+  module_section_list = module_sp->GetSectionList();
   SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
 
   static const SectionType g_sections[] = {
@@ -141,7 +163,8 @@
   }
 
   symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
-  return symbol_vendor;
+
+  return symbol_vendor.release();
 }
 
 // PluginInterface protocol
Index: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
===
--- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -154,6 +154,14 @@
 
   void RelocateSection(lldb_private::Section *section) override;
 
+  /// Takes the .gnu_debugdata and returns the decompressed object fil

[Lldb-commits] [PATCH] D66954: dotest: improvements to the pexpect tests

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: teemperor, JDevlieghere, davide.
Herald added a subscriber: aprantl.

While working on r370054, i've found it frustrating that the test output
was compeletely unhelpful in case of failures. Therefore I've decided to
improve that. In this I reuse the PExpectTest class, which was one of
our mechanisms for running pexpect tests, but which has gotten orhpaned
in the mean time.

I've replaced the existing send methods with a "expect" method, which
I've tried to design so that it has a similar interface to the expect
method in regular non-pexpect dotest tests (as it essentially does
something very similar). I've kept the ability to dump the transcript of
the pexpect communication to stdout in the "trace" mode, as that is a
very handy way to figure out what the test is doing. I've also removed
the "expect_string" method used in the existing tests -- I've found this
to be unhelpful because it hides the message that would be normally
displayed by the EOF exception. Although vebose, this message includes
some important information, like what strings we were searching for,
what were the last bits of lldb output, etc. I've also beefed up the
class to automatically disable the debug info test duplication, and
auto-skip tests when the host platform does not support pexpect.

This patch ports TestMultilineCompletion and TestIOHandlerCompletion to
the new class. It also deletes TestFormats as it is not testing anything
(definitely not formats) -- it used to test something at one point, but
then the testing code was commented out, and later deleted in (r356000).


https://reviews.llvm.org/D66954

Files:
  
packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
  packages/Python/lldbsuite/test/functionalities/format/Makefile
  packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
  packages/Python/lldbsuite/test/functionalities/format/main.c
  packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py
  packages/Python/lldbsuite/test/lldbpexpect.py

Index: packages/Python/lldbsuite/test/lldbpexpect.py
===
--- packages/Python/lldbsuite/test/lldbpexpect.py
+++ packages/Python/lldbsuite/test/lldbpexpect.py
@@ -13,82 +13,47 @@
 from . import lldbutil
 
 if sys.platform.startswith('win32'):
-class PExpectTest(TestBase):
+# llvm.org/pr22274: need a pexpect replacement for windows
+class PExpectTest(object):
 pass
 else:
 import pexpect
 
 class PExpectTest(TestBase):
 
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-TestBase.setUp(self)
+NO_DEBUG_INFO_TESTCASE = True
+PROMPT = "(lldb) "
 
-def launchArgs(self):
-return ""
+def expect_prompt(self):
+self.child.expect_exact(self.PROMPT)
 
-def launch(self, timeout=None):
-if timeout is None:
-timeout = 30
+def launch(self, executable=None, timeout=30, dimensions=None):
 logfile = sys.stdout if self.TraceOn() else None
+args = ['--no-lldbinit', '--no-use-colors']
+for cmd in self.setUpCommands():
+args += ['-O', cmd]
+if executable is not None:
+args += ['--file', executable]
 self.child = pexpect.spawn(
-'%s --no-use-colors %s' %
-(lldbtest_config.lldbExec, self.launchArgs()), logfile=logfile)
-self.child.timeout = timeout
-self.timeout = timeout
-
-def expect(self, patterns=None, timeout=None, exact=None):
-if patterns is None:
-return None
-if timeout is None:
-timeout = self.timeout
-if exact is None:
-exact = False
-if exact:
-return self.child.expect_exact(patterns, timeout=timeout)
-else:
-return self.child.expect(patterns, timeout=timeout)
-
-def expectall(self, patterns=None, timeout=None, exact=None):
-if patterns is None:
-return None
-if timeout is None:
-timeout = self.timeout
-if exact is None:
-exact = False
-for pattern in patterns:
-self.expect(pattern, timeout=timeout, exact=exact)
-
-def sendimpl(
-self,
-sender,
-command,
-patterns=None,
-timeout=None,
-exact=None):
-sender(command)
-return self.expect(patterns=patterns, timeout=timeout, exact=exact)
-
-def send(self, command, patterns=None, timeout=None, exact=None):
-return self.sendimpl(
-self.child.send,
-command,
-patterns,
-timeout

[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added inline comments.



Comment at: lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp:79
+  // If there's none in the orignal object file, we add it to it.
+  if (auto gdd_obj_file =
+  obj_file->GetGnuDebugDataObjectFile()) {

labath wrote:
> Wouldn't it be better to first check for the external file, and then fall 
> back to gnu_debugdata, as the external file will likely have more complete 
> debug info?
My idea was to load whatever symbols we can get and let it be overwritten by 
the the more concrete ones that might come later. Changing the logic requires 
to your suggesttion would require a bit more effort in that I cannot simply 
leave the `return nullptr` expressions untouched. 



Comment at: llvm/include/llvm/ObjectYAML/ELFYAML.h:320
+
+  bool HasSymbolsEntryInYAML() const { return Symbols.hasValue(); }
 };

labath wrote:
> This would be lower camel case in llvm style. (But honestly, I'm not sure if 
> this function adds any value).
Okay, I've removed it.



Comment at: llvm/include/llvm/Support/MathExtras.h:271
   unsigned char out[sizeof(Val)];
-  std::memcpy(in, &Val, sizeof(Val));
+  memcpy(in, &Val, sizeof(Val));
   for (unsigned i = 0; i < sizeof(Val); ++i)

labath wrote:
> Huh?
I did get this compile error before:


```
compile error: no memcpy in std ns

/home/kkleine/llvm/llvm/include/llvm/Support/MathExtras.h:271:8: error: no 
member named 'memcpy' in namespace 'std'; did you mean 'wmemcpy'?

std::memcpy(in, &Val, sizeof(Val));
~^~
 wmemcpy
```

So I "fixed" it along the way. And according to 
http://www.cplusplus.com/reference/cstring/memcpy/?kw=memcpy, there's no 
`std::memcpy`



Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:201
+  }
   if (!Doc.DynamicSymbols.empty())
 ImplicitSections.insert(ImplicitSections.end(), {".dynsym", ".dynstr"});

labath wrote:
> So, the .dynsym section is emitted only if the yaml table is non-empty, but 
> now .symtab will be emitted only when the yaml key is present? I think the 
> .symtab behavior is more reasonable (because then you are actually able to 
> generate an *empty* .symtab if needed), but consistency is important to. I 
> think we'll need to discuss this on the yaml patch.
Okay, I will strip it out of this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791



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


[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk updated this revision to Diff 217924.
kwk marked an inline comment as done.
kwk added a comment.

- Fix header comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791

Files:
  lldb/include/lldb/Host/LZMA.h
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/Makefile
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/TestMiniDebugInfo.py
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/main.c
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Host/CMakeLists.txt
  lldb/source/Host/common/LZMA.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/test/CMakeLists.txt
  llvm/CMakeLists.txt

Index: llvm/CMakeLists.txt
===
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -50,6 +50,8 @@
   VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
   LANGUAGES C CXX ASM)
 
+include(CMakeDependentOption)
+
 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "No build type selected, default to Debug")
   set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
@@ -345,6 +347,18 @@
 
 option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
 
+find_package(LibLZMA)
+cmake_dependent_option(LLVM_ENABLE_LZMA "Support LZMA compression" ON "LIBLZMA_FOUND" OFF)
+set(LLVM_LIBLZMA_LIBRARIES)
+if (LLVM_ENABLE_LZMA)
+  if (LIBLZMA_FOUND)
+	add_definitions(-DLLVM_ENABLE_LZMA)
+include_directories(${LIBLZMA_INCLUDE_DIRS})
+  else()
+message(FATAL_ERROR "LZMA devel package is required when LLVM_ENABLE_LZMA is On.")
+  endif()
+endif()
+
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
 
 find_package(Z3 4.7.1)
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -116,6 +116,10 @@
   endif()
 endif()
 
+if (LLVM_ENABLE_LZMA)
+  add_dependencies(lldb-test-deps llvm-nm llvm-strip)
+endif()
+
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
 
Index: lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -67,6 +67,30 @@
   if (!obj_file)
 return nullptr;
 
+  std::unique_ptr symbol_vendor(
+  new SymbolVendorELF(module_sp));
+  SectionList *module_section_list = module_sp->GetSectionList();
+
+  // If there's a .gnu_debugdata section, we'll try to read the .symtab that's
+  // embedded in there and replace the one in the original object file (if any).
+  // If there's none in the orignal object file, we add it to it.
+  if (auto gdd_obj_file =
+  obj_file->GetGnuDebugDataObjectFile()) {
+if (auto gdd_objfile_section_list = gdd_obj_file->GetSectionList()) {
+  if (SectionSP symtab_section_sp =
+  gdd_objfile_section_list->FindSectionByType(
+  eSectionTypeELFSymbolTable, true)) {
+SectionSP module_section_sp = module_section_list->FindSectionByType(
+eSectionTypeELFSymbolTable, true);
+if (module_section_sp)
+  module_section_list->ReplaceSection(module_section_sp->GetID(),
+  symtab_section_sp);
+else
+  module_section_list->AddSection(symtab_section_sp);
+  }
+}
+  }
+
   lldb_private::UUID uuid = obj_file->GetUUID();
   if (!uuid)
 return nullptr;
@@ -111,11 +135,9 @@
   // have stripped the code sections, etc.
   dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
 
-  SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
-
   // Get the module unified section list and add our debug sections to
   // that.
-  SectionList *module_section_list = module_sp->GetSectionList();
+  module_section_list = module_sp->GetSectionList();
   SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
 
   static const SectionType g_sections[] = {
@@ -141,7 +163,8 @@
   }
 
   symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
-  return symbol_vendor;
+
+  return symbol_vendor.release();
 }
 
 // PluginInterface protocol
Index: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
===
--- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -154,6 +154,14 @@
 
   void RelocateSection(lldb_private::Section *section) override;
 
+  /// Takes the .gnu_debugdata and returns the decompressed object file

[Lldb-commits] [lldb] r370385 - Revert "[TSanRuntime] Upstream thread swift race detector."

2019-08-29 Thread Davide Italiano via lldb-commits
Author: davide
Date: Thu Aug 29 10:14:25 2019
New Revision: 370385

URL: http://llvm.org/viewvc/llvm-project?rev=370385&view=rev
Log:
Revert "[TSanRuntime] Upstream thread swift race detector."

Sometimes it's easier to resolve merge conflict than arguing.

Modified:
lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h

Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp?rev=370385&r1=370384&r2=370385&view=diff
==
--- lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp 
(original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp Thu 
Aug 29 10:14:25 2019
@@ -88,7 +88,6 @@ extern "C"
 // TODO: dlsym won't work on Windows.
 void *dlsym(void* handle, const char* symbol);
 int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long 
idx, const char **object_type);
-int (*ptr__tsan_get_report_tag)(void *report, unsigned long *tag);
 }
 
 const int REPORT_TRACE_SIZE = 128;
@@ -98,7 +97,6 @@ struct data {
 void *report;
 const char *description;
 int report_count;
-unsigned long tag;
 
 void *sleep_trace[REPORT_TRACE_SIZE];
 
@@ -165,14 +163,10 @@ const char *thread_sanitizer_retrieve_re
 data t = {0};
 
 ptr__tsan_get_report_loc_object_type = 
(typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym((void*)-2 
/*RTLD_DEFAULT*/, "__tsan_get_report_loc_object_type");
-ptr__tsan_get_report_tag = (typeof(ptr__tsan_get_report_tag))(void 
*)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_tag");
 
 t.report = __tsan_get_current_report();
 __tsan_get_report_data(t.report, &t.description, &t.report_count, 
&t.stack_count, &t.mop_count, &t.loc_count, &t.mutex_count, &t.thread_count, 
&t.unique_tid_count, t.sleep_trace, REPORT_TRACE_SIZE);
 
-if (ptr__tsan_get_report_tag)
-ptr__tsan_get_report_tag(t.report, &t.tag);
-
 if (t.stack_count > REPORT_ARRAY_SIZE) t.stack_count = REPORT_ARRAY_SIZE;
 for (int i = 0; i < t.stack_count; i++) {
 t.stacks[i].idx = i;
@@ -353,9 +347,6 @@ ThreadSanitizerRuntime::RetrieveReportDa
->GetValueAsUnsigned(0));
   dict->AddItem("sleep_trace", StructuredData::ObjectSP(CreateStackTrace(
main_value, ".sleep_trace")));
-  dict->AddIntegerItem(
-  "tag",
-  main_value->GetValueForExpressionPath(".tag")->GetValueAsUnsigned(0));
 
   StructuredData::Array *stacks = ConvertToStructuredArray(
   main_value, ".stacks", ".stack_count",
@@ -494,8 +485,8 @@ ThreadSanitizerRuntime::RetrieveReportDa
   return StructuredData::ObjectSP(dict);
 }
 
-std::string ThreadSanitizerRuntime::FormatDescription(
-StructuredData::ObjectSP report, bool &is_swift_access_race) {
+std::string
+ThreadSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
   std::string description = report->GetAsDictionary()
 ->GetValueForKey("issue_type")
 ->GetAsString()
@@ -530,18 +521,8 @@ std::string ThreadSanitizerRuntime::Form
   } else if (description == "lock-order-inversion") {
 return "Lock order inversion (potential deadlock)";
   } else if (description == "external-race") {
-auto tag = report->GetAsDictionary()
-   ->GetValueForKey("tag")
-   ->GetAsInteger()
-   ->GetValue();
-static const unsigned long kSwiftAccessRaceTag = 0x1;
-if (tag == kSwiftAccessRaceTag) {
-  is_swift_access_race = true;
-  return "Swift access race";
-}
 return "Race on a library object";
   } else if (description == "swift-access-race") {
-is_swift_access_race = true;
 return "Swift access race";
   }
 
@@ -635,14 +616,9 @@ ThreadSanitizerRuntime::GenerateSummary(
 ->GetValueForKey("description")
 ->GetAsString()
 ->GetValue();
-  bool is_swift_access_race = report->GetAsDictionary()
-  ->GetValueForKey("is_swift_access_race")
-  ->GetAsBoolean()
-  ->GetValue();
-
   bool skip_one_frame =
-  (report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
-  "external-race") && (!is_swift_access_race);
+  report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
+  "external-race";
 
   addr_t pc = 0;
   if (report->GetAsDictionary()
@@ -834,12 +810,8 @@ bool ThreadSanitizerRuntime::NotifyBreak
   instance->RetrieveReportData(context->exe_ctx_ref);
   std::string stop_reason_description;
   if (report) {
-bool is_swift_access_race = false;
-std::string issue_descript

[Lldb-commits] [PATCH] D66962: [lldb][NFC] Remove TestFormats.py as is tests nothing

2019-08-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: LLDB.
Herald added subscribers: lldb-commits, JDevlieghere.
Herald added a project: LLDB.

This test tests nothing as it just creates a target and runs to main. It's also 
using pexpect
and its documentation and name don't fit its content.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66962

Files:
  lldb/packages/Python/lldbsuite/test/functionalities/format/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
  lldb/packages/Python/lldbsuite/test/functionalities/format/main.c


Index: lldb/packages/Python/lldbsuite/test/functionalities/format/main.c
===
--- lldb/packages/Python/lldbsuite/test/functionalities/format/main.c
+++ /dev/null
@@ -1,14 +0,0 @@
-//===-- main.c --*- C++ 
-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#include 
-int main (int argc, char const *argv[])
-{
-printf("testing\n");
-return 0;
-}
Index: lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-Test the command history mechanism
-"""
-
-from __future__ import print_function
-
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class TestFormats(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-@expectedFailureAll(
-hostoslist=["windows"],
-bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
-def test_formats(self):
-"""Test format string functionality."""
-self.build()
-exe = self.getBuildArtifact("a.out")
-import pexpect
-prompt = "(lldb) "
-child = pexpect.spawn(
-'%s %s -x -o "b main" -o r %s' %
-(lldbtest_config.lldbExec, self.lldbOption, exe))
-# So that the spawned lldb session gets shutdown durng teardown.
-self.child = child
-
-# Substitute 'Help!' for 'help' using the 'commands regex' mechanism.
-child.expect_exact(prompt + 'target create "%s"' % exe)
-child.expect_exact(prompt + 'b main')
-child.expect_exact(prompt + 'r')
-child.expect_exact(prompt)
-child.sendline()
Index: lldb/packages/Python/lldbsuite/test/functionalities/format/Makefile
===
--- lldb/packages/Python/lldbsuite/test/functionalities/format/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-LEVEL = ../../make
-
-C_SOURCES := main.c
-
-include $(LEVEL)/Makefile.rules


Index: lldb/packages/Python/lldbsuite/test/functionalities/format/main.c
===
--- lldb/packages/Python/lldbsuite/test/functionalities/format/main.c
+++ /dev/null
@@ -1,14 +0,0 @@
-//===-- main.c --*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#include 
-int main (int argc, char const *argv[])
-{
-printf("testing\n");
-return 0;
-}
Index: lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-Test the command history mechanism
-"""
-
-from __future__ import print_function
-
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class TestFormats(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-@expectedFailureAll(
-hostoslist=["windows"],
-bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
-def test_formats(self):
-"""Test format string functionality."""
-self.build()
-exe = self.getBuildArtifact("a.out")
-import pexpect
-prompt = "(lldb) "
-child = pexpect.spawn(
-'%s %s -x -o "b main" -o r %s' %
-(lldbtest_config.lldbExec, self.lldbOption, exe))
-# So that the spawned lldb session gets shutdown durng teardown.
-self.child = child
-
-# Substitute 'Help!' for 'help' using the 'commands regex

[Lldb-commits] [lldb] r370387 - [dotest] Remove deprecated loggin through env variables.

2019-08-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Aug 29 10:19:00 2019
New Revision: 370387

URL: http://llvm.org/viewvc/llvm-project?rev=370387&view=rev
Log:
[dotest] Remove deprecated loggin through env variables.

It used to be possible to enable logging through environment variables
read by dotest. This approach is deprecated, as stated in the dotest
help output. Instead --channel should be used.

Differential revision: https://reviews.llvm.org/D66920

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370387&r1=370386&r2=370387&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Aug 29 10:19:00 2019
@@ -167,20 +167,6 @@ to create reference logs for debugging.
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' 
subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
-  'process.gdb-remote' subsystem with a default option of 'packets' if
-  GDB_REMOTE_LOG_OPTION is not defined.
-
 """)
 sys.exit(0)
 
@@ -766,61 +752,6 @@ def disabledynamics():
 raise Exception('disabling dynamic type support failed')
 
 
-def lldbLoggings():
-import lldb
-"""Check and do lldb loggings if necessary."""
-
-# Turn on logging for debugging purposes if ${LLDB_LOG} environment 
variable is
-# defined.  Use ${LLDB_LOG} to specify the log file.
-ci = lldb.DBG.GetCommandInterpreter()
-res = lldb.SBCommandReturnObject()
-if ("LLDB_LOG" in os.environ):
-open(os.environ["LLDB_LOG"], 'w').close()
-if ("LLDB_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LOG"] +
-" lldb " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception('log enable failed (check LLDB_LOG env variable)')
-
-if ("LLDB_LINUX_LOG" in os.environ):
-open(os.environ["LLDB_LINUX_LOG"], 'w').close()
-if ("LLDB_LINUX_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LINUX_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LINUX_LOG"] +
-" linux " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check LLDB_LINUX_LOG env variable)')
-
-# Ditto for gdb-remote logging if ${GDB_REMOTE_LOG} environment variable 
is defined.
-# Use ${GDB_REMOTE_LOG} to specify the log file.
-if ("GDB_REMOTE_LOG" in os.environ):
-if ("GDB_REMOTE_LOG_OPTION" in os.environ):
-gdb_remote_log_option = os.environ["GDB_REMOTE_LOG_OPTION"]
-else:
-gdb_remote_log_option = "packets process"
-ci.HandleCommand(
-"log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " gdb-remote "
-+ gdb_remote_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check GDB_REMOTE_LOG env variable)')
-
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1091,9 +1022,6 @@ def run_suite():
 # Now that we have loaded all the test cases, run the whole test suite.
 #
 
-# Turn on lldb loggings if necessary.
-lldbLoggings()
-
 # Disable default dynamic types for testing purposes
 disabledynamics()
 


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


[Lldb-commits] [lldb] r370386 - [dotest] Remove the curses result formatter.

2019-08-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Aug 29 10:18:57 2019
New Revision: 370386

URL: http://llvm.org/viewvc/llvm-project?rev=370386&view=rev
Log:
[dotest] Remove the curses result formatter.

This removes the curses result formatter which appears to be broken.
Passing --curses to dotest.py screws up my terminal and doesn't run any
tests. It even crashes Python on occasion.

Differential revision: https://reviews.llvm.org/D66917

Removed:
lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370386&r1=370385&r2=370386&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Aug 29 10:18:57 2019
@@ -416,12 +416,6 @@ def parseOptionsAndInitTestdirs():
 if do_help:
 usage(parser)
 
-# Capture test results-related args.
-if args.curses:
-# Act as if the following args were set.
-args.results_formatter = "lldbsuite.test_event.formatter.curses.Curses"
-args.results_file = "stdout"
-
 if args.results_file:
 configuration.results_filename = args.results_file
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=370386&r1=370385&r2=370386&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Aug 29 
10:18:57 2019
@@ -199,10 +199,6 @@ def create_parser():
 # Test results support.
 group = parser.add_argument_group('Test results options')
 group.add_argument(
-'--curses',
-action='store_true',
-help='Shortcut for specifying test results using the curses formatter')
-group.add_argument(
 '--results-file',
 action='store',
 help=('Specifies the file where test results will be written '

Removed: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py?rev=370385&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py 
(removed)
@@ -1,341 +0,0 @@
-"""
-  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-  See https://llvm.org/LICENSE.txt for license information.
-  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-"""
-
-from __future__ import absolute_import
-from __future__ import print_function
-
-# System modules
-import curses
-import datetime
-import math
-import sys
-import time
-
-# Third-party modules
-
-# LLDB modules
-from lldbsuite.test import lldbcurses
-
-from . import results_formatter
-from ..event_builder import EventBuilder
-
-
-class Curses(results_formatter.ResultsFormatter):
-"""Receives live results from tests that are running and reports them to 
the terminal in a curses GUI"""
-
-def __init__(self, out_file, options):
-# Initialize the parent
-super(Curses, self).__init__(out_file, options)
-self.using_terminal = True
-self.have_curses = True
-self.initialize_event = None
-self.jobs = [None] * 64
-self.job_tests = [None] * 64
-self.results = list()
-try:
-self.main_window = lldbcurses.intialize_curses()
-self.main_window.add_key_action(
-'\t',
-self.main_window.select_next_first_responder,
-"Switch between views that can respond to keyboard input")
-self.main_window.refresh()
-self.job_panel = None
-self.results_panel = None
-self.status_panel = None
-self.info_panel = None
-self.hide_status_list = list()
-self.start_time = time.time()
-except:
-self.have_curses = False
-lldbcurses.terminate_curses()
-self.using_terminal = False
-print("Unexpected error:", sys.exc_info()[0])
-raise
-
-self.line_dict = dict()
-# self.events_file = open("/tmp/events.txt", "w")
-# self.formatters = list()
-# if tee_results_formatter:
-# self.formatters.append(tee_results_formatter)
-
-def status_to_short_str(self, status, test_event):
-if status == EventBuilder.STATUS_SUC

[Lldb-commits] [PATCH] D66917: [dotest] Remove the curses result formatter.

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370386: [dotest] Remove the curses result formatter. 
(authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66917?vs=217749&id=217930#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66917

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
  lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py

Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -416,12 +416,6 @@
 if do_help:
 usage(parser)
 
-# Capture test results-related args.
-if args.curses:
-# Act as if the following args were set.
-args.results_formatter = "lldbsuite.test_event.formatter.curses.Curses"
-args.results_file = "stdout"
-
 if args.results_file:
 configuration.results_filename = args.results_file
 
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -199,10 +199,6 @@
 # Test results support.
 group = parser.add_argument_group('Test results options')
 group.add_argument(
-'--curses',
-action='store_true',
-help='Shortcut for specifying test results using the curses formatter')
-group.add_argument(
 '--results-file',
 action='store',
 help=('Specifies the file where test results will be written '
Index: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
===
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
@@ -1,341 +0,0 @@
-"""
-  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-  See https://llvm.org/LICENSE.txt for license information.
-  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-"""
-
-from __future__ import absolute_import
-from __future__ import print_function
-
-# System modules
-import curses
-import datetime
-import math
-import sys
-import time
-
-# Third-party modules
-
-# LLDB modules
-from lldbsuite.test import lldbcurses
-
-from . import results_formatter
-from ..event_builder import EventBuilder
-
-
-class Curses(results_formatter.ResultsFormatter):
-"""Receives live results from tests that are running and reports them to the terminal in a curses GUI"""
-
-def __init__(self, out_file, options):
-# Initialize the parent
-super(Curses, self).__init__(out_file, options)
-self.using_terminal = True
-self.have_curses = True
-self.initialize_event = None
-self.jobs = [None] * 64
-self.job_tests = [None] * 64
-self.results = list()
-try:
-self.main_window = lldbcurses.intialize_curses()
-self.main_window.add_key_action(
-'\t',
-self.main_window.select_next_first_responder,
-"Switch between views that can respond to keyboard input")
-self.main_window.refresh()
-self.job_panel = None
-self.results_panel = None
-self.status_panel = None
-self.info_panel = None
-self.hide_status_list = list()
-self.start_time = time.time()
-except:
-self.have_curses = False
-lldbcurses.terminate_curses()
-self.using_terminal = False
-print("Unexpected error:", sys.exc_info()[0])
-raise
-
-self.line_dict = dict()
-# self.events_file = open("/tmp/events.txt", "w")
-# self.formatters = list()
-# if tee_results_formatter:
-# self.formatters.append(tee_results_formatter)
-
-def status_to_short_str(self, status, test_event):
-if status == EventBuilder.STATUS_SUCCESS:
-return '.'
-elif status == EventBuilder.STATUS_FAILURE:
-return 'F'
-elif status == EventBuilder.STATUS_UNEXPECTED_SUCCESS:
-return '?'
-elif status == EventBuilder.STATUS_EXPECTED_FAILURE:
-return 'X'
-elif status == EventBuilder.STATUS_SKIP:
-return 'S'
-elif status == EventBuilder.STATUS_ERROR:
-if test_event.get("issue_phase", None) == "build":
-# Build failure
-return 'B'
-else:
-return 'E'
-

[Lldb-commits] [PATCH] D66920: [dotest] Remove deprecated loggin through env variables.

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370387: [dotest] Remove deprecated loggin through env 
variables. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66920?vs=217753&id=217931#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66920

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -167,20 +167,6 @@
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' 
subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
-  'process.gdb-remote' subsystem with a default option of 'packets' if
-  GDB_REMOTE_LOG_OPTION is not defined.
-
 """)
 sys.exit(0)
 
@@ -766,61 +752,6 @@
 raise Exception('disabling dynamic type support failed')
 
 
-def lldbLoggings():
-import lldb
-"""Check and do lldb loggings if necessary."""
-
-# Turn on logging for debugging purposes if ${LLDB_LOG} environment 
variable is
-# defined.  Use ${LLDB_LOG} to specify the log file.
-ci = lldb.DBG.GetCommandInterpreter()
-res = lldb.SBCommandReturnObject()
-if ("LLDB_LOG" in os.environ):
-open(os.environ["LLDB_LOG"], 'w').close()
-if ("LLDB_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LOG"] +
-" lldb " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception('log enable failed (check LLDB_LOG env variable)')
-
-if ("LLDB_LINUX_LOG" in os.environ):
-open(os.environ["LLDB_LINUX_LOG"], 'w').close()
-if ("LLDB_LINUX_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LINUX_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LINUX_LOG"] +
-" linux " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check LLDB_LINUX_LOG env variable)')
-
-# Ditto for gdb-remote logging if ${GDB_REMOTE_LOG} environment variable 
is defined.
-# Use ${GDB_REMOTE_LOG} to specify the log file.
-if ("GDB_REMOTE_LOG" in os.environ):
-if ("GDB_REMOTE_LOG_OPTION" in os.environ):
-gdb_remote_log_option = os.environ["GDB_REMOTE_LOG_OPTION"]
-else:
-gdb_remote_log_option = "packets process"
-ci.HandleCommand(
-"log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " gdb-remote "
-+ gdb_remote_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check GDB_REMOTE_LOG env variable)')
-
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1091,9 +1022,6 @@
 # Now that we have loaded all the test cases, run the whole test suite.
 #
 
-# Turn on lldb loggings if necessary.
-lldbLoggings()
-
 # Disable default dynamic types for testing purposes
 disabledynamics()
 


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -167,20 +167,6 @@
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifie

[Lldb-commits] [PATCH] D66962: [lldb][NFC] Remove TestFormats.py as is tests nothing

2019-08-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor abandoned this revision.
teemperor added a comment.

D66954  ninja'd this patch :(


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66962



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


[Lldb-commits] [PATCH] D66962: [lldb][NFC] Remove TestFormats.py as is tests nothing

2019-08-29 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Does anybody know what this was supposed to test?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66962



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


[Lldb-commits] [PATCH] D66962: [lldb][NFC] Remove TestFormats.py as is tests nothing

2019-08-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

@jingham  In D66954 , Pavel digs into the 
history of the test a bit.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66962



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


[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

Currently the test 
`lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/TestMiniDebugInfo.py` 
fails if `LLVM_ENABLE_LZMA` is not defined because the test stupidly assumes 
that support for minidebuginfo is available.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791



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


[Lldb-commits] [PATCH] D66954: dotest: improvements to the pexpect tests

2019-08-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM. And it seems like you found TestFormats.py at the same time as me and 
ninja'd D66962 


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

https://reviews.llvm.org/D66954



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


[Lldb-commits] [PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-08-29 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk updated this revision to Diff 217933.
kwk added a comment.

- Cleanup


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66791

Files:
  lldb/include/lldb/Host/LZMA.h
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/Makefile
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/TestMiniDebugInfo.py
  lldb/packages/Python/lldbsuite/test/linux/minidebuginfo/main.c
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Host/CMakeLists.txt
  lldb/source/Host/common/LZMA.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
  lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
  lldb/test/CMakeLists.txt
  llvm/CMakeLists.txt

Index: llvm/CMakeLists.txt
===
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -50,6 +50,8 @@
   VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
   LANGUAGES C CXX ASM)
 
+include(CMakeDependentOption)
+
 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "No build type selected, default to Debug")
   set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
@@ -345,6 +347,18 @@
 
 option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
 
+find_package(LibLZMA)
+cmake_dependent_option(LLVM_ENABLE_LZMA "Support LZMA compression" ON "LIBLZMA_FOUND" OFF)
+set(LLVM_LIBLZMA_LIBRARIES)
+if (LLVM_ENABLE_LZMA)
+  if (LIBLZMA_FOUND)
+	add_definitions(-DLLVM_ENABLE_LZMA)
+include_directories(${LIBLZMA_INCLUDE_DIRS})
+  else()
+message(FATAL_ERROR "LZMA devel package is required when LLVM_ENABLE_LZMA is On.")
+  endif()
+endif()
+
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
 
 find_package(Z3 4.7.1)
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -116,6 +116,10 @@
   endif()
 endif()
 
+if (LLVM_ENABLE_LZMA)
+  add_dependencies(lldb-test-deps llvm-nm llvm-strip)
+endif()
+
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
 
Index: lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===
--- lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -67,6 +67,30 @@
   if (!obj_file)
 return nullptr;
 
+  std::unique_ptr symbol_vendor(
+  new SymbolVendorELF(module_sp));
+  SectionList *module_section_list = module_sp->GetSectionList();
+
+  // If there's a .gnu_debugdata section, we'll try to read the .symtab that's
+  // embedded in there and replace the one in the original object file (if any).
+  // If there's none in the orignal object file, we add it to it.
+  if (auto gdd_obj_file =
+  obj_file->GetGnuDebugDataObjectFile()) {
+if (auto gdd_objfile_section_list = gdd_obj_file->GetSectionList()) {
+  if (SectionSP symtab_section_sp =
+  gdd_objfile_section_list->FindSectionByType(
+  eSectionTypeELFSymbolTable, true)) {
+SectionSP module_section_sp = module_section_list->FindSectionByType(
+eSectionTypeELFSymbolTable, true);
+if (module_section_sp)
+  module_section_list->ReplaceSection(module_section_sp->GetID(),
+  symtab_section_sp);
+else
+  module_section_list->AddSection(symtab_section_sp);
+  }
+}
+  }
+
   lldb_private::UUID uuid = obj_file->GetUUID();
   if (!uuid)
 return nullptr;
@@ -111,11 +135,9 @@
   // have stripped the code sections, etc.
   dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
 
-  SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
-
   // Get the module unified section list and add our debug sections to
   // that.
-  SectionList *module_section_list = module_sp->GetSectionList();
+  module_section_list = module_sp->GetSectionList();
   SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList();
 
   static const SectionType g_sections[] = {
@@ -141,7 +163,8 @@
   }
 
   symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
-  return symbol_vendor;
+
+  return symbol_vendor.release();
 }
 
 // PluginInterface protocol
Index: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
===
--- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -154,6 +154,14 @@
 
   void RelocateSection(lldb_private::Section *section) override;
 
+  /// Takes the .gnu_debugdata and returns the decompressed object file that is
+  /// stored within that section.
+  //

[Lldb-commits] [PATCH] D66962: [lldb][NFC] Remove TestFormats.py as is tests nothing

2019-08-29 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

That was the only test that tested the "command regex" functionality.  It was 
probably called TestFormats.py because somebody copied over a test without 
changing the file name since that name makes no sense.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66962



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


[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, davide, friss.
Herald added subscribers: teemperor, abidh, mgorny.
Herald added a project: LLDB.

Currently, lit tests don't set neither the module cache for building inferiors 
nor the module cache used by lldb when running tests. Furthermore, we have 
several places where we rely on the path to the module cache being always the 
same, rather than passing the correct value around. This makes it hard to 
specify a different module cache path when debugging a a test.

This patch reworks how we determine and pass around the module cache paths and 
fixes the omission on the lit side.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66966

Files:
  lldb/CMakeLists.txt
  lldb/lit/CMakeLists.txt
  lldb/lit/Settings/TestModuleCacheSanity.test
  lldb/lit/Suite/lit.cfg
  lldb/lit/helper/toolchain.py
  lldb/lit/lit-lldb-init.in
  lldb/lit/lit.cfg.py
  lldb/lit/lit.site.cfg.py.in
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
  lldb/test/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -3,6 +3,7 @@
 import sys
 
 dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
+build_dir = '@LLDB_TEST_BUILD_DIRECTORY@'
 dotest_args_str = '@LLDB_DOTEST_ARGS@'
 
 if __name__ == '__main__':
@@ -11,6 +12,7 @@
 # Build dotest.py command.
 cmd = [sys.executable, dotest_path]
 cmd.extend(dotest_args)
+cmd.extend(['--build-dir', build_dir])
 cmd.extend(wrapper_args)
 # Invoke dotest.py and return exit code.
 print(' '.join(cmd))
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -39,8 +39,6 @@
   --arch=${LLDB_TEST_ARCH}
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
-  --build-dir
-  ${CMAKE_BINARY_DIR}/lldb-test-build.noindex
   -S nm
   -u CXXFLAGS
   -u CFLAGS
Index: lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
@@ -0,0 +1,25 @@
+"""
+This is a sanity check that verifies that the module cache path is set
+correctly and points to the default test build directory.
+"""
+
+from __future__ import print_function
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class ModuleCacheSanityTestCase(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  # If your test case doesn't stress debug info, the
+  # set this to true.  That way it won't be run once for
+  # each debug info format.
+  NO_DEBUG_INFO_TESTCASE = True
+
+  def test(self):
+self.expect(
+'settings show symbols.clang-modules-cache-path',
+substrs=['lldb-test-build.noindex'])
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1852,9 +1852,9 @@
 Base.setUp(self)
 
 # Set the clang modules cache path used by LLDB.
-mod_cache = os.path.join(os.environ["LLDB_BUILD"], "module-cache-lldb")
-self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
-% mod_cache)
+self.runCmd(
+'settings set symbols.clang-modules-cache-path "{}"'.format(
+configuration.module_cache_dir))
 
 for s in self.setUpCommands():
 self.runCmd(s)
@@ -2058,13 +2058,13 @@
 if check:
 output = ""
 if self.res.GetOutput():
-  output += "\nCommand output:\n" + self.res.GetOutput()
+output += "\nCommand output:\n" + self.res.GetOutput()
 if self.res.GetError():
-  output += "\nError output:\n" + self.res.GetError()
+output += "\nError output:\n" + self.res.GetError()
 if msg:
-  msg += output
+msg += output
 if cmd:
-  cmd += output
+cmd += output
 self.assertTrue(self.res.Succeeded(),
 msg if (msg) else CMD_MSG(cmd))
 
Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -147,6 +147,11 @@
 metavar='Test build directory',
 defa

[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/lit/CMakeLists.txt:18
 
+set(LLDB_TEST_MODULE_CACHE_LLDB 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The module cache 
used by lldb for running tests.")
+set(LLDB_TEST_MODULE_CACHE_CLANG 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The module cache 
used by clang to build inferiors.")

`"The Clang module cache used by the Clang embedded in LLDB while running 
tests."`



Comment at: lldb/lit/CMakeLists.txt:19
+set(LLDB_TEST_MODULE_CACHE_LLDB 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The module cache 
used by lldb for running tests.")
+set(LLDB_TEST_MODULE_CACHE_CLANG 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The module cache 
used by clang to build inferiors.")
+

"The Clang module cache used by the Clang while building tests."



Comment at: lldb/lit/Settings/TestModuleCacheSanity.test:2
+# This is a sanity check that verifies that the module cache path is set
+# correctly and points to the default test build directory.
+RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck  %s

points `inside` the



Comment at: lldb/lit/Settings/TestModuleCacheSanity.test:4
+RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck  %s
+CHECK: lldb-test-build.noindex

CHECK: lldb-test-build.noindex{{.*}}module-cache-lldb



Comment at: 
lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py:3
+This is a sanity check that verifies that the module cache path is set
+correctly and points to the default test build directory.
+"""

see my comment in the other test



Comment at: 
lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py:17
+
+  # If your test case doesn't stress debug info, the
+  # set this to true.  That way it won't be run once for

delete this comment



Comment at: 
lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py:25
+'settings show symbols.clang-modules-cache-path',
+substrs=['lldb-test-build.noindex'])

see my comment in the other test


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66966



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


[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Thanks, this looks great (few comments inside).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66966



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


[Lldb-commits] [lldb] r370394 - [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Aug 29 11:37:05 2019
New Revision: 370394

URL: http://llvm.org/viewvc/llvm-project?rev=370394&view=rev
Log:
[test] Fix various module cache bugs and inconsistencies

Currently, lit tests don't set neither the module cache for building
inferiors nor the module cache used by lldb when running tests.
Furthermore, we have several places where we rely on the path to the
module cache being always the same, rather than passing the correct
value around. This makes it hard to specify a different module cache
path when debugging a a test.

This patch reworks how we determine and pass around the module cache
paths and fixes the omission on the lit side. It also adds a sanity
check to the lit and dotest suites.

Differential revision: https://reviews.llvm.org/D66966

Added:
lldb/trunk/lit/Settings/TestModuleCacheSanity.test
lldb/trunk/packages/Python/lldbsuite/test/sanity/
lldb/trunk/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/Suite/lit.cfg
lldb/trunk/lit/Suite/lit.site.cfg.in
lldb/trunk/lit/helper/toolchain.py
lldb/trunk/lit/lit-lldb-init.in
lldb/trunk/lit/lit.cfg.py
lldb/trunk/lit/lit.site.cfg.py.in
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/test/CMakeLists.txt
lldb/trunk/utils/lldb-dotest/lldb-dotest.in

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=370394&r1=370393&r2=370394&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Thu Aug 29 11:37:05 2019
@@ -71,6 +71,7 @@ add_subdirectory(docs)
 
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." 
${LLVM_INCLUDE_TESTS})
 if(LLDB_INCLUDE_TESTS)
+  set(LLDB_TEST_BUILD_DIRECTORY 
"${CMAKE_CURRENT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build 
root for building tests.")
 
   # Set the path to the default lldb test executable.
   set(LLDB_DEFAULT_TEST_EXECUTABLE 
"${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=370394&r1=370393&r2=370394&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Thu Aug 29 11:37:05 2019
@@ -15,6 +15,9 @@ endif()
 get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
 set(dotest_args_replacement ${LLVM_BUILD_MODE})
 
+set(LLDB_TEST_MODULE_CACHE_LLDB 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module 
cache used by the Clang embedded in LLDB while running tests.")
+set(LLDB_TEST_MODULE_CACHE_CLANG 
"${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module 
cache used by the Clang while building tests.")
+
 if(LLDB_BUILT_STANDALONE)
   # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our 
configuration name placeholder.
   string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} 
config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})

Added: lldb/trunk/lit/Settings/TestModuleCacheSanity.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Settings/TestModuleCacheSanity.test?rev=370394&view=auto
==
--- lldb/trunk/lit/Settings/TestModuleCacheSanity.test (added)
+++ lldb/trunk/lit/Settings/TestModuleCacheSanity.test Thu Aug 29 11:37:05 2019
@@ -0,0 +1,4 @@
+# This is a sanity check that verifies that the module cache path is set
+# correctly and points inside the default test build directory.
+RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck  %s
+CHECK: lldb-test-build.noindex{{.*}}module-cache-lldb

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=370394&r1=370393&r2=370394&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Thu Aug 29 11:37:05 2019
@@ -69,6 +69,12 @@ if config.dotest_lit_args_str:
 if config.llvm_libs_dir:
   dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]
 
+if config.lldb_build_directory:
+  dotest_cmd += ['--build-dir', config.lldb_build_directory]
+
+if config.lldb_module_cache:
+  dotest_cmd += ['--module-cache-dir', config.lldb_module_cache]
+
 # Load LLDB test format.
 sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
 import lldbtest

Modified: lldb/trunk/lit/Suite/lit.site.cfg.in
URL: 
http://llvm.o

[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 217948.
JDevlieghere added a comment.

- Fix a few inconsistencies.
- Address Adrian's comments.


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

https://reviews.llvm.org/D66966

Files:
  lldb/CMakeLists.txt
  lldb/lit/CMakeLists.txt
  lldb/lit/Settings/TestModuleCacheSanity.test
  lldb/lit/Suite/lit.cfg
  lldb/lit/Suite/lit.site.cfg.in
  lldb/lit/helper/toolchain.py
  lldb/lit/lit-lldb-init.in
  lldb/lit/lit.cfg.py
  lldb/lit/lit.site.cfg.py.in
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
  lldb/test/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -3,6 +3,7 @@
 import sys
 
 dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
+build_dir = '@LLDB_TEST_BUILD_DIRECTORY@'
 dotest_args_str = '@LLDB_DOTEST_ARGS@'
 
 if __name__ == '__main__':
@@ -11,6 +12,7 @@
 # Build dotest.py command.
 cmd = [sys.executable, dotest_path]
 cmd.extend(dotest_args)
+cmd.extend(['--build-dir', build_dir])
 cmd.extend(wrapper_args)
 # Invoke dotest.py and return exit code.
 print(' '.join(cmd))
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -39,8 +39,6 @@
   --arch=${LLDB_TEST_ARCH}
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
-  --build-dir
-  ${CMAKE_BINARY_DIR}/lldb-test-build.noindex
   -S nm
   -u CXXFLAGS
   -u CFLAGS
Index: lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
@@ -0,0 +1,22 @@
+"""
+This is a sanity check that verifies that the module cache path is set
+correctly and points inside the default test build directory.
+"""
+
+from __future__ import print_function
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class ModuleCacheSanityTestCase(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  NO_DEBUG_INFO_TESTCASE = True
+
+  def test(self):
+self.expect(
+'settings show symbols.clang-modules-cache-path',
+substrs=['lldb-test-build.noindex', 'module-cache-lldb'])
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1852,9 +1852,9 @@
 Base.setUp(self)
 
 # Set the clang modules cache path used by LLDB.
-mod_cache = os.path.join(os.environ["LLDB_BUILD"], "module-cache-lldb")
-self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
-% mod_cache)
+self.runCmd(
+'settings set symbols.clang-modules-cache-path "{}"'.format(
+configuration.module_cache_dir))
 
 for s in self.setUpCommands():
 self.runCmd(s)
@@ -2058,13 +2058,13 @@
 if check:
 output = ""
 if self.res.GetOutput():
-  output += "\nCommand output:\n" + self.res.GetOutput()
+output += "\nCommand output:\n" + self.res.GetOutput()
 if self.res.GetError():
-  output += "\nError output:\n" + self.res.GetError()
+output += "\nError output:\n" + self.res.GetError()
 if msg:
-  msg += output
+msg += output
 if cmd:
-  cmd += output
+cmd += output
 self.assertTrue(self.res.Succeeded(),
 msg if (msg) else CMD_MSG(cmd))
 
Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -147,6 +147,11 @@
 metavar='Test build directory',
 default='lldb-test-build.noindex',
 help='The root build directory for the tests. It will be removed before running.')
+group.add_argument(
+'--module-cache-dir',
+dest='module_cache_dir',
+metavar='The clang module cache directory used by LLDB',
+help='The clang module cache directory used by LLDB. This is not the one used by the makefiles. Defaults to /module-cache-lldb.')
 
 # Configuration options
 group = parser.add_argument_group('Remote platform options')
Index: lldb/packages/Python/lldbsuite/test/dotest.p

[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370394: [test] Fix various module cache bugs and 
inconsistencies (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66966?vs=217948&id=217951#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66966

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/lit/CMakeLists.txt
  lldb/trunk/lit/Settings/TestModuleCacheSanity.test
  lldb/trunk/lit/Suite/lit.cfg
  lldb/trunk/lit/Suite/lit.site.cfg.in
  lldb/trunk/lit/helper/toolchain.py
  lldb/trunk/lit/lit-lldb-init.in
  lldb/trunk/lit/lit.cfg.py
  lldb/trunk/lit/lit.site.cfg.py.in
  lldb/trunk/packages/Python/lldbsuite/test/configuration.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
  lldb/trunk/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
  lldb/trunk/test/CMakeLists.txt
  lldb/trunk/utils/lldb-dotest/lldb-dotest.in

Index: lldb/trunk/test/CMakeLists.txt
===
--- lldb/trunk/test/CMakeLists.txt
+++ lldb/trunk/test/CMakeLists.txt
@@ -39,8 +39,6 @@
   --arch=${LLDB_TEST_ARCH}
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
-  --build-dir
-  ${CMAKE_BINARY_DIR}/lldb-test-build.noindex
   -S nm
   -u CXXFLAGS
   -u CFLAGS
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -147,6 +147,11 @@
 metavar='Test build directory',
 default='lldb-test-build.noindex',
 help='The root build directory for the tests. It will be removed before running.')
+group.add_argument(
+'--module-cache-dir',
+dest='module_cache_dir',
+metavar='The clang module cache directory used by LLDB',
+help='The clang module cache directory used by LLDB. This is not the one used by the makefiles. Defaults to /module-cache-lldb.')
 
 # Configuration options
 group = parser.add_argument_group('Remote platform options')
Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -1852,9 +1852,9 @@
 Base.setUp(self)
 
 # Set the clang modules cache path used by LLDB.
-mod_cache = os.path.join(os.environ["LLDB_BUILD"], "module-cache-lldb")
-self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
-% mod_cache)
+self.runCmd(
+'settings set symbols.clang-modules-cache-path "{}"'.format(
+configuration.module_cache_dir))
 
 for s in self.setUpCommands():
 self.runCmd(s)
@@ -2058,13 +2058,13 @@
 if check:
 output = ""
 if self.res.GetOutput():
-  output += "\nCommand output:\n" + self.res.GetOutput()
+output += "\nCommand output:\n" + self.res.GetOutput()
 if self.res.GetError():
-  output += "\nError output:\n" + self.res.GetError()
+output += "\nError output:\n" + self.res.GetError()
 if msg:
-  msg += output
+msg += output
 if cmd:
-  cmd += output
+cmd += output
 self.assertTrue(self.res.Succeeded(),
 msg if (msg) else CMD_MSG(cmd))
 
Index: lldb/trunk/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
+++ lldb/trunk/packages/Python/lldbsuite/test/sanity/TestModuleCacheSanity.py
@@ -0,0 +1,22 @@
+"""
+This is a sanity check that verifies that the module cache path is set
+correctly and points inside the default test build directory.
+"""
+
+from __future__ import print_function
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class ModuleCacheSanityTestCase(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  NO_DEBUG_INFO_TESTCASE = True
+
+  def test(self):
+self.expect(
+'settings show symbols.clang-modules-cache-path',
+substrs=['lldb-test-build.noindex', 'module-cache-lldb'])
Index: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py
+++ lldb/trunk/packages/Python/lldbsuite/test

[Lldb-commits] [lldb] r370395 - [lldb][NFC] Document options parameter in ClangUserExpression constructor

2019-08-29 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu Aug 29 11:53:20 2019
New Revision: 370395

URL: http://llvm.org/viewvc/llvm-project?rev=370395&view=rev
Log:
[lldb][NFC] Document options parameter in ClangUserExpression constructor

Somehow this option was only documented in the swift branch.

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h?rev=370395&r1=370394&r2=370395&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h Thu 
Aug 29 11:53:20 2019
@@ -105,6 +105,9 @@ public:
   /// If not eResultTypeAny, the type to use for the expression
   /// result.
   ///
+  /// \param[in] options
+  /// Additional options for the expression.
+  ///
   /// \param[in] ctx_obj
   /// The object (if any) in which context the expression
   /// must be evaluated. For details see the comment to


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


[Lldb-commits] [PATCH] D66975: [lit] Print exit code in for unresolved (lldb)tests.

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: friss, aprantl.
Herald added a project: LLDB.

A test is marked unresolved when we're unable to find PASSED or FAILED
in the dotest output. Usually this is because we crashed and when that
happens the exit code can give a clue as to why. This patch adds the
exit code to the lit output to make it easier to investigate those
issues.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66975

Files:
  lldb/lit/Suite/lldbtest.py


Index: lldb/lit/Suite/lldbtest.py
===
--- lldb/lit/Suite/lldbtest.py
+++ lldb/lit/Suite/lldbtest.py
@@ -104,8 +104,8 @@
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
-msg = ('Unable to find %r in dotest output:\n\n%s%s' %
-   (passing_test_line, out, err))
+msg = ('Unable to find %r in dotest output (exit code %d):\n\n%s%s'
+   % (passing_test_line, exitCode, out, err))
 return lit.Test.UNRESOLVED, msg
 
 return lit.Test.PASS, ''


Index: lldb/lit/Suite/lldbtest.py
===
--- lldb/lit/Suite/lldbtest.py
+++ lldb/lit/Suite/lldbtest.py
@@ -104,8 +104,8 @@
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
-msg = ('Unable to find %r in dotest output:\n\n%s%s' %
-   (passing_test_line, out, err))
+msg = ('Unable to find %r in dotest output (exit code %d):\n\n%s%s'
+   % (passing_test_line, exitCode, out, err))
 return lit.Test.UNRESOLVED, msg
 
 return lit.Test.PASS, ''
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66975: [lit] Print exit code in for unresolved (lldb)tests.

2019-08-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

If it helps...
Is there anything else we can print for a crashed dotest?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66975



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


[Lldb-commits] [lldb] r370413 - [lit] Print exit code in for unresolved (lldb)tests.

2019-08-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Aug 29 15:02:28 2019
New Revision: 370413

URL: http://llvm.org/viewvc/llvm-project?rev=370413&view=rev
Log:
[lit] Print exit code in for unresolved (lldb)tests.

A test is marked unresolved when we're unable to find PASSED or FAILED
in the dotest output. Usually this is because we crashed and when that
happens the exit code can give a clue as to why. This patch adds the
exit code to the lit output to make it easier to investigate those
issues.

Differential revision: https://reviews.llvm.org/D66975

Modified:
lldb/trunk/lit/Suite/lldbtest.py

Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=370413&r1=370412&r2=370413&view=diff
==
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Thu Aug 29 15:02:28 2019
@@ -104,8 +104,8 @@ class LLDBTest(TestFormat):
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
-msg = ('Unable to find %r in dotest output:\n\n%s%s' %
-   (passing_test_line, out, err))
+msg = ('Unable to find %r in dotest output (exit code %d):\n\n%s%s'
+   % (passing_test_line, exitCode, out, err))
 return lit.Test.UNRESOLVED, msg
 
 return lit.Test.PASS, ''


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


[Lldb-commits] [PATCH] D66975: [lit] Print exit code in for unresolved (lldb)tests.

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D66975#1651757 , @aprantl wrote:

> If it helps...
>  Is there anything else we can print for a crashed dotest?


Is there anything else other than stdout, stderr and the exit code?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D66975



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


[Lldb-commits] [PATCH] D66975: [lit] Print exit code in for unresolved (lldb)tests.

2019-08-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370413: [lit] Print exit code in for unresolved (lldb)tests. 
(authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66975?vs=217974&id=217983#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66975

Files:
  lldb/trunk/lit/Suite/lldbtest.py


Index: lldb/trunk/lit/Suite/lldbtest.py
===
--- lldb/trunk/lit/Suite/lldbtest.py
+++ lldb/trunk/lit/Suite/lldbtest.py
@@ -104,8 +104,8 @@
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
-msg = ('Unable to find %r in dotest output:\n\n%s%s' %
-   (passing_test_line, out, err))
+msg = ('Unable to find %r in dotest output (exit code %d):\n\n%s%s'
+   % (passing_test_line, exitCode, out, err))
 return lit.Test.UNRESOLVED, msg
 
 return lit.Test.PASS, ''


Index: lldb/trunk/lit/Suite/lldbtest.py
===
--- lldb/trunk/lit/Suite/lldbtest.py
+++ lldb/trunk/lit/Suite/lldbtest.py
@@ -104,8 +104,8 @@
 
 passing_test_line = 'RESULT: PASSED'
 if passing_test_line not in out and passing_test_line not in err:
-msg = ('Unable to find %r in dotest output:\n\n%s%s' %
-   (passing_test_line, out, err))
+msg = ('Unable to find %r in dotest output (exit code %d):\n\n%s%s'
+   % (passing_test_line, exitCode, out, err))
 return lit.Test.UNRESOLVED, msg
 
 return lit.Test.PASS, ''
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66934: [ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array

2019-08-29 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

LGTM.  In debugserver we have the definition for the V registers invaliding the 
D and S registers it contains.  If the user modifies v10, we want any cached 
s10 and d10 values to be marked as invalid / refresh them.  The same thing with 
the X and W registers.  But the definitions you're rewriting already had this 
as incorrect, you've just replicated it more compactly, so I wouldn't call that 
a reason to hold off.  Let's give Pavel a chance to look at this too.


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

https://reviews.llvm.org/D66934



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


[Lldb-commits] [PATCH] D66934: [ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks fine to me.


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

https://reviews.llvm.org/D66934



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


[Lldb-commits] [PATCH] D66966: [test] Fix various module cache bugs and inconsistencies

2019-08-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.
Herald added a subscriber: ormris.



Comment at: lldb/trunk/lit/Settings/TestModuleCacheSanity.test:1-4
+# This is a sanity check that verifies that the module cache path is set
+# correctly and points inside the default test build directory.
+RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck  %s
+CHECK: lldb-test-build.noindex{{.*}}module-cache-lldb

It seems weird to expose these as user-settable cmake variables, but then have 
a test which will fail if the user changes them in any way. Were you intending 
to have this feature be configurable at the cmake level? If not, could you 
change the cmake cache variables into something else (looks like regular 
variables should work just fine). If yes, then we should have a different 
testing strategy..


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66966



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