diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
8 files changed, 0 insertions, 178 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/Makefile deleted file mode 100644 index b3034c12abd..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -LEVEL = ../../../make - -CXX_SOURCES := main.cpp - -include $(LEVEL)/Makefile.rules - diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py deleted file mode 100644 index 0df97fc21ab..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py +++ /dev/null @@ -1,108 +0,0 @@ -""" -Test basics of Minidump debugging. -""" - -from __future__ import print_function -from six import iteritems - - -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class MiniDumpNewTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - NO_DEBUG_INFO_TESTCASE = True - - @expectedFailureAll - def test_process_info_in_minidump(self): - """Test that lldb can read the process information from the Minidump.""" - # target create -c linux-x86_64.dmp - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-x86_64.dmp") - self.assertTrue(self.process, PROCESS_IS_VALID) - self.assertEqual(self.process.GetNumThreads(), 1) - self.assertEqual(self.process.GetProcessID(), 16001) - - @expectedFailureAll - def test_thread_info_in_minidump(self): - """Test that lldb can read the thread information from the Minidump.""" - # target create -c linux-x86_64.dmp - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-x86_64.dmp") - # This process crashed due to a segmentation fault in its - # one and only thread. - self.assertEqual(self.process.GetNumThreads(), 1) - thread = self.process.GetThreadAtIndex(0) - self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal) - stop_description = thread.GetStopDescription(256) - self.assertTrue("SIGSEGV" in stop_description) - - @expectedFailureAll - def test_stack_info_in_minidump(self): - """Test that we can see a trivial stack in a breakpad-generated Minidump.""" - # target create linux-x86_64 -c linux-x86_64.dmp - self.dbg.CreateTarget("linux-x86_64") - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-x86_64.dmp") - self.assertEqual(self.process.GetNumThreads(), 1) - thread = self.process.GetThreadAtIndex(0) - # frame #0: a.out`crash() - # frame #1: a.out`main() - # frame #2: libc-2.19.so`__libc_start_main() - # frame #3: a.out`_start - self.assertEqual(thread.GetNumFrames(), 4) - frame = thread.GetFrameAtIndex(0) - self.assertTrue(frame.IsValid()) - pc = frame.GetPC() - eip = frame.FindRegister("pc") - self.assertTrue(eip.IsValid()) - self.assertEqual(pc, eip.GetValueAsUnsigned()) - - @expectedFailureAll - def test_snapshot_minidump(self): - """Test that if we load a snapshot minidump file (meaning the process did not crash) there is no stop reason.""" - # target create -c linux-x86_64_not_crashed.dmp - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-x86_64_not_crashed.dmp") - self.assertEqual(self.process.GetNumThreads(), 1) - thread = self.process.GetThreadAtIndex(0) - self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone) - stop_description = thread.GetStopDescription(256) - self.assertEqual(stop_description, None) - - @expectedFailureAll - def test_deeper_stack_in_minidump(self): - """Test that we can examine a more interesting stack in a Minidump.""" - # Launch with the Minidump, and inspect the stack. - # target create linux-x86_64_not_crashed -c linux-x86_64_not_crashed.dmp - target = self.dbg.CreateTarget("linux-x86_64_not_crashed") - process = target.LoadCore("linux-x86_64_not_crashed.dmp") - thread = process.GetThreadAtIndex(0) - - expected_stack = {1: 'bar', 2: 'foo', 3: 'main'} - self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack)) - for index, name in iteritems(expected_stack): - frame = thread.GetFrameAtIndex(index) - self.assertTrue(frame.IsValid()) - function_name = frame.GetFunctionName() - self.assertTrue(name in function_name) - - @expectedFailureAll - def test_local_variables_in_minidump(self): - """Test that we can examine local variables in a Minidump.""" - # Launch with the Minidump, and inspect a local variable. - # target create linux-x86_64_not_crashed -c linux-x86_64_not_crashed.dmp - target = self.dbg.CreateTarget("linux-x86_64_not_crashed") - process = target.LoadCore("linux-x86_64_not_crashed.dmp") - thread = process.GetThreadAtIndex(0) - frame = thread.GetFrameAtIndex(1) - value = frame.EvaluateExpression('x') - self.assertEqual(value.GetValueAsSigned(), 3) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64 b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64 Binary files differdeleted file mode 100755 index bd63cd9004f..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64 +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.cpp deleted file mode 100644 index 827fe67b503..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Example source from breakpad's linux tutorial -// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/linux_starter_guide.md - -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> - -#include "client/linux/handler/exception_handler.h" - -static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, - void *context, bool succeeded) { - printf("Dump path: %s\n", descriptor.path()); - return succeeded; -} - -void crash() { - volatile int *a = (int *)(NULL); - *a = 1; -} - -int main(int argc, char *argv[]) { - google_breakpad::MinidumpDescriptor descriptor("/tmp"); - google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, - true, -1); - printf("pid: %d\n", getpid()); - crash(); - return 0; -} diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.dmp Binary files differdeleted file mode 100644 index 29a12d6a2eb..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed Binary files differdeleted file mode 100755 index e204cf0e9d5..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp deleted file mode 100644 index 1d2743bc41c..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> - -#include "client/linux/handler/exception_handler.h" - -static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, -void* context, bool succeeded) { - printf("Dump path: %s\n", descriptor.path()); - return succeeded; -} - -int global = 42; - -int -bar(int x, google_breakpad::ExceptionHandler &eh) -{ - eh.WriteMinidump(); - int y = 4*x + global; - return y; -} - -int -foo(int x, google_breakpad::ExceptionHandler &eh) -{ - int y = 2*bar(3*x, eh); - return y; -} - - -int main(int argc, char* argv[]) { - google_breakpad::MinidumpDescriptor descriptor("/tmp"); - google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1); - foo(1, eh); - return 0; -} diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.dmp Binary files differdeleted file mode 100644 index e175b0d7264..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_not_crashed.dmp +++ /dev/null |