Skip to content

[Windows] Add support of watchpoints to ProcessWindows #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ def setUp(self):
self.exe_name = self.testMethodName
self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name}

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Most of the MIPS boards provide only one H/W watchpoints, and S/W
# watchpoints are not supported yet
@expectedFailureAll(triple=re.compile('^mips'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ def setUp(self):
self.exe_name = self.getBuildArtifact('a.out')
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@add_test_categories(["basic_process"])
def test_hello_watchpoint_using_watchpoint_set(self):
"""Test a simple sequence of watchpoint creation and watchpoint hit."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class MultipleHitsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@skipIf(bugnumber="llvm.org/pr30758", oslist=["linux"], archs=["arm", "aarch64", "powerpc64le"])
@skipIfwatchOS
def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
main_spec = lldb.SBFileSpec("main.cpp", False)

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watchpoint_before_thread_start(self):
"""Test that we can hit a watchpoint we set before starting another thread"""
self.do_watchpoint_test("Before running the thread")

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watchpoint_after_thread_start(self):
"""Test that we can hit a watchpoint we set after starting another thread"""
Expand Down Expand Up @@ -66,9 +60,6 @@ def do_watchpoint_test(self, line):
self.expect("watchpoint list -v",
substrs=['hit_count = 1'])

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_watchpoint_multiple_threads_wp_set_and_then_delete(self):
"""Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class TestStepOverWatchpoint(TestBase):
'aarch64',
'arm'],
bugnumber="llvm.org/pr26031")
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
@expectedFailureAll(oslist=["ios", "watchos", "tvos", "bridgeos"], bugnumber="<rdar://problem/34027183>") # watchpoint tests aren't working on arm64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ def setUp(self):
self.exe_name = self.testMethodName
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_rw_watchpoint(self):
Expand Down Expand Up @@ -105,9 +102,6 @@ def test_rw_watchpoint(self):
self.expect("watchpoint list -v",
substrs=['hit_count = 2'])

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_rw_watchpoint_delete(self):
Expand Down Expand Up @@ -162,9 +156,6 @@ def test_rw_watchpoint_delete(self):
self.expect("process status",
substrs=['exited'])

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_rw_watchpoint_set_ignore_count(self):
Expand Down Expand Up @@ -222,9 +213,6 @@ def test_rw_watchpoint_set_ignore_count(self):
self.expect("watchpoint list -v",
substrs=['hit_count = 2', 'ignore_count = 2'])

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_rw_disable_after_first_stop(self):
Expand Down Expand Up @@ -292,9 +280,6 @@ def test_rw_disable_after_first_stop(self):
self.expect("watchpoint list -v",
substrs=['hit_count = 1'])

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_rw_disable_then_enable(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def setUp(self):
archs=["aarch64"],
triple=no_match(".*-android"),
bugnumber="llvm.org/pr27710") # work on android
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watchpoint_command(self):
"""Test 'watchpoint command'."""
Expand Down Expand Up @@ -106,9 +103,6 @@ def test_watchpoint_command(self):
archs=["aarch64"],
triple=no_match(".*-android"),
bugnumber="llvm.org/pr27710") # work on android
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_watchpoint_command_can_disable_a_watchpoint(self):
"""Test that 'watchpoint command' action can disable a watchpoint after it is triggered."""
self.build(dictionary=self.d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def setUp(self):
self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name}

@skipIfFreeBSD # timing out on buildbot
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureAll(
oslist=["linux"],
archs=["aarch64"],
Expand Down Expand Up @@ -105,9 +102,6 @@ def test_watchpoint_command(self):
substrs=['(int32_t)', 'cookie = 777'])

@skipIfFreeBSD # timing out on buildbot
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureAll(
oslist=["linux"],
archs=["aarch64"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def setUp(self):
archs=["aarch64"],
triple=no_match(".*-android"),
bugnumber="llvm.org/pr27710")
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watchpoint_cond(self):
"""Test watchpoint condition."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ def setUp(self):
# Call super's setUp().
TestBase.setUp(self)

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_disable_works (self):
"""Set a watchpoint, disable it, and make sure it doesn't get hit."""
self.build()
self.do_test(False)

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_disable_enable_works (self):
"""Set a watchpoint, disable it, and make sure it doesn't get hit."""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def setUp(self):
archs=["aarch64"],
triple=no_match(".*-android"),
bugnumber="llvm.org/pr27710")
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_with_python_api(self):
"""Test that adding, deleting and modifying watchpoints sends the appropriate events."""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ class TestValueOfVectorVariableTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_value_of_vector_variable_using_watchpoint_set(self):
"""Test verify displayed value of vector variable."""
exe = self.getBuildArtifact("a.out")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ def setUp(self):
'aarch64',
'arm'],
bugnumber="llvm.org/pr26031")
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watchlocation_using_watchpoint_set(self):
"""Test watching a location with 'watchpoint set expression -w write -s size' option."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,18 @@ def setUp(self):
self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_byte_size_watchpoints_with_byte_selection(self):
"""Test to selectively watch different bytes in a 8-byte array."""
self.run_watchpoint_size_test('byteArray', 8, '1')

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_two_byte_watchpoints_with_word_selection(self):
"""Test to selectively watch different words in an 8-byte word array."""
self.run_watchpoint_size_test('wordArray', 4, '2')

@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_four_byte_watchpoints_with_dword_selection(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def setUp(self):
self.source, '// Set break point at this line.')

@add_test_categories(['pyapi'])
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_watch_val(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def setUp(self):
self.source, '// Set break point at this line.')

@add_test_categories(['pyapi'])
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
# Read-write watchpoints not supported on SystemZ
@expectedFailureAll(archs=['s390x'])
def test_set_watch_ignore_count(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ def setUp(self):
self.source, '// Set break point at this line.')

@add_test_categories(['pyapi'])
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_watch_iter(self):
"""Exercise SBTarget.watchpoint_iter() API to iterate on the available watchpoints."""
self.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def setUp(self):
archs=["aarch64"],
triple=no_match(".*-android"),
bugnumber="llvm.org/pr27710")
@skipIfWindows # Watchpoints not supported on Windows, and this test hangs
def test_watchpoint_cond_api(self):
"""Test watchpoint condition API."""
self.build(dictionary=self.d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def setUp(self):
self.violating_func = "do_bad_thing_with_location"

@add_test_categories(['pyapi'])
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watch_location(self):
"""Exercise SBValue.WatchPointee() API to set a watchpoint."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def setUp(self):
self.violating_func = "do_bad_thing_with_location"

@add_test_categories(['pyapi'])
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureNetBSD
def test_watch_address(self):
"""Exercise SBTarget.WatchAddress() API to set a watchpoint."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ProcessWindowsData {
HANDLE m_initial_stop_event = nullptr;
bool m_initial_stop_received = false;
bool m_stop_at_entry;
std::map<lldb::tid_t, HostThread> m_new_threads;
std::map<lldb::tid_t, lldb::ThreadSP> m_new_threads;
std::set<lldb::tid_t> m_exited_threads;
};

Expand Down
Loading