diff options
author | Jason Molenda <jmolenda@apple.com> | 2023-09-21 14:48:19 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2023-09-21 14:50:34 -0700 |
commit | 35e3939cb06d19942a30fd39f1416f49a7b982a4 (patch) | |
tree | 822b47e419f71f1a88c1edfd249771e2d3e05764 /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | 03c698a431b4dc23c2b9de3e9befd1860fef6e80 (diff) | |
download | llvm-35e3939cb06d19942a30fd39f1416f49a7b982a4.zip llvm-35e3939cb06d19942a30fd39f1416f49a7b982a4.tar.gz llvm-35e3939cb06d19942a30fd39f1416f49a7b982a4.tar.bz2 |
watch set expression's default type was wrong with new modify type
`watch set expression` was passing the OptionGroupWatchpoint enum
in to Target where the LLDB_WATCH_TYPE_* bitfield was expected.
Modify matched READ|WRITE and resulted in a test failure in
TestWatchTaggedAddress.py. David temporarily changed the test to
expect this incorrect output; this fixes the bug and updates the
test case to test it for correctness again.
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 83c2fb8..dc5be0d 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -1133,7 +1133,23 @@ protected: size = target->GetArchitecture().GetAddressByteSize(); // Now it's time to create the watchpoint. - uint32_t watch_type = m_option_watchpoint.watch_type; + uint32_t watch_type; + switch (m_option_watchpoint.watch_type) { + case OptionGroupWatchpoint::eWatchRead: + watch_type = LLDB_WATCH_TYPE_READ; + break; + case OptionGroupWatchpoint::eWatchWrite: + watch_type = LLDB_WATCH_TYPE_WRITE; + break; + case OptionGroupWatchpoint::eWatchModify: + watch_type = LLDB_WATCH_TYPE_MODIFY; + break; + case OptionGroupWatchpoint::eWatchReadWrite: + watch_type = LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE; + break; + default: + watch_type = LLDB_WATCH_TYPE_MODIFY; + } // Fetch the type from the value object, the type of the watched object is // the pointee type |