Index: lldb/packages/Python/lldbsuite/test/lldbutil.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbutil.py +++ lldb/packages/Python/lldbsuite/test/lldbutil.py @@ -840,6 +840,12 @@ threads.append(thread) return threads +def get_thread_overview(test): + """Returns a string providing an overview over all current threads. + Should be used for making test errors more expressive.""" + test.runCmd("thread backtrace all") + return "Current threads:\n" + test.res.GetOutput() + # Helper functions for run_to_{source,name}_breakpoint: def run_to_breakpoint_make_target(test, exe_name = "a.out", in_cwd = True): @@ -897,9 +903,13 @@ num_threads = len(threads) if only_one_thread: - test.assertEqual(num_threads, 1, "Expected 1 thread to stop at breakpoint, %d did."%(num_threads)) + test.assertEqual(num_threads, 1, + "Expected 1 thread to stop at breakpoint, %d did.\n%s" + % (num_threads, get_thread_overview(test))) else: - test.assertGreater(num_threads, 0, "No threads stopped at breakpoint") + test.assertGreater(num_threads, 0, + "No threads stopped at breakpoint.\n%s" % + (get_thread_overview(test))) thread = threads[0] return (target, process, thread, bkpt)