diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2019-10-18 15:02:16 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2019-10-18 15:02:16 +0000 |
commit | 77460d3888c56a6ed8184783388ed109590ee199 (patch) | |
tree | 1b7edabdf565146724182dc281b0f19974aadfbf /lldb/packages/Python/lldbsuite/test/functionalities/postmortem | |
parent | d094d97d02232f3c7c5b3b792760cedb5ccac25b (diff) | |
download | bcm5719-llvm-77460d3888c56a6ed8184783388ed109590ee199.tar.gz bcm5719-llvm-77460d3888c56a6ed8184783388ed109590ee199.zip |
ProcessMinidump: Suppress reporting stop for signal '0'
Summary:
The minidump exception stream can report an exception record with
signal 0. If we try to create a stop reason with signal zero, processing
of the stop event won't find anything, and the debugger will hang.
So, simply early-out of RefreshStateAfterStop in this case.
Also set the UnixSignals object in DoLoadCore as is done for
ProcessElfCore.
Reviewers: labath, clayborg, jfb
Reviewed By: labath, clayborg
Subscribers: dexonsmith, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68096
llvm-svn: 375244
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/postmortem')
2 files changed, 38 insertions, 2 deletions
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 index 02da79e31cb..c19fcd17000 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py @@ -153,9 +153,9 @@ class MiniDumpNewTestCase(TestBase): self.assertTrue(eip.IsValid()) self.assertEqual(pc, eip.GetValueAsUnsigned()) - def test_snapshot_minidump(self): + def test_snapshot_minidump_dump_requested(self): """Test that if we load a snapshot minidump file (meaning the process - did not crash) there is no stop reason.""" + did not crash) with exception code "DUMP_REQUESTED" there is no stop reason.""" # target create -c linux-x86_64_not_crashed.dmp self.dbg.CreateTarget(None) self.target = self.dbg.GetSelectedTarget() @@ -167,6 +167,17 @@ class MiniDumpNewTestCase(TestBase): stop_description = thread.GetStopDescription(256) self.assertEqual(stop_description, "") + def test_snapshot_minidump_null_exn_code(self): + """Test that if we load a snapshot minidump file (meaning the process + did not crash) with exception code zero there is no stop reason.""" + self.process_from_yaml("linux-x86_64_null_signal.yaml") + self.check_state() + 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, "") + def check_register_unsigned(self, set, name, expected): reg_value = set.GetChildMemberWithName(name) self.assertTrue(reg_value.IsValid(), diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_null_signal.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_null_signal.yaml new file mode 100644 index 00000000000..93b3fd0e8aa --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-x86_64_null_signal.yaml @@ -0,0 +1,25 @@ +--- !minidump +Streams: + - Type: ThreadList + Threads: + - Thread Id: 0x00002177 + Context: 0000 + Stack: + Start of Memory Range: 0x00007FFE2F689000 + Content: 00000000 + - Type: Exception + Thread ID: 0x00002177 + Exception Record: + Exception Code: 0x00000000 + Exception Address: 0x0000000000400582 + Thread Context: 0000 + - Type: SystemInfo + Processor Arch: AMD64 + Platform ID: Linux + - Type: LinuxProcStatus + Text: | + Name: busyloop + Umask: 0002 + State: t (tracing stop) + Pid: 8567 +... |