-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLDB][Windows] Fix watchpoints for Windows #95446
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
[LLDB][Windows] Fix watchpoints for Windows #95446
Conversation
The patch fixes not working watchpoints on windows.
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-lldb Author: Aleksandr Korepanov (AlexK0) ChangesHello! Currently, watchpoints don't work on Windows (this can be reproduced with the existing tests). This patch fixes the related issues so that the tests and watchpoints start working. Here is the list of tests that are fixed by this patch (on Windows, checked in release/18.x branch):
Full diff: https://github.com/llvm/llvm-project/pull/95446.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index eb0834b1159f6..780147fc607e9 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -406,7 +406,7 @@ void ProcessWindows::RefreshStateAfterStop() {
m_session_data->m_debugger->GetProcess().GetProcessId(), pc, id);
stop_info = StopInfo::CreateStopReasonWithWatchpointID(
- *stop_thread, id, m_watchpoints[id].address);
+ *stop_thread, id);
stop_thread->SetStopInfo(stop_info);
return;
@@ -857,7 +857,7 @@ Status ProcessWindows::EnableWatchpoint(WatchpointSP wp_sp, bool notify) {
info.address = wp_sp->GetLoadAddress();
info.size = wp_sp->GetByteSize();
info.read = wp_sp->WatchpointRead();
- info.write = wp_sp->WatchpointWrite();
+ info.write = wp_sp->WatchpointWrite() || wp_sp->WatchpointModify();
for (unsigned i = 0U; i < m_thread_list.GetSize(); i++) {
Thread *thread = m_thread_list.GetThreadAtIndex(i).get();
|
@@ -406,7 +406,7 @@ void ProcessWindows::RefreshStateAfterStop() { | |||
m_session_data->m_debugger->GetProcess().GetProcessId(), pc, id); | |||
|
|||
stop_info = StopInfo::CreateStopReasonWithWatchpointID( | |||
*stop_thread, id, m_watchpoints[id].address); | |||
*stop_thread, id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yikes, I believe I broke this in https://reviews.llvm.org/D147816 and that addr_t
is being treated like a boolean now :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, these are correct and they look like they're caused by me when I was doing my work on watchpoints earlier this year. Do you have permissions to merge the PR?
✅ With the latest revision this PR passed the C/C++ code formatter. |
I don't have the necessary permissions. Could you please merge the PR when it becomes possible? |
@AlexK0 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
Thanks for fixing this. It has been on Linaro's backlog for a while but as usual resources are scarce.
For background here, the Windows LLDB bot is run by Linaro and is Windows on Arm. As the code for Windows is trying to use Intel parts of the register context, that bot skips the watchpoint test category completely. (I think we fail to detect any hardware code breakpoints, so those tests get skipped transparently) |
Hello! Currently, watchpoints don't work on Windows (this can be reproduced with the existing tests). This patch fixes the related issues so that the tests and watchpoints start working. Here is the list of tests that are fixed by this patch (on Windows, checked in **release/18.x** branch): - commands/watchpoints/hello_watchpoint/TestMyFirstWatchpoint.py - commands/watchpoints/multiple_hits/TestMultipleHits.py - commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py - commands/watchpoints/step_over_watchpoint/TestStepOverWatchpoint.py - commands/watchpoints/unaligned-watchpoint/TestUnalignedWatchpoint.py - commands/watchpoints/watchpoint_commands/TestWatchpointCommands.py - commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandLLDB.py - commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py - commands/watchpoints/watchpoint_commands/condition/TestWatchpointConditionCmd.py - commands/watchpoints/watchpoint_count/TestWatchpointCount.py - commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py - commands/watchpoints/watchpoint_size/TestWatchpointSizes.py - python_api/watchpoint/TestSetWatchpoint.py - python_api/watchpoint/TestWatchpointIgnoreCount.py - python_api/watchpoint/TestWatchpointIter.py - python_api/watchpoint/condition/TestWatchpointConditionAPI.py - python_api/watchpoint/watchlocation/TestTargetWatchAddress.py --------- Co-authored-by: Jason Molenda <[email protected]>
Hello!
Currently, watchpoints don't work on Windows (this can be reproduced with the existing tests). This patch fixes the related issues so that the tests and watchpoints start working.
Here is the list of tests that are fixed by this patch (on Windows, checked in release/18.x branch):