[Lldb-commits] [lldb] d1280f6 - [lldb] [test] Add tests for coredumps with multiple threads

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 9 01:47:39 PDT 2021


Author: Michał Górny
Date: 2021-09-09T09:59:52+02:00
New Revision: d1280f6967db1ca8fa4e0c39414003e717b40feb

URL: https://github.com/llvm/llvm-project/commit/d1280f6967db1ca8fa4e0c39414003e717b40feb
DIFF: https://github.com/llvm/llvm-project/commit/d1280f6967db1ca8fa4e0c39414003e717b40feb.diff

LOG: [lldb] [test] Add tests for coredumps with multiple threads

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

Added: 
    lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core
    lldb/test/Shell/Register/Core/Inputs/multithread.cpp
    lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core
    lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core
    lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core
    lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core
    lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core
    lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core
    lldb/test/Shell/Register/Core/aarch64-freebsd-multithread.test
    lldb/test/Shell/Register/Core/x86-32-freebsd-multithread.test
    lldb/test/Shell/Register/Core/x86-32-linux-multithread.test
    lldb/test/Shell/Register/Core/x86-32-netbsd-multithread.test
    lldb/test/Shell/Register/Core/x86-64-freebsd-multithread.test
    lldb/test/Shell/Register/Core/x86-64-linux-multithread.test
    lldb/test/Shell/Register/Core/x86-64-netbsd-multithread.test

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core b/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core
new file mode 100644
index 0000000000000..e3ba2d7519af8
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/aarch64-freebsd-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/multithread.cpp b/lldb/test/Shell/Register/Core/Inputs/multithread.cpp
new file mode 100644
index 0000000000000..19c6682b32cf8
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/Inputs/multithread.cpp
@@ -0,0 +1,77 @@
+// This program is used to generate a core dump for testing multithreading
+// support.
+
+#include <atomic>
+#include <chrono>
+#include <cstdint>
+#include <thread>
+
+std::atomic_int start_counter{3};
+
+void pseudobarrier_wait() {
+  start_counter--;
+  while (start_counter > 0);
+}
+
+void fcommon(uint32_t a, uint32_t b, uint32_t c, uint32_t d, double fa, double fb, double fc, double fd, bool segv) {
+  if (segv) {
+    int *foo = nullptr;
+    *foo = 0;
+  }
+  while (1);
+}
+
+void f1() {
+  volatile uint32_t a = 0x01010101;
+  volatile uint32_t b = 0x02020202;
+  volatile uint32_t c = 0x03030303;
+  volatile uint32_t d = 0x04040404;
+  volatile double fa = 2.0;
+  volatile double fb = 4.0;
+  volatile double fc = 8.0;
+  volatile double fd = 16.0;
+
+  pseudobarrier_wait();
+  std::this_thread::sleep_for(std::chrono::milliseconds(200));
+  fcommon(a, b, c, d, fa, fb, fc, fd, true);
+}
+
+void f2() {
+  volatile uint32_t a = 0x11111111;
+  volatile uint32_t b = 0x12121212;
+  volatile uint32_t c = 0x13131313;
+  volatile uint32_t d = 0x14141414;
+  volatile double fa = 3.0;
+  volatile double fb = 6.0;
+  volatile double fc = 9.0;
+  volatile double fd = 12.0;
+
+  pseudobarrier_wait();
+  fcommon(a, b, c, d, fa, fb, fc, fd, false);
+}
+
+void f3() {
+  volatile uint32_t a = 0x21212121;
+  volatile uint32_t b = 0x22222222;
+  volatile uint32_t c = 0x23232323;
+  volatile uint32_t d = 0x24242424;
+  volatile double fa = 5.0;
+  volatile double fb = 10.0;
+  volatile double fc = 15.0;
+  volatile double fd = 20.0;
+
+  pseudobarrier_wait();
+  fcommon(a, b, c, d, fa, fb, fc, fd, false);
+}
+
+int main() {
+  std::thread t1{f1};
+  std::thread t2{f2};
+  std::thread t3{f3};
+
+  t3.join();
+  t2.join();
+  t1.join();
+
+  return 0;
+}

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core
new file mode 100644
index 0000000000000..342d5fb40f2b2
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-32-freebsd-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core
new file mode 100644
index 0000000000000..376a13217977d
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-32-linux-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core
new file mode 100644
index 0000000000000..e21821b5e1132
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-32-netbsd-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core
new file mode 100644
index 0000000000000..4f1b69276f574
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-64-freebsd-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core
new file mode 100644
index 0000000000000..503835a99f7af
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-64-linux-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core b/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core
new file mode 100644
index 0000000000000..42ed345f7ef64
Binary files /dev/null and b/lldb/test/Shell/Register/Core/Inputs/x86-64-netbsd-multithread.core 
diff er

diff  --git a/lldb/test/Shell/Register/Core/aarch64-freebsd-multithread.test b/lldb/test/Shell/Register/Core/aarch64-freebsd-multithread.test
new file mode 100644
index 0000000000000..c672233765d70
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/aarch64-freebsd-multithread.test
@@ -0,0 +1,42 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/aarch64-freebsd-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 100160, 0x0000000000211fc4, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #2: tid = 100115, 0x00000000406267a8, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #3: tid = 100161, 0x0000000000211fc8, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #4: tid = 100162, 0x0000000000211fc8, name = 'a.out', stop reason = signal SIGSEGV
+
+
+register read --all
+# CHECK-DAG: w0 = 0x01010101
+# CHECK-DAG: w1 = 0x02020202
+# CHECK-DAG: w2 = 0x03030303
+# CHECK-DAG: w3 = 0x04040404
+# CHECK-DAG: v0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x30 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: w0 = 0x11111111
+# CHECK-DAG: w1 = 0x12121212
+# CHECK-DAG: w2 = 0x13131313
+# CHECK-DAG: w3 = 0x14141414
+# CHECK-DAG: v0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x22 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x28 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 4
+# CHECK: (lldb) thread select 4
+register read --all
+# CHECK-DAG: w0 = 0x21212121
+# CHECK-DAG: w1 = 0x22222222
+# CHECK-DAG: w2 = 0x23232323
+# CHECK-DAG: w3 = 0x24242424
+# CHECK-DAG: v0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x2e 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: v3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}

diff  --git a/lldb/test/Shell/Register/Core/x86-32-freebsd-multithread.test b/lldb/test/Shell/Register/Core/x86-32-freebsd-multithread.test
new file mode 100644
index 0000000000000..dc35a8a3e2a0a
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-32-freebsd-multithread.test
@@ -0,0 +1,42 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-32-freebsd-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 100761, 0x00402ed1, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #2: tid = 100744, 0x2057f78b, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #3: tid = 100762, 0x00402edc, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #4: tid = 100763, 0x00402edc, name = 'a.out', stop reason = signal SIGSEGV
+
+
+register read --all
+# CHECK-DAG: ecx = 0x04040404
+# CHECK-DAG: edx = 0x03030303
+# CHECK-DAG: edi = 0x01010101
+# CHECK-DAG: esi = 0x02020202
+# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
+# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x01 0x40}
+# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x02 0x40}
+# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x03 0x40}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x14141414
+# CHECK-DAG: edx = 0x13131313
+# CHECK-DAG: edi = 0x11111111
+# CHECK-DAG: esi = 0x12121212
+# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0x00 0x40}
+# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0x01 0x40}
+# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x90 0x02 0x40}
+# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0x02 0x40}
+
+thread select 4
+# CHECK: (lldb) thread select 4
+register read --all
+# CHECK-DAG: ecx = 0x24242424
+# CHECK-DAG: edx = 0x23232323
+# CHECK-DAG: edi = 0x21212121
+# CHECK-DAG: esi = 0x22222222
+# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa0 0x01 0x40}
+# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa0 0x02 0x40}
+# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xf0 0x02 0x40}
+# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa0 0x03 0x40}

diff  --git a/lldb/test/Shell/Register/Core/x86-32-linux-multithread.test b/lldb/test/Shell/Register/Core/x86-32-linux-multithread.test
new file mode 100644
index 0000000000000..62e5bb8ee32fd
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-32-linux-multithread.test
@@ -0,0 +1,32 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-32-linux-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 330633, 0x080492d2, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #2: tid = 330634, 0x080492dd, stop reason = signal 0
+# CHECK-NEXT:   thread #3: tid = 330635, 0x080492dd, stop reason = signal 0
+# CHECK-NEXT:   thread #4: tid = 330632, 0xf7f59549, stop reason = signal 0
+
+register read --all
+# CHECK-DAG: ecx = 0x01010101
+# CHECK-DAG: edx = 0x02020202
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 2
+# CHECK: (lldb) thread select 2
+register read --all
+# CHECK-DAG: ecx = 0x11111111
+# CHECK-DAG: edx = 0x12121212
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x22 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x21212121
+# CHECK-DAG: edx = 0x22222222
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x2e 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}

diff  --git a/lldb/test/Shell/Register/Core/x86-32-netbsd-multithread.test b/lldb/test/Shell/Register/Core/x86-32-netbsd-multithread.test
new file mode 100644
index 0000000000000..16425e7ef807c
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-32-netbsd-multithread.test
@@ -0,0 +1,24 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-32-netbsd-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 2, 0x08048db9, stop reason = signal SIGSEGV 
+# CHECK-NEXT:   thread #2: tid = 4, 0x08048dbf, stop reason = signal 0 
+# CHECK-NEXT:   thread #3: tid = 3, 0x08048dbf, stop reason = signal 0 
+# CHECK-NEXT:   thread #4: tid = 1, 0xf876a147, stop reason = signal 0 
+
+
+register read --all
+# CHECK-DAG: ecx = 0x03030303
+# CHECK-DAG: ebx = 0x04040404
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x13131313
+# CHECK-DAG: ebx = 0x14141414
+
+thread select 2
+# CHECK: (lldb) thread select 2
+register read --all
+# CHECK-DAG: ecx = 0x23232323
+# CHECK-DAG: ebx = 0x24242424

diff  --git a/lldb/test/Shell/Register/Core/x86-64-freebsd-multithread.test b/lldb/test/Shell/Register/Core/x86-64-freebsd-multithread.test
new file mode 100644
index 0000000000000..f7ef5d50ee948
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-64-freebsd-multithread.test
@@ -0,0 +1,42 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-freebsd-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 100744, 0x00000000002030c2, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #2: tid = 100720, 0x0000000800396b3c, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #3: tid = 100745, 0x00000000002030cd, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #4: tid = 100746, 0x00000000002030cd, name = 'a.out', stop reason = signal SIGSEGV
+
+
+register read --all
+# CHECK-DAG: ecx = 0x04040404
+# CHECK-DAG: edx = 0x03030303
+# CHECK-DAG: edi = 0x01010101
+# CHECK-DAG: esi = 0x02020202
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x30 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x14141414
+# CHECK-DAG: edx = 0x13131313
+# CHECK-DAG: edi = 0x11111111
+# CHECK-DAG: esi = 0x12121212
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x22 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x28 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 4
+# CHECK: (lldb) thread select 4
+register read --all
+# CHECK-DAG: ecx = 0x24242424
+# CHECK-DAG: edx = 0x23232323
+# CHECK-DAG: edi = 0x21212121
+# CHECK-DAG: esi = 0x22222222
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x2e 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}

diff  --git a/lldb/test/Shell/Register/Core/x86-64-linux-multithread.test b/lldb/test/Shell/Register/Core/x86-64-linux-multithread.test
new file mode 100644
index 0000000000000..ab28901cae9f2
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-64-linux-multithread.test
@@ -0,0 +1,41 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-linux-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 329384, 0x0000000000401262, name = 'a.out', stop reason = signal SIGSEGV
+# CHECK-NEXT:   thread #2: tid = 329385, 0x000000000040126d, stop reason = signal 0
+# CHECK-NEXT:   thread #3: tid = 329386, 0x000000000040126d, stop reason = signal 0
+# CHECK-NEXT:   thread #4: tid = 329383, 0x00007fcf5582f762, stop reason = signal 0
+
+register read --all
+# CHECK-DAG: ecx = 0x04040404
+# CHECK-DAG: edx = 0x03030303
+# CHECK-DAG: edi = 0x01010101
+# CHECK-DAG: esi = 0x02020202
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x30 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 2
+# CHECK: (lldb) thread select 2
+register read --all
+# CHECK-DAG: ecx = 0x14141414
+# CHECK-DAG: edx = 0x13131313
+# CHECK-DAG: edi = 0x11111111
+# CHECK-DAG: esi = 0x12121212
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x22 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x28 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x24242424
+# CHECK-DAG: edx = 0x23232323
+# CHECK-DAG: edi = 0x21212121
+# CHECK-DAG: esi = 0x22222222
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x2e 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}

diff  --git a/lldb/test/Shell/Register/Core/x86-64-netbsd-multithread.test b/lldb/test/Shell/Register/Core/x86-64-netbsd-multithread.test
new file mode 100644
index 0000000000000..d4d0cfd1f613a
--- /dev/null
+++ b/lldb/test/Shell/Register/Core/x86-64-netbsd-multithread.test
@@ -0,0 +1,41 @@
+# RUN: %lldb -b -s %s -c %p/Inputs/x86-64-netbsd-multithread.core | FileCheck %s
+
+thread list
+# CHECK: * thread #1: tid = 2, 0x0000000000400f82, stop reason = signal SIGSEGV 
+# CHECK-NEXT:   thread #2: tid = 4, 0x0000000000400f88, stop reason = signal 0 
+# CHECK-NEXT:   thread #3: tid = 3, 0x0000000000400f88, stop reason = signal 0 
+# CHECK-NEXT:   thread #4: tid = 1, 0x0000791280ca1faa, stop reason = signal 0 
+
+register read --all
+# CHECK-DAG: ecx = 0x04040404
+# CHECK-DAG: edx = 0x03030303
+# CHECK-DAG: edi = 0x01010101
+# CHECK-DAG: esi = 0x02020202
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x30 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 3
+# CHECK: (lldb) thread select 3
+register read --all
+# CHECK-DAG: ecx = 0x14141414
+# CHECK-DAG: edx = 0x13131313
+# CHECK-DAG: edi = 0x11111111
+# CHECK-DAG: esi = 0x12121212
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x22 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x28 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+
+thread select 2
+# CHECK: (lldb) thread select 2
+register read --all
+# CHECK-DAG: ecx = 0x24242424
+# CHECK-DAG: edx = 0x23232323
+# CHECK-DAG: edi = 0x21212121
+# CHECK-DAG: esi = 0x22222222
+# CHECK-DAG: xmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x2e 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}


        


More information about the lldb-commits mailing list