jingham created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

We failure was a little bit terse.  Say whether we exited, hit another 
breakpoint/crashed, etc.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65682

Files:
  lldb/packages/Python/lldbsuite/test/lldbutil.py


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -778,7 +778,18 @@
     threads = get_threads_stopped_at_breakpoint(
                 process, bkpt)
 
+    # Check that we stopped at our breakpoint.  Try to separate failure 
reasons:
+    test.assertNotEqual(process.GetState(), lldb.eStateExited, "Process exited 
before stopping at breakpoint.")
+    if len(threads) == 0:
+        (bkpts, crashed, signaled) = ([], [], [])
+        sort_stopped_threads(process, 
+                             breakpoint_threads = bkpts, 
+                             crashed_threads = crashed, 
+                             signal_threads = signaled)
+        test.fail("Stopped for another reason: Breakpoint: %d Signaled: %d 
Crashed: %d"%(len(bkpts), len(crashed), len(signaled)))
+
     test.assertTrue(len(threads) == 1, "Expected 1 thread to stop at 
breakpoint, %d did."%(len(threads)))
+
     thread = threads[0]
     return (target, process, thread, bkpt)
 


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -778,7 +778,18 @@
     threads = get_threads_stopped_at_breakpoint(
                 process, bkpt)
 
+    # Check that we stopped at our breakpoint.  Try to separate failure reasons:
+    test.assertNotEqual(process.GetState(), lldb.eStateExited, "Process exited before stopping at breakpoint.")
+    if len(threads) == 0:
+        (bkpts, crashed, signaled) = ([], [], [])
+        sort_stopped_threads(process, 
+                             breakpoint_threads = bkpts, 
+                             crashed_threads = crashed, 
+                             signal_threads = signaled)
+        test.fail("Stopped for another reason: Breakpoint: %d Signaled: %d Crashed: %d"%(len(bkpts), len(crashed), len(signaled)))
+
     test.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads)))
+
     thread = threads[0]
     return (target, process, thread, bkpt)
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PAT... Jim Ingham via Phabricator via lldb-commits

Reply via email to