summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbutil.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-01-22 23:54:41 +0000
committerZachary Turner <zturner@google.com>2016-01-22 23:54:41 +0000
commit1da094a5ec6fe2c72e52e041930c71dbb946420c (patch)
treee7bc4b661b0e26d786db1b4c69a011772daaf1b3 /lldb/packages/Python/lldbsuite/test/lldbutil.py
parent8c8c9fb5d4db0c98ca3bee99fa0c0afaa42bfaa4 (diff)
downloadbcm5719-llvm-1da094a5ec6fe2c72e52e041930c71dbb946420c.tar.gz
bcm5719-llvm-1da094a5ec6fe2c72e52e041930c71dbb946420c.zip
More fixes related to counting threads on Windows.
The Windows 10 loader spawns threads at startup, so tests which count threads or assume that a given user thread will be at a specific index are incorrect in this case. The fix here is to use the standard mechanisms for getting the stopped thread (which is all we are really interested in anyway) and correlating them with the breakpoints that were set, and doing checks against those things. This fixes about 6 tests on Windows 10. llvm-svn: 258586
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbutil.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbutil.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index a5d5f7356b1..679fdbae75d 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -548,7 +548,7 @@ def get_stopped_thread(process, reason):
return None
return threads[0]
-def get_threads_stopped_at_breakpoint (process, bkpt):
+def get_threads_stopped_at_breakpoint_id(process, bpid):
""" For a stopped process returns the thread stopped at the breakpoint passed in bkpt"""
stopped_threads = []
threads = []
@@ -561,13 +561,16 @@ def get_threads_stopped_at_breakpoint (process, bkpt):
for thread in stopped_threads:
# Make sure we've hit our breakpoint...
break_id = thread.GetStopReasonDataAtIndex (0)
- if break_id == bkpt.GetID():
+ if break_id == bpid:
threads.append(thread)
return threads
-def get_one_thread_stopped_at_breakpoint(process, bkpt, require_exactly_one = True):
- threads = get_threads_stopped_at_breakpoint(process, bkpt)
+def get_threads_stopped_at_breakpoint (process, bkpt):
+ return get_threads_stopped_at_breakpoint_id(process, bkpt.GetID())
+
+def get_one_thread_stopped_at_breakpoint_id(process, bpid, require_exactly_one = True):
+ threads = get_threads_stopped_at_breakpoint_id(process, bpid)
if len(threads) == 0:
return None
if require_exactly_one and len(threads) != 1:
@@ -575,6 +578,9 @@ def get_one_thread_stopped_at_breakpoint(process, bkpt, require_exactly_one = Tr
return threads[0]
+def get_one_thread_stopped_at_breakpoint(process, bkpt, require_exactly_one = True):
+ return get_one_thread_stopped_at_breakpoint_id(bkpt.GetID(), require_exactly_one)
+
def is_thread_crashed (test, thread):
"""In the test suite we dereference a null pointer to simulate a crash. The way this is
reported depends on the platform."""
OpenPOWER on IntegriCloud