<div dir="ltr">looks fine.  </div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 16, 2015 at 11:02 AM Adrian McCarthy <<a href="mailto:amccarth@google.com">amccarth@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">amccarth updated this revision to Diff 34906.<br>
amccarth added a comment.<br>
<br>
Addressed earlier comments and moved to functionalities\postmortem\minidump<br>
<br>
<br>
<a href="http://reviews.llvm.org/D12888" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12888</a><br>
<br>
Files:<br>
  test/functionalities/postmortem/minidump/TestMiniDump.py<br>
  test/functionalities/postmortem/minidump/fizzbuzz.cpp<br>
  test/functionalities/postmortem/minidump/fizzbuzz_no_heap.dmp<br>
  test/lldbtest.py<br>
<br>
Index: test/lldbtest.py<br>
===================================================================<br>
--- test/lldbtest.py<br>
+++ test/lldbtest.py<br>
@@ -889,6 +889,10 @@<br>
     """Decorate the item to skip tests that should be skipped on Windows."""<br>
     return skipIfHostPlatform(["windows"])(func)<br>
<br>
+def skipUnlessWindows(func):<br>
+    """Decorate the item to skip tests that should be skipped on any non-Windows platform."""<br>
+    return skipUnlessPlatform(["windows"])(func)<br>
+<br>
 def skipUnlessDarwin(func):<br>
     """Decorate the item to skip tests that should be skipped on any non Darwin platform."""<br>
     return skipUnlessPlatform(getDarwinOSTriples())(func)<br>
Index: test/functionalities/postmortem/minidump/fizzbuzz.cpp<br>
===================================================================<br>
--- /dev/null<br>
+++ test/functionalities/postmortem/minidump/fizzbuzz.cpp<br>
@@ -0,0 +1,31 @@<br>
+// A sample program for getting minidumps on Windows.<br>
+<br>
+#include <iostream><br>
+<br>
+bool<br>
+fizz(int x)<br>
+{<br>
+    return x % 3 == 0;<br>
+}<br>
+<br>
+bool<br>
+buzz(int x)<br>
+{<br>
+    return x % 5 == 0;<br>
+}<br>
+<br>
+int<br>
+main()<br>
+{<br>
+    int *buggy = 0;<br>
+<br>
+    for (int i = 1; i <= 100; ++i)<br>
+    {<br>
+        if (fizz(i)) std::cout << "fizz";<br>
+        if (buzz(i)) std::cout << "buzz";<br>
+        if (!fizz(i) && !buzz(i)) std::cout << i;<br>
+        std::cout << '\n';<br>
+    }<br>
+<br>
+    return *buggy;<br>
+}<br>
Index: test/functionalities/postmortem/minidump/TestMiniDump.py<br>
===================================================================<br>
--- /dev/null<br>
+++ test/functionalities/postmortem/minidump/TestMiniDump.py<br>
@@ -0,0 +1,42 @@<br>
+"""<br>
+Test basics of mini dump debugging.<br>
+"""<br>
+<br>
+import unittest2<br>
+import lldb<br>
+from lldbtest import *<br>
+import lldbutil<br>
+<br>
+@skipUnlessWindows  # for now mini-dump debugging is limited to Windows hosts<br>
+class MiniDumpTestCase(TestBase):<br>
+<br>
+    mydir = TestBase.compute_mydir(__file__)<br>
+<br>
+    def test_process_info_in_mini_dump(self):<br>
+        """Test that lldb can read the process information from the minidump."""<br>
+        self.assertTrue(self.process, PROCESS_IS_VALID)<br>
+        self.assertEqual(self.process.GetNumThreads(), 1)<br>
+        # TODO(amccarth):  Check the process ID.<br>
+<br>
+    def test_thread_info_in_mini_dump(self):<br>
+        """Test that lldb can read the thread information from the minidump."""<br>
+        # This process crashed due to an access violation (0xc0000005) in its one and only thread.<br>
+        self.assertEqual(self.process.GetNumThreads(), 1)<br>
+        thread = self.process.GetThreadAtIndex(0)<br>
+        self.assertEqual(thread.GetStopReason(), lldb.eStopReasonException)<br>
+        stop_description = thread.GetStopDescription(256);<br>
+        self.assertTrue("0xc0000005" in stop_description);<br>
+<br>
+    def setUp(self):<br>
+        # Call super's setUp().<br>
+        TestBase.setUp(self)<br>
+        # target create -c fizzbuzz_no_heap.dmp<br>
+        self.dbg.CreateTarget("")<br>
+        self.target = self.dbg.GetSelectedTarget()<br>
+        self.process = self.target.LoadCore("fizzbuzz_no_heap.dmp")<br>
+<br>
+if __name__ == '__main__':<br>
+    import atexit<br>
+    lldb.SBDebugger.Initialize()<br>
+    atexit.register(lambda: lldb.SBDebugger.Terminate())<br>
+    unittest2.main()<br>
<br>
<br>
</blockquote></div>