[Lldb-commits] [PATCH] D61368: Fix build URL in new LLDB website

2019-05-01 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

After the LLDB website was migrated to be generated by Sphinx the build.html 
file lives in another location.

See http://lists.llvm.org/pipermail/lldb-dev/2019-April/014992.html.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61368

Files:
  lldb/INSTALL.txt


Index: lldb/INSTALL.txt
===
--- lldb/INSTALL.txt
+++ lldb/INSTALL.txt
@@ -15,4 +15,4 @@
 For instructions to build LLDB on Linux, or more details about supported
 compiler versions, other dependencies, and build flags, see:
 
-http://lldb.llvm.org/build.html
+https://lldb.llvm.org/resources/build.html


Index: lldb/INSTALL.txt
===
--- lldb/INSTALL.txt
+++ lldb/INSTALL.txt
@@ -15,4 +15,4 @@
 For instructions to build LLDB on Linux, or more details about supported
 compiler versions, other dependencies, and build flags, see:
 
-http://lldb.llvm.org/build.html
+https://lldb.llvm.org/resources/build.html
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61064: Object/Minidump: Add support for the ThreadList stream

2019-05-01 Thread James Henderson via Phabricator via lldb-commits
jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

Aside from a couple of nits, LGTM.




Comment at: lib/Object/Minidump.cpp:69
   size_t ListOffset = 4;
-  // Some producers insert additional padding bytes to align the module list to
-  // 8-byte boundary. Check for that by comparing the module list size with the
-  // overall stream size.
-  if (ListOffset + sizeof(Module) * ListSize < OptionalStream->size())
+  // Some producers insert additional padding bytes to align the list to 8-byte
+  // boundary. Check for that by comparing the list size with the overall 
stream

Nit (was there before): to 8-byte -> to an 8-byte



Comment at: unittests/Object/MinidumpTest.cpp:446
+
+  for (const std::vector &Data : {OneThread, PaddedThread}) {
+auto ExpectedFile = create(Data);

I missed this in the other tests, but this could be an `ArrayRef` 
instead of a `const std::vector &`. Feel free to leave it as is or to 
update it in an NFC throughout this test afterwards, if you would prefer to 
leave it to another patch.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61064



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


[Lldb-commits] [lldb] r359664 - Removed unnecessary conversion to StringRef

2019-05-01 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed May  1 02:49:07 2019
New Revision: 359664

URL: http://llvm.org/viewvc/llvm-project?rev=359664&view=rev
Log:
Removed unnecessary conversion to StringRef

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=359664&r1=359663&r2=359664&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed May  1 
02:49:07 2019
@@ -1644,9 +1644,7 @@ void SymbolFileDWARF::UpdateExternalModu
 // printed. However, as one can notice in this case we don't
 // actually need to try to load the already loaded module
 // (corresponding to .dwo) so we simply skip it.
-if (m_obj_file->GetFileSpec()
-.GetFileNameExtension()
-.GetStringRef() == ".dwo" &&
+if (m_obj_file->GetFileSpec().GetFileNameExtension() == ".dwo" &&
 llvm::StringRef(m_obj_file->GetFileSpec().GetPath())
 .endswith(dwo_module_spec.GetFileSpec().GetPath())) {
   continue;


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


[Lldb-commits] [PATCH] D61368: Fix build URL in new LLDB website

2019-05-01 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

I just realized that you probably don't have commit access yet, so I'll commit 
this for you. Thanks for the patch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61368



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


[Lldb-commits] [lldb] r359665 - Fix build URL in new LLDB website

2019-05-01 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed May  1 02:55:00 2019
New Revision: 359665

URL: http://llvm.org/viewvc/llvm-project?rev=359665&view=rev
Log:
Fix build URL in new LLDB website

Summary:
After the LLDB website was migrated to be generated by Sphinx the build.html 
file lives in another location.

See http://lists.llvm.org/pipermail/lldb-dev/2019-April/014992.html.

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/INSTALL.txt

Modified: lldb/trunk/INSTALL.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/INSTALL.txt?rev=359665&r1=359664&r2=359665&view=diff
==
--- lldb/trunk/INSTALL.txt (original)
+++ lldb/trunk/INSTALL.txt Wed May  1 02:55:00 2019
@@ -15,4 +15,4 @@ LLDB branch, according to the algorithm
 For instructions to build LLDB on Linux, or more details about supported
 compiler versions, other dependencies, and build flags, see:
 
-http://lldb.llvm.org/build.html
+https://lldb.llvm.org/resources/build.html


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


[Lldb-commits] [PATCH] D61368: Fix build URL in new LLDB website

2019-05-01 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359665: Fix build URL in new LLDB website (authored by 
teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61368?vs=197512&id=197519#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61368

Files:
  lldb/trunk/INSTALL.txt


Index: lldb/trunk/INSTALL.txt
===
--- lldb/trunk/INSTALL.txt
+++ lldb/trunk/INSTALL.txt
@@ -15,4 +15,4 @@
 For instructions to build LLDB on Linux, or more details about supported
 compiler versions, other dependencies, and build flags, see:
 
-http://lldb.llvm.org/build.html
+https://lldb.llvm.org/resources/build.html


Index: lldb/trunk/INSTALL.txt
===
--- lldb/trunk/INSTALL.txt
+++ lldb/trunk/INSTALL.txt
@@ -15,4 +15,4 @@
 For instructions to build LLDB on Linux, or more details about supported
 compiler versions, other dependencies, and build flags, see:
 
-http://lldb.llvm.org/build.html
+https://lldb.llvm.org/resources/build.html
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359682 - [lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers

2019-05-01 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May  1 06:55:23 2019
New Revision: 359682

URL: http://llvm.org/viewvc/llvm-project?rev=359682&view=rev
Log:
[lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/x86-64-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=359682&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Wed May  1 06:55:23 2019
@@ -0,0 +1,67 @@
+#include 
+#include 
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+
+  uint64_t r64[8];
+  xmm_t xmm[8];
+
+  asm volatile(
+"movq%2, %%r8\n\t"
+"movq%2, %%r9\n\t"
+"movq%2, %%r10\n\t"
+"movq%2, %%r11\n\t"
+"movq%2, %%r12\n\t"
+"movq%2, %%r13\n\t"
+"movq%2, %%r14\n\t"
+"movq%2, %%r15\n\t"
+"\n\t"
+"movaps  %2, %%xmm8\n\t"
+"movaps  %2, %%xmm9\n\t"
+"movaps  %2, %%xmm10\n\t"
+"movaps  %2, %%xmm11\n\t"
+"movaps  %2, %%xmm12\n\t"
+"movaps  %2, %%xmm13\n\t"
+"movaps  %2, %%xmm14\n\t"
+"movaps  %2, %%xmm15\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"movq%%r8, 0x00(%%rbx)\n\t"
+"movq%%r9, 0x08(%%rbx)\n\t"
+"movq%%r10, 0x10(%%rbx)\n\t"
+"movq%%r11, 0x18(%%rbx)\n\t"
+"movq%%r12, 0x20(%%rbx)\n\t"
+"movq%%r13, 0x28(%%rbx)\n\t"
+"movq%%r14, 0x30(%%rbx)\n\t"
+"movq%%r15, 0x38(%%rbx)\n\t"
+"\n\t"
+"lea %1, %%rbx\n\t"
+"movaps  %%xmm8, 0x00(%%rbx)\n\t"
+"movaps  %%xmm9, 0x10(%%rbx)\n\t"
+"movaps  %%xmm10, 0x20(%%rbx)\n\t"
+"movaps  %%xmm11, 0x30(%%rbx)\n\t"
+"movaps  %%xmm12, 0x40(%%rbx)\n\t"
+"movaps  %%xmm13, 0x50(%%rbx)\n\t"
+"movaps  %%xmm14, 0x60(%%rbx)\n\t"
+"movaps  %%xmm15, 0x70(%%rbx)\n\t"
+: "=m"(r64), "=m"(xmm)
+: "m"(xmm_fill)
+: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  for (int i = 0; i < 8; ++i)
+printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]);
+  for (int i = 0; i < 8; ++i)
+printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i+8, xmm[i].b, 
xmm[i].a);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-write.test?rev=359682&view=auto
==
--- lldb/trunk/lit/Register/x86-64-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-write.test Wed May  1 06:55:23 2019
@@ -0,0 +1,47 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
+# RUN: %clangxx %p/Inputs/x86-64-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write r8 0x0102030405060708
+register write r9 0x1112131415161718
+register write r10 0x2122232425262728
+register write r11 0x3132333435363738
+register write r12 0x4142434445464748
+register write r13 0x5152535455565758
+register write r14 0x6162636465666768
+register write r15 0x7172737475767778
+
+register write xmm8 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}"
+register write xmm9 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}"
+register write xmm10 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}"
+register write xmm11 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}"
+register write xmm12 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}"
+register write xmm13 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}"
+register write xmm14 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}"
+register write xmm15 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: r8 = 0x0102030405060708
+# CHECK-DAG: r9 = 0x1112131415161718
+# CHECK-DAG: r10 = 0x2122232425262728
+# CHECK-DAG: r11 = 0x3132333435363738
+# CHECK-DAG: r12 = 0x4142434445464748
+# CHECK-DAG: r13 = 0x5152535455565758
+# CHECK-DAG: r14 = 0x6162636465666768
+# CHECK-DAG: r15 = 0x7172737475767778
+
+# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: xmm9 = 0x131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: xmm10 = 0x232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: xmm11 = 0x333537393b3d3f30323436383a3c3e31

[Lldb-commits] [lldb] r359681 - [lldb] [lit] Add write tests for MM/XMM registers

2019-05-01 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May  1 06:55:13 2019
New Revision: 359681

URL: http://llvm.org/viewvc/llvm-project?rev=359681&view=rev
Log:
[lldb] [lit] Add write tests for MM/XMM registers

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

Added:
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/x86-mm-xmm-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp?rev=359681&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp Wed May  1 06:55:13 2019
@@ -0,0 +1,67 @@
+#include 
+#include 
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+
+  uint64_t mm[8];
+  xmm_t xmm[8];
+
+  asm volatile(
+"movq%2, %%mm0\n\t"
+"movq%2, %%mm1\n\t"
+"movq%2, %%mm2\n\t"
+"movq%2, %%mm3\n\t"
+"movq%2, %%mm4\n\t"
+"movq%2, %%mm5\n\t"
+"movq%2, %%mm6\n\t"
+"movq%2, %%mm7\n\t"
+"\n\t"
+"movaps  %2, %%xmm0\n\t"
+"movaps  %2, %%xmm1\n\t"
+"movaps  %2, %%xmm2\n\t"
+"movaps  %2, %%xmm3\n\t"
+"movaps  %2, %%xmm4\n\t"
+"movaps  %2, %%xmm5\n\t"
+"movaps  %2, %%xmm6\n\t"
+"movaps  %2, %%xmm7\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"movq%%mm0, 0x00(%%rbx)\n\t"
+"movq%%mm1, 0x08(%%rbx)\n\t"
+"movq%%mm2, 0x10(%%rbx)\n\t"
+"movq%%mm3, 0x18(%%rbx)\n\t"
+"movq%%mm4, 0x20(%%rbx)\n\t"
+"movq%%mm5, 0x28(%%rbx)\n\t"
+"movq%%mm6, 0x30(%%rbx)\n\t"
+"movq%%mm7, 0x38(%%rbx)\n\t"
+"\n\t"
+"lea %1, %%rbx\n\t"
+"movaps  %%xmm0, 0x00(%%rbx)\n\t"
+"movaps  %%xmm1, 0x10(%%rbx)\n\t"
+"movaps  %%xmm2, 0x20(%%rbx)\n\t"
+"movaps  %%xmm3, 0x30(%%rbx)\n\t"
+"movaps  %%xmm4, 0x40(%%rbx)\n\t"
+"movaps  %%xmm5, 0x50(%%rbx)\n\t"
+"movaps  %%xmm6, 0x60(%%rbx)\n\t"
+"movaps  %%xmm7, 0x70(%%rbx)\n\t"
+: "=m"(mm), "=m"(xmm)
+: "m"(xmm_fill)
+: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  for (int i = 0; i < 8; ++i)
+printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
+  for (int i = 0; i < 8; ++i)
+printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-mm-xmm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-write.test?rev=359681&view=auto
==
--- lldb/trunk/lit/Register/x86-mm-xmm-write.test (added)
+++ lldb/trunk/lit/Register/x86-mm-xmm-write.test Wed May  1 06:55:13 2019
@@ -0,0 +1,47 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
+# RUN: %clangxx %p/Inputs/x86-mm-xmm-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write mm0 0x0102030405060708
+register write mm1 0x1112131415161718
+register write mm2 0x2122232425262728
+register write mm3 0x3132333435363738
+register write mm4 0x4142434445464748
+register write mm5 0x5152535455565758
+register write mm6 0x6162636465666768
+register write mm7 0x7172737475767778
+
+register write xmm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03}"
+register write xmm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13}"
+register write xmm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23}"
+register write xmm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33}"
+register write xmm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43}"
+register write xmm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53}"
+register write xmm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63}"
+register write xmm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: mm0 = 0x0102030405060708
+# CHECK-DAG: mm1 = 0x1112131415161718
+# CHECK-DAG: mm2 = 0x2122232425262728
+# CHECK-DAG: mm3 = 0x3132333435363738
+# CHECK-DAG: mm4 = 0x4142434445464748
+# CHECK-DAG: mm5 = 0x5152535455565758
+# CHECK-DAG: mm6 = 0x6162636465666768
+# CHECK-DAG: mm7 = 0x7172737475767778
+
+# CHECK-DAG: xmm0 = 0x030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: xmm1 = 0x131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: xmm2 = 0x232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: xmm3 = 0x333537393b3d3f3032343

[Lldb-commits] [PATCH] D61303: [lldb] [lit] Add write tests for MM/XMM/r8-r15 registers

2019-05-01 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359681: [lldb] [lit] Add write tests for MM/XMM registers 
(authored by mgorny, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61303?vs=197376&id=197537#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61303

Files:
  lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
  lldb/trunk/lit/Register/x86-mm-xmm-write.test

Index: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
===
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
@@ -0,0 +1,67 @@
+#include 
+#include 
+#include 
+
+struct alignas(16) xmm_t {
+  uint64_t a, b;
+};
+
+int main() {
+  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+
+  uint64_t mm[8];
+  xmm_t xmm[8];
+
+  asm volatile(
+"movq%2, %%mm0\n\t"
+"movq%2, %%mm1\n\t"
+"movq%2, %%mm2\n\t"
+"movq%2, %%mm3\n\t"
+"movq%2, %%mm4\n\t"
+"movq%2, %%mm5\n\t"
+"movq%2, %%mm6\n\t"
+"movq%2, %%mm7\n\t"
+"\n\t"
+"movaps  %2, %%xmm0\n\t"
+"movaps  %2, %%xmm1\n\t"
+"movaps  %2, %%xmm2\n\t"
+"movaps  %2, %%xmm3\n\t"
+"movaps  %2, %%xmm4\n\t"
+"movaps  %2, %%xmm5\n\t"
+"movaps  %2, %%xmm6\n\t"
+"movaps  %2, %%xmm7\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"movq%%mm0, 0x00(%%rbx)\n\t"
+"movq%%mm1, 0x08(%%rbx)\n\t"
+"movq%%mm2, 0x10(%%rbx)\n\t"
+"movq%%mm3, 0x18(%%rbx)\n\t"
+"movq%%mm4, 0x20(%%rbx)\n\t"
+"movq%%mm5, 0x28(%%rbx)\n\t"
+"movq%%mm6, 0x30(%%rbx)\n\t"
+"movq%%mm7, 0x38(%%rbx)\n\t"
+"\n\t"
+"lea %1, %%rbx\n\t"
+"movaps  %%xmm0, 0x00(%%rbx)\n\t"
+"movaps  %%xmm1, 0x10(%%rbx)\n\t"
+"movaps  %%xmm2, 0x20(%%rbx)\n\t"
+"movaps  %%xmm3, 0x30(%%rbx)\n\t"
+"movaps  %%xmm4, 0x40(%%rbx)\n\t"
+"movaps  %%xmm5, 0x50(%%rbx)\n\t"
+"movaps  %%xmm6, 0x60(%%rbx)\n\t"
+"movaps  %%xmm7, 0x70(%%rbx)\n\t"
+: "=m"(mm), "=m"(xmm)
+: "m"(xmm_fill)
+: "%rbx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7"
+  );
+
+  for (int i = 0; i < 8; ++i)
+printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
+  for (int i = 0; i < 8; ++i)
+printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a);
+
+  return 0;
+}
Index: lldb/trunk/lit/Register/x86-mm-xmm-write.test
===
--- lldb/trunk/lit/Register/x86-mm-xmm-write.test
+++ lldb/trunk/lit/Register/x86-mm-xmm-write.test
@@ -0,0 +1,47 @@
+# XFAIL: system-darwin
+# XFAIL: system-windows
+# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
+# RUN: %clangxx %p/Inputs/x86-mm-xmm-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write mm0 0x0102030405060708
+register write mm1 0x1112131415161718
+register write mm2 0x2122232425262728
+register write mm3 0x3132333435363738
+register write mm4 0x4142434445464748
+register write mm5 0x5152535455565758
+register write mm6 0x6162636465666768
+register write mm7 0x7172737475767778
+
+register write xmm0 "{0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}"
+register write xmm1 "{0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13}"
+register write xmm2 "{0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23}"
+register write xmm3 "{0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33}"
+register write xmm4 "{0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43}"
+register write xmm5 "{0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53}"
+register write xmm6 "{0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63}"
+register write xmm7 "{0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: mm0 = 0x0102030405060708
+# CHECK-DAG: mm1 = 0x1112131415161718
+# CHECK-DAG: mm2 = 0x2122232425262728
+# CHECK-DAG: mm3 = 0x3132333435363738
+# CHECK-DAG: mm4 = 0x4142434445464748
+# CHECK-DAG: mm5 = 0x5152535455565758
+# CHECK-DAG: mm6 = 0x6162636465666768
+# CHECK-DAG: mm7 = 0x7172737475767778
+
+# CHECK-DAG: xmm0 = 0x030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: xmm1 = 0x131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: xmm2 = 0x232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: xmm3 = 0x333537393b3d3f30323436383a3c3e31
+# CHECK-DAG: xmm4 = 0x434547494b4d4f40424446484a4c4e41
+# CHECK-DAG: xmm5 = 0x53555759

[Lldb-commits] [PATCH] D61376: [lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

2019-05-01 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, JDevlieghere, krytarowski.
Herald added subscribers: kristof.beyls, javed.absar.

Since Darwin target implements support for zmm* registers without
matching support for the respectively added xmm* and ymm* registers,
split the tests for each register group.  To reduce code duplication,
the tests are using the same source file (which sets more registers
than necessary but that should not cause any harm).


https://reviews.llvm.org/D61376

Files:
  lldb/lit/Register/x86-64-xmm16-read.test
  lldb/lit/Register/x86-64-ymm16-read.test
  lldb/lit/Register/x86-64-zmm-read.test

Index: lldb/lit/Register/x86-64-zmm-read.test
===
--- lldb/lit/Register/x86-64-zmm-read.test
+++ lldb/lit/Register/x86-64-zmm-read.test
@@ -2,77 +2,12 @@
 # XFAIL: system-linux
 # XFAIL: system-netbsd
 # XFAIL: system-windows
-# XFAIL: system-darwin
 # REQUIRES: native && target-x86_64 && native-cpu-avx512f
 # RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch
 
 register read --all
-# CHECK-DAG: xmm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}
-# CHECK-DAG: xmm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13}
-# CHECK-DAG: xmm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23}
-# CHECK-DAG: xmm3 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33}
-# CHECK-DAG: xmm4 = {0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43}
-# CHECK-DAG: xmm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53}
-# CHECK-DAG: xmm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63}
-# CHECK-DAG: xmm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73}
-# CHECK-DAG: xmm8 = {0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83}
-# CHECK-DAG: xmm9 = {0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93}
-# CHECK-DAG: xmm10 = {0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3}
-# CHECK-DAG: xmm11 = {0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3}
-# CHECK-DAG: xmm12 = {0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3}
-# CHECK-DAG: xmm13 = {0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3}
-# CHECK-DAG: xmm14 = {0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3}
-# CHECK-DAG: xmm15 = {0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3}
-# CHECK-DAG: xmm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02}
-# CHECK-DAG: xmm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12}
-# CHECK-DAG: xmm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22}
-# CHECK-DAG: xmm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32}
-# CHECK-DAG: xmm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42}
-# CHECK-DAG: xmm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52}
-# CHECK-DAG: xmm22 = {0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62}
-# CHECK-DAG: xmm23 = {0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72}
-# CHECK-DAG: xmm24 = {0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82}
-# CHECK-DAG: xmm25 = {0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92}
-# CHECK-DAG: xmm26 = {0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2}
-# CHECK-DAG: xmm27 = {0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2}
-# CHECK-DAG: xmm28 = {0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2}
-# CHECK-DAG: xmm29 = {0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2}
-# CHECK-DAG: xmm30 = {0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2}
-# CHECK-DAG: xmm31 = {0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}
-# CHECK-DAG: ymm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82}
-# CHECK-DAG: ymm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92}
-# CHECK-DAG: ymm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0

[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@aprantl @teemperor I believe I addressed your comments.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [lldb] r359699 - Disabling test in TestClassTemplateParameterPack.py until we do template lookup correctly

2019-05-01 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Wed May  1 09:39:31 2019
New Revision: 359699

URL: http://llvm.org/viewvc/llvm-project?rev=359699&view=rev
Log:
Disabling test in TestClassTemplateParameterPack.py until we do template lookup 
correctly

Summary:
Some tests currently only work because we are pulling all the local variables 
when we are evaluating an expression. This will soon
change and these test are working but for the wrong reasons. The details can be 
found in the discussion here:
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180507/040689.html

Differential Review:  https://reviews.llvm.org/D61266

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py?rev=359699&r1=359698&r2=359699&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
 Wed May  1 09:39:31 2019
@@ -4,6 +4,4 @@ from lldbsuite.test import decorators
 lldbinline.MakeInlineTest(
 __file__, globals(), [
 decorators.expectedFailureAll(
-compiler="gcc"),
-# rdar://problem/48128064
-decorators.skipIfDarwin])
+compiler="gcc")])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp?rev=359699&r1=359698&r2=359699&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
 Wed May  1 09:39:31 2019
@@ -42,10 +42,12 @@ int main (int argc, char const *argv[])
 (void)C().isSixteenThirtyTwo();
 (void)C().isSixteenThirtyTwo();
 (void)(myC.member != 64);   //% self.expect("expression -- myC", 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 //% self.expect("expression -- 
myLesserC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
 //% self.expect("expression -- 
myC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
+
+// Disabling until we do template lookup 
correctly: 
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180507/040689.html
+//#% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
+//#% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])

 D myD;
 D myLesserD;
@@ -53,8 +55,10 @@ int main (int argc, char const *argv[])
 (void)D().isIntBool();
 (void)D().isIntBool();
 return myD.member != 64;   //% self.expect("expression -- myD", 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"])
-//% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
-//% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 //% self.expect("expression -- 
myLesserD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
 //% self.expect("expression -- 
myD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
+
+// See comment above.
+//#% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
+//#% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 }


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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Frederic Riss via Phabricator via lldb-commits
friss added a comment.

Correct me if I'm wrong, but the test seems overly complicated still. We are 
testing that we can get the return value of a type that needs to be passed by 
reference. Calling simple free function `Bounds bounds()` should trigger this 
code path, shouldn't it? I would be interested to know wether we do the right 
thing when passing such a struct by value in the source code too as Clang 
doesn't seem to differentiate return values and arguments. Something like:

  // This structure has a non-trivial copy constructor so
  // it needs to be passed by reference.
  struct PassByRef {
PassByRef() = default;
PassByRef(const PassByRef &p);
  
int x = 11223344;
  };
  
  PassByRef returnPassByRef() { return PassByRef(); }
  int takePassByRef(PassByRef p) {
  return p.x;
  }
  
  int main() {
  PassByRef p = returnPassByRef();
  p.x = 42;
  return takePassByRef(returnPassByRef())' // Break here
  }

Break on the return and evaluate `returnPassByRef()` and `takePassByRef(p)`.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

As we're anyway throwing in reduced test cases, here is another version:

  struct PassByRef {
// PassByRef should be pass by reference since the destructor is
// user-defined which means it can not be passed in registers.
~PassByRef() {}
int x = 0;
  };
  
  struct Foo {
PassByRef bar(Foo *f) const {
  PassByRef b;
  if (this == f)
b.x = 11223344;
  return b;
}
  };
  
  int main() {
Foo f;
return f.bar(&f).x; // break here
  }

We can save the typing work for the two constructors by just making a 
non-trivial destructor.

(Also this patch currently deletes `TestGlobalVariables.py` which seems 
unintentional)


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61394: Remove unnecessary check in SymbolFileDWARF::ParseImportedModules

2019-05-01 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: aprantl.
Herald added subscribers: lldb-commits, jdoerfert.
Herald added a project: LLDB.

This check seems unnecessary as we already assert the same condition above and 
also access `sc.comp_unit`
before this check.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61394

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp


Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -909,9 +909,6 @@
 return false;
   UpdateExternalModuleListIfNeeded();
 
-  if (!sc.comp_unit)
-return false;
-
   const DWARFDIE die = dwarf_cu->DIE();
   if (!die)
 return false;


Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -909,9 +909,6 @@
 return false;
   UpdateExternalModuleListIfNeeded();
 
-  if (!sc.comp_unit)
-return false;
-
   const DWARFDIE die = dwarf_cu->DIE();
   if (!die)
 return false;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@teemperor good call, that is indeed simpler and yes I did not intend that 
delete.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 197618.
shafik added a comment.

- Simplifying test
- Fixing unintended deleted test


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

https://reviews.llvm.org/D61146

Files:
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,20 @@
+struct PassByRef {
+  // PassByRef should be pass by reference since the destructor is
+  // user-defined which means it can not be passed in registers.
+  ~PassByRef() {}
+  int x = 0;
+};
+
+struct Foo {
+  PassByRef bar(Foo *f) const {
+PassByRef b;
+if (this == f)
+  b.x = 11223344;
+return b;
+  }
+};
+
+int main() {
+  Foo f;
+  return f.bar(&f).x; // break here
+}
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
@@ -0,0 +1,29 @@
+"""
+This is a test to ensure that both lldb is reconstructing the right
+calling convention for a CXXRecordDecl as represented by:
+
+   DW_CC_pass_by_reference
+   DW_CC_pass_by_value
+
+and to also make sure that the ASTImporter is copying over this
+setting when importing the CXXRecordDecl via setArgPassingRestrictions.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestArgumentPassingRestrictions(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  def test_argument_passing_restrictions(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp"))
+
+self.expect("expr f.bar(&f).x",
+substrs=['(int)', '= 11223344'])
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,20 @@
+struct PassByRef {
+  // PassByRef should be pass by reference since the destructor is
+  // user-defined which means it can not be passed in registers.
+  ~PassByRef() {}
+  int x = 0;
+};
+
+struct Foo {
+  PassByRef bar(Foo *f) const {
+PassByRef b;
+if (this == f)
+  b.x = 11223344;
+return b;
+  }
+};
+
+int main() {
+  Foo f;
+  return f.bar(&f).x; // break here
+}
Index: packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPas

[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Frederic Riss via Phabricator via lldb-commits
friss added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py:28-29
+
+self.expect("expr f.bar(&f).x",
+substrs=['(int)', '= 11223344'])

This still tests only getting the return value and not passing the struct as an 
argument.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61368: Fix build URL in new LLDB website

2019-05-01 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

In D61368#1485840 , @teemperor wrote:

> I just realized that you probably don't have commit access yet, so I'll 
> commit this for you. Thanks for the patch!


Thank you @teemperor !


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61368



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


[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-01 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added inline comments.



Comment at: source/API/SystemInitializerFull.cpp:132-133
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+

You need to include the headers for these classes


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 197628.
shafik added a comment.

Testing both passing as and argument and returning


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

https://reviews.llvm.org/D61146

Files:
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+return p.x;
+}
+
+int main() {
+PassByRef p = returnPassByRef();
+p.x = 42;
+return takePassByRef(p); // break here
+}
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
@@ -0,0 +1,32 @@
+"""
+This is a test to ensure that both lldb is reconstructing the right
+calling convention for a CXXRecordDecl as represented by:
+
+   DW_CC_pass_by_reference
+   DW_CC_pass_by_value
+
+and to also make sure that the ASTImporter is copying over this
+setting when importing the CXXRecordDecl via setArgPassingRestrictions.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestArgumentPassingRestrictions(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  def test_argument_passing_restrictions(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp"))
+
+self.expect("expr returnPassByRef()",
+substrs=['(PassByRef)', '= 11223344'])
+
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 11223344'])
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+return p.x;
+}
+
+int main() {
+PassByRef p = re

[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@friss added second test


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [lldb] r359724 - Disable queues_with_libBacktraceRecording

2019-05-01 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed May  1 13:37:05 2019
New Revision: 359724

URL: http://llvm.org/viewvc/llvm-project?rev=359724&view=rev
Log:
Disable queues_with_libBacktraceRecording

After multiple attempts from both Fred and Adrian, this variant of the
test is still flaky on GreenDragon. This commit disables it while we
continue investigate.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py?rev=359724&r1=359723&r2=359724&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py Wed 
May  1 13:37:05 2019
@@ -268,6 +268,7 @@ class TestQueues(TestBase):
 stream.GetData() == "Background",
 "background QoS thread name is valid")
 
+@skipIfDarwin # rdar://50379398
 def queues_with_libBacktraceRecording(self):
 """Test queues inspection SB APIs with libBacktraceRecording 
present."""
 exe = self.getBuildArtifact("a.out")


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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Frederic Riss via Phabricator via lldb-commits
friss added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py:32
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 11223344'])

If this test passes, we have a problem. The code modifies p.x to be 42, so that 
what it should return.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py:32
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 11223344'])

friss wrote:
> If this test passes, we have a problem. The code modifies p.x to be 42, so 
> that what it should return.
The copy constructor does not actually copy and we are default constructing 
since it is pass by value, but that is probably too clever so I changed it.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 197636.
shafik marked an inline comment as done.
shafik added a comment.

Modifying copy contructor to be act more intuitively.


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

https://reviews.llvm.org/D61146

Files:
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
  
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){x = p.x;};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+return p.x;
+}
+
+int main() {
+PassByRef p = returnPassByRef();
+p.x = 42;
+return takePassByRef(p); // break here
+}
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
@@ -0,0 +1,32 @@
+"""
+This is a test to ensure that both lldb is reconstructing the right
+calling convention for a CXXRecordDecl as represented by:
+
+   DW_CC_pass_by_reference
+   DW_CC_pass_by_value
+
+and to also make sure that the ASTImporter is copying over this
+setting when importing the CXXRecordDecl via setArgPassingRestrictions.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestArgumentPassingRestrictions(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  def test_argument_passing_restrictions(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp"))
+
+self.expect("expr returnPassByRef()",
+substrs=['(PassByRef)', '= 11223344'])
+
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 42'])
Index: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules


Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){x = p.x;};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+  

[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Frederic Riss via Phabricator via lldb-commits
friss accepted this revision.
friss added a comment.
This revision is now accepted and ready to land.

Thanks, indeed this looks better.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [lldb] r359730 - [lldb-server] Remove lldb-server's dependency on Core

2019-05-01 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Wed May  1 14:41:40 2019
New Revision: 359730

URL: http://llvm.org/viewvc/llvm-project?rev=359730&view=rev
Log:
[lldb-server] Remove lldb-server's dependency on Core

No need to directly link against Core, as lldb-server doesn't directly
use it.

Modified:
lldb/trunk/tools/lldb-server/CMakeLists.txt
lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed May  1 14:41:40 2019
@@ -64,7 +64,6 @@ add_lldb_tool(lldb-server
 
 LINK_LIBS
   lldbBase
-  lldbCore
   lldbHost
   lldbInitialization
   lldbInterpreter

Modified: lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp (original)
+++ lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp Wed May  1 14:41:40 
2019
@@ -8,7 +8,6 @@
 
 #include "LLDBServerUtilities.h"
 
-#include "lldb/Core/StreamFile.h"
 #include "lldb/Utility/Args.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Wed May  1 14:41:40 2019
@@ -22,7 +22,6 @@
 #include "LLDBServerUtilities.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
-#include "lldb/Core/PluginManager.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostGetOpt.h"


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


[Lldb-commits] [PATCH] D61362: lldb-server: remove link against lldbInterpreter

2019-05-01 Thread Alex Langford via Phabricator via lldb-commits
xiaobai accepted this revision.
xiaobai added a comment.
This revision is now accepted and ready to land.

Seems like the right thing to do.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61362



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


[Lldb-commits] [PATCH] D61406: Watchpoint test + stop-command-source-on-error fix combo

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: davide, sgraenitz, friss.
Herald added subscribers: teemperor, jfb.
Herald added a project: LLDB.

The original intention was to change the watchpoint Python test to a lit test. 
While doing so, I found a situation where stop-command-source-on-error was 
being ignored. Since the new test also tests the fix for the 
CommandObjectCommands, I figured I'd keep them in a single patch.

- I converted the test to lit because it is flaky on GreenDragon.
- The problem with the command object is that we didn't differentiate between 
the boolean value not being set, and the value being set to either true or 
false. If the value isn't set, we'd calculate it in the command interpreter 
based on the global options. With the old approach, we'd always set the value 
to the default of the option, which is not what the user wanted.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61406

Files:
  lldb/lit/Watchpoint/Inputs/main.cpp
  lldb/lit/Watchpoint/SetErrorCases.test
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
  lldb/source/Commands/CommandObjectCommands.cpp

Index: lldb/source/Commands/CommandObjectCommands.cpp
===
--- lldb/source/Commands/CommandObjectCommands.cpp
+++ lldb/source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ /dev/null
@@ -1,74 +0,0 @@
-"""
-Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class WatchpointSetErrorTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Our simple source filename.
-self.source = 'main.cpp'
-# Find the line number to break inside main().
-self.line = line_number(
-self.source, '// Set break point at this line.')
-# Build dictionary to have unique executable names for each test
-# method.
-
-def test_error_cases_with_watchpoint_set(self):
-"""Test error cases with the 'watchpoint set' command."""
-self.build()
-self.setTearDownCleanup()
-
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-lldbutil.run_break_set_by_file_and_line(
-self, None, self.line, num_expected_locations=1)
-
-# Run the program.
-self.runCmd("run", RUN_SUCCEEDED)
-
-# We should be stopped again due to the breakpoint.
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = breakpoint'])
-
-# Try some error conditions:
-
-# 'watchpoint set' is now a multiword command.
-self.expect("watchpoint set",
-substrs=['The following subcommands are supported:',
- 'expression',
- 'variable'])
-self.runCmd("watchpoint set variable -w read_write", check=False)
-
-# 'watchpoint set expression' with '-w' or '-s' specified now needs
-# an option terminator and a raw expression after that.
-self.expect("watchpoint set expression -w write --", error=True,
-startstr='error: ')
-
-# It's an error if the expression did not evaluate to an address.
-self.expect(
-"watchpoint set expression MyAggregateDataType",
-error=True,
-

[Lldb-commits] [PATCH] D61406: Watchpoint test + stop-command-source-on-error fix combo

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 197652.
JDevlieghere added a comment.

Reduce test


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

https://reviews.llvm.org/D61406

Files:
  lldb/lit/Watchpoint/Inputs/main.cpp
  lldb/lit/Watchpoint/SetErrorCases.test
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
  lldb/source/Commands/CommandObjectCommands.cpp

Index: lldb/source/Commands/CommandObjectCommands.cpp
===
--- lldb/source/Commands/CommandObjectCommands.cpp
+++ lldb/source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ /dev/null
@@ -1,74 +0,0 @@
-"""
-Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class WatchpointSetErrorTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Our simple source filename.
-self.source = 'main.cpp'
-# Find the line number to break inside main().
-self.line = line_number(
-self.source, '// Set break point at this line.')
-# Build dictionary to have unique executable names for each test
-# method.
-
-def test_error_cases_with_watchpoint_set(self):
-"""Test error cases with the 'watchpoint set' command."""
-self.build()
-self.setTearDownCleanup()
-
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-lldbutil.run_break_set_by_file_and_line(
-self, None, self.line, num_expected_locations=1)
-
-# Run the program.
-self.runCmd("run", RUN_SUCCEEDED)
-
-# We should be stopped again due to the breakpoint.
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = breakpoint'])
-
-# Try some error conditions:
-
-# 'watchpoint set' is now a multiword command.
-self.expect("watchpoint set",
-substrs=['The following subcommands are supported:',
- 'expression',
- 'variable'])
-self.runCmd("watchpoint set variable -w read_write", check=False)
-
-# 'watchpoint set expression' with '-w' or '-s' specified now needs
-# an option terminator and a raw expression after that.
-self.expect("watchpoint set expression -w write --", error=True,
-startstr='error: ')
-
-# It's an error if the expression did not evaluate to an address.
-self.expect(
-"watchpoint set expression MyAggregateDataType",
-error=True,
-startstr='error: expression did not evaluate to an address')
-
-# Wrong size parameter is an error.
-self.expect("watchpoint set variable -s -128", error=True,
-substrs=['invalid enumeration value'])
Index: lldb/lit/Watchpoint/SetErrorCases.test
===
--- /dev/null
+++ lldb/lit/Watchpoint/SetErrorCases.test
@@ -0,0 +1,28 @@
+# RUN: %clangxx %p/Inputs/main.cpp -g -o %t.out
+# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
+
+settings show interpreter.stop-command-source-on-error
+# CHECK: interpreter.stop-command-source-on-error (boolean) = false
+
+b main.cpp:11
+run
+# CHECK: stopped

[Lldb-commits] [lldb] r359732 - Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Wed May  1 15:23:06 2019
New Revision: 359732

URL: http://llvm.org/viewvc/llvm-project?rev=359732&view=rev
Log:
Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference 
when loading from DWARF

Summary:
This will fix a bug where during expression parsing we are not setting a 
CXXRecordDecl to not be passed in registers and the resulting code generation 
is wrong.
The DWARF attribute DW_CC_pass_by_reference tells us that we should not be 
passing in registers i.e. RAA_Indirect.
This change depends this clang change which fixes the fact that the ASTImporter 
does not copy RecordDeclBits for CXXRecordDecl: https://reviews.llvm.org/D61140

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile?rev=359732&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
 Wed May  1 15:23:06 2019
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py?rev=359732&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
 Wed May  1 15:23:06 2019
@@ -0,0 +1,32 @@
+"""
+This is a test to ensure that both lldb is reconstructing the right
+calling convention for a CXXRecordDecl as represented by:
+
+   DW_CC_pass_by_reference
+   DW_CC_pass_by_value
+
+and to also make sure that the ASTImporter is copying over this
+setting when importing the CXXRecordDecl via setArgPassingRestrictions.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestArgumentPassingRestrictions(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  def test_argument_passing_restrictions(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp"))
+
+self.expect("expr returnPassByRef()",
+substrs=['(PassByRef)', '= 11223344'])
+
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 42'])

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp?rev=359732&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
 Wed May  1 15:23:06 2019
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){x = p.x;};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+return p.x;
+}
+
+int main() {
+PassByRef p = returnPassByRef();
+p.x = 42;
+return takePassByRef(p); // break here
+}

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=359732&r1=359731&r2=359732&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile

[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-05-01 Thread Shafik Yaghmour via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359732: Set a CXXRecordDecl to not be passed in registers if 
DW_CC_pass_by_reference… (authored by shafik, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61146?vs=197636&id=197655#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61146

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp


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
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+}
+
   } break;
 
   case DW_TAG_enumeration_type: {
Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
@@ -0,0 +1,32 @@
+"""
+This is a test to ensure that both lldb is reconstructing the right
+calling convention for a CXXRecordDecl as represented by:
+
+   DW_CC_pass_by_reference
+   DW_CC_pass_by_value
+
+and to also make sure that the ASTImporter is copying over this
+setting when importing the CXXRecordDecl via setArgPassingRestrictions.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestArgumentPassingRestrictions(TestBase):
+
+  mydir = TestBase.compute_mydir(__file__)
+
+  def test_argument_passing_restrictions(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp"))
+
+self.expect("expr returnPassByRef()",
+substrs=['(PassByRef)', '= 11223344'])
+
+self.expect("expr takePassByRef(p)",
+substrs=['(int)', '= 42'])
Index: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp
@@ -0,0 +1,19 @@
+// This structure has a non-trivial copy constructor so
+// it needs to be passed by reference.
+struct PassByRef {
+  PassByRef() = default;
+  PassByRef(const PassByRef &p){x = p.x;};
+
+  int x = 11223344;
+};
+
+PassByRef returnPassByRef() { return PassByRef(); }
+int takePassByRef(PassByRef p) {
+return p.x;
+}
+
+int main() {
+PassByRef p = returnPassByRef();
+p.x = 42;
+return takePassByRef(p); // break here
+}


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
@@ -959,6 +959,14 @@
   }
 }
 
+if (calling_convention == llvm::dwarf::DW_CC_pass_by_reference) {
+  clang::CXXRecordDecl *record_decl =
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl)
+record_decl->setArgPassingRestrictions(
+cl

[Lldb-commits] [PATCH] D61406: [CommandObjectCommands] Honor stop-command-source-on-error

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 197662.
JDevlieghere retitled this revision from "Watchpoint test + 
stop-command-source-on-error fix combo" to "[CommandObjectCommands] Honor 
stop-command-source-on-error ".
JDevlieghere edited the summary of this revision.
JDevlieghere added a comment.

Add dedicated test


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

https://reviews.llvm.org/D61406

Files:
  lldb/lit/Commands/command-source.test
  lldb/source/Commands/CommandObjectCommands.cpp


Index: lldb/source/Commands/CommandObjectCommands.cpp
===
--- lldb/source/Commands/CommandObjectCommands.cpp
+++ lldb/source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  
options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo 
settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lldb/lit/Commands/command-source.test
===
--- /dev/null
+++ lldb/lit/Commands/command-source.test
@@ -0,0 +1,12 @@
+# Check that stop command source on error.
+
+# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s 
--check-prefix STOP
+# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s 
--check-prefix CONTINUE
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+
+bogus
+p 10+1
+
+# CONTINUE: 11
+# STOP-NOT: 11


Index: lldb/source/Commands/CommandObjectCommands.cpp
===
--- lldb/source/Commands/CommandObjectCommands.cpp
+++ lldb/source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lldb/lit/Commands/command-source.test
===
--- /dev/null
+++ lldb/lit/Commands/command-source.test
@@ -0,0 +1,12 @@
+# Check that stop command source on error.
+
+# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+
+bogus
+p 10+1
+
+# CONTINUE: 11
+# STOP-NOT: 11
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359738 - lldb-server: remove link against lldbInterpreter

2019-05-01 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Wed May  1 16:06:45 2019
New Revision: 359738

URL: http://llvm.org/viewvc/llvm-project?rev=359738&view=rev
Log:
lldb-server: remove link against lldbInterpreter

This dependency is unused. Remove the extraneous link.

Modified:
lldb/trunk/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=359738&r1=359737&r2=359738&view=diff
==
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed May  1 16:06:45 2019
@@ -66,7 +66,6 @@ add_lldb_tool(lldb-server
   lldbBase
   lldbHost
   lldbInitialization
-  lldbInterpreter
   ${LLDB_PLUGINS}
   ${LLDB_SYSTEM_LIBS}
 


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


[Lldb-commits] [PATCH] D61362: lldb-server: remove link against lldbInterpreter

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

SVN r359738


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61362



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


[Lldb-commits] [PATCH] D61406: [CommandObjectCommands] Honor stop-command-source-on-error

2019-05-01 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM


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

https://reviews.llvm.org/D61406



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


[Lldb-commits] [PATCH] D61414: [test] Convert TestWatchpointSetErrorCases.py to lit

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: davide, labath.
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

This test is flaky on GreenDragon. Since it was a pexpect test and
straightforward enough to convert, I went ahead and converted it to a
lit test.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61414

Files:
  lldb/lit/Watchpoint/Inputs/main.cpp
  lldb/lit/Watchpoint/SetErrorCases.test
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py

Index: lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ /dev/null
@@ -1,74 +0,0 @@
-"""
-Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class WatchpointSetErrorTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Our simple source filename.
-self.source = 'main.cpp'
-# Find the line number to break inside main().
-self.line = line_number(
-self.source, '// Set break point at this line.')
-# Build dictionary to have unique executable names for each test
-# method.
-
-def test_error_cases_with_watchpoint_set(self):
-"""Test error cases with the 'watchpoint set' command."""
-self.build()
-self.setTearDownCleanup()
-
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-lldbutil.run_break_set_by_file_and_line(
-self, None, self.line, num_expected_locations=1)
-
-# Run the program.
-self.runCmd("run", RUN_SUCCEEDED)
-
-# We should be stopped again due to the breakpoint.
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = breakpoint'])
-
-# Try some error conditions:
-
-# 'watchpoint set' is now a multiword command.
-self.expect("watchpoint set",
-substrs=['The following subcommands are supported:',
- 'expression',
- 'variable'])
-self.runCmd("watchpoint set variable -w read_write", check=False)
-
-# 'watchpoint set expression' with '-w' or '-s' specified now needs
-# an option terminator and a raw expression after that.
-self.expect("watchpoint set expression -w write --", error=True,
-startstr='error: ')
-
-# It's an error if the expression did not evaluate to an address.
-self.expect(
-"watchpoint set expression MyAggregateDataType",
-error=True,
-startstr='error: expression did not evaluate to an address')
-
-# Wrong size parameter is an error.
-self.expect("watchpoint set variable -s -128", error=True,
-substrs=['invalid enumeration value'])
Index: lldb/lit/Watchpoint/SetErrorCases.test
===
--- /dev/null
+++ lldb/lit/Watchpoint/SetErrorCases.test
@@ -0,0 +1,28 @@
+# RUN: %clangxx %p/Inputs/main.cpp -g -o %t.out
+# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
+
+settings show interpreter.stop-command-source-on-error
+# CHECK: interpreter.stop-command-source-on-error (boolean) = false
+
+b main.cpp:11
+run
+# CHECK: stopped
+# CHECK-NEXT: stop reason = breakpoint
+
+watchpoint set
+# CHECK: Commands for setting a watchpoint.
+# CHECK: The following subcommands are supported:
+# CHECK: Set a watchpoint on an address by supplying an expression.
+# CHECK: Set a watchpoint on a variable.
+
+watchpoint set variable -w read_write
+# CHECK: error: required argument missing
+
+watchpoint set expression -w write --
+# CHECK: error: expression evaluation of address to watch failed
+
+watchpoint set expression MyAggregateDataType
+# CHECK: error: expression did not evaluate to an address
+
+watchpoint set variable -s -128
+# CHECK: error: invalid enumeration value
Index: lldb/lit/Watchpoint/Inputs/main.cpp
===
--- /dev/null
+++ lldb/lit/Watchpoint/Inputs/main.cpp
@@ -0,0 +1,13 @@
+#include 
+
+int main (

[Lldb-commits] [PATCH] D61414: [test] Convert TestWatchpointSetErrorCases.py to lit

2019-05-01 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61414



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


[Lldb-commits] [lldb] r359748 - [CMake] Remove EmulateInstructionMIPS dependency on Interpreter

2019-05-01 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Wed May  1 18:10:38 2019
New Revision: 359748

URL: http://llvm.org/viewvc/llvm-project?rev=359748&view=rev
Log:
[CMake] Remove EmulateInstructionMIPS dependency on Interpreter

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS/CMakeLists.txt
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h

Modified: lldb/trunk/source/Plugins/Instruction/MIPS/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/CMakeLists.txt?rev=359748&r1=359747&r2=359748&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/CMakeLists.txt Wed May  1 
18:10:38 2019
@@ -7,7 +7,6 @@ add_lldb_library(lldbPluginInstructionMI
 
   LINK_LIBS
 lldbCore
-lldbInterpreter
 lldbSymbol
 lldbTarget
 lldbPluginProcessUtility

Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h?rev=359748&r1=359747&r2=359748&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Wed May 
 1 18:10:38 2019
@@ -20,8 +20,11 @@ class MCInstrInfo;
 class MCInst;
 }
 
+namespace lldb_private {
+  class OptionValueDictionary;
+}
+
 #include "lldb/Core/EmulateInstruction.h"
-#include "lldb/Interpreter/OptionValue.h"
 #include "lldb/Utility/Status.h"
 
 class EmulateInstructionMIPS : public lldb_private::EmulateInstruction {


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


[Lldb-commits] [lldb] r359750 - [CommandObjectCommands] Honor stop-command-source-on-error

2019-05-01 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed May  1 18:54:02 2019
New Revision: 359750

URL: http://llvm.org/viewvc/llvm-project?rev=359750&view=rev
Log:
[CommandObjectCommands] Honor stop-command-source-on-error

This patch ensures that we honor the stop-command-source-on-error
setting from `command source`. The problem is that we didn't
differentiate between the boolean value being true or false, or not
being set. For the latter scenario, we should calculate the value in the
command interpreter based on the global options.

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

Added:
lldb/trunk/lit/Commands/command-source.test
Modified:
lldb/trunk/source/Commands/CommandObjectCommands.cpp

Added: lldb/trunk/lit/Commands/command-source.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/command-source.test?rev=359750&view=auto
==
--- lldb/trunk/lit/Commands/command-source.test (added)
+++ lldb/trunk/lit/Commands/command-source.test Wed May  1 18:54:02 2019
@@ -0,0 +1,12 @@
+# Check that stop command source on error.
+
+# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s 
--check-prefix STOP
+# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s 
--check-prefix CONTINUE
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+
+bogus
+p 10+1
+
+# CONTINUE: 11
+# STOP-NOT: 11

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=359750&r1=359749&r2=359750&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Wed May  1 18:54:02 
2019
@@ -309,8 +309,13 @@ protected:
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  
options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo 
settings.
   if (m_options.m_silent_run.GetCurrentValue()) {


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


[Lldb-commits] [lldb] r359751 - [test] Convert TestWatchpointSetErrorCases.py to lit

2019-05-01 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed May  1 18:54:05 2019
New Revision: 359751

URL: http://llvm.org/viewvc/llvm-project?rev=359751&view=rev
Log:
[test] Convert TestWatchpointSetErrorCases.py to lit

This test is flaky on GreenDragon. Since it was a pexpect test and
straightforward enough to convert, I went ahead and converted it to a
lit test.

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

Added:
lldb/trunk/lit/Watchpoint/
lldb/trunk/lit/Watchpoint/Inputs/
lldb/trunk/lit/Watchpoint/Inputs/main.cpp
lldb/trunk/lit/Watchpoint/SetErrorCases.test
Removed:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py

Added: lldb/trunk/lit/Watchpoint/Inputs/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Watchpoint/Inputs/main.cpp?rev=359751&view=auto
==
--- lldb/trunk/lit/Watchpoint/Inputs/main.cpp (added)
+++ lldb/trunk/lit/Watchpoint/Inputs/main.cpp Wed May  1 18:54:05 2019
@@ -0,0 +1,13 @@
+#include 
+
+int main (int argc, char const *argv[])
+{
+struct {
+int a;
+int b;
+int c;
+} MyAggregateDataType;
+
+printf ("Set break point at this line.\n");
+return 0;
+}

Added: lldb/trunk/lit/Watchpoint/SetErrorCases.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Watchpoint/SetErrorCases.test?rev=359751&view=auto
==
--- lldb/trunk/lit/Watchpoint/SetErrorCases.test (added)
+++ lldb/trunk/lit/Watchpoint/SetErrorCases.test Wed May  1 18:54:05 2019
@@ -0,0 +1,28 @@
+# RUN: %clangxx %p/Inputs/main.cpp -g -o %t.out
+# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error 
false' -s %s %t.out 2>&1 | FileCheck %s
+
+settings show interpreter.stop-command-source-on-error
+# CHECK: interpreter.stop-command-source-on-error (boolean) = false
+
+b main.cpp:11
+run
+# CHECK: stopped
+# CHECK-NEXT: stop reason = breakpoint
+
+watchpoint set
+# CHECK: Commands for setting a watchpoint.
+# CHECK: The following subcommands are supported:
+# CHECK: Set a watchpoint on an address by supplying an expression.
+# CHECK: Set a watchpoint on a variable.
+
+watchpoint set variable -w read_write
+# CHECK: error: required argument missing
+
+watchpoint set expression -w write --
+# CHECK: error: expression evaluation of address to watch failed
+
+watchpoint set expression MyAggregateDataType
+# CHECK: error: expression did not evaluate to an address
+
+watchpoint set variable -s -128
+# CHECK: error: invalid enumeration value

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py?rev=359750&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
 (removed)
@@ -1,74 +0,0 @@
-"""
-Test error cases for the 'watchpoint set' command to make sure it errors out 
when necessary.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class WatchpointSetErrorTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Our simple source filename.
-self.source = 'main.cpp'
-# Find the line number to break inside main().
-self.line = line_number(
-self.source, '// Set break point at this line.')
-# Build dictionary to have unique executable names for each test
-# method.
-
-def test_error_cases_with_watchpoint_set(self):
-"""Test error cases with the 'watchpoint set' command."""
-self.build()
-self.setTearDownCleanup()
-
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-lldbutil.run_break_set_by_file_and_line(
-self, None, self.line, num_expected_locations=1)
-
-# Run the program.
-self.runCmd("run", RUN_SUCCEEDED)
-
-# We should be stopped again due to the breakpoint.
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = br

[Lldb-commits] [PATCH] D61406: [CommandObjectCommands] Honor stop-command-source-on-error

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359750: [CommandObjectCommands] Honor 
stop-command-source-on-error (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61406?vs=197662&id=197689#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61406

Files:
  lit/Commands/command-source.test
  source/Commands/CommandObjectCommands.cpp


Index: source/Commands/CommandObjectCommands.cpp
===
--- source/Commands/CommandObjectCommands.cpp
+++ source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  
options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo 
settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lit/Commands/command-source.test
===
--- lit/Commands/command-source.test
+++ lit/Commands/command-source.test
@@ -0,0 +1,12 @@
+# Check that stop command source on error.
+
+# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s 
--check-prefix STOP
+# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s 
--check-prefix CONTINUE
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error 
false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+
+bogus
+p 10+1
+
+# CONTINUE: 11
+# STOP-NOT: 11


Index: source/Commands/CommandObjectCommands.cpp
===
--- source/Commands/CommandObjectCommands.cpp
+++ source/Commands/CommandObjectCommands.cpp
@@ -309,8 +309,13 @@
 m_options.m_stop_on_continue.OptionWasSet()) {
   // Use user set settings
   CommandInterpreterRunOptions options;
-  options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
-  options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
+
+  if (m_options.m_stop_on_continue.OptionWasSet())
+options.SetStopOnContinue(
+m_options.m_stop_on_continue.GetCurrentValue());
+
+  if (m_options.m_stop_on_error.OptionWasSet())
+options.SetStopOnError(m_options.m_stop_on_error.GetCurrentValue());
 
   // Individual silent setting is override for global command echo settings.
   if (m_options.m_silent_run.GetCurrentValue()) {
Index: lit/Commands/command-source.test
===
--- lit/Commands/command-source.test
+++ lit/Commands/command-source.test
@@ -0,0 +1,12 @@
+# Check that stop command source on error.
+
+# RUN: %lldb -x -b -o "command source -e 1 %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o "command source -e 0 %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error true' -o "command source %s" 2>&1 | FileCheck %s --check-prefix STOP
+# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
+
+bogus
+p 10+1
+
+# CONTINUE: 11
+# STOP-NOT: 11
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61414: [test] Convert TestWatchpointSetErrorCases.py to lit

2019-05-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359751: [test] Convert TestWatchpointSetErrorCases.py to 
lit (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61414?vs=197674&id=197691#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61414

Files:
  lit/Watchpoint/Inputs/main.cpp
  lit/Watchpoint/SetErrorCases.test
  
packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py

Index: lit/Watchpoint/SetErrorCases.test
===
--- lit/Watchpoint/SetErrorCases.test
+++ lit/Watchpoint/SetErrorCases.test
@@ -0,0 +1,28 @@
+# RUN: %clangxx %p/Inputs/main.cpp -g -o %t.out
+# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
+
+settings show interpreter.stop-command-source-on-error
+# CHECK: interpreter.stop-command-source-on-error (boolean) = false
+
+b main.cpp:11
+run
+# CHECK: stopped
+# CHECK-NEXT: stop reason = breakpoint
+
+watchpoint set
+# CHECK: Commands for setting a watchpoint.
+# CHECK: The following subcommands are supported:
+# CHECK: Set a watchpoint on an address by supplying an expression.
+# CHECK: Set a watchpoint on a variable.
+
+watchpoint set variable -w read_write
+# CHECK: error: required argument missing
+
+watchpoint set expression -w write --
+# CHECK: error: expression evaluation of address to watch failed
+
+watchpoint set expression MyAggregateDataType
+# CHECK: error: expression did not evaluate to an address
+
+watchpoint set variable -s -128
+# CHECK: error: invalid enumeration value
Index: lit/Watchpoint/Inputs/main.cpp
===
--- lit/Watchpoint/Inputs/main.cpp
+++ lit/Watchpoint/Inputs/main.cpp
@@ -0,0 +1,13 @@
+#include 
+
+int main (int argc, char const *argv[])
+{
+struct {
+int a;
+int b;
+int c;
+} MyAggregateDataType;
+
+printf ("Set break point at this line.\n");
+return 0;
+}
Index: packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
===
--- packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
@@ -1,74 +0,0 @@
-"""
-Test error cases for the 'watchpoint set' command to make sure it errors out when necessary.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class WatchpointSetErrorTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Our simple source filename.
-self.source = 'main.cpp'
-# Find the line number to break inside main().
-self.line = line_number(
-self.source, '// Set break point at this line.')
-# Build dictionary to have unique executable names for each test
-# method.
-
-def test_error_cases_with_watchpoint_set(self):
-"""Test error cases with the 'watchpoint set' command."""
-self.build()
-self.setTearDownCleanup()
-
-exe = self.getBuildArtifact("a.out")
-self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-lldbutil.run_break_set_by_file_and_line(
-self, None, self.line, num_expected_locations=1)
-
-# Run the program.
-self.runCmd("run", RUN_SUCCEEDED)
-
-# We should be stopped again due to the breakpoint.
-# The stop reason of the thread should be breakpoint.
-self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-substrs=['stopped',
- 'stop reason = breakpoint'])
-
-# Try some error conditions:
-
-# 'watchpoint set' is now a multiword command.
-self.expect("watchpoint set",
-substrs=['The following subcommands are supported:',
- 'expression',
- 'variable'])
-self.runCmd("watchpoint set variable -w read_write", check=False)
-
-# 'watchpoint set expression' with '-w' or '-s' specified now needs
-# an option terminator and a raw expression after that.
-self.expect("watchpoint set expression -w write --", error=True,
-startstr='error: ')
-
-# It's an error if the expression did not evaluate to an address.
-sel

[Lldb-commits] [lldb] r359752 - Mention the thread-format & frame-format settings in help.

2019-05-01 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Wed May  1 19:14:08 2019
New Revision: 359752

URL: http://llvm.org/viewvc/llvm-project?rev=359752&view=rev
Log:
Mention the thread-format & frame-format settings in help.

You can only find out about this useful customization by browsing
the settings list output or the llvm.org web pages.  Mention it
in the help for thread list, thread backtrace & _regex_bt commands
to make it more discoverable.

Modified:
lldb/trunk/source/Commands/CommandObjectThread.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=359752&r1=359751&r2=359752&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Wed May  1 19:14:08 2019
@@ -317,7 +317,10 @@ public:
 "indexes can be specified as arguments.\n"
 "Use the thread-index \"all\" to see all threads.\n"
 "Use the thread-index \"unique\" to see threads grouped by unique "
-"call stacks.",
+"call stacks.\n"
+"Use 'settings set frame-format' to customize the printing of "
+"frames in the backtrace and 'settings set thread-format' to "
+"customize the thread header.",
 nullptr,
 eCommandRequiresProcess | eCommandRequiresThread |
 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
@@ -1388,7 +1391,9 @@ public:
   CommandObjectThreadList(CommandInterpreter &interpreter)
   : CommandObjectParsed(
 interpreter, "thread list",
-"Show a summary of each thread in the current target process.",
+"Show a summary of each thread in the current target process.  "
+"Use 'settings set thread-format' to customize the individual "
+"thread listings.",
 "thread list",
 eCommandRequiresProcess | eCommandTryTargetAPILock |
 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=359752&r1=359751&r2=359752&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Wed May  1 19:14:08 
2019
@@ -744,7 +744,9 @@ void CommandInterpreter::LoadCommandDict
   *this, "_regexp-bt",
   "Show the current thread's call stack.  Any numeric argument "
   "displays at most that many "
-  "frames.  The argument 'all' displays all threads.",
+  "frames.  The argument 'all' displays all threads.  Use 'settings"
+  " set frame-format' to customize the printing of individual frames "
+  "and 'settings set thread-format' to customize the thread header.",
   "bt [ | all]", 2, 0, false));
   if (bt_regex_cmd_up) {
 // accept but don't document "bt -c " -- before bt was a regex


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