summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2019-03-10 09:50:36 +0000
committerMichal Gorny <mgorny@gentoo.org>2019-03-10 09:50:36 +0000
commit369a011cee0779973849a8283fb5d1bdc2e3cb90 (patch)
treef2e69ad3f6898e7bbf294c3829a2d5d03b7d2150 /lldb/packages/Python/lldbsuite
parenta2b144fc7402573872808553c8e870da610b415a (diff)
downloadbcm5719-llvm-369a011cee0779973849a8283fb5d1bdc2e3cb90.tar.gz
bcm5719-llvm-369a011cee0779973849a8283fb5d1bdc2e3cb90.zip
[lldb] [test] Make 2lwp_process_SIGSEGV test more portable
Fix 2lwp_process_SIGSEGV NetBSD core test to terminate inside regular function rather than libc call, in order to get reproducible backtrace on different platforms. Differential Revision: https://reviews.llvm.org/D59177 llvm-svn: 355786
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rwxr-xr-xlldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64bin15816 -> 16344 bytes
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.corebin121208 -> 121216 bytes
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c7
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py6
4 files changed, 8 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64 b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
index 00f61dfce84..32a49852215 100755
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
Binary files differ
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
index f9c2b562fba..2dbb299bbfb 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
Binary files differ
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
index ce583aaada9..fcbfa8a6b51 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
@@ -4,9 +4,12 @@
#include <unistd.h>
#include <signal.h>
+volatile int sem = 0;
+
static void bar() {
char F = 'b';
- kill(getpid(), SIGSEGV); // Frame bar
+ sem = 1;
+ while (1) continue; // Frame bar
}
static void foo(void (*boomer)()) {
@@ -28,5 +31,7 @@ int main(int argc, char **argv) {
stack = malloc(ssize);
_lwp_makecontext(&uc, lwp_main, NULL, NULL, stack, ssize);
_lwp_create(&uc, 0, &lid);
+ while (sem != 1) continue;
+ kill(getpid(), SIGSEGV);
_lwp_wait(lid, NULL);
}
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
index 15af9617754..6d3037417a9 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
@@ -206,11 +206,10 @@ class NetBSD2LWPProcessSigCoreTestCase(NetBSDCoreCommonTestCase):
thread = process.GetSelectedThread()
self.assertTrue(thread)
self.assertEqual(thread.GetThreadID(), 2)
- self.assertEqual(thread.GetThreadID(), 2)
self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)
self.assertEqual(thread.GetStopReasonDataCount(), 1)
self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
- backtrace = ["_kill", "bar", "foo", "lwp_main"]
+ backtrace = ["bar", "foo", "lwp_main"]
self.check_backtrace(thread, filename, backtrace)
# thread 1 should have the same signal
@@ -219,8 +218,7 @@ class NetBSD2LWPProcessSigCoreTestCase(NetBSDCoreCommonTestCase):
self.assertEqual(thread.GetStopReasonDataCount(), 1)
self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
- @skipIf # TODO: fails with non-netbsd libc
@skipIfLLVMTargetMissing("X86")
def test_amd64(self):
"""Test double-threaded amd64 core dump where process is signalled."""
- self.do_test("2lwp_process_SIGSEGV.amd64", pid=141, region_count=24)
+ self.do_test("2lwp_process_SIGSEGV.amd64", pid=665, region_count=24)
OpenPOWER on IntegriCloud